mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-31 12:19:58 +02:00
1936 lines
82 KiB
Plaintext
1936 lines
82 KiB
Plaintext
# serializer version: 1
|
|
# name: test_conditional_entrypoint_graph
|
|
'{"title": "LangGraphInput"}'
|
|
# ---
|
|
# name: test_conditional_entrypoint_graph.1
|
|
'{"title": "LangGraphOutput"}'
|
|
# ---
|
|
# name: test_conditional_entrypoint_graph.2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "left",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "left"
|
|
}
|
|
},
|
|
{
|
|
"id": "right",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "right"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_start",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_start"
|
|
}
|
|
},
|
|
{
|
|
"id": "condition",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "RunnableLambda"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "right",
|
|
"target": "__end__"
|
|
},
|
|
{
|
|
"source": "__start__",
|
|
"target": "should_start"
|
|
},
|
|
{
|
|
"source": "should_start",
|
|
"target": "left",
|
|
"data": "go-left",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_start",
|
|
"target": "right",
|
|
"data": "go-right",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "left",
|
|
"target": "condition"
|
|
},
|
|
{
|
|
"source": "condition",
|
|
"target": "__end__",
|
|
"data": "__end__",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_entrypoint_graph.3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+--------------+
|
|
| should_start |
|
|
+--------------+
|
|
. ..
|
|
.. .
|
|
. ..
|
|
+------+ .
|
|
| left | .
|
|
+------+ .
|
|
* .
|
|
* .
|
|
* .
|
|
+-----------+ +-------+
|
|
| condition | | right |
|
|
+-----------+ +-------+
|
|
. *
|
|
.. **
|
|
. *
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_conditional_entrypoint_graph_state
|
|
'{"title": "LangGraphInput", "$ref": "#/definitions/AgentState", "definitions": {"AgentState": {"title": "AgentState", "type": "object", "properties": {"input": {"title": "Input", "type": "string"}, "output": {"title": "Output", "type": "string"}, "steps": {"title": "Steps", "type": "array", "items": {"type": "string"}}}}}}'
|
|
# ---
|
|
# name: test_conditional_entrypoint_graph_state.1
|
|
'{"title": "LangGraphOutput", "type": "object", "properties": {"input": {"title": "Input", "type": "string"}, "output": {"title": "Output", "type": "string"}, "steps": {"title": "Steps", "type": "array", "items": {"type": "string"}}}}'
|
|
# ---
|
|
# name: test_conditional_entrypoint_graph_state.2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "left",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "left"
|
|
}
|
|
},
|
|
{
|
|
"id": "right",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "right"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_start",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_start"
|
|
}
|
|
},
|
|
{
|
|
"id": "condition",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "RunnableLambda"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "right",
|
|
"target": "__end__"
|
|
},
|
|
{
|
|
"source": "__start__",
|
|
"target": "should_start"
|
|
},
|
|
{
|
|
"source": "should_start",
|
|
"target": "left",
|
|
"data": "go-left",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_start",
|
|
"target": "right",
|
|
"data": "go-right",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "left",
|
|
"target": "condition"
|
|
},
|
|
{
|
|
"source": "condition",
|
|
"target": "__end__",
|
|
"data": "__end__",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_entrypoint_graph_state.3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+--------------+
|
|
| should_start |
|
|
+--------------+
|
|
. ..
|
|
.. .
|
|
. ..
|
|
+------+ .
|
|
| left | .
|
|
+------+ .
|
|
* .
|
|
* .
|
|
* .
|
|
+-----------+ +-------+
|
|
| condition | | right |
|
|
+-----------+ +-------+
|
|
. *
|
|
.. **
|
|
. *
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_run]
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"schema",
|
|
"runnable",
|
|
"RunnableAssign"
|
|
],
|
|
"name": "RunnableAssign<agent_outcome>"
|
|
}
|
|
},
|
|
{
|
|
"id": "tools",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "execute_tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "tools",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "tools",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "exit",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_run].1
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +-------+
|
|
| __end__ | | tools |
|
|
+---------+ +-------+
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_run].2
|
|
'''
|
|
graph TD;
|
|
__start__ --> agent;
|
|
tools --> agent;
|
|
agent -. continue .-> tools;
|
|
agent -. exit .-> __end__;
|
|
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_run].3
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": 2,
|
|
"type": "schema",
|
|
"data": "Parallel<agent_outcome>Input"
|
|
},
|
|
{
|
|
"id": 3,
|
|
"type": "schema",
|
|
"data": "Parallel<agent_outcome>Output"
|
|
},
|
|
{
|
|
"id": 4,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"prompts",
|
|
"prompt",
|
|
"PromptTemplate"
|
|
],
|
|
"name": "PromptTemplate"
|
|
}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_community",
|
|
"llms",
|
|
"fake",
|
|
"FakeStreamingListLLM"
|
|
],
|
|
"name": "FakeStreamingListLLM"
|
|
}
|
|
},
|
|
{
|
|
"id": 6,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "agent_parser"
|
|
}
|
|
},
|
|
{
|
|
"id": 7,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"schema",
|
|
"runnable",
|
|
"RunnablePassthrough"
|
|
],
|
|
"name": "RunnablePassthrough"
|
|
}
|
|
},
|
|
{
|
|
"id": "tools",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "execute_tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": 4,
|
|
"target": 5
|
|
},
|
|
{
|
|
"source": 5,
|
|
"target": 6
|
|
},
|
|
{
|
|
"source": 2,
|
|
"target": 4
|
|
},
|
|
{
|
|
"source": 6,
|
|
"target": 3
|
|
},
|
|
{
|
|
"source": 2,
|
|
"target": 7
|
|
},
|
|
{
|
|
"source": 7,
|
|
"target": 3
|
|
},
|
|
{
|
|
"source": "__start__",
|
|
"target": 2
|
|
},
|
|
{
|
|
"source": "tools",
|
|
"target": 2
|
|
},
|
|
{
|
|
"source": 3,
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "tools",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "exit",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_run].4
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+------------------------------+
|
|
| Parallel<agent_outcome>Input |
|
|
+------------------------------+
|
|
***** * *****
|
|
****** * ****
|
|
*** * *****
|
|
+----------------+ * ***
|
|
| PromptTemplate | * *
|
|
+----------------+ * *
|
|
* * *
|
|
* * *
|
|
* * *
|
|
+----------------------+ * *
|
|
| FakeStreamingListLLM | * *
|
|
+----------------------+ * *
|
|
* * *
|
|
* * *
|
|
* * *
|
|
+----------------------+ +-------------+ *
|
|
| Lambda(agent_parser) | | Passthrough | *
|
|
+----------------------+ +-------------+ *
|
|
*** *** *
|
|
** ** *
|
|
** ** *
|
|
+-------------------------------+ *
|
|
| Parallel<agent_outcome>Output | *
|
|
+-------------------------------+ *
|
|
* *
|
|
* *
|
|
* *
|
|
+-----------------+ *
|
|
| should_continue |... *
|
|
+-----------------+ ......... *
|
|
. ........ *
|
|
. ......... *
|
|
. ..... *
|
|
+---------+ +-------+
|
|
| __end__ | | tools |
|
|
+---------+ +-------+
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_run].5
|
|
'''
|
|
graph TD;
|
|
PromptTemplate --> FakeStreamingListLLM;
|
|
FakeStreamingListLLM --> Lambda_agent_parser_;
|
|
Parallel_agent_outcome_Input --> PromptTemplate;
|
|
Lambda_agent_parser_ --> Parallel_agent_outcome_Output;
|
|
Parallel_agent_outcome_Input --> Passthrough;
|
|
Passthrough --> Parallel_agent_outcome_Output;
|
|
__start__ --> Parallel_agent_outcome_Input;
|
|
tools --> Parallel_agent_outcome_Input;
|
|
Parallel_agent_outcome_Output -. continue .-> tools;
|
|
Parallel_agent_outcome_Output -. exit .-> __end__;
|
|
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_step]
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"schema",
|
|
"runnable",
|
|
"RunnableAssign"
|
|
],
|
|
"name": "RunnableAssign<agent_outcome>"
|
|
}
|
|
},
|
|
{
|
|
"id": "tools",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "execute_tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "tools",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "tools",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "exit",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_step].1
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +-------+
|
|
| __end__ | | tools |
|
|
+---------+ +-------+
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_step].2
|
|
'''
|
|
graph TD;
|
|
__start__ --> agent;
|
|
tools --> agent;
|
|
agent -. continue .-> tools;
|
|
agent -. exit .-> __end__;
|
|
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_step].3
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": 2,
|
|
"type": "schema",
|
|
"data": "Parallel<agent_outcome>Input"
|
|
},
|
|
{
|
|
"id": 3,
|
|
"type": "schema",
|
|
"data": "Parallel<agent_outcome>Output"
|
|
},
|
|
{
|
|
"id": 4,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"prompts",
|
|
"prompt",
|
|
"PromptTemplate"
|
|
],
|
|
"name": "PromptTemplate"
|
|
}
|
|
},
|
|
{
|
|
"id": 5,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_community",
|
|
"llms",
|
|
"fake",
|
|
"FakeStreamingListLLM"
|
|
],
|
|
"name": "FakeStreamingListLLM"
|
|
}
|
|
},
|
|
{
|
|
"id": 6,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "agent_parser"
|
|
}
|
|
},
|
|
{
|
|
"id": 7,
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"schema",
|
|
"runnable",
|
|
"RunnablePassthrough"
|
|
],
|
|
"name": "RunnablePassthrough"
|
|
}
|
|
},
|
|
{
|
|
"id": "tools",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "execute_tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": 4,
|
|
"target": 5
|
|
},
|
|
{
|
|
"source": 5,
|
|
"target": 6
|
|
},
|
|
{
|
|
"source": 2,
|
|
"target": 4
|
|
},
|
|
{
|
|
"source": 6,
|
|
"target": 3
|
|
},
|
|
{
|
|
"source": 2,
|
|
"target": 7
|
|
},
|
|
{
|
|
"source": 7,
|
|
"target": 3
|
|
},
|
|
{
|
|
"source": "__start__",
|
|
"target": 2
|
|
},
|
|
{
|
|
"source": "tools",
|
|
"target": 2
|
|
},
|
|
{
|
|
"source": 3,
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "tools",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "exit",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_step].4
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+------------------------------+
|
|
| Parallel<agent_outcome>Input |
|
|
+------------------------------+
|
|
***** * *****
|
|
****** * ****
|
|
*** * *****
|
|
+----------------+ * ***
|
|
| PromptTemplate | * *
|
|
+----------------+ * *
|
|
* * *
|
|
* * *
|
|
* * *
|
|
+----------------------+ * *
|
|
| FakeStreamingListLLM | * *
|
|
+----------------------+ * *
|
|
* * *
|
|
* * *
|
|
* * *
|
|
+----------------------+ +-------------+ *
|
|
| Lambda(agent_parser) | | Passthrough | *
|
|
+----------------------+ +-------------+ *
|
|
*** *** *
|
|
** ** *
|
|
** ** *
|
|
+-------------------------------+ *
|
|
| Parallel<agent_outcome>Output | *
|
|
+-------------------------------+ *
|
|
* *
|
|
* *
|
|
* *
|
|
+-----------------+ *
|
|
| should_continue |... *
|
|
+-----------------+ ......... *
|
|
. ........ *
|
|
. ......... *
|
|
. ..... *
|
|
+---------+ +-------+
|
|
| __end__ | | tools |
|
|
+---------+ +-------+
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph[end_of_step].5
|
|
'''
|
|
graph TD;
|
|
PromptTemplate --> FakeStreamingListLLM;
|
|
FakeStreamingListLLM --> Lambda_agent_parser_;
|
|
Parallel_agent_outcome_Input --> PromptTemplate;
|
|
Lambda_agent_parser_ --> Parallel_agent_outcome_Output;
|
|
Parallel_agent_outcome_Input --> Passthrough;
|
|
Passthrough --> Parallel_agent_outcome_Output;
|
|
__start__ --> Parallel_agent_outcome_Input;
|
|
tools --> Parallel_agent_outcome_Input;
|
|
Parallel_agent_outcome_Output -. continue .-> tools;
|
|
Parallel_agent_outcome_Output -. exit .-> __end__;
|
|
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_run]
|
|
'{"title": "LangGraphInput", "$ref": "#/definitions/AgentState", "definitions": {"AgentAction": {"title": "AgentAction", "description": "A full description of an action for an ActionAgent to execute.", "type": "object", "properties": {"tool": {"title": "Tool", "type": "string"}, "tool_input": {"title": "Tool Input", "anyOf": [{"type": "string"}, {"type": "object"}]}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentAction", "enum": ["AgentAction"], "type": "string"}}, "required": ["tool", "tool_input", "log"]}, "AgentFinish": {"title": "AgentFinish", "description": "The final return value of an ActionAgent.", "type": "object", "properties": {"return_values": {"title": "Return Values", "type": "object"}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentFinish", "enum": ["AgentFinish"], "type": "string"}}, "required": ["return_values", "log"]}, "AgentState": {"title": "AgentState", "type": "object", "properties": {"input": {"title": "Input", "type": "string"}, "agent_outcome": {"title": "Agent Outcome", "anyOf": [{"$ref": "#/definitions/AgentAction"}, {"$ref": "#/definitions/AgentFinish"}]}, "intermediate_steps": {"title": "Intermediate Steps", "type": "array", "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": [{"$ref": "#/definitions/AgentAction"}, {"type": "string"}]}}}}}}'
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_run].1
|
|
'{"title": "LangGraphOutput", "type": "object", "properties": {"input": {"title": "Input", "type": "string"}, "agent_outcome": {"title": "Agent Outcome", "anyOf": [{"$ref": "#/definitions/AgentAction"}, {"$ref": "#/definitions/AgentFinish"}]}, "intermediate_steps": {"title": "Intermediate Steps", "type": "array", "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": [{"$ref": "#/definitions/AgentAction"}, {"type": "string"}]}}}, "definitions": {"AgentAction": {"title": "AgentAction", "description": "A full description of an action for an ActionAgent to execute.", "type": "object", "properties": {"tool": {"title": "Tool", "type": "string"}, "tool_input": {"title": "Tool Input", "anyOf": [{"type": "string"}, {"type": "object"}]}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentAction", "enum": ["AgentAction"], "type": "string"}}, "required": ["tool", "tool_input", "log"]}, "AgentFinish": {"title": "AgentFinish", "description": "The final return value of an ActionAgent.", "type": "object", "properties": {"return_values": {"title": "Return Values", "type": "object"}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentFinish", "enum": ["AgentFinish"], "type": "string"}}, "required": ["return_values", "log"]}}}'
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_run].2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"schema",
|
|
"runnable",
|
|
"RunnableSequence"
|
|
],
|
|
"name": "RunnableSequence"
|
|
}
|
|
},
|
|
{
|
|
"id": "tools",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "execute_tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "tools",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "tools",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "exit",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_run].3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +-------+
|
|
| __end__ | | tools |
|
|
+---------+ +-------+
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_step]
|
|
'{"title": "LangGraphInput", "$ref": "#/definitions/AgentState", "definitions": {"AgentAction": {"title": "AgentAction", "description": "A full description of an action for an ActionAgent to execute.", "type": "object", "properties": {"tool": {"title": "Tool", "type": "string"}, "tool_input": {"title": "Tool Input", "anyOf": [{"type": "string"}, {"type": "object"}]}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentAction", "enum": ["AgentAction"], "type": "string"}}, "required": ["tool", "tool_input", "log"]}, "AgentFinish": {"title": "AgentFinish", "description": "The final return value of an ActionAgent.", "type": "object", "properties": {"return_values": {"title": "Return Values", "type": "object"}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentFinish", "enum": ["AgentFinish"], "type": "string"}}, "required": ["return_values", "log"]}, "AgentState": {"title": "AgentState", "type": "object", "properties": {"input": {"title": "Input", "type": "string"}, "agent_outcome": {"title": "Agent Outcome", "anyOf": [{"$ref": "#/definitions/AgentAction"}, {"$ref": "#/definitions/AgentFinish"}]}, "intermediate_steps": {"title": "Intermediate Steps", "type": "array", "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": [{"$ref": "#/definitions/AgentAction"}, {"type": "string"}]}}}}}}'
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_step].1
|
|
'{"title": "LangGraphOutput", "type": "object", "properties": {"input": {"title": "Input", "type": "string"}, "agent_outcome": {"title": "Agent Outcome", "anyOf": [{"$ref": "#/definitions/AgentAction"}, {"$ref": "#/definitions/AgentFinish"}]}, "intermediate_steps": {"title": "Intermediate Steps", "type": "array", "items": {"type": "array", "minItems": 2, "maxItems": 2, "items": [{"$ref": "#/definitions/AgentAction"}, {"type": "string"}]}}}, "definitions": {"AgentAction": {"title": "AgentAction", "description": "A full description of an action for an ActionAgent to execute.", "type": "object", "properties": {"tool": {"title": "Tool", "type": "string"}, "tool_input": {"title": "Tool Input", "anyOf": [{"type": "string"}, {"type": "object"}]}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentAction", "enum": ["AgentAction"], "type": "string"}}, "required": ["tool", "tool_input", "log"]}, "AgentFinish": {"title": "AgentFinish", "description": "The final return value of an ActionAgent.", "type": "object", "properties": {"return_values": {"title": "Return Values", "type": "object"}, "log": {"title": "Log", "type": "string"}, "type": {"title": "Type", "default": "AgentFinish", "enum": ["AgentFinish"], "type": "string"}}, "required": ["return_values", "log"]}}}'
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_step].2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain",
|
|
"schema",
|
|
"runnable",
|
|
"RunnableSequence"
|
|
],
|
|
"name": "RunnableSequence"
|
|
}
|
|
},
|
|
{
|
|
"id": "tools",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "execute_tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "tools",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "tools",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "exit",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_conditional_graph_state[end_of_step].3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +-------+
|
|
| __end__ | | tools |
|
|
+---------+ +-------+
|
|
'''
|
|
# ---
|
|
# name: test_in_one_fan_out_state_graph_waiting_edge[end_of_run]
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+---------------+
|
|
| rewrite_query |
|
|
+---------------+
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+--------------+ *
|
|
| analyzer_one | *
|
|
+--------------+ *
|
|
* *
|
|
* *
|
|
* *
|
|
+---------------+ +---------------+
|
|
| retriever_one | | retriever_two |
|
|
+---------------+ +---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+----+
|
|
| qa |
|
|
+----+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_in_one_fan_out_state_graph_waiting_edge[end_of_step]
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+---------------+
|
|
| rewrite_query |
|
|
+---------------+
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+--------------+ *
|
|
| analyzer_one | *
|
|
+--------------+ *
|
|
* *
|
|
* *
|
|
* *
|
|
+---------------+ +---------------+
|
|
| retriever_one | | retriever_two |
|
|
+---------------+ +---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+----+
|
|
| qa |
|
|
+----+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_in_one_fan_out_state_graph_waiting_edge_custom_state_class[end_of_run]
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+---------------+
|
|
| rewrite_query |
|
|
+---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+--------------+ +---------+
|
|
| analyzer_one | | decider |
|
|
+--------------+ +---------+
|
|
* .
|
|
* .
|
|
* .
|
|
+---------------+ +---------------+
|
|
| retriever_one | | retriever_two |
|
|
+---------------+ +---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+----+
|
|
| qa |
|
|
+----+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_in_one_fan_out_state_graph_waiting_edge_custom_state_class[end_of_step]
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+---------------+
|
|
| rewrite_query |
|
|
+---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+--------------+ +---------+
|
|
| analyzer_one | | decider |
|
|
+--------------+ +---------+
|
|
* .
|
|
* .
|
|
* .
|
|
+---------------+ +---------------+
|
|
| retriever_one | | retriever_two |
|
|
+---------------+ +---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+----+
|
|
| qa |
|
|
+----+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_in_one_fan_out_state_graph_waiting_edge_via_branch[end_of_run]
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+---------------+
|
|
| rewrite_query |
|
|
+---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+--------------+ +-----------+
|
|
| analyzer_one | | condition |
|
|
+--------------+ +-----------+
|
|
* .
|
|
* .
|
|
* .
|
|
+---------------+ +---------------+
|
|
| retriever_one | | retriever_two |
|
|
+---------------+ +---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+----+
|
|
| qa |
|
|
+----+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_in_one_fan_out_state_graph_waiting_edge_via_branch[end_of_step]
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+---------------+
|
|
| rewrite_query |
|
|
+---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+--------------+ +-----------+
|
|
| analyzer_one | | condition |
|
|
+--------------+ +-----------+
|
|
* .
|
|
* .
|
|
* .
|
|
+---------------+ +---------------+
|
|
| retriever_one | | retriever_two |
|
|
+---------------+ +---------------+
|
|
*** ***
|
|
* *
|
|
** **
|
|
+----+
|
|
| qa |
|
|
+----+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_message_graph[end_of_run]
|
|
'{"title": "LangGraphInput", "type": "array", "items": {"anyOf": [{"$ref": "#/definitions/AIMessage"}, {"$ref": "#/definitions/HumanMessage"}, {"$ref": "#/definitions/ChatMessage"}, {"$ref": "#/definitions/SystemMessage"}, {"$ref": "#/definitions/FunctionMessage"}, {"$ref": "#/definitions/ToolMessage"}]}, "definitions": {"ToolCall": {"title": "ToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "object"}, "id": {"title": "Id", "type": "string"}}, "required": ["name", "args", "id"]}, "InvalidToolCall": {"title": "InvalidToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "string"}, "id": {"title": "Id", "type": "string"}, "error": {"title": "Error", "type": "string"}}, "required": ["name", "args", "id", "error"]}, "AIMessage": {"title": "AIMessage", "description": "Message from an AI.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "ai", "enum": ["ai"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}, "tool_calls": {"title": "Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/ToolCall"}}, "invalid_tool_calls": {"title": "Invalid Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/InvalidToolCall"}}}, "required": ["content"]}, "HumanMessage": {"title": "HumanMessage", "description": "Message from a human.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "human", "enum": ["human"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}}, "required": ["content"]}, "ChatMessage": {"title": "ChatMessage", "description": "Message that can be assigned an arbitrary speaker (i.e. role).", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "chat", "enum": ["chat"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "role": {"title": "Role", "type": "string"}}, "required": ["content", "role"]}, "SystemMessage": {"title": "SystemMessage", "description": "Message for priming AI behavior, usually passed in as the first of a sequence\\nof input messages.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "system", "enum": ["system"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content"]}, "FunctionMessage": {"title": "FunctionMessage", "description": "Message for passing the result of executing a function back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "function", "enum": ["function"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "name"]}, "ToolMessage": {"title": "ToolMessage", "description": "Message for passing the result of executing a tool back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "tool", "enum": ["tool"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "tool_call_id": {"title": "Tool Call Id", "type": "string"}}, "required": ["content", "tool_call_id"]}}}'
|
|
# ---
|
|
# name: test_message_graph[end_of_run].1
|
|
'{"title": "LangGraphOutput", "type": "array", "items": {"anyOf": [{"$ref": "#/definitions/AIMessage"}, {"$ref": "#/definitions/HumanMessage"}, {"$ref": "#/definitions/ChatMessage"}, {"$ref": "#/definitions/SystemMessage"}, {"$ref": "#/definitions/FunctionMessage"}, {"$ref": "#/definitions/ToolMessage"}]}, "definitions": {"ToolCall": {"title": "ToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "object"}, "id": {"title": "Id", "type": "string"}}, "required": ["name", "args", "id"]}, "InvalidToolCall": {"title": "InvalidToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "string"}, "id": {"title": "Id", "type": "string"}, "error": {"title": "Error", "type": "string"}}, "required": ["name", "args", "id", "error"]}, "AIMessage": {"title": "AIMessage", "description": "Message from an AI.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "ai", "enum": ["ai"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}, "tool_calls": {"title": "Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/ToolCall"}}, "invalid_tool_calls": {"title": "Invalid Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/InvalidToolCall"}}}, "required": ["content"]}, "HumanMessage": {"title": "HumanMessage", "description": "Message from a human.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "human", "enum": ["human"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}}, "required": ["content"]}, "ChatMessage": {"title": "ChatMessage", "description": "Message that can be assigned an arbitrary speaker (i.e. role).", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "chat", "enum": ["chat"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "role": {"title": "Role", "type": "string"}}, "required": ["content", "role"]}, "SystemMessage": {"title": "SystemMessage", "description": "Message for priming AI behavior, usually passed in as the first of a sequence\\nof input messages.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "system", "enum": ["system"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content"]}, "FunctionMessage": {"title": "FunctionMessage", "description": "Message for passing the result of executing a function back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "function", "enum": ["function"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "name"]}, "ToolMessage": {"title": "ToolMessage", "description": "Message for passing the result of executing a tool back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "tool", "enum": ["tool"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "tool_call_id": {"title": "Tool Call Id", "type": "string"}}, "required": ["content", "tool_call_id"]}}}'
|
|
# ---
|
|
# name: test_message_graph[end_of_run].2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"tests",
|
|
"test_pregel",
|
|
"FakeFuntionChatModel"
|
|
],
|
|
"name": "FakeFuntionChatModel"
|
|
}
|
|
},
|
|
{
|
|
"id": "action",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langgraph",
|
|
"prebuilt",
|
|
"tool_node",
|
|
"ToolNode"
|
|
],
|
|
"name": "tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "action",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "action",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "end",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_message_graph[end_of_run].3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +--------+
|
|
| __end__ | | action |
|
|
+---------+ +--------+
|
|
'''
|
|
# ---
|
|
# name: test_message_graph[end_of_step]
|
|
'{"title": "LangGraphInput", "type": "array", "items": {"anyOf": [{"$ref": "#/definitions/AIMessage"}, {"$ref": "#/definitions/HumanMessage"}, {"$ref": "#/definitions/ChatMessage"}, {"$ref": "#/definitions/SystemMessage"}, {"$ref": "#/definitions/FunctionMessage"}, {"$ref": "#/definitions/ToolMessage"}]}, "definitions": {"ToolCall": {"title": "ToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "object"}, "id": {"title": "Id", "type": "string"}}, "required": ["name", "args", "id"]}, "InvalidToolCall": {"title": "InvalidToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "string"}, "id": {"title": "Id", "type": "string"}, "error": {"title": "Error", "type": "string"}}, "required": ["name", "args", "id", "error"]}, "AIMessage": {"title": "AIMessage", "description": "Message from an AI.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "ai", "enum": ["ai"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}, "tool_calls": {"title": "Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/ToolCall"}}, "invalid_tool_calls": {"title": "Invalid Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/InvalidToolCall"}}}, "required": ["content"]}, "HumanMessage": {"title": "HumanMessage", "description": "Message from a human.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "human", "enum": ["human"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}}, "required": ["content"]}, "ChatMessage": {"title": "ChatMessage", "description": "Message that can be assigned an arbitrary speaker (i.e. role).", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "chat", "enum": ["chat"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "role": {"title": "Role", "type": "string"}}, "required": ["content", "role"]}, "SystemMessage": {"title": "SystemMessage", "description": "Message for priming AI behavior, usually passed in as the first of a sequence\\nof input messages.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "system", "enum": ["system"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content"]}, "FunctionMessage": {"title": "FunctionMessage", "description": "Message for passing the result of executing a function back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "function", "enum": ["function"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "name"]}, "ToolMessage": {"title": "ToolMessage", "description": "Message for passing the result of executing a tool back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "tool", "enum": ["tool"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "tool_call_id": {"title": "Tool Call Id", "type": "string"}}, "required": ["content", "tool_call_id"]}}}'
|
|
# ---
|
|
# name: test_message_graph[end_of_step].1
|
|
'{"title": "LangGraphOutput", "type": "array", "items": {"anyOf": [{"$ref": "#/definitions/AIMessage"}, {"$ref": "#/definitions/HumanMessage"}, {"$ref": "#/definitions/ChatMessage"}, {"$ref": "#/definitions/SystemMessage"}, {"$ref": "#/definitions/FunctionMessage"}, {"$ref": "#/definitions/ToolMessage"}]}, "definitions": {"ToolCall": {"title": "ToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "object"}, "id": {"title": "Id", "type": "string"}}, "required": ["name", "args", "id"]}, "InvalidToolCall": {"title": "InvalidToolCall", "type": "object", "properties": {"name": {"title": "Name", "type": "string"}, "args": {"title": "Args", "type": "string"}, "id": {"title": "Id", "type": "string"}, "error": {"title": "Error", "type": "string"}}, "required": ["name", "args", "id", "error"]}, "AIMessage": {"title": "AIMessage", "description": "Message from an AI.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "ai", "enum": ["ai"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}, "tool_calls": {"title": "Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/ToolCall"}}, "invalid_tool_calls": {"title": "Invalid Tool Calls", "default": [], "type": "array", "items": {"$ref": "#/definitions/InvalidToolCall"}}}, "required": ["content"]}, "HumanMessage": {"title": "HumanMessage", "description": "Message from a human.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "human", "enum": ["human"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "example": {"title": "Example", "default": false, "type": "boolean"}}, "required": ["content"]}, "ChatMessage": {"title": "ChatMessage", "description": "Message that can be assigned an arbitrary speaker (i.e. role).", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "chat", "enum": ["chat"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "role": {"title": "Role", "type": "string"}}, "required": ["content", "role"]}, "SystemMessage": {"title": "SystemMessage", "description": "Message for priming AI behavior, usually passed in as the first of a sequence\\nof input messages.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "system", "enum": ["system"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content"]}, "FunctionMessage": {"title": "FunctionMessage", "description": "Message for passing the result of executing a function back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "function", "enum": ["function"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "name"]}, "ToolMessage": {"title": "ToolMessage", "description": "Message for passing the result of executing a tool back to a model.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "default": "tool", "enum": ["tool"], "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}, "tool_call_id": {"title": "Tool Call Id", "type": "string"}}, "required": ["content", "tool_call_id"]}}}'
|
|
# ---
|
|
# name: test_message_graph[end_of_step].2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"tests",
|
|
"test_pregel",
|
|
"FakeFuntionChatModel"
|
|
],
|
|
"name": "FakeFuntionChatModel"
|
|
}
|
|
},
|
|
{
|
|
"id": "action",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langgraph",
|
|
"prebuilt",
|
|
"tool_node",
|
|
"ToolNode"
|
|
],
|
|
"name": "tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "action",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "action",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "end",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_message_graph[end_of_step].3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +--------+
|
|
| __end__ | | action |
|
|
+---------+ +--------+
|
|
'''
|
|
# ---
|
|
# name: test_nested_graph
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| inner |
|
|
+-------+
|
|
*
|
|
*
|
|
*
|
|
+------+
|
|
| side |
|
|
+------+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|
|
# name: test_prebuilt_chat
|
|
'{"title": "LangGraphInput", "$ref": "#/definitions/AgentState", "definitions": {"BaseMessage": {"title": "BaseMessage", "description": "Base abstract Message class.\\n\\nMessages are the inputs and outputs of ChatModels.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "type"]}, "AgentState": {"title": "AgentState", "type": "object", "properties": {"messages": {"title": "Messages", "type": "array", "items": {"$ref": "#/definitions/BaseMessage"}}}, "required": ["messages"]}}}'
|
|
# ---
|
|
# name: test_prebuilt_chat.1
|
|
'{"title": "LangGraphOutput", "type": "object", "properties": {"messages": {"title": "Messages", "type": "array", "items": {"$ref": "#/definitions/BaseMessage"}}}, "definitions": {"BaseMessage": {"title": "BaseMessage", "description": "Base abstract Message class.\\n\\nMessages are the inputs and outputs of ChatModels.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "type"]}}}'
|
|
# ---
|
|
# name: test_prebuilt_chat.2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "call_model"
|
|
}
|
|
},
|
|
{
|
|
"id": "action",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "call_tool"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "action",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "action",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "end",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_prebuilt_chat.3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +--------+
|
|
| __end__ | | action |
|
|
+---------+ +--------+
|
|
'''
|
|
# ---
|
|
# name: test_prebuilt_tool_chat
|
|
'{"title": "LangGraphInput", "$ref": "#/definitions/AgentState", "definitions": {"BaseMessage": {"title": "BaseMessage", "description": "Base abstract Message class.\\n\\nMessages are the inputs and outputs of ChatModels.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "type"]}, "AgentState": {"title": "AgentState", "type": "object", "properties": {"messages": {"title": "Messages", "type": "array", "items": {"$ref": "#/definitions/BaseMessage"}}}, "required": ["messages"]}}}'
|
|
# ---
|
|
# name: test_prebuilt_tool_chat.1
|
|
'{"title": "LangGraphOutput", "type": "object", "properties": {"messages": {"title": "Messages", "type": "array", "items": {"$ref": "#/definitions/BaseMessage"}}}, "definitions": {"BaseMessage": {"title": "BaseMessage", "description": "Base abstract Message class.\\n\\nMessages are the inputs and outputs of ChatModels.", "type": "object", "properties": {"content": {"title": "Content", "anyOf": [{"type": "string"}, {"type": "array", "items": {"anyOf": [{"type": "string"}, {"type": "object"}]}}]}, "additional_kwargs": {"title": "Additional Kwargs", "type": "object"}, "response_metadata": {"title": "Response Metadata", "type": "object"}, "type": {"title": "Type", "type": "string"}, "name": {"title": "Name", "type": "string"}, "id": {"title": "Id", "type": "string"}}, "required": ["content", "type"]}}}'
|
|
# ---
|
|
# name: test_prebuilt_tool_chat.2
|
|
'''
|
|
{
|
|
"nodes": [
|
|
{
|
|
"id": "__start__",
|
|
"type": "schema",
|
|
"data": "__start__"
|
|
},
|
|
{
|
|
"id": "__end__",
|
|
"type": "schema",
|
|
"data": "__end__"
|
|
},
|
|
{
|
|
"id": "agent",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "call_model"
|
|
}
|
|
},
|
|
{
|
|
"id": "action",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langgraph",
|
|
"prebuilt",
|
|
"tool_node",
|
|
"ToolNode"
|
|
],
|
|
"name": "tools"
|
|
}
|
|
},
|
|
{
|
|
"id": "should_continue",
|
|
"type": "runnable",
|
|
"data": {
|
|
"id": [
|
|
"langchain_core",
|
|
"runnables",
|
|
"base",
|
|
"RunnableLambda"
|
|
],
|
|
"name": "should_continue"
|
|
}
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"source": "__start__",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "action",
|
|
"target": "agent"
|
|
},
|
|
{
|
|
"source": "agent",
|
|
"target": "should_continue"
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "action",
|
|
"data": "continue",
|
|
"conditional": true
|
|
},
|
|
{
|
|
"source": "should_continue",
|
|
"target": "__end__",
|
|
"data": "end",
|
|
"conditional": true
|
|
}
|
|
]
|
|
}
|
|
'''
|
|
# ---
|
|
# name: test_prebuilt_tool_chat.3
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+-------+
|
|
| agent |
|
|
+-------+*
|
|
*** ***
|
|
* *
|
|
** ***
|
|
+-----------------+ *
|
|
| should_continue | *
|
|
+-----------------+. *
|
|
. ..... *
|
|
. ... *
|
|
. ... *
|
|
+---------+ +--------+
|
|
| __end__ | | action |
|
|
+---------+ +--------+
|
|
'''
|
|
# ---
|
|
# name: test_repeat_condition
|
|
'''
|
|
graph TD;
|
|
__start__ --> Researcher;
|
|
Researcher --> Researcher_router;
|
|
Researcher_router -. continue .-> Chart_Generator;
|
|
Researcher_router -. call_tool .-> Call_Tool;
|
|
Researcher_router -. end .-> __end__;
|
|
Chart_Generator --> Chart_Generator_router;
|
|
Chart_Generator_router -. continue .-> Researcher;
|
|
Chart_Generator_router -. call_tool .-> Call_Tool;
|
|
Chart_Generator_router -. end .-> __end__;
|
|
Call_Tool --> condition;
|
|
condition -. Researcher .-> Researcher;
|
|
condition -. Chart Generator .-> Chart_Generator;
|
|
|
|
'''
|
|
# ---
|
|
# name: test_simple_multi_edge
|
|
'''
|
|
+-----------+
|
|
| __start__ |
|
|
+-----------+
|
|
*
|
|
*
|
|
*
|
|
+----+
|
|
| up |
|
|
+----+
|
|
** **
|
|
* *
|
|
* *
|
|
+------+ *
|
|
| side | *
|
|
+------+ *
|
|
** **
|
|
* *
|
|
* *
|
|
+------+
|
|
| down |
|
|
+------+
|
|
*
|
|
*
|
|
*
|
|
+---------+
|
|
| __end__ |
|
|
+---------+
|
|
'''
|
|
# ---
|