{ "openapi": "3.1.0", "info": { "title": "Data Agent Backend", "description": "DeepSeek Data Analysis Agent API", "version": "1.0" }, "paths": { "/upload": { "post": { "summary": "Upload Csv", "description": "前端上传 CSV 文件,后端保存并加载到内存 DataFrame", "operationId": "upload_csv_upload_post", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_upload_csv_upload_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/data-preview": { "get": { "summary": "Data Preview", "description": "获取当前数据的预览 (用于页面刷新后恢复显示)", "operationId": "data_preview_data_preview_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/agent/input_schema": { "get": { "tags": [ "agent" ], "summary": "Agent Input Schema", "description": "Return the input schema.", "operationId": "agent_input_schema_agent_input_schema_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/agent/c/{config_hash}/input_schema": { "get": { "tags": [ "agent/config" ], "summary": "Agent Input Schema With Config", "description": "Return the input schema.", "operationId": "agent_input_schema_with_config_agent_c__config_hash__input_schema_get", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/output_schema": { "get": { "tags": [ "agent" ], "summary": "Agent Output Schema", "description": "Return the output schema.", "operationId": "agent_output_schema_agent_output_schema_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/agent/c/{config_hash}/output_schema": { "get": { "tags": [ "agent/config" ], "summary": "Agent Output Schema With Config", "description": "Return the output schema.", "operationId": "agent_output_schema_with_config_agent_c__config_hash__output_schema_get", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/config_schema": { "get": { "tags": [ "agent" ], "summary": "Agent Config Schema", "description": "Return the config schema.", "operationId": "agent_config_schema_agent_config_schema_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } } } } }, "/agent/c/{config_hash}/config_schema": { "get": { "tags": [ "agent/config" ], "summary": "Agent Config Schema With Config", "description": "Return the config schema.", "operationId": "agent_config_schema_with_config_agent_c__config_hash__config_schema_get", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/token_feedback": { "post": { "summary": "Create Feedback From Token", "description": "Send feedback on an individual run to langsmith.", "operationId": "create_feedback_from_token_agent_token_feedback_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FeedbackCreateRequestTokenBased" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/invoke": { "post": { "tags": [ "agent" ], "summary": "Agent Invoke", "description": "Invoke the runnable with the given input and config.", "operationId": "agent_invoke_agent_invoke_post", "parameters": [ { "name": "config_hash", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentInvokeRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentInvokeResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/c/{config_hash}/invoke": { "post": { "tags": [ "agent/config" ], "summary": "Agent Invoke With Config", "description": "This endpoint is to be used with share links generated by the LangServe playground. The hash is an LZString compressed JSON string. For regular use cases, use the /invoke endpoint without the `c/{config_hash}` path parameter.", "operationId": "agent_invoke_with_config_agent_c__config_hash__invoke_post", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentInvokeRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentInvokeResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/batch": { "post": { "tags": [ "agent" ], "summary": "Agent Batch", "description": "Batch invoke the runnable with the given inputs and config.", "operationId": "agent_batch_agent_batch_post", "parameters": [ { "name": "config_hash", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentBatchRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentBatchResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/c/{config_hash}/batch": { "post": { "tags": [ "agent/config" ], "summary": "Agent Batch With Config", "description": "This endpoint is to be used with share links generated by the LangServe playground. The hash is an LZString compressed JSON string. For regular use cases, use the /batch endpoint without the `c/{config_hash}` path parameter.", "operationId": "agent_batch_with_config_agent_c__config_hash__batch_post", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentBatchRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentBatchResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/stream": { "post": { "tags": [ "agent" ], "summary": "Agent Stream", "description": "This endpoint allows to stream the output of the runnable. The endpoint uses a server sent event stream to stream the output. https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events", "operationId": "agent_stream_agent_stream_post", "parameters": [ { "name": "config_hash", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentStreamRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/c/{config_hash}/stream": { "post": { "tags": [ "agent/config" ], "summary": "Agent Stream With Config", "description": "This endpoint is to be used with share links generated by the LangServe playground. The hash is an LZString compressed JSON string. For regular use cases, use the /stream endpoint without the `c/{config_hash}` path parameter.", "operationId": "agent_stream_with_config_agent_c__config_hash__stream_post", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentStreamRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/stream_log": { "post": { "tags": [ "agent" ], "summary": "Agent Stream Log", "description": "Invoke the runnable stream_log the output.\n\nThis endpoint allows to stream the output of the runnable, including\nthe output of all intermediate steps.\n\nThe endpoint uses a server sent event stream to stream the output.\n\nhttps://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events\n\nImportant: Set the \"text/event-stream\" media type for request headers if\n not using an existing SDK.\n\nThis endpoint uses two different types of events:\n\n* data - for streaming the output of the runnable\n\n {\n \"event\": \"data\",\n \"data\": {\n ...\n }\n }\n\n* error - for signaling an error in the stream, also ends the stream.\n\n{\n \"event\": \"error\",\n \"data\": {\n \"status_code\": 500,\n \"message\": \"Internal Server Error\"\n }\n}\n\n* end - for signaling the end of the stream.\n\n This helps the client to know when to stop listening for events and\n know that the streaming has ended successfully.\n\n {\n \"event\": \"end\",\n }", "operationId": "agent_stream_log_agent_stream_log_post", "parameters": [ { "name": "config_hash", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentStreamLogRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/c/{config_hash}/stream_log": { "post": { "tags": [ "agent/config" ], "summary": "Agent Stream Log With Config", "description": "This endpoint is to be used with share links generated by the LangServe playground. The hash is an LZString compressed JSON string. For regular use cases, use the /stream_log endpoint without the `c/{config_hash}` path parameter.", "operationId": "agent_stream_log_with_config_agent_c__config_hash__stream_log_post", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentStreamLogRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/stream_events": { "post": { "tags": [ "agent" ], "summary": "Agent Stream Events", "description": "Stream events from the given runnable.\n\nThis endpoint allows to stream events from the runnable, including\nevents from all intermediate steps.\n\n**Attention**\n\n This is a new endpoint that only works for langchain-core >= 0.1.14.\n\n It belongs to a Beta API that may change in the future.\n\n**Important**\n Specify filters to the events you want to receive by setting\n the appropriate filters in the request body.\n\n This will help avoid sending too much data over the network.\n\n It will also prevent serialization issues with\n any unsupported types since it won't need to serialize events\n that aren't transmitted.\n\nThe endpoint uses a server sent event stream to stream the output.\n\nhttps://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events\n\nThe encoding of events follows the following format:\n\n* data - for streaming the output of the runnable\n\n {\n \"event\": \"data\",\n \"data\": {\n ...\n }\n }\n\n* error - for signaling an error in the stream, also ends the stream.\n\n{\n \"event\": \"error\",\n \"data\": {\n \"status_code\": 500,\n \"message\": \"Internal Server Error\"\n }\n}\n\n* end - for signaling the end of the stream.\n\n This helps the client to know when to stop listening for events and\n know that the streaming has ended successfully.\n\n {\n \"event\": \"end\",\n }\n\n`data` for the `data` event is a JSON object that corresponds\nto a serialized representation of a StreamEvent.\n\nSee LangChain documentation for more information about astream_events.", "operationId": "agent_stream_events_agent_stream_events_post", "parameters": [ { "name": "config_hash", "in": "query", "required": false, "schema": { "type": "string", "default": "", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentStreamEventsRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/agent/c/{config_hash}/stream_events": { "post": { "tags": [ "agent/config" ], "summary": "Agent Stream Events With Config", "description": "This endpoint is to be used with share links generated by the LangServe playground. The hash is an LZString compressed JSON string. For regular use cases, use the /stream_events endpoint without the `c/{config_hash}` path parameter.", "operationId": "agent_stream_events_with_config_agent_c__config_hash__stream_events_post", "parameters": [ { "name": "config_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Config Hash" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/agentStreamEventsRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } } }, "components": { "schemas": { "AIMessage-Input": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "ai", "title": "Type", "default": "ai" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "tool_calls": { "items": { "$ref": "#/components/schemas/ToolCall" }, "type": "array", "title": "Tool Calls", "default": [] }, "invalid_tool_calls": { "items": { "$ref": "#/components/schemas/InvalidToolCall" }, "type": "array", "title": "Invalid Tool Calls", "default": [] }, "usage_metadata": { "anyOf": [ { "$ref": "#/components/schemas/UsageMetadata" }, { "type": "null" } ] } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "AIMessage", "description": "Message from an AI.\n\nAn `AIMessage` is returned from a chat model as a response to a prompt.\n\nThis message represents the output of the model and consists of both\nthe raw output as returned by the model and standardized fields\n(e.g., tool calls, usage metadata) added by the LangChain framework." }, "AIMessage-Output": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "ai", "title": "Type", "default": "ai" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "tool_calls": { "items": { "$ref": "#/components/schemas/ToolCall" }, "type": "array", "title": "Tool Calls", "default": [] }, "invalid_tool_calls": { "items": { "$ref": "#/components/schemas/InvalidToolCall" }, "type": "array", "title": "Invalid Tool Calls", "default": [] }, "usage_metadata": { "anyOf": [ { "$ref": "#/components/schemas/UsageMetadata" }, { "type": "null" } ] } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "AIMessage", "description": "Message from an AI.\n\nAn `AIMessage` is returned from a chat model as a response to a prompt.\n\nThis message represents the output of the model and consists of both\nthe raw output as returned by the model and standardized fields\n(e.g., tool calls, usage metadata) added by the LangChain framework." }, "AIMessageChunk-Input": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "AIMessageChunk", "title": "Type", "default": "AIMessageChunk" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "tool_calls": { "items": { "$ref": "#/components/schemas/ToolCall" }, "type": "array", "title": "Tool Calls", "default": [] }, "invalid_tool_calls": { "items": { "$ref": "#/components/schemas/InvalidToolCall" }, "type": "array", "title": "Invalid Tool Calls", "default": [] }, "usage_metadata": { "anyOf": [ { "$ref": "#/components/schemas/UsageMetadata" }, { "type": "null" } ] }, "tool_call_chunks": { "items": { "$ref": "#/components/schemas/ToolCallChunk" }, "type": "array", "title": "Tool Call Chunks", "default": [] }, "chunk_position": { "anyOf": [ { "type": "string", "const": "last" }, { "type": "null" } ], "title": "Chunk Position" } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "AIMessageChunk", "description": "Message chunk from an AI (yielded when streaming)." }, "AIMessageChunk-Output": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "AIMessageChunk", "title": "Type", "default": "AIMessageChunk" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "tool_calls": { "items": { "$ref": "#/components/schemas/ToolCall" }, "type": "array", "title": "Tool Calls", "default": [] }, "invalid_tool_calls": { "items": { "$ref": "#/components/schemas/InvalidToolCall" }, "type": "array", "title": "Invalid Tool Calls", "default": [] }, "usage_metadata": { "anyOf": [ { "$ref": "#/components/schemas/UsageMetadata" }, { "type": "null" } ] }, "tool_call_chunks": { "items": { "$ref": "#/components/schemas/ToolCallChunk" }, "type": "array", "title": "Tool Call Chunks", "default": [] }, "chunk_position": { "anyOf": [ { "type": "string", "const": "last" }, { "type": "null" } ], "title": "Chunk Position" } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "AIMessageChunk", "description": "Message chunk from an AI (yielded when streaming)." }, "BatchResponseMetadata": { "properties": { "responses": { "items": { "$ref": "#/components/schemas/InvokeResponseMetadata" }, "type": "array", "title": "Responses" }, "run_ids": { "items": { "type": "string", "format": "uuid" }, "type": "array", "title": "Run Ids" } }, "type": "object", "required": [ "responses", "run_ids" ], "title": "BatchResponseMetadata", "description": "Represents response metadata used for batches of input/output LangServe\nresponses." }, "Body_upload_csv_upload_post": { "properties": { "file": { "type": "string", "format": "binary", "title": "File" } }, "type": "object", "required": [ "file" ], "title": "Body_upload_csv_upload_post" }, "ChatMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "chat", "title": "Type", "default": "chat" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "role": { "type": "string", "title": "Role" } }, "additionalProperties": true, "type": "object", "required": [ "content", "role" ], "title": "ChatMessage", "description": "Message that can be assigned an arbitrary speaker (i.e. role)." }, "ChatMessageChunk": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "ChatMessageChunk", "title": "Type", "default": "ChatMessageChunk" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "role": { "type": "string", "title": "Role" } }, "additionalProperties": true, "type": "object", "required": [ "content", "role" ], "title": "ChatMessageChunk", "description": "Chat Message chunk." }, "FeedbackCreateRequestTokenBased": { "properties": { "token_or_url": { "anyOf": [ { "type": "string", "format": "uuid" }, { "type": "string" } ], "title": "Token Or Url" }, "score": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "null" } ], "title": "Score" }, "value": { "anyOf": [ { "type": "number" }, { "type": "integer" }, { "type": "boolean" }, { "type": "string" }, { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Value" }, "comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Comment" }, "correction": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Correction" }, "metadata": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "title": "Metadata" } }, "type": "object", "required": [ "token_or_url" ], "title": "FeedbackCreateRequestTokenBased", "description": "Shared information between create requests of feedback and feedback objects." }, "FeedbackToken": { "properties": { "key": { "type": "string", "title": "Key" }, "token_url": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Token Url" }, "expires_at": { "anyOf": [ { "type": "string", "format": "date-time" }, { "type": "null" } ], "title": "Expires At" } }, "type": "object", "required": [ "key" ], "title": "FeedbackToken", "description": "Represents the feedback tokens for a given request." }, "FunctionMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "function", "title": "Type", "default": "function" }, "name": { "type": "string", "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" } }, "additionalProperties": true, "type": "object", "required": [ "content", "name" ], "title": "FunctionMessage", "description": "Message for passing the result of executing a tool back to a model.\n\n`FunctionMessage` are an older version of the `ToolMessage` schema, and\ndo not contain the `tool_call_id` field.\n\nThe `tool_call_id` field is used to associate the tool call request with the\ntool call response. Useful in situations where a chat model is able\nto request multiple tool calls in parallel." }, "FunctionMessageChunk": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "FunctionMessageChunk", "title": "Type", "default": "FunctionMessageChunk" }, "name": { "type": "string", "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" } }, "additionalProperties": true, "type": "object", "required": [ "content", "name" ], "title": "FunctionMessageChunk", "description": "Function Message chunk." }, "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "HumanMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "human", "title": "Type", "default": "human" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "HumanMessage", "description": "Message from the user.\n\nA `HumanMessage` is a message that is passed in from a user to the model.\n\nExample:\n ```python\n from langchain_core.messages import HumanMessage, SystemMessage\n\n messages = [\n SystemMessage(content=\"You are a helpful assistant! Your name is Bob.\"),\n HumanMessage(content=\"What is your name?\"),\n ]\n\n # Instantiate a chat model and invoke it with the messages\n model = ...\n print(model.invoke(messages))\n ```" }, "HumanMessageChunk": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "HumanMessageChunk", "title": "Type", "default": "HumanMessageChunk" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "HumanMessageChunk", "description": "Human Message chunk." }, "InputSchema": { "properties": { "messages": { "items": { "oneOf": [ { "$ref": "#/components/schemas/AIMessage-Input" }, { "$ref": "#/components/schemas/HumanMessage" }, { "$ref": "#/components/schemas/ChatMessage" }, { "$ref": "#/components/schemas/SystemMessage" }, { "$ref": "#/components/schemas/FunctionMessage" }, { "$ref": "#/components/schemas/ToolMessage" }, { "$ref": "#/components/schemas/AIMessageChunk-Input" }, { "$ref": "#/components/schemas/HumanMessageChunk" }, { "$ref": "#/components/schemas/ChatMessageChunk" }, { "$ref": "#/components/schemas/SystemMessageChunk" }, { "$ref": "#/components/schemas/FunctionMessageChunk" }, { "$ref": "#/components/schemas/ToolMessageChunk" } ] }, "type": "array", "title": "Messages" } }, "type": "object", "required": [ "messages" ], "title": "InputSchema" }, "InputTokenDetails": { "properties": { "audio": { "type": "integer", "title": "Audio" }, "cache_creation": { "type": "integer", "title": "Cache Creation" }, "cache_read": { "type": "integer", "title": "Cache Read" } }, "additionalProperties": true, "type": "object", "title": "InputTokenDetails", "description": "Breakdown of input token counts.\n\nDoes *not* need to sum to full input token count. Does *not* need to have all keys.\n\nExample:\n ```python\n {\n \"audio\": 10,\n \"cache_creation\": 200,\n \"cache_read\": 100,\n }\n ```\n\nMay also hold extra provider-specific keys.\n\n!!! version-added \"Added in `langchain-core` 0.3.9\"" }, "InvalidToolCall": { "properties": { "type": { "type": "string", "const": "invalid_tool_call", "title": "Type" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "args": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Args" }, "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Error" }, "index": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "title": "Index" }, "extras": { "additionalProperties": true, "type": "object", "title": "Extras" } }, "additionalProperties": true, "type": "object", "required": [ "type", "id", "name", "args", "error" ], "title": "InvalidToolCall", "description": "Allowance for errors made by LLM.\n\nHere we add an `error` key to surface errors made during generation\n(e.g., invalid JSON arguments.)" }, "InvokeResponseMetadata": { "properties": { "run_id": { "type": "string", "format": "uuid", "title": "Run Id" }, "feedback_tokens": { "items": { "$ref": "#/components/schemas/FeedbackToken" }, "type": "array", "title": "Feedback Tokens", "description": "Feedback tokens from the given run.These tokens allow a user to provide feedback on the run.Only available if server was configured to provide feedback tokens." } }, "type": "object", "required": [ "run_id", "feedback_tokens" ], "title": "InvokeResponseMetadata", "description": "Represents response metadata used for just single input/output LangServe\nresponses." }, "LangGraphInput": { "$ref": "#/components/schemas/InputSchema", "title": "LangGraphInput" }, "LangGraphOutput": { "properties": { "messages": { "items": { "oneOf": [ { "$ref": "#/components/schemas/AIMessage-Output" }, { "$ref": "#/components/schemas/HumanMessage" }, { "$ref": "#/components/schemas/ChatMessage" }, { "$ref": "#/components/schemas/SystemMessage" }, { "$ref": "#/components/schemas/FunctionMessage" }, { "$ref": "#/components/schemas/ToolMessage" }, { "$ref": "#/components/schemas/AIMessageChunk-Output" }, { "$ref": "#/components/schemas/HumanMessageChunk" }, { "$ref": "#/components/schemas/ChatMessageChunk" }, { "$ref": "#/components/schemas/SystemMessageChunk" }, { "$ref": "#/components/schemas/FunctionMessageChunk" }, { "$ref": "#/components/schemas/ToolMessageChunk" } ] }, "type": "array", "title": "Messages" }, "structured_response": { "title": "Structured Response" } }, "type": "object", "title": "LangGraphOutput" }, "OutputTokenDetails": { "properties": { "audio": { "type": "integer", "title": "Audio" }, "reasoning": { "type": "integer", "title": "Reasoning" } }, "additionalProperties": true, "type": "object", "title": "OutputTokenDetails", "description": "Breakdown of output token counts.\n\nDoes *not* need to sum to full output token count. Does *not* need to have all keys.\n\nExample:\n ```python\n {\n \"audio\": 10,\n \"reasoning\": 200,\n }\n ```\n\nMay also hold extra provider-specific keys.\n\n!!! version-added \"Added in `langchain-core` 0.3.9\"" }, "SystemMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "system", "title": "Type", "default": "system" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "SystemMessage", "description": "Message for priming AI behavior.\n\nThe system message is usually passed in as the first of a sequence\nof input messages.\n\nExample:\n ```python\n from langchain_core.messages import HumanMessage, SystemMessage\n\n messages = [\n SystemMessage(content=\"You are a helpful assistant! Your name is Bob.\"),\n HumanMessage(content=\"What is your name?\"),\n ]\n\n # Define a chat model and invoke it with the messages\n print(model.invoke(messages))\n ```" }, "SystemMessageChunk": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "SystemMessageChunk", "title": "Type", "default": "SystemMessageChunk" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" } }, "additionalProperties": true, "type": "object", "required": [ "content" ], "title": "SystemMessageChunk", "description": "System Message chunk." }, "ToolCall": { "properties": { "name": { "type": "string", "title": "Name" }, "args": { "additionalProperties": true, "type": "object", "title": "Args" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "type": { "type": "string", "const": "tool_call", "title": "Type" } }, "additionalProperties": true, "type": "object", "required": [ "name", "args", "id" ], "title": "ToolCall", "description": "Represents an AI's request to call a tool.\n\nExample:\n ```python\n {\"name\": \"foo\", \"args\": {\"a\": 1}, \"id\": \"123\"}\n ```\n\n This represents a request to call the tool named `'foo'` with arguments\n `{\"a\": 1}` and an identifier of `'123'`." }, "ToolCallChunk": { "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "args": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Args" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "index": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Index" }, "type": { "type": "string", "const": "tool_call_chunk", "title": "Type" } }, "additionalProperties": true, "type": "object", "required": [ "name", "args", "id", "index" ], "title": "ToolCallChunk", "description": "A chunk of a tool call (yielded when streaming).\n\nWhen merging `ToolCallChunk`s (e.g., via `AIMessageChunk.__add__`),\nall string attributes are concatenated. Chunks are only merged if their\nvalues of `index` are equal and not None.\n\nExample:\n```python\nleft_chunks = [ToolCallChunk(name=\"foo\", args='{\"a\":', index=0)]\nright_chunks = [ToolCallChunk(name=None, args=\"1}\", index=0)]\n\n(\n AIMessageChunk(content=\"\", tool_call_chunks=left_chunks)\n + AIMessageChunk(content=\"\", tool_call_chunks=right_chunks)\n).tool_call_chunks == [ToolCallChunk(name=\"foo\", args='{\"a\":1}', index=0)]\n```" }, "ToolMessage": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "tool", "title": "Type", "default": "tool" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "tool_call_id": { "type": "string", "title": "Tool Call Id" }, "artifact": { "title": "Artifact" }, "status": { "type": "string", "enum": [ "success", "error" ], "title": "Status", "default": "success" } }, "additionalProperties": true, "type": "object", "required": [ "content", "tool_call_id" ], "title": "ToolMessage", "description": "Message for passing the result of executing a tool back to a model.\n\n`ToolMessage` objects contain the result of a tool invocation. Typically, the result\nis encoded inside the `content` field.\n\nExample: A `ToolMessage` representing a result of `42` from a tool call with id\n\n```python\nfrom langchain_core.messages import ToolMessage\n\nToolMessage(content=\"42\", tool_call_id=\"call_Jja7J89XsjrOLA5r!MEOW!SL\")\n```\n\nExample: A `ToolMessage` where only part of the tool output is sent to the model\nand the full output is passed in to artifact.\n\n```python\nfrom langchain_core.messages import ToolMessage\n\ntool_output = {\n \"stdout\": \"From the graph we can see that the correlation between \"\n \"x and y is ...\",\n \"stderr\": None,\n \"artifacts\": {\"type\": \"image\", \"base64_data\": \"/9j/4gIcSU...\"},\n}\n\nToolMessage(\n content=tool_output[\"stdout\"],\n artifact=tool_output,\n tool_call_id=\"call_Jja7J89XsjrOLA5r!MEOW!SL\",\n)\n```\n\nThe `tool_call_id` field is used to associate the tool call request with the\ntool call response. Useful in situations where a chat model is able\nto request multiple tool calls in parallel." }, "ToolMessageChunk": { "properties": { "content": { "anyOf": [ { "type": "string" }, { "items": { "anyOf": [ { "type": "string" }, { "additionalProperties": true, "type": "object" } ] }, "type": "array" } ], "title": "Content" }, "additional_kwargs": { "additionalProperties": true, "type": "object", "title": "Additional Kwargs" }, "response_metadata": { "additionalProperties": true, "type": "object", "title": "Response Metadata" }, "type": { "type": "string", "const": "ToolMessageChunk", "title": "Type", "default": "ToolMessageChunk" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Id" }, "tool_call_id": { "type": "string", "title": "Tool Call Id" }, "artifact": { "title": "Artifact" }, "status": { "type": "string", "enum": [ "success", "error" ], "title": "Status", "default": "success" } }, "additionalProperties": true, "type": "object", "required": [ "content", "tool_call_id" ], "title": "ToolMessageChunk", "description": "Tool Message chunk." }, "UsageMetadata": { "properties": { "input_tokens": { "type": "integer", "title": "Input Tokens" }, "output_tokens": { "type": "integer", "title": "Output Tokens" }, "total_tokens": { "type": "integer", "title": "Total Tokens" }, "input_token_details": { "$ref": "#/components/schemas/InputTokenDetails" }, "output_token_details": { "$ref": "#/components/schemas/OutputTokenDetails" } }, "additionalProperties": true, "type": "object", "required": [ "input_tokens", "output_tokens", "total_tokens" ], "title": "UsageMetadata", "description": "Usage metadata for a message, such as token counts.\n\nThis is a standard representation of token usage that is consistent across models.\n\nExample:\n ```python\n {\n \"input_tokens\": 350,\n \"output_tokens\": 240,\n \"total_tokens\": 590,\n \"input_token_details\": {\n \"audio\": 10,\n \"cache_creation\": 200,\n \"cache_read\": 100,\n },\n \"output_token_details\": {\n \"audio\": 10,\n \"reasoning\": 200,\n },\n }\n ```\n\n!!! warning \"Behavior changed in `langchain-core` 0.3.9\"\n Added `input_token_details` and `output_token_details`.\n\n!!! note \"LangSmith SDK\"\n The LangSmith SDK also has a `UsageMetadata` class. While the two share fields,\n LangSmith's `UsageMetadata` has additional fields to capture cost information\n used by the LangSmith platform." }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "agentBatchRequest": { "properties": { "inputs": { "items": { "$ref": "#/components/schemas/LangGraphInput" }, "type": "array", "title": "Inputs" }, "config": { "anyOf": [ { "$ref": "#/components/schemas/agentLangGraphConfig" }, { "items": { "$ref": "#/components/schemas/agentLangGraphConfig" }, "type": "array" } ], "title": "Config", "description": "Subset of RunnableConfig object in LangChain. Either specify one config for all inputs or a list of configs with one per input. Useful for passing information like tags, metadata etc." }, "kwargs": { "additionalProperties": true, "type": "object", "title": "Kwargs", "description": "Keyword arguments to the runnable. Currently ignored." } }, "type": "object", "required": [ "inputs" ], "title": "agentBatchRequest" }, "agentBatchResponse": { "properties": { "output": { "items": { "$ref": "#/components/schemas/LangGraphOutput" }, "type": "array", "title": "Output", "description": "The outputs corresponding to the inputs the batch request." }, "metadata": { "$ref": "#/components/schemas/BatchResponseMetadata", "description": "Metadata about the response that may be useful to specific clients" } }, "type": "object", "required": [ "output", "metadata" ], "title": "agentBatchResponse" }, "agentInvokeRequest": { "properties": { "input": { "$ref": "#/components/schemas/LangGraphInput", "description": "The input to the runnable." }, "config": { "$ref": "#/components/schemas/agentLangGraphConfig", "description": "Subset of RunnableConfig object in LangChain. Useful for passing information like tags, metadata etc." }, "kwargs": { "additionalProperties": true, "type": "object", "title": "Kwargs", "description": "Keyword arguments to the runnable. Currently ignored." } }, "type": "object", "required": [ "input" ], "title": "agentInvokeRequest" }, "agentInvokeResponse": { "properties": { "output": { "$ref": "#/components/schemas/LangGraphOutput", "description": "The output of the invocation." }, "metadata": { "$ref": "#/components/schemas/InvokeResponseMetadata", "description": "Metadata about the response that may be useful to specific clients" } }, "type": "object", "required": [ "output", "metadata" ], "title": "agentInvokeResponse" }, "agentLangGraphConfig": { "properties": {}, "type": "object", "title": "agentLangGraphConfig" }, "agentStreamEventsRequest": { "properties": { "input": { "$ref": "#/components/schemas/LangGraphInput" }, "config": { "$ref": "#/components/schemas/agentLangGraphConfig" }, "include_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Include Names", "description": "If specified, filter to runnables with matching names" }, "include_types": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Include Types", "description": "If specified, filter to runnables with matching types" }, "include_tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Include Tags", "description": "If specified, filter to runnables with matching tags" }, "exclude_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exclude Names", "description": "If specified, exclude runnables with matching names" }, "exclude_types": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exclude Types", "description": "If specified, exclude runnables with matching types" }, "exclude_tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exclude Tags", "description": "If specified, exclude runnables with matching tags" }, "kwargs": { "additionalProperties": true, "type": "object", "title": "Kwargs" } }, "type": "object", "required": [ "input" ], "title": "agentStreamEventsRequest" }, "agentStreamLogRequest": { "properties": { "input": { "$ref": "#/components/schemas/LangGraphInput" }, "config": { "$ref": "#/components/schemas/agentLangGraphConfig" }, "include_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Include Names", "description": "If specified, filter to runnables with matching names" }, "include_types": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Include Types", "description": "If specified, filter to runnables with matching types" }, "include_tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Include Tags", "description": "If specified, filter to runnables with matching tags" }, "exclude_names": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exclude Names", "description": "If specified, exclude runnables with matching names" }, "exclude_types": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exclude Types", "description": "If specified, exclude runnables with matching types" }, "exclude_tags": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exclude Tags", "description": "If specified, exclude runnables with matching tags" }, "kwargs": { "additionalProperties": true, "type": "object", "title": "Kwargs" } }, "type": "object", "required": [ "input" ], "title": "agentStreamLogRequest" }, "agentStreamRequest": { "properties": { "input": { "$ref": "#/components/schemas/LangGraphInput", "description": "The input to the runnable." }, "config": { "$ref": "#/components/schemas/agentLangGraphConfig", "description": "Subset of RunnableConfig object in LangChain. Useful for passing information like tags, metadata etc." }, "kwargs": { "additionalProperties": true, "type": "object", "title": "Kwargs", "description": "Keyword arguments to the runnable. Currently ignored." } }, "type": "object", "required": [ "input" ], "title": "agentStreamRequest" } } }, "tags": [ { "name": "agent" }, { "name": "agent/config", "description": "Endpoints with a default configuration set by `config_hash` path parameter. Used in conjunction with share links generated using the LangServe UI playground. The hash is an LZString compressed JSON string." } ] }