Complete the code to import the base class for creating a custom agent in LangChain.
from langchain.agents import [1]
The BaseSingleActionAgent is the base class used to create custom agents with specific logic.
Complete the method signature to define the custom agent's decision logic.
def plan(self, intermediate_steps, [1]):
The plan method receives intermediate_steps and inputs to decide the next action.
Fix the error in the code to correctly return the agent's action.
return [1](tool='search', tool_input=inputs['query'])
The AgentAction class is used to specify the tool and input for the agent's next step.
Fill both blanks to create a dictionary comprehension that maps tool names to their descriptions.
tool_descriptions = {tool.[1]: tool.[2] for tool in tools}Each tool has a name and a description attribute used here to build the dictionary.
Fill all three blanks to define a custom agent class with a name, a method, and a return statement.
class CustomAgent([1]): def [2](self, intermediate_steps, inputs): return f"Hello, [3]!"
The class inherits from BaseSingleActionAgent. The method to define agent logic is plan. The return uses the input's 'name' key.