| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 1 | package claudetool |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "encoding/json" |
| 6 | |
| Josh Bleecher Snyder | 4f84ab7 | 2025-04-22 16:40:54 -0700 | [diff] [blame] | 7 | "sketch.dev/llm" |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | // The Think tool provides space to think. |
| Josh Bleecher Snyder | 4f84ab7 | 2025-04-22 16:40:54 -0700 | [diff] [blame] | 11 | var Think = &llm.Tool{ |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 12 | Name: thinkName, |
| 13 | Description: thinkDescription, |
| Josh Bleecher Snyder | 4f84ab7 | 2025-04-22 16:40:54 -0700 | [diff] [blame] | 14 | InputSchema: llm.MustSchema(thinkInputSchema), |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 15 | Run: thinkRun, |
| 16 | } |
| 17 | |
| 18 | const ( |
| 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 | |
| Josh Bleecher Snyder | 43b60b9 | 2025-07-21 14:57:10 -0700 | [diff] [blame] | 37 | func thinkRun(ctx context.Context, m json.RawMessage) llm.ToolOut { |
| 38 | return llm.ToolOut{LLMContent: llm.TextContent("recorded")} |
| Earl Lee | 2e463fb | 2025-04-17 11:22:22 -0700 | [diff] [blame] | 39 | } |