agents
#
Schema definitions for representing agent actions, observations, and return values.
ATTENTION The schema definitions are provided for backwards compatibility.
New agents should be built using the langgraph library (langchain-ai/langgraph)), which provides a simpler and more flexible way to define agents.
Please see the migration guide for information on how to migrate existing agents to modern langgraph agents: https://python.langchain.com/docs/how_to/migrate_agent/
Agents use language models to choose a sequence of actions to take.
A basic agent works in the following manner:
Given a prompt an agent uses an LLM to request an action to take (e.g., a tool to run).
The agent executes the action (e.g., runs the tool), and receives an observation.
The agent returns the observation to the LLM, which can then be used to generate the next action.
When the agent reaches a stopping condition, it returns a final return value.
The schemas for the agents themselves are defined in langchain.agents.agent.
Classes
Represents a request to execute an action by an agent. |
|
Representation of an action to be executed by an agent. |
|
Final return value of an ActionAgent. |
|
Result of running an AgentAction. |