0
0
LangChainframework~10 mins

AgentExecutor setup and configuration in LangChain - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the AgentExecutor class from langchain.

LangChain
from langchain.agents import [1]
Drag options to blanks, or click blank then click option'
AAgent
BExecutorAgent
CAgentExecutor
DAgentRunner
Attempts:
3 left
💡 Hint
Common Mistakes
Importing a wrong class name like 'Agent' or 'ExecutorAgent'.
Forgetting to import from 'langchain.agents'.
2fill in blank
medium

Complete the code to create an AgentExecutor instance using the agent and tools.

LangChain
agent_executor = AgentExecutor.from_agent_and_tools(agent=[1], tools=tools)
Drag options to blanks, or click blank then click option'
Aagent
Bexecutor
Ctools
Dtool_list
Attempts:
3 left
💡 Hint
Common Mistakes
Passing 'tools' instead of 'agent' to the 'agent' parameter.
Passing a list of tools to the 'agent' parameter.
3fill in blank
hard

Fix the error in the code by completing the missing parameter to enable verbose output.

LangChain
agent_executor = AgentExecutor.from_agent_and_tools(agent=agent, tools=tools, [1]=True)
Drag options to blanks, or click blank then click option'
Asilent
Blog
Cdebug
Dverbose
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'silent' which disables output.
Using 'debug' or 'log' which are not valid parameters here.
4fill in blank
hard

Fill both blanks to create an AgentExecutor with a custom callback manager and verbose mode on.

LangChain
agent_executor = AgentExecutor.from_agent_and_tools(agent=agent, tools=tools, [1]=callback_manager, [2]=True)
Drag options to blanks, or click blank then click option'
Acallback_manager
Bverbose
Csilent
Dlog_level
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'silent' instead of 'verbose'.
Confusing 'log_level' with 'callback_manager'.
5fill in blank
hard

Fill all three blanks to create an AgentExecutor with a custom agent, tools, and set verbose mode off.

LangChain
agent_executor = AgentExecutor.from_agent_and_tools(agent=[1], tools=[2], verbose=[3])
Drag options to blanks, or click blank then click option'
Acustom_agent
Bcustom_tools
CFalse
DTrue
Attempts:
3 left
💡 Hint
Common Mistakes
Setting verbose to True when asked to set it off.
Mixing up agent and tools variables.