-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Description
This post here:
https://x.com/mattpocockuk/status/1903145626122043536
Suggests a tool like this:
import i anthropic } from "@ai-sdk/anthropic"; import i streamText } from "ai"; import { z } from "zod";
const result = await streamText({
model: anthropic ("claude-3-7-sonnet-20250219"), tools: 1
think: 1
description: *
Use the tool to think about something.
It will not obtain new information or change the database, but just append the thought to the log.
Use it when complex reasoning or some cache memory is needed.
parameters: z. object({
thought: z
•string()
• describe("A thought to think about."),
}),
execute: async (args) => 1
return {
thought: args. thought,
;
}
});
New research from Anthropic shows how a simple "think" tool can improve Claude's problem-solving skills.
Here's how to implement it in 28 lines of code.
More details:
https://www.aihero.dev/implementing-anthropics-think-tool-in-typescript
Metadata
Metadata
Assignees
Labels
No labels