Skip to content

Commit cfe9c7d

Browse files
committed
add file
1 parent dd8a4a0 commit cfe9c7d

File tree

1 file changed

+43
-0
lines changed
  • libs/langgraph-checkpoint-mongodb/tests/integration_tests

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from typing import Literal, Union
2+
3+
from pydantic import BaseModel
4+
5+
6+
# define these objects to avoid importing langchain_core.agents
7+
# and therefore avoid relying on core Pydantic version
8+
class AgentAction(BaseModel):
9+
tool: str
10+
tool_input: Union[str, dict]
11+
log: str
12+
type: Literal["AgentAction"] = "AgentAction"
13+
14+
model_config = {
15+
"json_schema_extra": {
16+
"description": (
17+
"""Represents a request to execute an action by an agent.
18+
19+
The action consists of the name of the tool to execute and the input to pass
20+
to the tool. The log is used to pass along extra information about the action."""
21+
)
22+
}
23+
}
24+
25+
26+
class AgentFinish(BaseModel):
27+
"""Final return value of an ActionAgent.
28+
29+
Agents return an AgentFinish when they have reached a stopping condition.
30+
"""
31+
32+
return_values: dict
33+
log: str
34+
type: Literal["AgentFinish"] = "AgentFinish"
35+
model_config = {
36+
"json_schema_extra": {
37+
"description": (
38+
"""Final return value of an ActionAgent.
39+
40+
Agents return an AgentFinish when they have reached a stopping condition."""
41+
)
42+
}
43+
}

0 commit comments

Comments
 (0)