python.langchain.com-ConversationalAgent
python.langchain.com-ConversationalAgent
python.langchain.com/v0.2/api_reference/langchain/agents/langchain.agents.conversational.base.ConversationalAgent.ht
ml
Bases: Agent
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
Parameters:
intermediate_steps (List[Tuple[AgentAction, str]]) – Steps the LLM has taken
to date, along with observations.
Returns:
Action specifying what tool to use.
Return type:
1/6
AgentAction | AgentFinish
Parameters:
tools (Sequence[BaseTool]) – List of tools the agent will have access to, used
to format the prompt.
prefix (str) – String to put before the list of tools. Defaults to PREFIX.
suffix (str) – String to put after the list of tools. Defaults to SUFFIX.
2/6
format_instructions (str) – Instructions on how to use the tools. Defaults to
FORMAT_INSTRUCTIONS
input_variables (List[str] | None) – List of input variables the final prompt will
expect. Defaults to [“input”, “chat_history”, “agent_scratchpad”].
Returns:
A PromptTemplate with the template assembled from the pieces here.
Return type:
PromptTemplate
Parameters:
llm (BaseLanguageModel) – The language model to use.
3/6
Returns:
An agent.
Return type:
Agent
Return type:
List[str] | None
Parameters:
intermediate_steps (List[Tuple[AgentAction, str]]) – Steps the LLM has taken
to date, along with observations.
Returns:
Full inputs for the LLMChain.
Return type:
Dict[str, Any]
Parameters:
intermediate_steps (List[Tuple[AgentAction, str]]) – Steps the LLM has taken
to date, along with observations.
Returns:
Action specifying what tool to use.
Return type:
4/6
AgentAction | AgentFinish
Return response when agent has been stopped due to max iterations.
Parameters:
early_stopping_method (str) – Method to use for early stopping.
Returns:
Agent finish object.
Return type:
AgentFinish
Raises:
ValueError – If early_stopping_method is not in [‘force’, ‘generate’].
Parameters:
file_path (Path | str) – Path to file to save the agent to.
Return type:
None
tool_run_logging_kwargs() → Dict#
Return logging kwargs for tool run.
Return type:
Dict
Returns:
5/6
”
Return type:
“Thought
Returns:
”
Return type:
“Observation
6/6