Skip to content

The agent engineering platform.

Add JSON representation of runnable graph to serialized representation (#17745)

Nuno Campos223e5eff1440
diff --git a/libs/core/langchain_core/load/serializable.py b/libs/core/langchain_core/load/serializable.py
index 6b415f78b1..38f7fc1d3d 100644
--- a/libs/core/langchain_core/load/serializable.py
+++ b/libs/core/langchain_core/load/serializable.py
@@ -1,5 +1,16 @@
from abc import ABC
-from typing import Any, Dict, List, Literal, Optional, TypedDict, Union, cast
+from typing import (
+ Any,
+ Dict,
+ List,
+ Literal,
+ Optional,
+ TypedDict,
+ Union,
+ cast,
+)
+
+from typing_extensions import NotRequired
from langchain_core.pydantic_v1 import BaseModel, PrivateAttr
@@ -9,6 +20,8 @@ class BaseSerialized(TypedDict):
lc: int
id: List[str]
+ name: NotRequired[str]
+ graph: NotRequired[Dict[str, Any]]
class SerializedConstructor(BaseSerialized):
diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.py
index 8c9f0b8b02..89f2dd6c03 100644
--- a/libs/core/langchain_core/runnables/base.py
+++ b/libs/core/langchain_core/runnables/base.py
@@ -37,7 +37,11 @@ from typing_extensions import Literal, get_args
from langchain_core._api import beta_decorator
from langchain_core.load.dump import dumpd
-from langchain_core.load.serializable import Serializable
+from langchain_core.load.serializable import (
+ Serializable,
+ SerializedConstructor,
+ SerializedNotImplemented,
+)
from langchain_core.pydantic_v1 import BaseModel, Field
from langchain_core.runnables.config import (
RunnableConfig,
@@ -1630,6 +1634,16 @@ class RunnableSerializable(Serializable, Runnable[Input, Output]):
name: Optional[str] = None
"""The name of the runnable. Used for debugging and tracing."""
+ def to_json(self) -> Union[SerializedConstructor, SerializedNotImplemented]:
+ """Serialize the runnable to JSON."""
+ dumped = super().to_json()
+ try:
+ dumped["name"] = self.get_name()
+ dumped["graph"] = self.get_graph().to_json()
+ except Exception:
+ pass
+ return dumped
+
def configurable_fields(
self, **kwargs: AnyConfigurableField
) -> RunnableSerializable[Input, Output]:
diff --git a/libs/core/langchain_core/runnables/graph.py b/libs/core/langchain_core/runnables/graph.py
index 26a4fbd0aa..d9d30e3b1e 100644
--- a/libs/core/langchain_core/runnables/graph.py
+++ b/libs/core/langchain_core/runnables/graph.py
@@ -1,8 +1,9 @@
from __future__ import annotations
+import inspect
from dataclasses import dataclass, field
-from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Type, Union
-from uuid import uuid4
+from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Type, Union
+from uuid import UUID, uuid4
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.runnables.graph_draw import draw
@@ -11,11 +12,20 @@ if TYPE_CHECKING:
from langchain_core.runnables.base import Runnable as RunnableType
+def is_uuid(value: str) -> bool:
+ try:
+ UUID(value)
+ return True
+ except ValueError:
+ return False
+
+
class Edge(NamedTuple):
"""Edge in a graph."""
source: str
target: str
+ data: Optional[str] = None
class Node(NamedTuple):
@@ -25,6 +35,61 @@ class Node(NamedTuple):
data: Union[Type[BaseModel], RunnableType]
+def node_data_str(node: Node) -> str:
+ from langchain_core.runnables.base import Runnable
+
+ if not is_uuid(node.id):
+ return node.id
+ elif isinstance(node.data, Runnable):
+ try:
+ data = str(node.data)
+ if (
+ data.startswith("<")
+ or data[0] != data[0].upper()
+ or len(data.splitlines()) > 1
+ ):
+ data = node.data.__class__.__name__
+ elif len(data) > 42:
+ data = data[:42] + "..."
+ except Exception:
+ data = node.data.__class__.__name__
+ else:
+ data = node.data.__name__
+ return data if not data.startswith("Runnable") else data[8:]
+
+
+def node_data_json(node: Node) -> Dict[str, Union[str, Dict[str, Any]]]:
+ from langchain_core.load.serializable import to_json_not_implemented
+ from langchain_core.runnables.base import Runnable, RunnableSerializable
+
+ if isinstance(node.data, RunnableSerializable):
+ return {
+ "type": "runnable",
+ "data": {
+ "id": node.data.lc_id(),
+ "name": node.data.get_name(),
+ },
+ }
+ elif isinstance(node.data, Runnable):
+ return {
+ "type": "runnable",
+ "data": {
+ "id": to_json_not_implemented(node.data)["id"],
+ "name": node.data.get_name(),
+ },
+ }
+ elif inspect.isclass(node.data) and issubclass(node.data, BaseModel):
+ return {
+ "type": "schema",
+ "data": node.data.schema(),
+ }
+ else:
+ return {
+ "type": "unknown",
+ "data": node_data_str(node),
+ }
+
+
@dataclass
class Graph:
"""Graph of nodes and edges."""
@@ -32,15 +97,46 @@ class Graph:
nodes: Dict[str, Node] = field(default_factory=dict)
edges: List[Edge] = field(default_factory=list)
+ def to_json(self) -> Dict[str, List[Dict[str, Any]]]:
+ """Convert the graph to a JSON-serializable format."""
+ stable_node_ids = {
+ node.id: i if is_uuid(node.id) else node.id
+ for i, node in enumerate(self.nodes.values())
+ }
+
+ return {
+ "nodes": [
+ {"id": stable_node_ids[node.id], **node_data_json(node)}
+ for node in self.nodes.values()
+ ],
+ "edges": [
+ {
+ "source": stable_node_ids[edge.source],
+ "target": stable_node_ids[edge.target],
+ "data": edge.data,
+ }
+ if edge.data is not None
+ else {
+ "source": stable_node_ids[edge.source],
+ "target": stable_node_ids[edge.target],
+ }
+ for edge in self.edges
+ ],
+ }
+
def __bool__(self) -> bool:
return bool(self.nodes)
def next_id(self) -> str:
return uuid4().hex
- def add_node(self, data: Union[Type[BaseModel], RunnableType]) -> Node:
+ def add_node(
+ self, data: Union[Type[BaseModel], RunnableType], id: Optional[str] = None
+ ) -> Node:
"""Add a node to the graph and return it."""
- node = Node(id=self.next_id(), data=data)
+ if id is not None and id in self.nodes:
+ raise ValueError(f"Node with id {id} already exists")
+ node = Node(id=id or self.next_id(), data=data)
self.nodes[node.id] = node
return node
@@ -53,13 +149,13 @@ class Graph:
if edge.source != node.id and edge.target != node.id
]
- def add_edge(self, source: Node, target: Node) -> Edge:
+ def add_edge(self, source: Node, target: Node, data: Optional[str] = None) -> Edge:
"""Add an edge to the graph and return it."""
if source.id not in self.nodes:
raise ValueError(f"Source node {source.id} not in graph")
if target.id not in self.nodes:
raise ValueError(f"Target node {target.id} not in graph")
- edge = Edge(source=source.id, target=target.id)
+ edge = Edge(source=source.id, target=target.id, data=data)
self.edges.append(edge)
return edge
@@ -117,28 +213,8 @@ class Graph:
self.remove_node(last_node)
def draw_ascii(self) -> str:
- from langchain_core.runnables.base import Runnable
-
- def node_data(node: Node) -> str:
- if isinstance(node.data, Runnable):
- try:
- data = str(node.data)
- if (
- data.startswith("<")
- or data[0] != data[0].upper()
- or len(data.splitlines()) > 1
- ):
- data = node.data.__class__.__name__
- elif len(data) > 42:
- data = data[:42] + "..."
- except Exception:
- data = node.data.__class__.__name__
- else:
- data = node.data.__name__
- return data if not data.startswith("Runnable") else data[8:]
-
return draw(
- {node.id: node_data(node) for node in self.nodes.values()},
+ {node.id: node_data_str(node) for node in self.nodes.values()},
[(edge.source, edge.target) for edge in self.edges],
)
diff --git a/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr b/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr
index 751274bf76..63f8fa3271 100644
--- a/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr
+++ b/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr
@@ -34,6 +34,56 @@
"repr": "RunnableLambda(lambda x: x)"
}
}
+ },
+ "name": "RunnableParallel<buz>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<buz>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<buz>Output",
+ "type": "object",
+ "properties": {
+ "buz": {
+ "title": "Buz"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ }
+ ]
}
},
"middle": [],
@@ -73,6 +123,434 @@
"template": "what did baz say to {buz}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "buz": {
+ "title": "Buz",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"middle": [],
@@ -86,9 +564,528 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=['foo'], i=1)"
+ "repr": "FakeListLLM(responses=['foo'], i=1)",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "buz": {
+ "title": "Buz",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"fallbacks": [
@@ -118,6 +1115,434 @@
"template": "what did baz say to {buz}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "buz": {
+ "title": "Buz",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"middle": [],
@@ -131,9 +1556,528 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=['bar'])"
+ "repr": "FakeListLLM(responses=['bar'])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "buz": {
+ "title": "Buz",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
],
@@ -149,9 +2093,121 @@
}
],
"exception_key": null
+ },
+ "name": "RunnableWithFallbacks",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "buz": {
+ "title": "Buz",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableWithFallbacks"
+ ],
+ "name": "RunnableWithFallbacks"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<buz>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableWithFallbacks"
+ ],
+ "name": "RunnableWithFallbacks"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''
@@ -192,9 +2248,101 @@
"func": null,
"afunc": null,
"input_type": null
+ },
+ "name": "RunnablePassthrough",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnablePassthroughInput"
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "name": "RunnablePassthrough"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "RunnablePassthroughOutput"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
+ },
+ "name": "RunnableParallel<text>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<text>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<text>Output",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "name": "RunnablePassthrough"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ }
+ ]
}
},
"middle": [],
@@ -244,9 +2392,115 @@
}
],
"exception_key": "exception"
+ },
+ "name": "RunnableWithFallbacks",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "_raise_error_input",
+ "type": "object"
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableWithFallbacks"
+ ],
+ "name": "RunnableWithFallbacks"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "_raise_error_output",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<text>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "name": "RunnablePassthrough"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableWithFallbacks"
+ ],
+ "name": "RunnableWithFallbacks"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "_raise_error_output",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''
@@ -273,7 +2527,458 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=['foo'], i=1)"
+ "repr": "FakeListLLM(responses=['foo'], i=1)",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"fallbacks": [
{
@@ -286,7 +2991,458 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=['bar'])"
+ "repr": "FakeListLLM(responses=['bar'])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
}
],
"exceptions_to_handle": [
@@ -301,6 +3457,456 @@
}
],
"exception_key": null
+ },
+ "name": "RunnableWithFallbacks",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableWithFallbacks"
+ ],
+ "name": "RunnableWithFallbacks"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''
@@ -327,7 +3933,458 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=['foo'], i=1)"
+ "repr": "FakeListLLM(responses=['foo'], i=1)",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"fallbacks": [
{
@@ -340,7 +4397,458 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=['baz'], i=1)"
+ "repr": "FakeListLLM(responses=['baz'], i=1)",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
{
"lc": 1,
@@ -352,7 +4860,458 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=['bar'])"
+ "repr": "FakeListLLM(responses=['bar'])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
}
],
"exceptions_to_handle": [
@@ -367,6 +5326,456 @@
}
],
"exception_key": null
+ },
+ "name": "RunnableWithFallbacks",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableWithFallbacks"
+ ],
+ "name": "RunnableWithFallbacks"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''
diff --git a/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr b/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr
index fcd3cddf61..817eece20f 100644
--- a/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr
+++ b/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr
@@ -46,6 +46,429 @@
"template": "You are a nice assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -76,6 +499,434 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -84,6 +935,434 @@
"input_variables": [
"question"
]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"middle": [
@@ -97,7 +1376,782 @@
"chat_model",
"FakeListChatModel"
],
- "repr": "FakeListChatModel(responses=['foo, bar'])"
+ "repr": "FakeListChatModel(responses=['foo, bar'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
}
],
"last": {
@@ -109,9 +2163,471 @@
"list",
"CommaSeparatedListOutputParser"
],
- "kwargs": {}
+ "kwargs": {},
+ "name": "CommaSeparatedListOutputParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 4
+ },
+ {
+ "source": 2,
+ "target": 3
+ }
+ ]
}
}
'''
@@ -175,6 +2691,429 @@
"template": "You are a nicer assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -205,16 +3144,872 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
- }
- }
- }
- }
- ],
- "input_variables": [
- "question"
- ]
- }
- },
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "input_variables": [
+ "question"
+ ]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
{
"lc": 1,
"type": "not_implemented",
@@ -225,7 +4020,782 @@
"chat_model",
"FakeListChatModel"
],
- "repr": "FakeListChatModel(responses=['baz, qux'])"
+ "repr": "FakeListChatModel(responses=['baz, qux'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
}
],
"last": {
@@ -237,9 +4807,481 @@
"list",
"CommaSeparatedListOutputParser"
],
- "kwargs": {}
+ "kwargs": {},
+ "name": "CommaSeparatedListOutputParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableLambdaInput"
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 4,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 5,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 4,
+ "target": 5
+ },
+ {
+ "source": 3,
+ "target": 4
+ }
+ ]
}
}
'''
@@ -291,6 +5333,429 @@
"template": "You are a nice assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -321,6 +5786,434 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -329,20 +6222,1223 @@
"input_variables": [
"question"
]
- }
- },
- "middle": [
- {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [
+ {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
"chat_model",
"FakeListChatModel"
],
- "repr": "FakeListChatModel(responses=['foo, bar'])"
+ "repr": "FakeListChatModel(responses=['foo, bar'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
{
"lc": 1,
@@ -353,7 +7449,381 @@
"list",
"CommaSeparatedListOutputParser"
],
- "kwargs": {}
+ "kwargs": {},
+ "name": "CommaSeparatedListOutputParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
{
"lc": 1,
@@ -401,6 +7871,429 @@
"template": "You are a nicer assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -431,6 +8324,434 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -439,6 +8760,434 @@
"input_variables": [
"question"
]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
{
@@ -451,30 +9200,1336 @@
"chat_model",
"FakeListChatModel"
],
- "repr": "FakeListChatModel(responses=['baz, qux'])"
- }
- ],
- "last": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "output_parsers",
- "list",
- "CommaSeparatedListOutputParser"
- ],
- "kwargs": {}
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_combining_sequences.3
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])"}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, {'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': "RunnableLambda(lambda x: {'question': x[0] + x[1]})"}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nicer assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['baz, qux'])"}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['baz', 'qux']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo, bar'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo, bar', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo, bar'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': AIMessage(content='foo, bar')}, outputs={'output': ['foo', 'bar']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003'), Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='RunnableLambda', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': "RunnableLambda(lambda x: {'question': x[0] + x[1]})"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': ['foo', 'bar']}, outputs={'question': 'foobar'}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:4'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000004'), Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nicer assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'foobar'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nicer assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'foobar', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:5'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000005'), Run(id=UUID('00000000-0000-4000-8000-000000000006'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['baz, qux'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['baz, qux'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nicer assistant.\nHuman: foobar']}, outputs={'generations': [[{'text': 'baz, qux', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'baz, qux'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:6'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000006'), Run(id=UUID('00000000-0000-4000-8000-000000000007'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': AIMessage(content='baz, qux')}, outputs={'output': ['baz', 'qux']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:7'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000007')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- ])
-# ---
+ "repr": "FakeListChatModel(responses=['baz, qux'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ ],
+ "last": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "kwargs": {},
+ "name": "CommaSeparatedListOutputParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 4,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 5,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 6,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 7,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 8,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 3,
+ "target": 4
+ },
+ {
+ "source": 4,
+ "target": 5
+ },
+ {
+ "source": 5,
+ "target": 6
+ },
+ {
+ "source": 7,
+ "target": 8
+ },
+ {
+ "source": 6,
+ "target": 7
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_combining_sequences.3
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, {'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': "RunnableLambda(lambda x: {'question': x[0] + x[1]})"}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nicer assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['baz, qux'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 3, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 4, 'type': 'runnable', 'data': {'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'name': 'RunnableLambda'}}, {'id': 5, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 6, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 7, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 8, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}, {'source': 2, 'target': 3}, {'source': 3, 'target': 4}, {'source': 4, 'target': 5}, {'source': 5, 'target': 6}, {'source': 7, 'target': 8}, {'source': 6, 'target': 7}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['baz', 'qux']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo, bar'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo, bar', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo, bar'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': AIMessage(content='foo, bar')}, outputs={'output': ['foo', 'bar']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003'), Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='RunnableLambda', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': "RunnableLambda(lambda x: {'question': x[0] + x[1]})"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': ['foo', 'bar']}, outputs={'question': 'foobar'}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:4'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000004'), Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nicer assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'foobar'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nicer assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'foobar', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:5'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000005'), Run(id=UUID('00000000-0000-4000-8000-000000000006'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['baz, qux'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['baz, qux'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nicer assistant.\nHuman: foobar']}, outputs={'generations': [[{'text': 'baz, qux', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'baz, qux'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:6'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000006'), Run(id=UUID('00000000-0000-4000-8000-000000000007'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': AIMessage(content='baz, qux')}, outputs={'output': ['baz', 'qux']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:7'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000007')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ ])
+# ---
# name: test_each
'''
{
@@ -522,6 +10577,429 @@
"template": "You are a nice assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -552,6 +11030,434 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -560,357 +11466,1286 @@
"input_variables": [
"question"
]
- }
- },
- "middle": [
- {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeStreamingListLLM"
- ],
- "repr": "FakeStreamingListLLM(responses=['first item, second item, third item'])"
},
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "tests",
- "unit_tests",
- "runnables",
- "test_runnable",
- "FakeSplitIntoListParser"
- ],
- "kwargs": {}
- }
- ],
- "last": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableEach"
- ],
- "kwargs": {
- "bound": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeStreamingListLLM"
- ],
- "repr": "FakeStreamingListLLM(responses=['this', 'is', 'a', 'test'])"
- }
- }
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_higher_order_lambda_runnable
- '''
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableSequence"
- ],
- "kwargs": {
- "first": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableParallel"
- ],
- "kwargs": {
- "steps": {
- "key": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(lambda x: x['key'])"
- },
- "input": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableParallel"
- ],
- "kwargs": {
- "steps": {
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
"question": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(lambda x: x['question'])"
+ "title": "Question",
+ "type": "string"
}
}
}
- }
- }
- }
- },
- "middle": [],
- "last": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(router)"
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_prompt_with_chat_model
- '''
- ChatPromptTemplate(input_variables=['question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['question'], template='{question}'))])
- | FakeListChatModel(responses=['foo'])
- '''
-# ---
-# name: test_prompt_with_chat_model.1
- '''
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableSequence"
- ],
- "kwargs": {
- "first": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "ChatPromptTemplate"
- ],
- "kwargs": {
- "messages": [
+ },
{
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "SystemMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [],
- "template": "You are a nice assistant.",
- "template_format": "f-string",
- "partial_variables": {}
- }
- }
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
}
},
{
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [
- "question"
- ],
- "template": "{question}",
- "template_format": "f-string",
- "partial_variables": {}
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
}
}
}
}
],
- "input_variables": [
- "question"
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
]
}
},
- "middle": [],
- "last": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "chat_model",
- "FakeListChatModel"
- ],
- "repr": "FakeListChatModel(responses=['foo'])"
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_prompt_with_chat_model.2
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])"}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': AIMessage(content='foo')}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- ])
-# ---
-# name: test_prompt_with_chat_model_and_parser
- '''
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableSequence"
- ],
- "kwargs": {
- "first": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "ChatPromptTemplate"
- ],
- "kwargs": {
- "messages": [
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "SystemMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
+ "middle": [
+ {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "repr": "FakeStreamingListLLM(responses=['first item, second item, third item'])",
+ "name": "FakeStreamingListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
],
- "kwargs": {
- "input_variables": [],
- "template": "You are a nice assistant.",
- "template_format": "f-string",
- "partial_variables": {}
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
}
}
- }
- },
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
"id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
],
- "kwargs": {
- "input_variables": [
- "question"
- ],
- "template": "{question}",
- "template_format": "f-string",
- "partial_variables": {}
- }
+ "name": "FakeStreamingListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMOutput",
+ "type": "string"
}
}
- }
- ],
- "input_variables": [
- "question"
- ]
- }
- },
- "middle": [
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
{
"lc": 1,
- "type": "not_implemented",
+ "type": "constructor",
"id": [
"tests",
"unit_tests",
- "fake",
- "chat_model",
- "FakeListChatModel"
+ "runnables",
+ "test_runnable",
+ "FakeSplitIntoListParser"
],
- "repr": "FakeListChatModel(responses=['foo, bar'])"
+ "kwargs": {},
+ "name": "FakeSplitIntoListParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeSplitIntoListParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "runnables",
+ "test_runnable",
+ "FakeSplitIntoListParser"
+ ],
+ "name": "FakeSplitIntoListParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeSplitIntoListParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
}
],
"last": {
@@ -918,139 +12753,1037 @@
"type": "constructor",
"id": [
"langchain",
- "output_parsers",
- "list",
- "CommaSeparatedListOutputParser"
- ],
- "kwargs": {}
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_prompt_with_chat_model_and_parser.1
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])"}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['foo', 'bar']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo, bar'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo, bar', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo, bar'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': AIMessage(content='foo, bar')}, outputs={'output': ['foo', 'bar']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- ])
-# ---
-# name: test_prompt_with_chat_model_async
- '''
- ChatPromptTemplate(input_variables=['question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['question'], template='{question}'))])
- | FakeListChatModel(responses=['foo'])
- '''
-# ---
-# name: test_prompt_with_chat_model_async.1
- '''
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableSequence"
- ],
- "kwargs": {
- "first": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "ChatPromptTemplate"
+ "schema",
+ "runnable",
+ "RunnableEach"
],
"kwargs": {
- "messages": [
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "SystemMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [],
- "template": "You are a nice assistant.",
- "template_format": "f-string",
- "partial_variables": {}
- }
- }
- }
- },
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [
- "question"
+ "bound": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "repr": "FakeStreamingListLLM(responses=['this', 'is', 'a', 'test'])",
+ "name": "FakeStreamingListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
],
- "template": "{question}",
- "template_format": "f-string",
- "partial_variables": {}
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "name": "FakeStreamingListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ },
+ "name": "RunnableEach<FakeStreamingListLLM>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
}
}
}
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "name": "FakeStreamingListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMOutput",
+ "type": "string"
+ }
}
],
- "input_variables": [
- "question"
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
]
}
},
- "middle": [],
- "last": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "chat_model",
- "FakeListChatModel"
- ],
- "repr": "FakeListChatModel(responses=['foo'])"
- },
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "name": "FakeStreamingListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "runnables",
+ "test_runnable",
+ "FakeSplitIntoListParser"
+ ],
+ "name": "FakeSplitIntoListParser"
+ }
+ },
+ {
+ "id": 4,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "name": "FakeStreamingListLLM"
+ }
+ },
+ {
+ "id": 5,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 4,
+ "target": 5
+ },
+ {
+ "source": 3,
+ "target": 4
+ }
+ ]
}
}
'''
# ---
-# name: test_prompt_with_chat_model_async.2
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])"}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': AIMessage(content='foo')}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- ])
-# ---
-# name: test_prompt_with_llm
+# name: test_higher_order_lambda_runnable
'''
{
"lc": 1,
@@ -1067,73 +13800,184 @@
"type": "constructor",
"id": [
"langchain",
- "prompts",
- "chat",
- "ChatPromptTemplate"
+ "schema",
+ "runnable",
+ "RunnableParallel"
],
"kwargs": {
- "messages": [
- {
+ "steps": {
+ "key": {
"lc": 1,
- "type": "constructor",
+ "type": "not_implemented",
"id": [
- "langchain",
- "prompts",
- "chat",
- "SystemMessagePromptTemplate"
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [],
- "template": "You are a nice assistant.",
- "template_format": "f-string",
- "partial_variables": {}
- }
- }
- }
+ "repr": "RunnableLambda(lambda x: x['key'])"
},
- {
+ "input": {
"lc": 1,
"type": "constructor",
"id": [
"langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
+ "schema",
+ "runnable",
+ "RunnableParallel"
],
"kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [
- "question"
+ "steps": {
+ "question": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
],
- "template": "{question}",
- "template_format": "f-string",
- "partial_variables": {}
+ "repr": "RunnableLambda(lambda x: x['question'])"
}
}
+ },
+ "name": "RunnableParallel<question>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question>Input",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question>Output",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ }
+ ]
+ }
+ }
+ }
+ },
+ "name": "RunnableParallel<key,input>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Input",
+ "type": "object",
+ "properties": {
+ "key": {
+ "title": "Key"
+ },
+ "question": {
+ "title": "Question"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Output",
+ "type": "object",
+ "properties": {
+ "key": {
+ "title": "Key"
+ },
+ "input": {
+ "title": "Input",
+ "type": "object"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
}
}
],
- "input_variables": [
- "question"
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 3
+ },
+ {
+ "source": 3,
+ "target": 1
+ }
]
}
},
@@ -1142,31 +13986,204 @@
"lc": 1,
"type": "not_implemented",
"id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeListLLM"
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
],
- "repr": "FakeListLLM(responses=['foo', 'bar'])"
+ "repr": "RunnableLambda(router)"
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Input",
+ "type": "object",
+ "properties": {
+ "key": {
+ "title": "Key"
+ },
+ "question": {
+ "title": "Question"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Output",
+ "type": "object",
+ "properties": {
+ "key": {
+ "title": "Key"
+ },
+ "input": {
+ "title": "Input",
+ "type": "object"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "router_input",
+ "type": "object"
+ }
+ },
+ {
+ "id": 5,
+ "type": "schema",
+ "data": {
+ "title": "router_output"
+ }
+ },
+ {
+ "id": 6,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 7,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 8,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 9,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 3
+ },
+ {
+ "source": 3,
+ "target": 1
+ },
+ {
+ "source": 6,
+ "target": 7
+ },
+ {
+ "source": 4,
+ "target": 6
+ },
+ {
+ "source": 7,
+ "target": 5
+ },
+ {
+ "source": 8,
+ "target": 9
+ },
+ {
+ "source": 4,
+ "target": 8
+ },
+ {
+ "source": 9,
+ "target": 5
+ },
+ {
+ "source": 1,
+ "target": 4
+ }
+ ]
}
}
'''
# ---
-# name: test_prompt_with_llm.1
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])"}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- ])
-# ---
-# name: test_prompt_with_llm.2
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)"}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': 'bar'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'bar', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)"}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your favorite color?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000003'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000003.20230101T000000000000Z00000000-0000-4000-8000-000000000004'), Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your favorite color?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000003'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000003.20230101T000000000000Z00000000-0000-4000-8000-000000000005')], trace_id=UUID('00000000-0000-4000-8000-000000000003'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000003'),
- ])
+# name: test_prompt_with_chat_model
+ '''
+ ChatPromptTemplate(input_variables=['question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['question'], template='{question}'))])
+ | FakeListChatModel(responses=['foo'])
+ '''
# ---
-# name: test_prompt_with_llm_and_async_lambda
+# name: test_prompt_with_chat_model.1
'''
{
"lc": 1,
@@ -1213,6 +14230,429 @@
"template": "You are a nice assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -1243,6 +14683,434 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -1251,44 +15119,1627 @@
"input_variables": [
"question"
]
- }
- },
- "middle": [
- {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeListLLM"
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
],
- "repr": "FakeListLLM(responses=['foo', 'bar'])"
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
- ],
+ },
+ "middle": [],
"last": {
"lc": 1,
"type": "not_implemented",
"id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
],
- "repr": "RunnableLambda(afunc=passthrough)"
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_prompt_with_llm_and_async_lambda.1
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])"}], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': 'RunnableLambda(afunc=passthrough)'}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='passthrough', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': 'RunnableLambda(afunc=passthrough)'}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'foo'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ "repr": "FakeListChatModel(responses=['foo'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_prompt_with_chat_model.2
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 3, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 2, 'target': 3}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': AIMessage(content='foo')}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
])
# ---
-# name: test_prompt_with_llm_parser
+# name: test_prompt_with_chat_model_and_parser
'''
{
"lc": 1,
@@ -1335,6 +16786,429 @@
"template": "You are a nice assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -1365,6 +17239,434 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -1373,50 +17675,1715 @@
"input_variables": [
"question"
]
- }
- },
- "middle": [
- {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeStreamingListLLM"
- ],
- "repr": "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'])"
- }
- ],
- "last": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "output_parsers",
- "list",
- "CommaSeparatedListOutputParser"
- ],
- "kwargs": {}
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_prompt_with_llm_parser.1
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'])"}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeStreamingListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['bear, dog, cat', 'tomato, lettuce, onion'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'])"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'bear, dog, cat', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'bear, dog, cat'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- ])
-# ---
-# name: test_prompt_with_llm_parser.2
- list([
- Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)"}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['tomato', 'lettuce', 'onion']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeStreamingListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['bear, dog, cat', 'tomato, lettuce, onion'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'tomato, lettuce, onion', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'tomato, lettuce, onion'}, outputs={'output': ['tomato', 'lettuce', 'onion']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
- Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)"}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, 'name': None}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}}}}], 'input_variables': ['question']}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your favorite color?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000004'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004.20230101T000000000000Z00000000-0000-4000-8000-000000000005'), Run(id=UUID('00000000-0000-4000-8000-000000000006'), name='FakeStreamingListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['bear, dog, cat', 'tomato, lettuce, onion'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)"}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your favorite color?']}, outputs={'generations': [[{'text': 'bear, dog, cat', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000004'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004.20230101T000000000000Z00000000-0000-4000-8000-000000000006'), Run(id=UUID('00000000-0000-4000-8000-000000000007'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'bear, dog, cat'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000004'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004.20230101T000000000000Z00000000-0000-4000-8000-000000000007')], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004'),
- ])
-# ---
-# name: test_router_runnable
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [
+ {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "repr": "FakeListChatModel(responses=['foo, bar'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ ],
+ "last": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "kwargs": {},
+ "name": "CommaSeparatedListOutputParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 4
+ },
+ {
+ "source": 2,
+ "target": 3
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_prompt_with_chat_model_and_parser.1
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 3, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 4, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}, {'source': 3, 'target': 4}, {'source': 2, 'target': 3}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['foo', 'bar']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo, bar'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo, bar'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo, bar', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo, bar'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': AIMessage(content='foo, bar')}, outputs={'output': ['foo', 'bar']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ ])
+# ---
+# name: test_prompt_with_chat_model_async
+ '''
+ ChatPromptTemplate(input_variables=['question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['question'], template='{question}'))])
+ | FakeListChatModel(responses=['foo'])
+ '''
+# ---
+# name: test_prompt_with_chat_model_async.1
'''
{
"lc": 1,
@@ -1433,281 +19400,12047 @@
"type": "constructor",
"id": [
"langchain",
- "schema",
- "runnable",
- "RunnableParallel"
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
],
"kwargs": {
- "steps": {
- "key": {
+ "messages": [
+ {
"lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(...)"
- },
- "input": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableParallel"
- ],
- "kwargs": {
- "steps": {
- "question": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(...)"
- }
- }
- }
- }
- }
- }
- },
- "middle": [],
- "last": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RouterRunnable"
- ],
- "kwargs": {
- "runnables": {
- "math": {
- "lc": 1,
- "type": "constructor",
+ "type": "constructor",
"id": [
"langchain",
- "schema",
- "runnable",
- "RunnableSequence"
+ "prompts",
+ "chat",
+ "SystemMessagePromptTemplate"
],
"kwargs": {
- "first": {
+ "prompt": {
"lc": 1,
"type": "constructor",
"id": [
"langchain",
"prompts",
- "chat",
- "ChatPromptTemplate"
+ "prompt",
+ "PromptTemplate"
],
"kwargs": {
- "input_variables": [
- "question"
- ],
- "messages": [
+ "input_variables": [],
+ "template": "You are a nice assistant.",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
{
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [
- "question"
- ],
- "template": "You are a math genius. Answer the question: {question}",
- "template_format": "f-string",
- "partial_variables": {}
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
}
}
}
}
],
- "partial_variables": {}
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
- },
- "middle": [],
- "last": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeListLLM"
- ],
- "repr": "FakeListLLM(responses=['4'])"
- },
- "name": null
+ }
}
},
- "english": {
+ {
"lc": 1,
"type": "constructor",
"id": [
"langchain",
- "schema",
- "runnable",
- "RunnableSequence"
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
],
"kwargs": {
- "first": {
+ "prompt": {
"lc": 1,
"type": "constructor",
"id": [
"langchain",
"prompts",
- "chat",
- "ChatPromptTemplate"
+ "prompt",
+ "PromptTemplate"
],
"kwargs": {
"input_variables": [
"question"
],
- "messages": [
+ "template": "{question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
{
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [
- "question"
- ],
- "template": "You are an english major. Answer the question: {question}",
- "template_format": "f-string",
- "partial_variables": {}
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
}
}
}
}
],
- "partial_variables": {}
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
- },
- "middle": [],
- "last": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeListLLM"
- ],
- "repr": "FakeListLLM(responses=['2'])"
- },
- "name": null
+ }
}
}
- }
+ ],
+ "input_variables": [
+ "question"
+ ]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
- "name": null
- }
- }
- '''
+ "middle": [],
+ "last": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "repr": "FakeListChatModel(responses=['foo'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ '''
# ---
-# name: test_schemas
- dict({
- 'anyOf': list([
- dict({
- 'type': 'string',
- }),
- dict({
- '$ref': '#/definitions/StringPromptValue',
- }),
- dict({
- '$ref': '#/definitions/ChatPromptValueConcrete',
- }),
- dict({
- 'items': dict({
- 'anyOf': list([
- dict({
- '$ref': '#/definitions/AIMessage',
- }),
- dict({
- '$ref': '#/definitions/HumanMessage',
- }),
- dict({
- '$ref': '#/definitions/ChatMessage',
- }),
- dict({
- '$ref': '#/definitions/SystemMessage',
- }),
- dict({
- '$ref': '#/definitions/FunctionMessage',
- }),
- dict({
- '$ref': '#/definitions/ToolMessage',
- }),
- ]),
- }),
- 'type': 'array',
- }),
- ]),
- 'definitions': dict({
- 'AIMessage': dict({
- 'description': 'Message from an AI.',
- 'properties': dict({
- 'additional_kwargs': dict({
- 'title': 'Additional Kwargs',
- 'type': 'object',
- }),
- 'content': dict({
- 'anyOf': list([
- dict({
- 'type': 'string',
- }),
- dict({
- 'items': dict({
- 'anyOf': list([
- dict({
- 'type': 'string',
- }),
- dict({
- 'type': 'object',
- }),
- ]),
- }),
+# name: test_prompt_with_chat_model_async.2
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 3, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 2, 'target': 3}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': AIMessage(content='foo')}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListChatModel', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo'], '_type': 'fake-list-chat-model', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'repr': "FakeListChatModel(responses=['foo'])", 'name': 'FakeListChatModel', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListChatModelInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'chat_model', 'FakeListChatModel'], 'name': 'FakeListChatModel'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListChatModelOutput', 'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'ChatGeneration', 'message': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'AIMessage'], 'kwargs': {'content': 'foo'}}}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ ])
+# ---
+# name: test_prompt_with_llm
+ '''
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "kwargs": {
+ "messages": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "SystemMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [],
+ "template": "You are a nice assistant.",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "template": "{question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "input_variables": [
+ "question"
+ ]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [],
+ "last": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "repr": "FakeListLLM(responses=['foo', 'bar'])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_prompt_with_llm.1
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 3, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 2, 'target': 3}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ ])
+# ---
+# name: test_prompt_with_llm.2
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 3, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 2, 'target': 3}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': 'bar'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'bar', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 3, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 2, 'target': 3}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your favorite color?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000003'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000003.20230101T000000000000Z00000000-0000-4000-8000-000000000004'), Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'], i=1)", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your favorite color?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000003'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000003'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000003.20230101T000000000000Z00000000-0000-4000-8000-000000000005')], trace_id=UUID('00000000-0000-4000-8000-000000000003'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000003'),
+ ])
+# ---
+# name: test_prompt_with_llm_and_async_lambda
+ '''
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "kwargs": {
+ "messages": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "SystemMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [],
+ "template": "You are a nice assistant.",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "template": "{question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "input_variables": [
+ "question"
+ ]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [
+ {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "repr": "FakeListLLM(responses=['foo', 'bar'])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ ],
+ "last": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "repr": "RunnableLambda(afunc=passthrough)"
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "passthrough"
+ }
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "passthrough_output"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 4
+ },
+ {
+ "source": 2,
+ "target": 3
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_prompt_with_llm_and_async_lambda.1
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}], 'last': {'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': 'RunnableLambda(afunc=passthrough)'}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 3, 'type': 'runnable', 'data': {'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'name': 'passthrough'}}, {'id': 4, 'type': 'schema', 'data': {'title': 'passthrough_output'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}, {'source': 3, 'target': 4}, {'source': 2, 'target': 3}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['foo', 'bar'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'repr': "FakeListLLM(responses=['foo', 'bar'])", 'name': 'FakeListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeListLLM'], 'name': 'FakeListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'foo', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='passthrough', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['langchain_core', 'runnables', 'base', 'RunnableLambda'], 'repr': 'RunnableLambda(afunc=passthrough)'}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'foo'}, outputs={'output': 'foo'}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ ])
+# ---
+# name: test_prompt_with_llm_parser
+ '''
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "kwargs": {
+ "messages": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "SystemMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [],
+ "template": "You are a nice assistant.",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "template": "{question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "input_variables": [
+ "question"
+ ]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [
+ {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "repr": "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'])",
+ "name": "FakeStreamingListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "name": "FakeStreamingListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeStreamingListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ ],
+ "last": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "kwargs": {},
+ "name": "CommaSeparatedListOutputParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeStreamingListLLM"
+ ],
+ "name": "FakeStreamingListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 4
+ },
+ {
+ "source": 2,
+ "target": 3
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_prompt_with_llm_parser.1
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'])", 'name': 'FakeStreamingListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 3, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 4, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}, {'source': 3, 'target': 4}, {'source': 2, 'target': 3}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeStreamingListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['bear, dog, cat', 'tomato, lettuce, onion'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 1}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'])", 'name': 'FakeStreamingListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'bear, dog, cat', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'bear, dog, cat'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ ])
+# ---
+# name: test_prompt_with_llm_parser.2
+ list([
+ Run(id=UUID('00000000-0000-4000-8000-000000000000'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)", 'name': 'FakeStreamingListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 3, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 4, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}, {'source': 3, 'target': 4}, {'source': 2, 'target': 3}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'output': ['tomato', 'lettuce', 'onion']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000001'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your name?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your name?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000001'), Run(id=UUID('00000000-0000-4000-8000-000000000002'), name='FakeStreamingListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['bear, dog, cat', 'tomato, lettuce, onion'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)", 'name': 'FakeStreamingListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your name?']}, outputs={'generations': [[{'text': 'tomato, lettuce, onion', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000002'), Run(id=UUID('00000000-0000-4000-8000-000000000003'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'tomato, lettuce, onion'}, outputs={'output': ['tomato', 'lettuce', 'onion']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000000'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000.20230101T000000000000Z00000000-0000-4000-8000-000000000003')], trace_id=UUID('00000000-0000-4000-8000-000000000000'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000000'),
+ Run(id=UUID('00000000-0000-4000-8000-000000000004'), name='RunnableSequence', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='chain', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'runnable', 'RunnableSequence'], 'kwargs': {'first': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'middle': [{'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)", 'name': 'FakeStreamingListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}], 'last': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, 'name': None}, 'name': 'RunnableSequence', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 3, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 4, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}, {'source': 3, 'target': 4}, {'source': 2, 'target': 3}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=None, tags=[], execution_order=None, child_execution_order=None, child_runs=[Run(id=UUID('00000000-0000-4000-8000-000000000005'), name='ChatPromptTemplate', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='prompt', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'SystemMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': [], 'template': 'You are a nice assistant.', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'HumanMessagePromptTemplate'], 'kwargs': {'prompt': {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'kwargs': {'input_variables': ['question'], 'template': '{question}', 'template_format': 'f-string', 'partial_variables': {}}, 'name': 'PromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'prompt', 'PromptTemplate'], 'name': 'PromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'PromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}}}], 'input_variables': ['question']}, 'name': 'ChatPromptTemplate', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'prompts', 'chat', 'ChatPromptTemplate'], 'name': 'ChatPromptTemplate'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'ChatPromptTemplateOutput', 'anyOf': [{'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'question': 'What is your favorite color?'}, outputs={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'prompts', 'chat', 'ChatPromptValue'], 'kwargs': {'messages': [{'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'SystemMessage'], 'kwargs': {'content': 'You are a nice assistant.', 'additional_kwargs': {}}}, {'lc': 1, 'type': 'constructor', 'id': ['langchain', 'schema', 'messages', 'HumanMessage'], 'kwargs': {'content': 'What is your favorite color?', 'additional_kwargs': {}}}]}}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000004'), tags=['seq:step:1'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004.20230101T000000000000Z00000000-0000-4000-8000-000000000005'), Run(id=UUID('00000000-0000-4000-8000-000000000006'), name='FakeStreamingListLLM', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='llm', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={'invocation_params': {'responses': ['bear, dog, cat', 'tomato, lettuce, onion'], '_type': 'fake-list', 'stop': None}, 'options': {'stop': None}, 'batch_size': 2}, error=None, serialized={'lc': 1, 'type': 'not_implemented', 'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'repr': "FakeStreamingListLLM(responses=['bear, dog, cat', 'tomato, lettuce, onion'], i=1)", 'name': 'FakeStreamingListLLM', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/StringPromptValue'}, {'$ref': '#/definitions/ChatPromptValueConcrete'}, {'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}], 'definitions': {'StringPromptValue': {'title': 'StringPromptValue', 'description': 'String prompt value.', 'type': 'object', 'properties': {'text': {'title': 'Text', 'type': 'string'}, 'type': {'title': 'Type', 'default': 'StringPromptValue', 'enum': ['StringPromptValue'], 'type': 'string'}}, 'required': ['text']}, '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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, 'ChatPromptValueConcrete': {'title': 'ChatPromptValueConcrete', 'description': 'Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.', 'type': 'object', 'properties': {'messages': {'title': 'Messages', 'type': 'array', 'items': {'anyOf': [{'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}]}}, 'type': {'title': 'Type', 'default': 'ChatPromptValueConcrete', 'enum': ['ChatPromptValueConcrete'], 'type': 'string'}}, 'required': ['messages']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['tests', 'unit_tests', 'fake', 'llm', 'FakeStreamingListLLM'], 'name': 'FakeStreamingListLLM'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'FakeStreamingListLLMOutput', 'type': 'string'}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'prompts': ['System: You are a nice assistant.\nHuman: What is your favorite color?']}, outputs={'generations': [[{'text': 'bear, dog, cat', 'generation_info': None, 'type': 'Generation'}]], 'llm_output': None, 'run': None}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000004'), tags=['seq:step:2'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004.20230101T000000000000Z00000000-0000-4000-8000-000000000006'), Run(id=UUID('00000000-0000-4000-8000-000000000007'), name='CommaSeparatedListOutputParser', start_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), run_type='parser', end_time=FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), extra={}, error=None, serialized={'lc': 1, 'type': 'constructor', 'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'kwargs': {}, 'name': 'CommaSeparatedListOutputParser', 'graph': {'nodes': [{'id': 0, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserInput', 'anyOf': [{'type': 'string'}, {'$ref': '#/definitions/AIMessage'}, {'$ref': '#/definitions/HumanMessage'}, {'$ref': '#/definitions/ChatMessage'}, {'$ref': '#/definitions/SystemMessage'}, {'$ref': '#/definitions/FunctionMessage'}, {'$ref': '#/definitions/ToolMessage'}], 'definitions': {'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'}, 'type': {'title': 'Type', 'default': 'ai', 'enum': ['ai'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, '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'}, 'type': {'title': 'Type', 'default': 'human', 'enum': ['human'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', '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'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'id': 1, 'type': 'runnable', 'data': {'id': ['langchain', 'output_parsers', 'list', 'CommaSeparatedListOutputParser'], 'name': 'CommaSeparatedListOutputParser'}}, {'id': 2, 'type': 'schema', 'data': {'title': 'CommaSeparatedListOutputParserOutput', 'type': 'array', 'items': {'type': 'string'}}}], 'edges': [{'source': 0, 'target': 1}, {'source': 1, 'target': 2}]}}, events=[{'name': 'start', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}, {'name': 'end', 'time': FakeDatetime(2023, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)}], inputs={'input': 'bear, dog, cat'}, outputs={'output': ['bear', 'dog', 'cat']}, reference_example_id=None, parent_run_id=UUID('00000000-0000-4000-8000-000000000004'), tags=['seq:step:3'], execution_order=None, child_execution_order=None, child_runs=[], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004.20230101T000000000000Z00000000-0000-4000-8000-000000000007')], trace_id=UUID('00000000-0000-4000-8000-000000000004'), dotted_order='20230101T000000000000Z00000000-0000-4000-8000-000000000004'),
+ ])
+# ---
+# name: test_router_runnable
+ '''
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableParallel"
+ ],
+ "kwargs": {
+ "steps": {
+ "key": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "repr": "RunnableLambda(...)"
+ },
+ "input": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableParallel"
+ ],
+ "kwargs": {
+ "steps": {
+ "question": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "repr": "RunnableLambda(...)"
+ }
+ }
+ },
+ "name": "RunnableParallel<question>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question>Output",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ }
+ ]
+ }
+ }
+ }
+ },
+ "name": "RunnableParallel<key,input>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Output",
+ "type": "object",
+ "properties": {
+ "key": {
+ "title": "Key"
+ },
+ "input": {
+ "title": "Input",
+ "type": "object"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 3
+ },
+ {
+ "source": 3,
+ "target": 1
+ }
+ ]
+ }
+ },
+ "middle": [],
+ "last": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RouterRunnable"
+ ],
+ "kwargs": {
+ "runnables": {
+ "math": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "messages": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "template": "You are a math genius. Answer the question: {question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "partial_variables": {}
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [],
+ "last": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "repr": "FakeListLLM(responses=['4'])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "english": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "messages": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "template": "You are an english major. Answer the question: {question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "partial_variables": {}
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [],
+ "last": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "repr": "FakeListLLM(responses=['2'])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+ "name": "RouterRunnable",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RouterRunnableInput",
+ "$ref": "#/definitions/RouterInput",
+ "definitions": {
+ "RouterInput": {
+ "title": "RouterInput",
+ "type": "object",
+ "properties": {
+ "key": {
+ "title": "Key",
+ "type": "string"
+ },
+ "input": {
+ "title": "Input"
+ }
+ },
+ "required": [
+ "key",
+ "input"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RouterRunnable"
+ ],
+ "name": "RouterRunnable"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "RouterRunnableOutput"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<key,input>Output",
+ "type": "object",
+ "properties": {
+ "key": {
+ "title": "Key"
+ },
+ "input": {
+ "title": "Input",
+ "type": "object"
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 4,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RouterRunnable"
+ ],
+ "name": "RouterRunnable"
+ }
+ },
+ {
+ "id": 5,
+ "type": "schema",
+ "data": {
+ "title": "RouterRunnableOutput"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 3
+ },
+ {
+ "source": 3,
+ "target": 1
+ },
+ {
+ "source": 4,
+ "target": 5
+ },
+ {
+ "source": 1,
+ "target": 4
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_schemas
+ dict({
+ 'anyOf': list([
+ dict({
+ 'type': 'string',
+ }),
+ dict({
+ '$ref': '#/definitions/StringPromptValue',
+ }),
+ dict({
+ '$ref': '#/definitions/ChatPromptValueConcrete',
+ }),
+ dict({
+ 'items': dict({
+ 'anyOf': list([
+ dict({
+ '$ref': '#/definitions/AIMessage',
+ }),
+ dict({
+ '$ref': '#/definitions/HumanMessage',
+ }),
+ dict({
+ '$ref': '#/definitions/ChatMessage',
+ }),
+ dict({
+ '$ref': '#/definitions/SystemMessage',
+ }),
+ dict({
+ '$ref': '#/definitions/FunctionMessage',
+ }),
+ dict({
+ '$ref': '#/definitions/ToolMessage',
+ }),
+ ]),
+ }),
+ 'type': 'array',
+ }),
+ ]),
+ 'definitions': dict({
+ 'AIMessage': dict({
+ 'description': 'Message from an AI.',
+ 'properties': dict({
+ 'additional_kwargs': dict({
+ 'title': 'Additional Kwargs',
+ 'type': 'object',
+ }),
+ 'content': dict({
+ 'anyOf': list([
+ dict({
+ 'type': 'string',
+ }),
+ dict({
+ 'items': dict({
+ 'anyOf': list([
+ dict({
+ 'type': 'string',
+ }),
+ dict({
+ 'type': 'object',
+ }),
+ ]),
+ }),
'type': 'array',
}),
]),
@@ -4328,21 +34061,3354 @@
'title': 'CommaSeparatedListOutputParserInput',
})
# ---
-# name: test_seq_dict_prompt_llm
+# name: test_seq_dict_prompt_llm
+ '''
+ {
+ question: RunnablePassthrough()
+ | RunnableLambda(...),
+ documents: RunnableLambda(...)
+ | FakeRetriever(),
+ just_to_test_lambda: RunnableLambda(...)
+ }
+ | ChatPromptTemplate(input_variables=['documents', 'question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['documents', 'question'], template='Context:\n{documents}\n\nQuestion:\n{question}'))])
+ | FakeListChatModel(responses=['foo, bar'])
+ | CommaSeparatedListOutputParser()
+ '''
+# ---
+# name: test_seq_dict_prompt_llm.1
+ '''
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableParallel"
+ ],
+ "kwargs": {
+ "steps": {
+ "question": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "kwargs": {
+ "func": null,
+ "afunc": null,
+ "input_type": null
+ },
+ "name": "RunnablePassthrough",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnablePassthroughInput"
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "name": "RunnablePassthrough"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "RunnablePassthroughOutput"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [],
+ "last": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "repr": "RunnableLambda(...)"
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnablePassthroughInput"
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "name": "RunnablePassthrough"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "RunnableLambdaOutput"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "documents": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnableSequence"
+ ],
+ "kwargs": {
+ "first": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "repr": "RunnableLambda(...)"
+ },
+ "middle": [],
+ "last": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "runnables",
+ "test_runnable",
+ "FakeRetriever"
+ ],
+ "repr": "FakeRetriever()",
+ "name": "FakeRetriever",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeRetrieverInput",
+ "type": "string"
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "runnables",
+ "test_runnable",
+ "FakeRetriever"
+ ],
+ "name": "FakeRetriever"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeRetrieverOutput",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Document"
+ },
+ "definitions": {
+ "Document": {
+ "title": "Document",
+ "description": "Class for storing a piece of text and associated metadata.",
+ "type": "object",
+ "properties": {
+ "page_content": {
+ "title": "Page Content",
+ "type": "string"
+ },
+ "metadata": {
+ "title": "Metadata",
+ "type": "object"
+ },
+ "type": {
+ "title": "Type",
+ "default": "Document",
+ "enum": [
+ "Document"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "page_content"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableLambdaInput"
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "runnables",
+ "test_runnable",
+ "FakeRetriever"
+ ],
+ "name": "FakeRetriever"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "FakeRetrieverOutput",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Document"
+ },
+ "definitions": {
+ "Document": {
+ "title": "Document",
+ "description": "Class for storing a piece of text and associated metadata.",
+ "type": "object",
+ "properties": {
+ "page_content": {
+ "title": "Page Content",
+ "type": "string"
+ },
+ "metadata": {
+ "title": "Metadata",
+ "type": "object"
+ },
+ "type": {
+ "title": "Type",
+ "default": "Document",
+ "enum": [
+ "Document"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "page_content"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "just_to_test_lambda": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "repr": "RunnableLambda(...)"
+ }
+ }
+ },
+ "name": "RunnableParallel<question,documents,just_to_test_lambda>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question,documents,just_to_test_lambda>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question,documents,just_to_test_lambda>Output",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question"
+ },
+ "documents": {
+ "title": "Documents",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Document"
+ }
+ },
+ "just_to_test_lambda": {
+ "title": "Just To Test Lambda"
+ }
+ },
+ "definitions": {
+ "Document": {
+ "title": "Document",
+ "description": "Class for storing a piece of text and associated metadata.",
+ "type": "object",
+ "properties": {
+ "page_content": {
+ "title": "Page Content",
+ "type": "string"
+ },
+ "metadata": {
+ "title": "Metadata",
+ "type": "object"
+ },
+ "type": {
+ "title": "Type",
+ "default": "Document",
+ "enum": [
+ "Document"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "page_content"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "name": "RunnablePassthrough"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 4,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 5,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "runnables",
+ "test_runnable",
+ "FakeRetriever"
+ ],
+ "name": "FakeRetriever"
+ }
+ },
+ {
+ "id": 6,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 1
+ },
+ {
+ "source": 4,
+ "target": 5
+ },
+ {
+ "source": 0,
+ "target": 4
+ },
+ {
+ "source": 5,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 6
+ },
+ {
+ "source": 6,
+ "target": 1
+ }
+ ]
+ }
+ },
+ "middle": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "kwargs": {
+ "messages": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "SystemMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [],
+ "template": "You are a nice assistant.",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "documents",
+ "question"
+ ],
+ "template": "Context:\n{documents}\n\nQuestion:\n{question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "documents": {
+ "title": "Documents",
+ "type": "string"
+ },
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "input_variables": [
+ "documents",
+ "question"
+ ]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "documents": {
+ "title": "Documents",
+ "type": "string"
+ },
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "repr": "FakeListChatModel(responses=['foo, bar'])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ ],
+ "last": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "kwargs": {},
+ "name": "CommaSeparatedListOutputParser",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question,documents,just_to_test_lambda>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<question,documents,just_to_test_lambda>Output",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question"
+ },
+ "documents": {
+ "title": "Documents",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Document"
+ }
+ },
+ "just_to_test_lambda": {
+ "title": "Just To Test Lambda"
+ }
+ },
+ "definitions": {
+ "Document": {
+ "title": "Document",
+ "description": "Class for storing a piece of text and associated metadata.",
+ "type": "object",
+ "properties": {
+ "page_content": {
+ "title": "Page Content",
+ "type": "string"
+ },
+ "metadata": {
+ "title": "Metadata",
+ "type": "object"
+ },
+ "type": {
+ "title": "Type",
+ "default": "Document",
+ "enum": [
+ "Document"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "page_content"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "schema",
+ "runnable",
+ "RunnablePassthrough"
+ ],
+ "name": "RunnablePassthrough"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 4,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 5,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "runnables",
+ "test_runnable",
+ "FakeRetriever"
+ ],
+ "name": "FakeRetriever"
+ }
+ },
+ {
+ "id": 6,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 7,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 8,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 9,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser"
+ ],
+ "name": "CommaSeparatedListOutputParser"
+ }
+ },
+ {
+ "id": 10,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 2,
+ "target": 3
+ },
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 1
+ },
+ {
+ "source": 4,
+ "target": 5
+ },
+ {
+ "source": 0,
+ "target": 4
+ },
+ {
+ "source": 5,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 6
+ },
+ {
+ "source": 6,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 7
+ },
+ {
+ "source": 7,
+ "target": 8
+ },
+ {
+ "source": 9,
+ "target": 10
+ },
+ {
+ "source": 8,
+ "target": 9
+ }
+ ]
+ }
+ }
+ '''
+# ---
+# name: test_seq_prompt_dict
'''
- {
- question: RunnablePassthrough()
- | RunnableLambda(...),
- documents: RunnableLambda(...)
- | FakeRetriever(),
- just_to_test_lambda: RunnableLambda(...)
- }
- | ChatPromptTemplate(input_variables=['documents', 'question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['documents', 'question'], template='Context:\n{documents}\n\nQuestion:\n{question}'))])
- | FakeListChatModel(responses=['foo, bar'])
- | CommaSeparatedListOutputParser()
+ ChatPromptTemplate(input_variables=['question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['question'], template='{question}'))])
+ | RunnableLambda(...)
+ | {
+ chat: FakeListChatModel(responses=["i'm a chatbot"]),
+ llm: FakeListLLM(responses=["i'm a textbot"])
+ }
'''
# ---
-# name: test_seq_dict_prompt_llm.1
+# name: test_seq_prompt_dict.1
'''
{
"lc": 1,
@@ -4355,6 +37421,1373 @@
],
"kwargs": {
"first": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "kwargs": {
+ "messages": [
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "SystemMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [],
+ "template": "You are a nice assistant.",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "HumanMessagePromptTemplate"
+ ],
+ "kwargs": {
+ "prompt": {
+ "lc": 1,
+ "type": "constructor",
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "kwargs": {
+ "input_variables": [
+ "question"
+ ],
+ "template": "{question}",
+ "template_format": "f-string",
+ "partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "input_variables": [
+ "question"
+ ]
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "middle": [
+ {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "repr": "RunnableLambda(...)"
+ }
+ ],
+ "last": {
"lc": 1,
"type": "constructor",
"id": [
@@ -4365,215 +38798,2121 @@
],
"kwargs": {
"steps": {
- "question": {
+ "chat": {
"lc": 1,
- "type": "constructor",
+ "type": "not_implemented",
"id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableSequence"
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
],
- "kwargs": {
- "first": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnablePassthrough"
- ],
- "kwargs": {
- "func": null,
- "afunc": null,
- "input_type": null
+ "repr": "FakeListChatModel(responses=[\"i'm a chatbot\"])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ },
+ "llm": {
+ "lc": 1,
+ "type": "not_implemented",
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "repr": "FakeListLLM(responses=[\"i'm a textbot\"])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
+ }
+ }
+ },
+ "name": "RunnableParallel<chat,llm>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm>Output",
+ "type": "object",
+ "properties": {
+ "chat": {
+ "title": "Chat",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ },
+ "llm": {
+ "title": "Llm",
+ "type": "string"
+ }
+ },
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
}
- },
- "middle": [],
- "last": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(...)"
- },
- "name": null
+ }
}
},
- "documents": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableSequence"
- ],
- "kwargs": {
- "first": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(...)"
- },
- "middle": [],
- "last": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "runnables",
- "test_runnable",
- "FakeRetriever"
- ],
- "repr": "FakeRetriever()"
- },
- "name": null
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
}
},
- "just_to_test_lambda": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(...)"
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
}
- }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 3
+ },
+ {
+ "source": 3,
+ "target": 1
+ }
+ ]
}
},
- "middle": [
+ "name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
{
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "ChatPromptTemplate"
- ],
- "kwargs": {
- "messages": [
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "SystemMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm>Output",
+ "type": "object",
+ "properties": {
+ "chat": {
+ "title": "Chat",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ },
+ "llm": {
+ "title": "Llm",
+ "type": "string"
+ }
+ },
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
],
- "kwargs": {
- "input_variables": [],
- "template": "You are a nice assistant.",
- "template_format": "f-string",
- "partial_variables": {}
- }
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
}
- }
+ },
+ "required": [
+ "content"
+ ]
},
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
],
- "kwargs": {
- "input_variables": [
- "documents",
- "question"
- ],
- "template": "Context:\n{documents}\n\nQuestion:\n{question}",
- "template_format": "f-string",
- "partial_variables": {}
- }
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
}
+ }
+ }
+ },
+ {
+ "id": 5,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
],
- "input_variables": [
- "documents",
- "question"
- ]
+ "name": "FakeListChatModel"
}
},
{
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "chat_model",
- "FakeListChatModel"
- ],
- "repr": "FakeListChatModel(responses=['foo, bar'])"
+ "id": 6,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
}
],
- "last": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "output_parsers",
- "list",
- "CommaSeparatedListOutputParser"
- ],
- "kwargs": {}
- },
- "name": null
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 5
+ },
+ {
+ "source": 5,
+ "target": 4
+ },
+ {
+ "source": 3,
+ "target": 6
+ },
+ {
+ "source": 6,
+ "target": 4
+ },
+ {
+ "source": 2,
+ "target": 3
+ }
+ ]
}
}
'''
# ---
-# name: test_seq_prompt_dict
- '''
- ChatPromptTemplate(input_variables=['question'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=[], template='You are a nice assistant.')), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['question'], template='{question}'))])
- | RunnableLambda(...)
- | {
- chat: FakeListChatModel(responses=["i'm a chatbot"]),
- llm: FakeListLLM(responses=["i'm a textbot"])
- }
- '''
-# ---
-# name: test_seq_prompt_dict.1
+# name: test_seq_prompt_map
'''
{
"lc": 1,
@@ -4620,6 +40959,429 @@
"template": "You are a nice assistant.",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -4650,6 +41412,434 @@
"template": "{question}",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
@@ -4658,148 +41848,433 @@
"input_variables": [
"question"
]
- }
- },
- "middle": [
- {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "langchain_core",
- "runnables",
- "base",
- "RunnableLambda"
- ],
- "repr": "RunnableLambda(...)"
- }
- ],
- "last": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableParallel"
- ],
- "kwargs": {
- "steps": {
- "chat": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "chat_model",
- "FakeListChatModel"
- ],
- "repr": "FakeListChatModel(responses=[\"i'm a chatbot\"])"
- },
- "llm": {
- "lc": 1,
- "type": "not_implemented",
- "id": [
- "tests",
- "unit_tests",
- "fake",
- "llm",
- "FakeListLLM"
- ],
- "repr": "FakeListLLM(responses=[\"i'm a textbot\"])"
- }
- }
- }
- },
- "name": null
- }
- }
- '''
-# ---
-# name: test_seq_prompt_map
- '''
- {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "schema",
- "runnable",
- "RunnableSequence"
- ],
- "kwargs": {
- "first": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "ChatPromptTemplate"
- ],
- "kwargs": {
- "messages": [
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
{
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "SystemMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [],
- "template": "You are a nice assistant.",
- "template_format": "f-string",
- "partial_variables": {}
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
}
}
}
},
{
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "chat",
- "HumanMessagePromptTemplate"
- ],
- "kwargs": {
- "prompt": {
- "lc": 1,
- "type": "constructor",
- "id": [
- "langchain",
- "prompts",
- "prompt",
- "PromptTemplate"
- ],
- "kwargs": {
- "input_variables": [
- "question"
- ],
- "template": "{question}",
- "template_format": "f-string",
- "partial_variables": {}
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
}
}
}
}
],
- "input_variables": [
- "question"
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
]
}
},
@@ -4847,7 +42322,782 @@
"chat_model",
"FakeListChatModel"
],
- "repr": "FakeListChatModel(responses=[\"i'm a chatbot\"])"
+ "repr": "FakeListChatModel(responses=[\"i'm a chatbot\"])",
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"kwargs": {
"stop": [
@@ -4858,6 +43108,781 @@
"config_factories": [],
"custom_input_type": null,
"custom_output_type": null
+ },
+ "name": "FakeListChatModel",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListChatModelOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"llm": {
@@ -4870,7 +43895,458 @@
"llm",
"FakeListLLM"
],
- "repr": "FakeListLLM(responses=[\"i'm a textbot\"])"
+ "repr": "FakeListLLM(responses=[\"i'm a textbot\"])",
+ "name": "FakeListLLM",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "FakeListLLMOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
+ }
},
"passthrough": {
"lc": 1,
@@ -4884,9 +44360,913 @@
"repr": "RunnableLambda(...)"
}
}
+ },
+ "name": "RunnableParallel<chat,llm,passthrough>",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm,passthrough>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 1,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm,passthrough>Output",
+ "type": "object",
+ "properties": {
+ "chat": {
+ "title": "Chat",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ },
+ "llm": {
+ "title": "Llm",
+ "type": "string"
+ },
+ "passthrough": {
+ "title": "Passthrough"
+ }
+ },
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 4,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 2
+ },
+ {
+ "source": 2,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 3
+ },
+ {
+ "source": 3,
+ "target": 1
+ },
+ {
+ "source": 0,
+ "target": 4
+ },
+ {
+ "source": 4,
+ "target": 1
+ }
+ ]
}
},
"name": null
+ },
+ "name": "RunnableSequence",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "question": {
+ "title": "Question",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm,passthrough>Input",
+ "type": "object",
+ "properties": {}
+ }
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<chat,llm,passthrough>Output",
+ "type": "object",
+ "properties": {
+ "chat": {
+ "title": "Chat",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ },
+ "llm": {
+ "title": "Llm",
+ "type": "string"
+ },
+ "passthrough": {
+ "title": "Passthrough"
+ }
+ },
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 5,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "chat_model",
+ "FakeListChatModel"
+ ],
+ "name": "FakeListChatModel"
+ }
+ },
+ {
+ "id": 6,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "tests",
+ "unit_tests",
+ "fake",
+ "llm",
+ "FakeListLLM"
+ ],
+ "name": "FakeListLLM"
+ }
+ },
+ {
+ "id": 7,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "runnables",
+ "base",
+ "RunnableLambda"
+ ],
+ "name": "RunnableLambda"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ },
+ {
+ "source": 3,
+ "target": 5
+ },
+ {
+ "source": 5,
+ "target": 4
+ },
+ {
+ "source": 3,
+ "target": 6
+ },
+ {
+ "source": 6,
+ "target": 4
+ },
+ {
+ "source": 3,
+ "target": 7
+ },
+ {
+ "source": 7,
+ "target": 4
+ },
+ {
+ "source": 2,
+ "target": 3
+ }
+ ]
}
}
'''
diff --git a/libs/core/tests/unit_tests/runnables/test_graph.py b/libs/core/tests/unit_tests/runnables/test_graph.py
index 7d84bc2634..884cddb435 100644
--- a/libs/core/tests/unit_tests/runnables/test_graph.py
+++ b/libs/core/tests/unit_tests/runnables/test_graph.py
@@ -31,6 +31,63 @@ def test_graph_sequence(snapshot: SnapshotAssertion) -> None:
sequence = prompt | fake_llm | list_parser
graph = sequence.get_graph()
+ assert graph.to_json() == {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {"name": {"title": "Name", "type": "string"}},
+ },
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": ["langchain", "prompts", "prompt", "PromptTemplate"],
+ "name": "PromptTemplate",
+ },
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": ["tests", "unit_tests", "fake", "llm", "FakeListLLM"],
+ "name": "FakeListLLM",
+ },
+ },
+ {
+ "id": 3,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser",
+ ],
+ "name": "CommaSeparatedListOutputParser",
+ },
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "CommaSeparatedListOutputParserOutput",
+ "type": "array",
+ "items": {"type": "string"},
+ },
+ },
+ ],
+ "edges": [
+ {"source": 0, "target": 1},
+ {"source": 1, "target": 2},
+ {"source": 3, "target": 4},
+ {"source": 2, "target": 3},
+ ],
+ }
assert graph.draw_ascii() == snapshot
@@ -56,4 +113,343 @@ def test_graph_sequence_map(snapshot: SnapshotAssertion) -> None:
}
)
graph = sequence.get_graph()
+ assert graph.to_json() == {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {"name": {"title": "Name", "type": "string"}},
+ },
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": ["langchain", "prompts", "prompt", "PromptTemplate"],
+ "name": "PromptTemplate",
+ },
+ },
+ {
+ "id": 2,
+ "type": "runnable",
+ "data": {
+ "id": ["tests", "unit_tests", "fake", "llm", "FakeListLLM"],
+ "name": "FakeListLLM",
+ },
+ },
+ {
+ "id": 3,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<as_list,as_str>Input",
+ "anyOf": [
+ {"type": "string"},
+ {"$ref": "#/definitions/AIMessage"},
+ {"$ref": "#/definitions/HumanMessage"},
+ {"$ref": "#/definitions/ChatMessage"},
+ {"$ref": "#/definitions/SystemMessage"},
+ {"$ref": "#/definitions/FunctionMessage"},
+ {"$ref": "#/definitions/ToolMessage"},
+ ],
+ "definitions": {
+ "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",
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": ["ai"],
+ "type": "string",
+ },
+ "name": {"title": "Name", "type": "string"},
+ "example": {
+ "title": "Example",
+ "default": False,
+ "type": "boolean",
+ },
+ },
+ "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",
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": ["human"],
+ "type": "string",
+ },
+ "name": {"title": "Name", "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).", # noqa: E501
+ "type": "object",
+ "properties": {
+ "content": {
+ "title": "Content",
+ "anyOf": [
+ {"type": "string"},
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {"type": "string"},
+ {"type": "object"},
+ ]
+ },
+ },
+ ],
+ },
+ "additional_kwargs": {
+ "title": "Additional Kwargs",
+ "type": "object",
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": ["chat"],
+ "type": "string",
+ },
+ "name": {"title": "Name", "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.", # noqa: E501
+ "type": "object",
+ "properties": {
+ "content": {
+ "title": "Content",
+ "anyOf": [
+ {"type": "string"},
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {"type": "string"},
+ {"type": "object"},
+ ]
+ },
+ },
+ ],
+ },
+ "additional_kwargs": {
+ "title": "Additional Kwargs",
+ "type": "object",
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": ["system"],
+ "type": "string",
+ },
+ "name": {"title": "Name", "type": "string"},
+ },
+ "required": ["content"],
+ },
+ "FunctionMessage": {
+ "title": "FunctionMessage",
+ "description": "Message for passing the result of executing a function back to a model.", # noqa: E501
+ "type": "object",
+ "properties": {
+ "content": {
+ "title": "Content",
+ "anyOf": [
+ {"type": "string"},
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {"type": "string"},
+ {"type": "object"},
+ ]
+ },
+ },
+ ],
+ },
+ "additional_kwargs": {
+ "title": "Additional Kwargs",
+ "type": "object",
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": ["function"],
+ "type": "string",
+ },
+ "name": {"title": "Name", "type": "string"},
+ },
+ "required": ["content", "name"],
+ },
+ "ToolMessage": {
+ "title": "ToolMessage",
+ "description": "Message for passing the result of executing a tool back to a model.", # noqa: E501
+ "type": "object",
+ "properties": {
+ "content": {
+ "title": "Content",
+ "anyOf": [
+ {"type": "string"},
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {"type": "string"},
+ {"type": "object"},
+ ]
+ },
+ },
+ ],
+ },
+ "additional_kwargs": {
+ "title": "Additional Kwargs",
+ "type": "object",
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": ["tool"],
+ "type": "string",
+ },
+ "name": {"title": "Name", "type": "string"},
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string",
+ },
+ },
+ "required": ["content", "tool_call_id"],
+ },
+ },
+ },
+ },
+ {
+ "id": 4,
+ "type": "schema",
+ "data": {
+ "title": "RunnableParallel<as_list,as_str>Output",
+ "type": "object",
+ "properties": {
+ "as_list": {
+ "title": "As List",
+ "type": "array",
+ "items": {"type": "string"},
+ },
+ "as_str": {"title": "As Str"},
+ },
+ },
+ },
+ {
+ "id": 5,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "output_parsers",
+ "list",
+ "CommaSeparatedListOutputParser",
+ ],
+ "name": "CommaSeparatedListOutputParser",
+ },
+ },
+ {
+ "id": 6,
+ "type": "schema",
+ "data": {"title": "conditional_str_parser_input", "type": "string"},
+ },
+ {
+ "id": 7,
+ "type": "schema",
+ "data": {"title": "conditional_str_parser_output"},
+ },
+ {
+ "id": 8,
+ "type": "runnable",
+ "data": {
+ "id": ["langchain", "schema", "output_parser", "StrOutputParser"],
+ "name": "StrOutputParser",
+ },
+ },
+ {
+ "id": 9,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain_core",
+ "output_parsers",
+ "xml",
+ "XMLOutputParser",
+ ],
+ "name": "XMLOutputParser",
+ },
+ },
+ ],
+ "edges": [
+ {"source": 0, "target": 1},
+ {"source": 1, "target": 2},
+ {"source": 3, "target": 5},
+ {"source": 5, "target": 4},
+ {"source": 6, "target": 8},
+ {"source": 8, "target": 7},
+ {"source": 6, "target": 9},
+ {"source": 9, "target": 7},
+ {"source": 3, "target": 6},
+ {"source": 7, "target": 4},
+ {"source": 2, "target": 3},
+ ],
+ }
assert graph.draw_ascii() == snapshot
diff --git a/libs/langchain/tests/unit_tests/load/__snapshots__/test_dump.ambr b/libs/langchain/tests/unit_tests/load/__snapshots__/test_dump.ambr
index 826746ac24..3ae7ce44d1 100644
--- a/libs/langchain/tests/unit_tests/load/__snapshots__/test_dump.ambr
+++ b/libs/langchain/tests/unit_tests/load/__snapshots__/test_dump.ambr
@@ -90,6 +90,456 @@
"OPENAI_API_KEY"
]
}
+ },
+ "name": "OpenAI",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "OpenAIInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "llms",
+ "openai",
+ "OpenAI"
+ ],
+ "name": "OpenAI"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "OpenAIOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"prompt": {
@@ -108,8 +558,490 @@
"template": "hello {name}!",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
+ },
+ "name": "LLMChain",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "ChainInput",
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "chains",
+ "llm",
+ "LLMChain"
+ ],
+ "name": "LLMChain"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChainOutput",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text"
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''
@@ -145,6 +1077,780 @@
"OPENAI_API_KEY"
]
}
+ },
+ "name": "ChatOpenAI",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "ChatOpenAIInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "chat_models",
+ "openai",
+ "ChatOpenAI"
+ ],
+ "name": "ChatOpenAI"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatOpenAIOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ],
+ "definitions": {
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"prompt": {
@@ -187,14 +1893,924 @@
"template": "hello {name}!",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
}
}
],
"partial_variables": {}
+ },
+ "name": "ChatPromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "chat",
+ "ChatPromptTemplate"
+ ],
+ "name": "ChatPromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChatPromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
+ },
+ "name": "LLMChain",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "ChainInput",
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "chains",
+ "llm",
+ "LLMChain"
+ ],
+ "name": "LLMChain"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChainOutput",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text"
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''
@@ -230,6 +2846,456 @@
"OPENAI_API_KEY"
]
}
+ },
+ "name": "OpenAI",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "OpenAIInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "llms",
+ "openai",
+ "OpenAI"
+ ],
+ "name": "OpenAI"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "OpenAIOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
},
"prompt": {
@@ -248,8 +3314,490 @@
"template": "hello {name}!",
"template_format": "f-string",
"partial_variables": {}
+ },
+ "name": "PromptTemplate",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "PromptInput",
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name",
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "prompts",
+ "prompt",
+ "PromptTemplate"
+ ],
+ "name": "PromptTemplate"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "PromptTemplateOutput",
+ "anyOf": [
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
+ },
+ "name": "LLMChain",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "ChainInput",
+ "type": "object",
+ "properties": {
+ "name": {
+ "title": "Name"
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "chains",
+ "llm",
+ "LLMChain"
+ ],
+ "name": "LLMChain"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "ChainOutput",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text"
+ }
+ }
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''
@@ -275,6 +3823,456 @@
"OPENAI_API_KEY"
]
}
+ },
+ "name": "OpenAI",
+ "graph": {
+ "nodes": [
+ {
+ "id": 0,
+ "type": "schema",
+ "data": {
+ "title": "OpenAIInput",
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/definitions/StringPromptValue"
+ },
+ {
+ "$ref": "#/definitions/ChatPromptValueConcrete"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ }
+ ],
+ "definitions": {
+ "StringPromptValue": {
+ "title": "StringPromptValue",
+ "description": "String prompt value.",
+ "type": "object",
+ "properties": {
+ "text": {
+ "title": "Text",
+ "type": "string"
+ },
+ "type": {
+ "title": "Type",
+ "default": "StringPromptValue",
+ "enum": [
+ "StringPromptValue"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "text"
+ ]
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "ai",
+ "enum": [
+ "ai"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "example": {
+ "title": "Example",
+ "default": false,
+ "type": "boolean"
+ }
+ },
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "human",
+ "enum": [
+ "human"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "chat",
+ "enum": [
+ "chat"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "system",
+ "enum": [
+ "system"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "function",
+ "enum": [
+ "function"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "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"
+ },
+ "type": {
+ "title": "Type",
+ "default": "tool",
+ "enum": [
+ "tool"
+ ],
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "tool_call_id": {
+ "title": "Tool Call Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "tool_call_id"
+ ]
+ },
+ "ChatPromptValueConcrete": {
+ "title": "ChatPromptValueConcrete",
+ "description": "Chat prompt value which explicitly lists out the message types it accepts.\nFor use in external schemas.",
+ "type": "object",
+ "properties": {
+ "messages": {
+ "title": "Messages",
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/definitions/AIMessage"
+ },
+ {
+ "$ref": "#/definitions/HumanMessage"
+ },
+ {
+ "$ref": "#/definitions/ChatMessage"
+ },
+ {
+ "$ref": "#/definitions/SystemMessage"
+ },
+ {
+ "$ref": "#/definitions/FunctionMessage"
+ },
+ {
+ "$ref": "#/definitions/ToolMessage"
+ }
+ ]
+ }
+ },
+ "type": {
+ "title": "Type",
+ "default": "ChatPromptValueConcrete",
+ "enum": [
+ "ChatPromptValueConcrete"
+ ],
+ "type": "string"
+ }
+ },
+ "required": [
+ "messages"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": 1,
+ "type": "runnable",
+ "data": {
+ "id": [
+ "langchain",
+ "llms",
+ "openai",
+ "OpenAI"
+ ],
+ "name": "OpenAI"
+ }
+ },
+ {
+ "id": 2,
+ "type": "schema",
+ "data": {
+ "title": "OpenAIOutput",
+ "type": "string"
+ }
+ }
+ ],
+ "edges": [
+ {
+ "source": 0,
+ "target": 1
+ },
+ {
+ "source": 1,
+ "target": 2
+ }
+ ]
}
}
'''