a7d6d88f6f
CI / changes (push) Has been cancelled
CI / cd libs/checkpoint (push) Has been cancelled
CI / cd libs/checkpoint-conformance (push) Has been cancelled
CI / cd libs/checkpoint-postgres (push) Has been cancelled
CI / cd libs/checkpoint-sqlite (push) Has been cancelled
CI / cd libs/cli (push) Has been cancelled
CI / cd libs/prebuilt (push) Has been cancelled
CI / cd libs/sdk-py (push) Has been cancelled
CI / cd libs/langgraph (push) Has been cancelled
CI / Check SDK methods matching (push) Has been cancelled
CI / Check CLI schema hasn't changed #3.13 (push) Has been cancelled
CI / CLI integration test (push) Has been cancelled
CI / sdk-py integration test (push) Has been cancelled
CI / CI Success (push) Has been cancelled
baseline / benchmark (push) Has been cancelled
Deploy Redirects to GitHub Pages / deploy (push) Has been cancelled
31 lines
805 B
Python
31 lines
805 B
Python
from typing import Literal
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
# define these objects to avoid importing langchain_core.agents
|
|
# and therefore avoid relying on core Pydantic version
|
|
class AgentAction(BaseModel):
|
|
"""
|
|
Represents a request to execute an action by an agent.
|
|
|
|
The action consists of the name of the tool to execute and the input to pass
|
|
to the tool. The log is used to pass along extra information about the action.
|
|
"""
|
|
|
|
tool: str
|
|
tool_input: str | dict
|
|
log: str
|
|
type: Literal["AgentAction"] = "AgentAction"
|
|
|
|
|
|
class AgentFinish(BaseModel):
|
|
"""Final return value of an ActionAgent.
|
|
|
|
Agents return an AgentFinish when they have reached a stopping condition.
|
|
"""
|
|
|
|
return_values: dict
|
|
log: str
|
|
type: Literal["AgentFinish"] = "AgentFinish"
|