mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 20:16:52 +00:00
core: mermaid: Render metadata key-value pairs when drawing mermaid graph (#24103)
- if node is runnable binding with metadata attached
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
"base",
|
||||
"RunnableLambda"
|
||||
],
|
||||
"name": "RunnableLambda"
|
||||
"name": "Lambda"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -458,7 +458,7 @@
|
||||
"runnable",
|
||||
"RunnableWithFallbacks"
|
||||
],
|
||||
"name": "RunnableWithFallbacks"
|
||||
"name": "WithFallbacks"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -498,7 +498,7 @@
|
||||
"base",
|
||||
"RunnableLambda"
|
||||
],
|
||||
"name": "RunnableLambda"
|
||||
"name": "Lambda"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -511,7 +511,7 @@
|
||||
"runnable",
|
||||
"RunnableWithFallbacks"
|
||||
],
|
||||
"name": "RunnableWithFallbacks"
|
||||
"name": "WithFallbacks"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -589,7 +589,7 @@
|
||||
"runnable",
|
||||
"RunnablePassthrough"
|
||||
],
|
||||
"name": "RunnablePassthrough"
|
||||
"name": "Passthrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -635,7 +635,7 @@
|
||||
"runnable",
|
||||
"RunnablePassthrough"
|
||||
],
|
||||
"name": "RunnablePassthrough"
|
||||
"name": "Passthrough"
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -716,7 +716,7 @@
|
||||
"runnable",
|
||||
"RunnableWithFallbacks"
|
||||
],
|
||||
"name": "RunnableWithFallbacks"
|
||||
"name": "WithFallbacks"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -756,7 +756,7 @@
|
||||
"runnable",
|
||||
"RunnablePassthrough"
|
||||
],
|
||||
"name": "RunnablePassthrough"
|
||||
"name": "Passthrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -769,7 +769,7 @@
|
||||
"runnable",
|
||||
"RunnableWithFallbacks"
|
||||
],
|
||||
"name": "RunnableWithFallbacks"
|
||||
"name": "WithFallbacks"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -938,7 +938,7 @@
|
||||
"runnable",
|
||||
"RunnableWithFallbacks"
|
||||
],
|
||||
"name": "RunnableWithFallbacks"
|
||||
"name": "WithFallbacks"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -1152,7 +1152,7 @@
|
||||
"runnable",
|
||||
"RunnableWithFallbacks"
|
||||
],
|
||||
"name": "RunnableWithFallbacks"
|
||||
"name": "WithFallbacks"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@@ -36,7 +36,8 @@
|
||||
graph TD;
|
||||
PromptInput[PromptInput]:::startclass;
|
||||
PromptTemplate([PromptTemplate]):::otherclass;
|
||||
FakeListLLM([FakeListLLM]):::otherclass;
|
||||
FakeListLLM([<strong>FakeListLLM</strong>
|
||||
key = 2]):::otherclass;
|
||||
CommaSeparatedListOutputParser([CommaSeparatedListOutputParser]):::otherclass;
|
||||
CommaSeparatedListOutputParserOutput[CommaSeparatedListOutputParserOutput]:::endclass;
|
||||
PromptInput --> PromptTemplate;
|
||||
|
File diff suppressed because one or more lines are too long
@@ -33,7 +33,7 @@ def test_graph_sequence(snapshot: SnapshotAssertion) -> None:
|
||||
prompt = PromptTemplate.from_template("Hello, {name}!")
|
||||
list_parser = CommaSeparatedListOutputParser()
|
||||
|
||||
sequence = prompt | fake_llm | list_parser
|
||||
sequence = prompt | fake_llm.with_config(metadata={"key": 2}) | list_parser
|
||||
graph = sequence.get_graph()
|
||||
assert graph.to_json() == {
|
||||
"nodes": [
|
||||
|
Reference in New Issue
Block a user