think.go

 1package claudetool
 2
 3import (
 4	"context"
 5	"encoding/json"
 6
 7	"shelley.exe.dev/llm"
 8)
 9
10// The Think tool provides space to think.
11var Think = &llm.Tool{
12	Name:        thinkName,
13	Description: thinkDescription,
14	InputSchema: llm.MustSchema(thinkInputSchema),
15	Run:         thinkRun,
16}
17
18const (
19	thinkName        = "think"
20	thinkDescription = `Think out loud, take notes, form plans. Has no external effects.`
21
22	// If you modify this, update the termui template for prettier rendering.
23	thinkInputSchema = `
24{
25  "type": "object",
26  "required": ["thoughts"],
27  "properties": {
28    "thoughts": {
29      "type": "string",
30      "description": "The thoughts, notes, or plans to record"
31    }
32  }
33}
34`
35)
36
37func thinkRun(ctx context.Context, m json.RawMessage) llm.ToolOut {
38	return llm.ToolOut{LLMContent: llm.TextContent("recorded")}
39}