1. Learn
  2. /
  3. Courses
  4. /
  5. Designing Agentic Systems with LangChain

Connected

Exercise

Integrating custom tools and queries

You now have a custom math tool for calculating roof length. You can integrate it with an agentic workflow by creating a variable called query that accepts the user's natural language question as a string. Your tool is already loaded as hypotenuse_length, as well as your model.

Instructions

100 XP
  • Create a list variable called tools and include your tool, hypotenuse_length, inside the list.
  • Create a variable called query that accepts questions as natural language strings.
  • Use the create_react_agent() function to create the agent, passing in the model and tools.
  • Invoke the agent app, passing in your query labeled "human", before storing and printing the agent's response.