@langchain/anthropic
Version:
Anthropic integrations for LangChain.js
1 lines • 4.53 kB
Source Map (JSON)
{"version":3,"file":"memory.d.ts","names":["zod_v4_core0","DynamicStructuredTool","MemoryTool20250818Options","memory_20250818","zod0","ZodLiteral","ZodString","$strip","ZodObject","ZodNumber","ZodDiscriminatedUnion","Promise"],"sources":["../../src/tools/memory.d.ts"],"sourcesContent":["import type { DynamicStructuredTool } from \"@langchain/core/tools\";\nimport { type MemoryTool20250818Options } from \"./types.js\";\n/**\n * Creates an Anthropic memory tool that can be used with ChatAnthropic.\n *\n * The memory tool enables Claude to store and retrieve information across conversations\n * through a memory file directory. Claude can create, read, update, and delete files that\n * persist between sessions, allowing it to build knowledge over time without keeping\n * everything in the context window.\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, memory_20250818 } from \"@langchain/anthropic\";\n *\n * const llm = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\"\n * });\n *\n * const memory = memory_20250818({\n * execute: async (args) => {\n * // handle memory command execution\n * // ...\n * },\n * });\n * const llmWithMemory = llm.bindTools([memory]);\n *\n * const response = await llmWithMemory.invoke(\"Remember that I like Python\");\n * ```\n *\n * @param options - Optional configuration for the memory tool (currently unused)\n * @param options.execute - Optional execute function that handles memory command execution.\n * @returns The memory tool object that can be passed to `bindTools`\n *\n * @see https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/memory-tool\n */\nexport declare function memory_20250818(options?: MemoryTool20250818Options): DynamicStructuredTool<import(\"zod\").ZodDiscriminatedUnion<[import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"view\">;\n path: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"create\">;\n path: import(\"zod\").ZodString;\n file_text: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"str_replace\">;\n path: import(\"zod\").ZodString;\n old_str: import(\"zod\").ZodString;\n new_str: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"insert\">;\n path: import(\"zod\").ZodString;\n insert_line: import(\"zod\").ZodNumber;\n insert_text: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"delete\">;\n path: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>, import(\"zod\").ZodObject<{\n command: import(\"zod\").ZodLiteral<\"rename\">;\n old_path: import(\"zod\").ZodString;\n new_path: import(\"zod\").ZodString;\n}, import(\"zod/v4/core\").$strip>], \"command\">, {\n command: \"view\";\n path: string;\n} | {\n command: \"create\";\n path: string;\n file_text: string;\n} | {\n command: \"str_replace\";\n path: string;\n old_str: string;\n new_str: string;\n} | {\n command: \"insert\";\n path: string;\n insert_line: number;\n insert_text: string;\n} | {\n command: \"delete\";\n path: string;\n} | {\n command: \"rename\";\n old_path: string;\n new_path: string;\n}, unknown, string | Promise<string>>;\n//# sourceMappingURL=memory.d.ts.map"],"mappings":";;;;;;;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuB4BM,iBAvBJH,eAAAA,CAuBIG,OAAAA,CAAAA,EAvBsBJ,yBAuBtBI,CAAAA,EAvBkDL,qBAuBlDK,CAH6BF,IAAAA,CApByDM,qBAuBtFJ,CAAAA,CApBGF,IAAAA,CAHwHI,SAuB3HF,CAAAA;EAASN,OAAAA,EAvBsCI,IAAAA,CAChDC,UAuBFE,CAAAA,MAAAA,CAAAA;EAAMH,IAJiBI,EAnBXJ,IAAAA,CACbE,SAkBwBE;CAASJ,EAlBxBJ,YAAAA,CACRO,MAAAA,CAHyFG,EAOnFN,IAAAA,CAJiBI,SAHkEE,CAAAA;EAgD7FC,OAAAA,EAhD2IP,IAAAA,CAIrIC,UA4CNM,CAAAA,QAAAA,CAAAA;EAhDyDV,IAAAA,EAIzCG,IAAAA,CACbE,SALsDL;EAAqB,SAAA,EAKlEG,IAAAA,CACJE,SANsE;GAM7DN,YAAAA,CACbO,MAAAA,GAKMH,IAAAA,CALiBI;WAJSJ,IAAAA,CAK9BC;QAAUD,IAAAA,CACbE;WAASF,IAAAA,CACNE;WAASF,IAAAA,CACTE;GAASN,YAAAA,CACXO,MAAAA,GAKMH,IAAAA,CALiBI;WALSJ,IAAAA,CAM9BC;QAAUD,IAAAA,CACbE;eAASF,IAAAA,CACFK;eAASL,IAAAA,CACTE;GAASN,YAAAA,CACfO,MAAAA,GAGMH,IAAAA,CAHiBI;WALSJ,IAAAA,CAM9BC;QAAUD,IAAAA,CACbE;GAASN,YAAAA,CACRO,MAAAA,GAIMH,IAAAA,CAJiBI;WAHSJ,IAAAA,CAI9BC;YAAUD,IAAAA,CACTE;YAASF,IAAAA,CACTE;GAASN,YAAAA,CACZO,MAAAA;;;;;;;;;;;;;;;;;;;;;;;;qBAwBJI"}