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

Connected

Exercise

Conversation setup

Now that you have a custom tool to help you calculate the length of a roof, you can set your agent's outputs to respond to your entered query. By slightly modifying your print statements, you can directly compare your query and your agent's response to ensure accuracy. Your tools and query have already been set up and your model is ready to use.

Instructions

100 XP
  • Initialize the create_react_agent function creating an object called app, passing in the required arguments.
  • Invoke the agent app, passing in your query, before storing and printing the agent's response.
  • Define the "user_input" as query and the "agent_output" as the last item extracted from "messages" in response before both are printed.