Summary
In this chapter, we discussed examples of prompt techniques, such as CoT, that demonstrate an improvement in an LLM’s reasoning abilities. We also discussed that we can take it a step further. If LLMs are not very good at math, what if instead of trying to teach them math, we give them access to a calculator?
We learned about the various ways to define a tool with LangChain from Python functions, by defining your own classes that implement the specific logic of a tool, defining them as Pydantic models (it’s useful when you need to parse your output into a specific structure), or providing a direct OpenAPI specification of your API.
In the next chapter, we’ll look at how we can use tool calling to develop more sophisticated applications to solve complex tasks with LLMs.