diff --git a/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr b/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr new file mode 100644 index 000000000000000..77b8f75b1b1a99d --- /dev/null +++ b/libs/core/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr @@ -0,0 +1,6046 @@ +# serializer version: 1 +# name: test_fallbacks[chain] + ''' + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableSequence" + ], + "kwargs": { + "first": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableParallel" + ], + "kwargs": { + "steps": { + "buz": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "repr": "RunnableLambda(lambda x: x)" + } + } + }, + "name": "RunnableParallel", + "graph": { + "nodes": [ + { + "id": 0, + "type": "schema", + "data": { + "title": "RunnableParallelInput", + "type": "object", + "properties": {} + } + }, + { + "id": 1, + "type": "schema", + "data": { + "title": "RunnableParallelOutput", + "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": [], + "last": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableWithFallbacks" + ], + "kwargs": { + "runnable": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableSequence" + ], + "kwargs": { + "first": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "prompts", + "prompt", + "PromptTemplate" + ], + "kwargs": { + "input_variables": [ + "buz" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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'], 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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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": [ + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableSequence" + ], + "kwargs": { + "first": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "prompts", + "prompt", + "PromptTemplate" + ], + "kwargs": { + "input_variables": [ + "buz" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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=['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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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 + } + ] + } + } + ], + "exceptions_to_handle": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "builtins", + "Exception" + ], + "repr": "" + } + ], + "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": "RunnableParallelInput", + "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 + } + ] + } + } + ''' +# --- +# name: test_fallbacks[chain_pass_exceptions] + ''' + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableSequence" + ], + "kwargs": { + "first": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableParallel" + ], + "kwargs": { + "steps": { + "text": { + "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 + } + ] + } + } + } + }, + "name": "RunnableParallel", + "graph": { + "nodes": [ + { + "id": 0, + "type": "schema", + "data": { + "title": "RunnableParallelInput", + "type": "object", + "properties": {} + } + }, + { + "id": 1, + "type": "schema", + "data": { + "title": "RunnableParallelOutput", + "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": [], + "last": { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableWithFallbacks" + ], + "kwargs": { + "runnable": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "repr": "RunnableLambda(_raise_error)" + }, + "fallbacks": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "repr": "RunnableLambda(_dont_raise_error)" + } + ], + "exceptions_to_handle": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "builtins", + "Exception" + ], + "repr": "" + } + ], + "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": "RunnableParallelInput", + "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 + } + ] + } + } + ''' +# --- +# name: test_fallbacks[llm] + ''' + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableWithFallbacks" + ], + "kwargs": { + "runnable": { + "lc": 1, + "type": "not_implemented", + "id": [ + "tests", + "unit_tests", + "fake", + "llm", + "FakeListLLM" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "tests", + "unit_tests", + "fake", + "llm", + "FakeListLLM" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "builtins", + "Exception" + ], + "repr": "" + } + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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 + } + ] + } + } + ''' +# --- +# name: test_fallbacks[llm_multi] + ''' + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableWithFallbacks" + ], + "kwargs": { + "runnable": { + "lc": 1, + "type": "not_implemented", + "id": [ + "tests", + "unit_tests", + "fake", + "llm", + "FakeListLLM" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "tests", + "unit_tests", + "fake", + "llm", + "FakeListLLM" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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, + "type": "not_implemented", + "id": [ + "tests", + "unit_tests", + "fake", + "llm", + "FakeListLLM" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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": [ + { + "lc": 1, + "type": "not_implemented", + "id": [ + "builtins", + "Exception" + ], + "repr": "" + } + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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 6f3228008282302..15833b9df810074 100644 --- a/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +++ b/libs/core/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_each +# name: test_combining_sequences ''' { "lc": 1, @@ -1445,18 +1445,18 @@ "tests", "unit_tests", "fake", - "llm", - "FakeStreamingListLLM" + "chat_model", + "FakeListChatModel" ], - "repr": "FakeStreamingListLLM(responses=['first item, second item, third item'])", - "name": "FakeStreamingListLLM", + "repr": "FakeListChatModel(responses=['foo, bar'])", + "name": "FakeListChatModel", "graph": { "nodes": [ { "id": 0, "type": "schema", "data": { - "title": "FakeStreamingListLLMInput", + "title": "FakeListChatModelInput", "anyOf": [ { "type": "string" @@ -1898,56 +1898,18 @@ "tests", "unit_tests", "fake", - "llm", - "FakeStreamingListLLM" + "chat_model", + "FakeListChatModel" ], - "name": "FakeStreamingListLLM" + "name": "FakeListChatModel" } }, { "id": 2, "type": "schema", "data": { - "title": "FakeStreamingListLLMOutput", - "type": "string" - } - } - ], - "edges": [ - { - "source": 0, - "target": 1 - }, - { - "source": 1, - "target": 2 - } - ] - } - }, - { - "lc": 1, - "type": "constructor", - "id": [ - "tests", - "unit_tests", - "runnables", - "test_runnable", - "FakeSplitIntoListParser" - ], - "kwargs": {}, - "name": "FakeSplitIntoListParser", - "graph": { - "nodes": [ - { - "id": 0, - "type": "schema", - "data": { - "title": "FakeSplitIntoListParserInput", + "title": "FakeListChatModelOutput", "anyOf": [ - { - "type": "string" - }, { "$ref": "#/definitions/AIMessage" }, @@ -2297,31 +2259,6 @@ } } } - }, - { - "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": [ @@ -2342,92 +2279,11262 @@ "type": "constructor", "id": [ "langchain", - "schema", - "runnable", - "RunnableEach" + "output_parsers", + "list", + "CommaSeparatedListOutputParser" ], - "kwargs": { - "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": [ - { + "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" }, - { - "$ref": "#/definitions/StringPromptValue" + "name": { + "title": "Name", + "type": "string" }, - { - "$ref": "#/definitions/ChatPromptValueConcrete" + "id": { + "title": "Id", + "type": "string" }, - { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/definitions/AIMessage" - }, - { - "$ref": "#/definitions/HumanMessage" - }, - { - "$ref": "#/definitions/ChatMessage" - }, - { - "$ref": "#/definitions/SystemMessage" - }, - { - "$ref": "#/definitions/FunctionMessage" - }, - { - "$ref": "#/definitions/ToolMessage" - } - ] - } + "example": { + "title": "Example", + "default": false, + "type": "boolean" } - ], - "definitions": { - "StringPromptValue": { - "title": "StringPromptValue", - "description": "String prompt value.", - "type": "object", - "properties": { - "text": { - "title": "Text", + }, + "required": [ + "content" + ] + }, + "HumanMessage": { + "title": "HumanMessage", + "description": "Message from a human.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { "type": "string" }, - "type": { - "title": "Type", - "default": "StringPromptValue", - "enum": [ - "StringPromptValue" - ], - "type": "string" - } - }, - "required": [ - "text" - ] - }, - "AIMessage": { - "title": "AIMessage", - "description": "Message from an AI.", + { + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + }, + { + "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_combining_sequences.1 + ''' + { + "lc": 1, + "type": "constructor", + "id": [ + "langchain", + "schema", + "runnable", + "RunnableSequence" + ], + "kwargs": { + "first": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "repr": "RunnableLambda(lambda x: {'question': x[0] + x[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 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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + } + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + }, + { + "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 + } + ] + } + } + ''' +# --- +# name: test_combining_sequences.2 + ''' + { + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + } + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + }, + { + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + } + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + }, + { + "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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}, '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}], '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'}, 'id': {'title': 'Id', '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'}, 'id': {'title': 'Id', 'type': 'string'}, 'example': {'title': 'Example', 'default': False, 'type': 'boolean'}}, 'required': ['content']}, 'ChatMessage': {'title': 'ChatMessage', 'description': 'Message that can be assigned an arbitrary speaker (i.e. role).', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'chat', 'enum': ['chat'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'role': {'title': 'Role', 'type': 'string'}}, 'required': ['content', 'role']}, 'SystemMessage': {'title': 'SystemMessage', 'description': 'Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'system', 'enum': ['system'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content']}, 'FunctionMessage': {'title': 'FunctionMessage', 'description': 'Message for passing the result of executing a function back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'function', 'enum': ['function'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}}, 'required': ['content', 'name']}, 'ToolMessage': {'title': 'ToolMessage', 'description': 'Message for passing the result of executing a tool back to a model.', 'type': 'object', 'properties': {'content': {'title': 'Content', 'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'anyOf': [{'type': 'string'}, {'type': 'object'}]}}]}, 'additional_kwargs': {'title': 'Additional Kwargs', 'type': 'object'}, 'type': {'title': 'Type', 'default': 'tool', 'enum': ['tool'], 'type': 'string'}, 'name': {'title': 'Name', 'type': 'string'}, 'id': {'title': 'Id', 'type': 'string'}, 'tool_call_id': {'title': 'Tool Call Id', 'type': 'string'}}, 'required': ['content', 'tool_call_id']}}}}, {'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 + ''' + { + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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=['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" + } + ] + } + } + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + }, + "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 + } + ] + } + }, + { + "lc": 1, + "type": "constructor", + "id": [ + "tests", + "unit_tests", + "runnables", + "test_runnable", + "FakeSplitIntoListParser" + ], + "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" + }, + "id": { + "title": "Id", + "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" + }, + "id": { + "title": "Id", + "type": "string" + }, + "example": { + "title": "Example", + "default": false, + "type": "boolean" + } + }, + "required": [ + "content" + ] + }, + "ChatMessage": { + "title": "ChatMessage", + "description": "Message that can be assigned an arbitrary speaker (i.e. role).", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "chat", + "enum": [ + "chat" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "role": { + "title": "Role", + "type": "string" + } + }, + "required": [ + "content", + "role" + ] + }, + "SystemMessage": { + "title": "SystemMessage", + "description": "Message for priming AI behavior, usually passed in as the first of a sequence\nof input messages.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "system", + "enum": [ + "system" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "FunctionMessage": { + "title": "FunctionMessage", + "description": "Message for passing the result of executing a function back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "function", + "enum": [ + "function" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + } + }, + "required": [ + "content", + "name" + ] + }, + "ToolMessage": { + "title": "ToolMessage", + "description": "Message for passing the result of executing a tool back to a model.", + "type": "object", + "properties": { + "content": { + "title": "Content", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + ] + }, + "additional_kwargs": { + "title": "Additional Kwargs", + "type": "object" + }, + "type": { + "title": "Type", + "default": "tool", + "enum": [ + "tool" + ], + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "id": { + "title": "Id", + "type": "string" + }, + "tool_call_id": { + "title": "Tool Call Id", + "type": "string" + } + }, + "required": [ + "content", + "tool_call_id" + ] + } + } + } + }, + { + "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": { + "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": "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": { @@ -3259,58 +14366,377 @@ } ] } - }, - "type": { - "title": "Type", - "default": "ChatPromptValueConcrete", - "enum": [ - "ChatPromptValueConcrete" - ], - "type": "string" + }, + "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": 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_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": { + "question": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "repr": "RunnableLambda(lambda x: x['question'])" + } + } + }, + "name": "RunnableParallel", + "graph": { + "nodes": [ + { + "id": 0, + "type": "schema", + "data": { + "title": "RunnableParallelInput", + "type": "object", + "properties": { + "question": { + "title": "Question" + } + } + } + }, + { + "id": 1, + "type": "schema", + "data": { + "title": "RunnableParallelOutput", + "type": "object", + "properties": { + "question": { + "title": "Question" + } } - }, - "required": [ - "messages" - ] + } + }, + { + "id": 2, + "type": "runnable", + "data": { + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "name": "RunnableLambda" + } + } + ], + "edges": [ + { + "source": 0, + "target": 2 + }, + { + "source": 2, + "target": 1 + } + ] + } + } + } + }, + "name": "RunnableParallel", + "graph": { + "nodes": [ + { + "id": 0, + "type": "schema", + "data": { + "title": "RunnableParallelInput", + "type": "object", + "properties": { + "key": { + "title": "Key" + }, + "question": { + "title": "Question" } } } }, { "id": 1, + "type": "schema", + "data": { + "title": "RunnableParallelOutput", + "type": "object", + "properties": { + "key": { + "title": "Key" + }, + "input": { + "title": "Input", + "type": "object" + } + } + } + }, + { + "id": 2, "type": "runnable", "data": { "id": [ - "tests", - "unit_tests", - "fake", - "llm", - "FakeStreamingListLLM" + "langchain_core", + "runnables", + "base", + "RunnableLambda" ], - "name": "FakeStreamingListLLM" + "name": "RunnableLambda" } }, { - "id": 2, - "type": "schema", + "id": 3, + "type": "runnable", "data": { - "title": "FakeStreamingListLLMOutput", - "type": "string" + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "name": "RunnableLambda" } } ], "edges": [ { "source": 0, + "target": 2 + }, + { + "source": 2, "target": 1 }, { - "source": 1, - "target": 2 + "source": 0, + "target": 3 + }, + { + "source": 3, + "target": 1 } ] } }, + "middle": [], + "last": { + "lc": 1, + "type": "not_implemented", + "id": [ + "langchain_core", + "runnables", + "base", + "RunnableLambda" + ], + "repr": "RunnableLambda(router)" + }, "name": null }, "name": "RunnableSequence", @@ -3320,18 +14746,78 @@ "id": 0, "type": "schema", "data": { - "title": "PromptInput", + "title": "RunnableParallelInput", "type": "object", "properties": { + "key": { + "title": "Key" + }, "question": { - "title": "Question", - "type": "string" + "title": "Question" } } } }, { "id": 1, + "type": "schema", + "data": { + "title": "RunnableParallelOutput", + "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": [ @@ -3344,7 +14830,7 @@ } }, { - "id": 2, + "id": 7, "type": "runnable", "data": { "id": [ @@ -3352,27 +14838,26 @@ "unit_tests", "fake", "llm", - "FakeStreamingListLLM" + "FakeListLLM" ], - "name": "FakeStreamingListLLM" + "name": "FakeListLLM" } }, { - "id": 3, + "id": 8, "type": "runnable", "data": { "id": [ - "tests", - "unit_tests", - "runnables", - "test_runnable", - "FakeSplitIntoListParser" + "langchain", + "prompts", + "chat", + "ChatPromptTemplate" ], - "name": "FakeSplitIntoListParser" + "name": "ChatPromptTemplate" } }, { - "id": 4, + "id": 9, "type": "runnable", "data": { "id": [ @@ -3380,39 +14865,55 @@ "unit_tests", "fake", "llm", - "FakeStreamingListLLM" + "FakeListLLM" ], - "name": "FakeStreamingListLLM" - } - }, - { - "id": 5, - "type": "schema", - "data": { - "title": "FakeStreamingListLLMOutput", - "type": "string" + "name": "FakeListLLM" } } ], "edges": [ { "source": 0, - "target": 1 - }, - { - "source": 1, "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": 3, + "source": 1, "target": 4 } ]