File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
libs/langgraph-checkpoint-mongodb/tests/integration_tests Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments