Mastering LangGraph Tools: Error Handling Guide

Mastering LangGraph Tools: Error Handling Guide

LLMs are not perfect when calling tools. Models may attempt to call non-existent tools or fail to return parameters that match the requested schema. Strategies such as keeping the schema simple, reducing the number of tools passed at once, and using good names and descriptions can help mitigate this risk, but they are not foolproof. … Read more

Mastering LangGraph Tools: A Comprehensive Guide

Mastering LangGraph Tools: A Comprehensive Guide

Sometimes, we want the LLM that calls the tools to fill in a subset of parameters for the tool functions, while providing other values for the remaining parameters at runtime. If you are using LangChain-style tools, a simple way to handle this situation is to annotate the function parameters with InjectedArg. This annotation excludes the … Read more

Mastering LangGraph Tools: Configuring Parameters

Mastering LangGraph Tools: Configuring Parameters

How to Pass Config to the Tools At runtime, we may need to pass values to the tools, such as user ID. For security reasons, this value should be set by application logic rather than controlled by the LLM. The LLM should only manage its expected parameters. The LangChain tools use the Runnable interface, where … Read more