diff --git a/cn/.gitbook/assets/1.jpg b/cn/.gitbook/assets/1.jpg new file mode 100644 index 00000000..1452a2b2 Binary files /dev/null and b/cn/.gitbook/assets/1.jpg differ diff --git a/cn/.gitbook/assets/2.png b/cn/.gitbook/assets/2.png new file mode 100644 index 00000000..aa69c6bc Binary files /dev/null and b/cn/.gitbook/assets/2.png differ diff --git a/cn/.gitbook/assets/3.png b/cn/.gitbook/assets/3.png new file mode 100644 index 00000000..d8f1242f Binary files /dev/null and b/cn/.gitbook/assets/3.png differ diff --git a/cn/.gitbook/assets/4.png b/cn/.gitbook/assets/4.png new file mode 100644 index 00000000..198cf347 Binary files /dev/null and b/cn/.gitbook/assets/4.png differ diff --git a/cn/.gitbook/assets/Agentic RAG V2.json b/cn/.gitbook/assets/Agentic RAG V2.json new file mode 100644 index 00000000..c37df8a9 --- /dev/null +++ b/cn/.gitbook/assets/Agentic RAG V2.json @@ -0,0 +1,2168 @@ +{ + "description": "An agent based approach using AgentflowV2 to perform self-correcting question answering over documents", + "usecases": ["Reflective Agent"], + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": -261.54516755177303, + "y": 62.39402454297252 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": ["Start"], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": false + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": false + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": false + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar" + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "chatInput", + "formTitle": "", + "formDescription": "", + "formInputTypes": "", + "startState": [ + { + "key": "query", + "value": "" + } + ] + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 101, + "height": 65, + "selected": false, + "positionAbsolute": { + "x": -261.54516755177303, + "y": 62.39402454297252 + }, + "dragging": false + }, + { + "id": "conditionAgentAgentflow_0", + "position": { + "x": -114.84790789259606, + "y": 53.22583468442305 + }, + "data": { + "id": "conditionAgentAgentflow_0", + "label": "Check if query valid", + "version": 1, + "name": "conditionAgentAgentflow", + "type": "ConditionAgent", + "color": "#ff8fab", + "baseClasses": ["ConditionAgent"], + "category": "Agent Flows", + "description": "Utilize an agent to split flows based on dynamic conditions", + "inputParams": [ + { + "label": "Model", + "name": "conditionAgentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "conditionAgentAgentflow_0-input-conditionAgentModel-asyncOptions", + "display": true + }, + { + "label": "Instructions", + "name": "conditionAgentInstructions", + "type": "string", + "description": "A general instructions of what the condition agent should do", + "rows": 4, + "acceptVariable": true, + "placeholder": "Determine if the user is interested in learning about AI", + "id": "conditionAgentAgentflow_0-input-conditionAgentInstructions-string", + "display": true + }, + { + "label": "Input", + "name": "conditionAgentInput", + "type": "string", + "description": "Input to be used for the condition agent", + "rows": 4, + "acceptVariable": true, + "default": "

{{ question }}

", + "id": "conditionAgentAgentflow_0-input-conditionAgentInput-string", + "display": true + }, + { + "label": "Scenarios", + "name": "conditionAgentScenarios", + "description": "Define the scenarios that will be used as the conditions to split the flow", + "type": "array", + "array": [ + { + "label": "Scenario", + "name": "scenario", + "type": "string", + "placeholder": "User is asking for a pizza" + } + ], + "default": [ + { + "scenario": "AI Related" + }, + { + "scenario": "General" + } + ], + "id": "conditionAgentAgentflow_0-input-conditionAgentScenarios-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "conditionAgentModel": "chatOpenAI", + "conditionAgentInstructions": "

Check if user is asking about AI related topic, or just general query

", + "conditionAgentInput": "

{{ question }}

", + "conditionAgentScenarios": [ + { + "scenario": "AI Related" + }, + { + "scenario": "General" + } + ], + "conditionAgentModelConfig": { + "credential": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "conditionAgentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "conditionAgentAgentflow_0-output-0", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + }, + { + "id": "conditionAgentAgentflow_0-output-1", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + } + ], + "outputs": { + "conditionAgentAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 190, + "height": 80, + "selected": false, + "positionAbsolute": { + "x": -114.84790789259606, + "y": 53.22583468442305 + }, + "dragging": false + }, + { + "id": "llmAgentflow_0", + "position": { + "x": 158.29022963739308, + "y": -20.666608318859062 + }, + "data": { + "id": "llmAgentflow_0", + "label": "Generate Query", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": ["LLM"], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_0-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_0-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_0-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_0-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_0-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_0-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_0-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatOpenAI", + "llmMessages": [ + { + "role": "system", + "content": "

Given the user question and history, construct a short string that can be used for searching vector database. Only generate the query, no meta comments, no explanation

Example:

Question: what are the events happening today?

Query: today's event

Example:

Question: how about the address?

Query: business address of the shop

Question: {{ question }}

Query:

" + } + ], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": "", + "llmUpdateState": [ + { + "key": "query", + "value": "

{{ output }}

" + } + ], + "llmModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "llmModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_0-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 168, + "height": 71, + "selected": false, + "positionAbsolute": { + "x": 158.29022963739308, + "y": -20.666608318859062 + }, + "dragging": false + }, + { + "id": "llmAgentflow_1", + "position": { + "x": 165.82871786911647, + "y": 92.15131805222342 + }, + "data": { + "id": "llmAgentflow_1", + "label": "General Answer", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": ["LLM"], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_1-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_1-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_1-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_1-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_1-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_1-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_1-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_1-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_1-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_1-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatOpenAI", + "llmMessages": [], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": "", + "llmUpdateState": "", + "llmModelConfig": { + "credential": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "llmModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_1-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 168, + "height": 71, + "selected": false, + "positionAbsolute": { + "x": 165.82871786911647, + "y": 92.15131805222342 + }, + "dragging": false + }, + { + "id": "retrieverAgentflow_0", + "position": { + "x": 396.87575963946966, + "y": -17.41189617164227 + }, + "data": { + "id": "retrieverAgentflow_0", + "label": "Retriever Vector DB", + "version": 1, + "name": "retrieverAgentflow", + "type": "Retriever", + "color": "#b8bedd", + "baseClasses": ["Retriever"], + "category": "Agent Flows", + "description": "Retrieve information from vector database", + "inputParams": [ + { + "label": "Knowledge (Document Stores)", + "name": "retrieverKnowledgeDocumentStores", + "type": "array", + "description": "Document stores to retrieve information from. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + } + ], + "id": "retrieverAgentflow_0-input-retrieverKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Retriever Query", + "name": "retrieverQuery", + "type": "string", + "placeholder": "Enter your query here", + "rows": 4, + "acceptVariable": true, + "id": "retrieverAgentflow_0-input-retrieverQuery-string", + "display": true + }, + { + "label": "Output Format", + "name": "outputFormat", + "type": "options", + "options": [ + { + "label": "Text", + "name": "text" + }, + { + "label": "Text with Metadata", + "name": "textWithMetadata" + } + ], + "default": "text", + "id": "retrieverAgentflow_0-input-outputFormat-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "retrieverUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "retrieverAgentflow_0-input-retrieverUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "retrieverKnowledgeDocumentStores": [ + { + "documentStore": "570df92b-087b-4d3b-9462-7a11283454a5:ai paper" + } + ], + "retrieverQuery": "

{{ $flow.state.query }}

", + "outputFormat": "text", + "retrieverUpdateState": "" + }, + "outputAnchors": [ + { + "id": "retrieverAgentflow_0-output-retrieverAgentflow", + "label": "Retriever", + "name": "retrieverAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 190, + "height": 65, + "selected": false, + "positionAbsolute": { + "x": 396.87575963946966, + "y": -17.41189617164227 + }, + "dragging": false + }, + { + "id": "conditionAgentAgentflow_1", + "position": { + "x": 647.9586712853835, + "y": -24.93225611691784 + }, + "data": { + "id": "conditionAgentAgentflow_1", + "label": "Check if docs relevant", + "version": 1, + "name": "conditionAgentAgentflow", + "type": "ConditionAgent", + "color": "#ff8fab", + "baseClasses": ["ConditionAgent"], + "category": "Agent Flows", + "description": "Utilize an agent to split flows based on dynamic conditions", + "inputParams": [ + { + "label": "Model", + "name": "conditionAgentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "conditionAgentAgentflow_1-input-conditionAgentModel-asyncOptions", + "display": true + }, + { + "label": "Instructions", + "name": "conditionAgentInstructions", + "type": "string", + "description": "A general instructions of what the condition agent should do", + "rows": 4, + "acceptVariable": true, + "placeholder": "Determine if the user is interested in learning about AI", + "id": "conditionAgentAgentflow_1-input-conditionAgentInstructions-string", + "display": true + }, + { + "label": "Input", + "name": "conditionAgentInput", + "type": "string", + "description": "Input to be used for the condition agent", + "rows": 4, + "acceptVariable": true, + "default": "

{{ question }}

", + "id": "conditionAgentAgentflow_1-input-conditionAgentInput-string", + "display": true + }, + { + "label": "Scenarios", + "name": "conditionAgentScenarios", + "description": "Define the scenarios that will be used as the conditions to split the flow", + "type": "array", + "array": [ + { + "label": "Scenario", + "name": "scenario", + "type": "string", + "placeholder": "User is asking for a pizza" + } + ], + "default": [ + { + "scenario": "Relevant" + }, + { + "scenario": "Irrelevant" + } + ], + "id": "conditionAgentAgentflow_1-input-conditionAgentScenarios-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "conditionAgentModel": "chatOpenAI", + "conditionAgentInstructions": "

Determine if the document is relevant to user question. User question is {{ question }}

", + "conditionAgentInput": "

{{ retrieverAgentflow_0 }}

", + "conditionAgentScenarios": [ + { + "scenario": "Relevant" + }, + { + "scenario": "Irrelevant" + } + ], + "conditionAgentModelConfig": { + "credential": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "conditionAgentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "conditionAgentAgentflow_1-output-0", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + }, + { + "id": "conditionAgentAgentflow_1-output-1", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + } + ], + "outputs": { + "conditionAgentAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 206, + "height": 80, + "selected": false, + "positionAbsolute": { + "x": 647.9586712853835, + "y": -24.93225611691784 + }, + "dragging": false + }, + { + "id": "llmAgentflow_2", + "position": { + "x": 920.5416793343077, + "y": -75.82606372993476 + }, + "data": { + "id": "llmAgentflow_2", + "label": "Generate Response", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": ["LLM"], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_2-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_2-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_2-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_2-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_2-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_2-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_2-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_2-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_2-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_2-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatOpenAI", + "llmMessages": "", + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "

Given the question: {{ question }}

And the findings: {{ retrieverAgentflow_0 }}

Output the final response

", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": "", + "llmUpdateState": "", + "llmModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "llmModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_2-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 190, + "height": 71, + "selected": false, + "positionAbsolute": { + "x": 920.5416793343077, + "y": -75.82606372993476 + }, + "dragging": false + }, + { + "id": "llmAgentflow_3", + "position": { + "x": 921.1014768144131, + "y": 26.898902739007895 + }, + "data": { + "id": "llmAgentflow_3", + "label": "Regenerate Question", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": ["LLM"], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_3-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_3-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_3-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_3-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_3-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_3-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_3-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_3-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_3-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_3-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatOpenAI", + "llmMessages": [ + { + "role": "system", + "content": "

You are a helpful assistant that can transform the query to produce a better question.

" + } + ], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "

Look at the input and try to reason about the underlying semantic intent / meaning.

Here is the initial question:

{{ $flow.state.query }}

Formulate an improved question:

", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": "", + "llmUpdateState": [ + { + "key": "query", + "value": "

{{ output }}

" + } + ], + "llmModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "llmModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_3-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 199, + "height": 71, + "selected": false, + "positionAbsolute": { + "x": 921.1014768144131, + "y": 26.898902739007895 + }, + "dragging": false + }, + { + "id": "loopAgentflow_0", + "position": { + "x": 1160.0553838519766, + "y": 30.06685001229809 + }, + "data": { + "id": "loopAgentflow_0", + "label": "Loop back to Retriever", + "version": 1, + "name": "loopAgentflow", + "type": "Loop", + "color": "#FFA07A", + "hideOutput": true, + "baseClasses": ["Loop"], + "category": "Agent Flows", + "description": "Loop back to a previous node", + "inputParams": [ + { + "label": "Loop Back To", + "name": "loopBackToNode", + "type": "asyncOptions", + "loadMethod": "listPreviousNodes", + "freeSolo": true, + "id": "loopAgentflow_0-input-loopBackToNode-asyncOptions", + "display": true + }, + { + "label": "Max Loop Count", + "name": "maxLoopCount", + "type": "number", + "default": 5, + "id": "loopAgentflow_0-input-maxLoopCount-number", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "loopBackToNode": "retrieverAgentflow_0-Retriever Vector DB", + "maxLoopCount": 5 + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 208, + "height": 65, + "selected": false, + "positionAbsolute": { + "x": 1160.0553838519766, + "y": 30.06685001229809 + }, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_0", + "position": { + "x": 145.5705985486235, + "y": -116.29641765720946 + }, + "data": { + "id": "stickyNoteAgentflow_0", + "label": "Sticky Note", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": ["StickyNote"], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_0-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "First update of the state.query" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_0-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 189, + "height": 81, + "selected": false, + "positionAbsolute": { + "x": 145.5705985486235, + "y": -116.29641765720946 + }, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_1", + "position": { + "x": 923.4413972289242, + "y": 110.04672879978278 + }, + "data": { + "id": "stickyNoteAgentflow_1", + "label": "Sticky Note (1)", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": ["StickyNote"], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_1-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "Second update of state.query" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_1-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 189, + "height": 81, + "selected": false, + "positionAbsolute": { + "x": 923.4413972289242, + "y": 110.04672879978278 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-0", + "target": "llmAgentflow_0", + "targetHandle": "llmAgentflow_0", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#64B5F6", + "edgeLabel": "0", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-0-llmAgentflow_0-llmAgentflow_0" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-1", + "target": "llmAgentflow_1", + "targetHandle": "llmAgentflow_1", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#64B5F6", + "edgeLabel": "1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-1-llmAgentflow_1-llmAgentflow_1" + }, + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "conditionAgentAgentflow_0", + "targetHandle": "conditionAgentAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#ff8fab", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-conditionAgentAgentflow_0-conditionAgentAgentflow_0" + }, + { + "source": "llmAgentflow_0", + "sourceHandle": "llmAgentflow_0-output-llmAgentflow", + "target": "retrieverAgentflow_0", + "targetHandle": "retrieverAgentflow_0", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#b8bedd", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-retrieverAgentflow_0-retrieverAgentflow_0" + }, + { + "source": "retrieverAgentflow_0", + "sourceHandle": "retrieverAgentflow_0-output-retrieverAgentflow", + "target": "conditionAgentAgentflow_1", + "targetHandle": "conditionAgentAgentflow_1", + "data": { + "sourceColor": "#b8bedd", + "targetColor": "#ff8fab", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "retrieverAgentflow_0-retrieverAgentflow_0-output-retrieverAgentflow-conditionAgentAgentflow_1-conditionAgentAgentflow_1" + }, + { + "source": "llmAgentflow_3", + "sourceHandle": "llmAgentflow_3-output-llmAgentflow", + "target": "loopAgentflow_0", + "targetHandle": "loopAgentflow_0", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#FFA07A", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_3-llmAgentflow_3-output-llmAgentflow-loopAgentflow_0-loopAgentflow_0" + }, + { + "source": "conditionAgentAgentflow_1", + "sourceHandle": "conditionAgentAgentflow_1-output-1", + "target": "llmAgentflow_3", + "targetHandle": "llmAgentflow_3", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#64B5F6", + "edgeLabel": "1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_1-conditionAgentAgentflow_1-output-1-llmAgentflow_3-llmAgentflow_3" + }, + { + "source": "conditionAgentAgentflow_1", + "sourceHandle": "conditionAgentAgentflow_1-output-0", + "target": "llmAgentflow_2", + "targetHandle": "llmAgentflow_2", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#64B5F6", + "edgeLabel": "0", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_1-conditionAgentAgentflow_1-output-0-llmAgentflow_2-llmAgentflow_2" + } + ] +} diff --git a/cn/.gitbook/assets/Collage_Horizontal.png b/cn/.gitbook/assets/Collage_Horizontal.png new file mode 100644 index 00000000..b9055b37 Binary files /dev/null and b/cn/.gitbook/assets/Collage_Horizontal.png differ diff --git a/cn/.gitbook/assets/Customer Support Agents.json b/cn/.gitbook/assets/Customer Support Agents.json new file mode 100644 index 00000000..73e9519d --- /dev/null +++ b/cn/.gitbook/assets/Customer Support Agents.json @@ -0,0 +1,1512 @@ +{ + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": -142.48525859587886, + "y": 159.99117861928372 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": true + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": true + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": true + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true, + "display": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar" + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "formInput", + "formTitle": "Inquiry", + "formDescription": "Customer Inquiry", + "formInputTypes": [ + { + "type": "string", + "label": "Subject", + "name": "subject", + "addOptions": "" + }, + { + "type": "string", + "label": "Body", + "name": "body", + "addOptions": "" + } + ], + "startState": "" + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": -142.48525859587886, + "y": 159.99117861928372 + }, + "dragging": false + }, + { + "id": "conditionAgentAgentflow_0", + "position": { + "x": -8.296983647330677, + "y": 142.81116471739003 + }, + "data": { + "id": "conditionAgentAgentflow_0", + "label": "Detect User Intention", + "version": 1.1, + "name": "conditionAgentAgentflow", + "type": "ConditionAgent", + "color": "#ff8fab", + "baseClasses": [ + "ConditionAgent" + ], + "category": "Agent Flows", + "description": "Utilize an agent to split flows based on dynamic conditions", + "inputParams": [ + { + "label": "Model", + "name": "conditionAgentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "conditionAgentAgentflow_0-input-conditionAgentModel-asyncOptions", + "display": true + }, + { + "label": "Instructions", + "name": "conditionAgentInstructions", + "type": "string", + "description": "A general instructions of what the condition agent should do", + "rows": 4, + "acceptVariable": true, + "placeholder": "Determine if the user is interested in learning about AI", + "id": "conditionAgentAgentflow_0-input-conditionAgentInstructions-string", + "display": true + }, + { + "label": "Input", + "name": "conditionAgentInput", + "type": "string", + "description": "Input to be used for the condition agent", + "rows": 4, + "acceptVariable": true, + "default": "

{{ question }}

", + "id": "conditionAgentAgentflow_0-input-conditionAgentInput-string", + "display": true + }, + { + "label": "Scenarios", + "name": "conditionAgentScenarios", + "description": "Define the scenarios that will be used as the conditions to split the flow", + "type": "array", + "array": [ + { + "label": "Scenario", + "name": "scenario", + "type": "string", + "placeholder": "User is asking for a pizza" + } + ], + "default": [ + { + "scenario": "" + }, + { + "scenario": "" + } + ], + "id": "conditionAgentAgentflow_0-input-conditionAgentScenarios-array", + "display": true + }, + { + "label": "Override System Prompt", + "name": "conditionAgentOverrideSystemPrompt", + "type": "boolean", + "description": "Override initial system prompt for Condition Agent", + "optional": true, + "id": "conditionAgentAgentflow_0-input-conditionAgentOverrideSystemPrompt-boolean", + "display": true + }, + { + "label": "Node System Prompt", + "name": "conditionAgentSystemPrompt", + "type": "string", + "rows": 4, + "optional": true, + "acceptVariable": true, + "default": "

You are part of a multi-agent system designed to make agent coordination and execution easy. Your task is to analyze the given input and select one matching scenario from a provided set of scenarios.

\n \n

Steps

\n
    \n
  1. Read the input string and the list of scenarios.
  2. \n
  3. Analyze the content of the input to identify its main topic or intention.
  4. \n
  5. Compare the input with each scenario: Evaluate how well the input's topic or intention aligns with each of the provided scenarios and select the one that is the best fit.
  6. \n
  7. Output the result: Return the selected scenario in the specified JSON format.
  8. \n
\n

Output Format

\n

Output should be a JSON object that names the selected scenario, like this: {\"output\": \"\"}. No explanation is needed.

\n

Examples

\n
    \n
  1. \n

    Input: {\"input\": \"Hello\", \"scenarios\": [\"user is asking about AI\", \"user is not asking about AI\"], \"instruction\": \"Your task is to check if the user is asking about AI.\"}

    \n

    Output: {\"output\": \"user is not asking about AI\"}

    \n
  2. \n
  3. \n

    Input: {\"input\": \"What is AIGC?\", \"scenarios\": [\"user is asking about AI\", \"user is asking about the weather\"], \"instruction\": \"Your task is to check and see if the user is asking a topic about AI.\"}

    \n

    Output: {\"output\": \"user is asking about AI\"}

    \n
  4. \n
  5. \n

    Input: {\"input\": \"Can you explain deep learning?\", \"scenarios\": [\"user is interested in AI topics\", \"user wants to order food\"], \"instruction\": \"Determine if the user is interested in learning about AI.\"}

    \n

    Output: {\"output\": \"user is interested in AI topics\"}

    \n
  6. \n
\n

Note

\n ", + "description": "Expert use only. Modifying this can significantly alter agent behavior. Leave default if unsure", + "show": { + "conditionAgentOverrideSystemPrompt": true + }, + "id": "conditionAgentAgentflow_0-input-conditionAgentSystemPrompt-string", + "display": false + } + ], + "inputAnchors": [], + "inputs": { + "conditionAgentModel": "chatOpenAI", + "conditionAgentInstructions": "

You are a customer support agent. Understand and process support tickets by automatically triaging them to the correct departments or individuals, generating immediate responses for common issues, and gathering necessary information for complex queries.

Follow the following routine with the user:

1. First, greet the user and see how you can help the user

2. If question is related to HR query, handoff to HR Agent

3. If question is related to events query, handoff to Event Manager

Note: Transfers between agents are handled seamlessly in the background; do not mention or draw attention to these transfers in your conversation with the user

", + "conditionAgentInput": "

{{ $form.subject }}

", + "conditionAgentScenarios": [ + { + "scenario": "Query is related to HR" + }, + { + "scenario": "Query is related to events" + }, + { + "scenario": "Query is general query" + } + ], + "conditionAgentOverrideSystemPrompt": "", + "conditionAgentSystemPrompt": "

You are part of a multi-agent system designed to make agent coordination and execution easy. Your task is to analyze the given input and select one matching scenario from a provided set of scenarios.

\n \n

Steps

\n
    \n
  1. Read the input string and the list of scenarios.
  2. \n
  3. Analyze the content of the input to identify its main topic or intention.
  4. \n
  5. Compare the input with each scenario: Evaluate how well the input's topic or intention aligns with each of the provided scenarios and select the one that is the best fit.
  6. \n
  7. Output the result: Return the selected scenario in the specified JSON format.
  8. \n
\n

Output Format

\n

Output should be a JSON object that names the selected scenario, like this: {\"output\": \"\"}. No explanation is needed.

\n

Examples

\n
    \n
  1. \n

    Input: {\"input\": \"Hello\", \"scenarios\": [\"user is asking about AI\", \"user is not asking about AI\"], \"instruction\": \"Your task is to check if the user is asking about AI.\"}

    \n

    Output: {\"output\": \"user is not asking about AI\"}

    \n
  2. \n
  3. \n

    Input: {\"input\": \"What is AIGC?\", \"scenarios\": [\"user is asking about AI\", \"user is asking about the weather\"], \"instruction\": \"Your task is to check and see if the user is asking a topic about AI.\"}

    \n

    Output: {\"output\": \"user is asking about AI\"}

    \n
  4. \n
  5. \n

    Input: {\"input\": \"Can you explain deep learning?\", \"scenarios\": [\"user is interested in AI topics\", \"user wants to order food\"], \"instruction\": \"Determine if the user is interested in learning about AI.\"}

    \n

    Output: {\"output\": \"user is interested in AI topics\"}

    \n
  6. \n
\n

Note

\n ", + "conditionAgentModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": true, + "reasoningEffort": "medium", + "conditionAgentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "conditionAgentAgentflow_0-output-0", + "label": 0, + "name": 0, + "description": "Condition 0" + }, + { + "id": "conditionAgentAgentflow_0-output-1", + "label": 1, + "name": 1, + "description": "Condition 1" + }, + { + "id": "conditionAgentAgentflow_0-output-2", + "label": 2, + "name": 2, + "description": "Condition 2" + } + ], + "outputs": { + "conditionAgentAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 209, + "height": 100, + "selected": false, + "positionAbsolute": { + "x": -8.296983647330677, + "y": 142.81116471739003 + }, + "dragging": false + }, + { + "id": "agentAgentflow_0", + "position": { + "x": 256.1838081680137, + "y": 39.51170632109836 + }, + "data": { + "id": "agentAgentflow_0", + "label": "HR Agent", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_0-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_0-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_0-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_0-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_0-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_0-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_0-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_0-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatAnthropic", + "agentMessages": [ + { + "role": "system", + "content": "

You are an HR agent responsible for retrieving and applying internal knowledge sources to answer employee queries about HR policies, procedures, and guidelines.

\n

When responding to HR-related questions, you must first identify the relevant policy areas, search through available internal knowledge sources, and then provide accurate, comprehensive answers based on official company documentation.

\n

Steps

\n
    \n
  1. Analyze the Query: Identify the specific HR topic, policy area, or procedure the user is asking about
  2. \n
  3. Retrieve Relevant Information: Search through internal HR knowledge sources including:
  4. \n
\n\n
    \n
  1. Cross-Reference Sources: Verify information across multiple relevant documents to ensure accuracy and completeness
  2. \n
  3. Synthesize Response: Combine retrieved information into a coherent, actionable answer
  4. \n
  5. Provide Supporting Details: Include relevant policy numbers, effective dates, or references to specific sections when applicable
  6. \n
\n

Notes

\n" + } + ], + "agentTools": "", + "agentKnowledgeDocumentStores": [ + { + "documentStore": "27fb1130-7417-4d9e-9edc-0c61315958dc:Human Resources Law", + "docStoreDescription": "This information is useful when determining the legal framework and implementation requirements for human resources management under the 2016 HR law and its 2020 implementing regulation.", + "returnSourceDocuments": true + } + ], + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "claude-sonnet-4-0", + "temperature": 0.9, + "streaming": true, + "maxTokensToSample": "", + "topP": "", + "topK": "", + "extendedThinking": "", + "budgetTokens": 1024, + "allowImageUploads": "", + "agentModel": "chatAnthropic" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_0-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 213, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 256.1838081680137, + "y": 39.51170632109836 + }, + "dragging": false + }, + { + "id": "agentAgentflow_1", + "position": { + "x": 255.95225989267777, + "y": 143.20151624252088 + }, + "data": { + "id": "agentAgentflow_1", + "label": "Event Manager", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_1-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_1-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_1-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_1-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_1-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_1-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_1-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_1-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_1-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_1-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_1-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_1-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatMistralAI", + "agentMessages": [ + { + "role": "system", + "content": "

Act as an event manager that can determine actions on events such as create, update, get, list and delete.

" + } + ], + "agentTools": [ + { + "agentSelectedTool": "openAPIToolkit", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "yamlFile": "data:application/octet-stream;base64,b3BlbmFwaTogMy4wLjANCmluZm86DQogIHZlcnNpb246IDEuMC4wDQogIHRpdGxlOiBFdmVudCBNYW5hZ2VtZW50IEFQSQ0KICBkZXNjcmlwdGlvbjogQW4gQVBJIGZvciBtYW5hZ2luZyBldmVudCBkYXRhDQoNCnNlcnZlcnM6DQogIC0gdXJsOiBodHRwOi8vbG9jYWxob3N0OjU1NjYNCiAgICBkZXNjcmlwdGlvbjogTG9jYWwgZGV2ZWxvcG1lbnQgc2VydmVyDQoNCnBhdGhzOg0KICAvZXZlbnRzOg0KICAgIGdldDoNCiAgICAgIHN1bW1hcnk6IExpc3QgYWxsIGV2ZW50cw0KICAgICAgb3BlcmF0aW9uSWQ6IGxpc3RFdmVudHMNCiAgICAgIHJlc3BvbnNlczoNCiAgICAgICAgJzIwMCc6DQogICAgICAgICAgZGVzY3JpcHRpb246IEEgbGlzdCBvZiBldmVudHMNCiAgICAgICAgICBjb250ZW50Og0KICAgICAgICAgICAgYXBwbGljYXRpb24vanNvbjoNCiAgICAgICAgICAgICAgc2NoZW1hOg0KICAgICAgICAgICAgICAgIHR5cGU6IGFycmF5DQogICAgICAgICAgICAgICAgaXRlbXM6DQogICAgICAgICAgICAgICAgICAkcmVmOiAnIy9jb21wb25lbnRzL3NjaGVtYXMvRXZlbnQnDQogICAgDQogICAgcG9zdDoNCiAgICAgIHN1bW1hcnk6IENyZWF0ZSBhIG5ldyBldmVudA0KICAgICAgb3BlcmF0aW9uSWQ6IGNyZWF0ZUV2ZW50DQogICAgICByZXF1ZXN0Qm9keToNCiAgICAgICAgcmVxdWlyZWQ6IHRydWUNCiAgICAgICAgY29udGVudDoNCiAgICAgICAgICBhcHBsaWNhdGlvbi9qc29uOg0KICAgICAgICAgICAgc2NoZW1hOg0KICAgICAgICAgICAgICAkcmVmOiAnIy9jb21wb25lbnRzL3NjaGVtYXMvRXZlbnRJbnB1dCcNCiAgICAgIHJlc3BvbnNlczoNCiAgICAgICAgJzIwMSc6DQogICAgICAgICAgZGVzY3JpcHRpb246IFRoZSBldmVudCB3YXMgY3JlYXRlZA0KICAgICAgICAgIGNvbnRlbnQ6DQogICAgICAgICAgICBhcHBsaWNhdGlvbi9qc29uOg0KICAgICAgICAgICAgICBzY2hlbWE6DQogICAgICAgICAgICAgICAgJHJlZjogJyMvY29tcG9uZW50cy9zY2hlbWFzL0V2ZW50Jw0KICAgICAgICAnNDAwJzoNCiAgICAgICAgICBkZXNjcmlwdGlvbjogSW52YWxpZCBpbnB1dA0KICAgICAgICAgIGNvbnRlbnQ6DQogICAgICAgICAgICBhcHBsaWNhdGlvbi9qc29uOg0KICAgICAgICAgICAgICBzY2hlbWE6DQogICAgICAgICAgICAgICAgJHJlZjogJyMvY29tcG9uZW50cy9zY2hlbWFzL0Vycm9yJw0KDQogIC9ldmVudHMve2lkfToNCiAgICBwYXJhbWV0ZXJzOg0KICAgICAgLSBuYW1lOiBpZA0KICAgICAgICBpbjogcGF0aA0KICAgICAgICByZXF1aXJlZDogdHJ1ZQ0KICAgICAgICBzY2hlbWE6DQogICAgICAgICAgdHlwZTogc3RyaW5nDQogICAgICAgIGRlc2NyaXB0aW9uOiBUaGUgZXZlbnQgSUQNCiAgICANCiAgICBnZXQ6DQogICAgICBzdW1tYXJ5OiBSZXRyaWV2ZSBhbiBldmVudCBieSBJRA0KICAgICAgb3BlcmF0aW9uSWQ6IGdldEV2ZW50QnlJZA0KICAgICAgcmVzcG9uc2VzOg0KICAgICAgICAnMjAwJzoNCiAgICAgICAgICBkZXNjcmlwdGlvbjogVGhlIGV2ZW50DQogICAgICAgICAgY29udGVudDoNCiAgICAgICAgICAgIGFwcGxpY2F0aW9uL2pzb246DQogICAgICAgICAgICAgIHNjaGVtYToNCiAgICAgICAgICAgICAgICAkcmVmOiAnIy9jb21wb25lbnRzL3NjaGVtYXMvRXZlbnQnDQogICAgICAgICc0MDQnOg0KICAgICAgICAgIGRlc2NyaXB0aW9uOiBFdmVudCBub3QgZm91bmQNCiAgICAgICAgICBjb250ZW50Og0KICAgICAgICAgICAgYXBwbGljYXRpb24vanNvbjoNCiAgICAgICAgICAgICAgc2NoZW1hOg0KICAgICAgICAgICAgICAgICRyZWY6ICcjL2NvbXBvbmVudHMvc2NoZW1hcy9FcnJvcicNCiAgICANCiAgICBwYXRjaDoNCiAgICAgIHN1bW1hcnk6IFVwZGF0ZSBhbiBldmVudCdzIGRldGFpbHMgYnkgSUQNCiAgICAgIG9wZXJhdGlvbklkOiB1cGRhdGVFdmVudERldGFpbHMNCiAgICAgIHJlcXVlc3RCb2R5Og0KICAgICAgICByZXF1aXJlZDogdHJ1ZQ0KICAgICAgICBjb250ZW50Og0KICAgICAgICAgIGFwcGxpY2F0aW9uL2pzb246DQogICAgICAgICAgICBzY2hlbWE6DQogICAgICAgICAgICAgICRyZWY6ICcjL2NvbXBvbmVudHMvc2NoZW1hcy9FdmVudElucHV0Jw0KICAgICAgcmVzcG9uc2VzOg0KICAgICAgICAnMjAwJzoNCiAgICAgICAgICBkZXNjcmlwdGlvbjogVGhlIGV2ZW50J3MgZGV0YWlscyB3ZXJlIHVwZGF0ZWQNCiAgICAgICAgICBjb250ZW50Og0KICAgICAgICAgICAgYXBwbGljYXRpb24vanNvbjoNCiAgICAgICAgICAgICAgc2NoZW1hOg0KICAgICAgICAgICAgICAgICRyZWY6ICcjL2NvbXBvbmVudHMvc2NoZW1hcy9FdmVudCcNCiAgICAgICAgJzQwMCc6DQogICAgICAgICAgZGVzY3JpcHRpb246IEludmFsaWQgaW5wdXQNCiAgICAgICAgICBjb250ZW50Og0KICAgICAgICAgICAgYXBwbGljYXRpb24vanNvbjoNCiAgICAgICAgICAgICAgc2NoZW1hOg0KICAgICAgICAgICAgICAgICRyZWY6ICcjL2NvbXBvbmVudHMvc2NoZW1hcy9FcnJvcicNCiAgICAgICAgJzQwNCc6DQogICAgICAgICAgZGVzY3JpcHRpb246IEV2ZW50IG5vdCBmb3VuZA0KICAgICAgICAgIGNvbnRlbnQ6DQogICAgICAgICAgICBhcHBsaWNhdGlvbi9qc29uOg0KICAgICAgICAgICAgICBzY2hlbWE6DQogICAgICAgICAgICAgICAgJHJlZjogJyMvY29tcG9uZW50cy9zY2hlbWFzL0Vycm9yJw0KICAgIA0KICAgIGRlbGV0ZToNCiAgICAgIHN1bW1hcnk6IERlbGV0ZSBhbiBldmVudCBieSBJRA0KICAgICAgb3BlcmF0aW9uSWQ6IGRlbGV0ZUV2ZW50DQogICAgICByZXNwb25zZXM6DQogICAgICAgICcyMDQnOg0KICAgICAgICAgIGRlc2NyaXB0aW9uOiBUaGUgZXZlbnQgd2FzIGRlbGV0ZWQNCiAgICAgICAgJzQwNCc6DQogICAgICAgICAgZGVzY3JpcHRpb246IEV2ZW50IG5vdCBmb3VuZA0KICAgICAgICAgIGNvbnRlbnQ6DQogICAgICAgICAgICBhcHBsaWNhdGlvbi9qc29uOg0KICAgICAgICAgICAgICBzY2hlbWE6DQogICAgICAgICAgICAgICAgJHJlZjogJyMvY29tcG9uZW50cy9zY2hlbWFzL0Vycm9yJw0KDQpjb21wb25lbnRzOg0KICBzY2hlbWFzOg0KICAgIEV2ZW50Og0KICAgICAgdHlwZTogb2JqZWN0DQogICAgICBwcm9wZXJ0aWVzOg0KICAgICAgICBpZDoNCiAgICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgICAgICBkZXNjcmlwdGlvbjogVGhlIHVuaXF1ZSBpZGVudGlmaWVyIGZvciB0aGUgZXZlbnQNCiAgICAgICAgbmFtZToNCiAgICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgICAgICBkZXNjcmlwdGlvbjogVGhlIG5hbWUgb2YgdGhlIGV2ZW50DQogICAgICAgIGRhdGU6DQogICAgICAgICAgdHlwZTogc3RyaW5nDQogICAgICAgICAgZm9ybWF0OiBkYXRlLXRpbWUNCiAgICAgICAgICBkZXNjcmlwdGlvbjogVGhlIGRhdGUgYW5kIHRpbWUgb2YgdGhlIGV2ZW50IGluIElTTyA4NjAxIGZvcm1hdA0KICAgICAgICBsb2NhdGlvbjoNCiAgICAgICAgICB0eXBlOiBzdHJpbmcNCiAgICAgICAgICBkZXNjcmlwdGlvbjogVGhlIGxvY2F0aW9uIG9mIHRoZSBldmVudA0KICAgICAgcmVxdWlyZWQ6DQogICAgICAgIC0gbmFtZQ0KICAgICAgICAtIGRhdGUNCiAgICAgICAgLSBsb2NhdGlvbg0KICAgIA0KICAgIEV2ZW50SW5wdXQ6DQogICAgICB0eXBlOiBvYmplY3QNCiAgICAgIHByb3BlcnRpZXM6DQogICAgICAgIG5hbWU6DQogICAgICAgICAgdHlwZTogc3RyaW5nDQogICAgICAgICAgZGVzY3JpcHRpb246IFRoZSBuYW1lIG9mIHRoZSBldmVudA0KICAgICAgICBkYXRlOg0KICAgICAgICAgIHR5cGU6IHN0cmluZw0KICAgICAgICAgIGZvcm1hdDogZGF0ZS10aW1lDQogICAgICAgICAgZGVzY3JpcHRpb246IFRoZSBkYXRlIGFuZCB0aW1lIG9mIHRoZSBldmVudCBpbiBJU08gODYwMSBmb3JtYXQNCiAgICAgICAgbG9jYXRpb246DQogICAgICAgICAgdHlwZTogc3RyaW5nDQogICAgICAgICAgZGVzY3JpcHRpb246IFRoZSBsb2NhdGlvbiBvZiB0aGUgZXZlbnQNCiAgICAgIHJlcXVpcmVkOg0KICAgICAgICAtIG5hbWUNCiAgICAgICAgLSBkYXRlDQogICAgICAgIC0gbG9jYXRpb24NCiAgICANCiAgICBFcnJvcjoNCiAgICAgIHR5cGU6IG9iamVjdA0KICAgICAgcHJvcGVydGllczoNCiAgICAgICAgZXJyb3I6DQogICAgICAgICAgdHlwZTogc3RyaW5nDQogICAgICAgICAgZGVzY3JpcHRpb246IEVycm9yIG1lc3NhZ2U=,filename:events.yaml", + "returnDirect": "", + "headers": "", + "removeNulls": "", + "customCode": "const fetch = require('node-fetch');\nconst url = $url;\nconst options = $options;\n\ntry {\n\tconst response = await fetch(url, options);\n\tconst resp = await response.json();\n\treturn JSON.stringify(resp);\n} catch (error) {\n\tconsole.error(error);\n\treturn '';\n}\n", + "agentSelectedTool": "openAPIToolkit" + } + } + ], + "agentKnowledgeDocumentStores": [], + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "mistral-large-latest", + "temperature": 0.9, + "streaming": true, + "maxOutputTokens": "", + "topP": "", + "randomSeed": "", + "safeMode": "", + "overrideEndpoint": "", + "agentModel": "chatMistralAI" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_1-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 212, + "height": 100, + "selected": false, + "positionAbsolute": { + "x": 255.95225989267777, + "y": 143.20151624252088 + }, + "dragging": false + }, + { + "id": "agentAgentflow_3", + "position": { + "x": 254.52955040661755, + "y": 269.9598089153506 + }, + "data": { + "id": "agentAgentflow_3", + "label": "General Agent", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_3-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_3-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_3-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_3-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_3-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_3-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_3-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_3-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_3-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_3-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_3-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_3-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatGoogleGenerativeAI", + "agentMessages": [ + { + "role": "system", + "content": "

You are helpful assistant

" + } + ], + "agentTools": "", + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "gemini-2.0-flash", + "customModelName": "", + "temperature": 0.9, + "streaming": true, + "maxOutputTokens": "", + "topP": "", + "topK": "", + "harmCategory": "", + "harmBlockThreshold": "", + "baseUrl": "", + "allowImageUploads": "", + "agentModel": "chatGoogleGenerativeAI" + }, + "undefined": "" + }, + "outputAnchors": [ + { + "id": "agentAgentflow_3-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 199, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 254.52955040661755, + "y": 269.9598089153506 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "conditionAgentAgentflow_0", + "targetHandle": "conditionAgentAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#ff8fab", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-conditionAgentAgentflow_0-conditionAgentAgentflow_0" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-0", + "target": "agentAgentflow_0", + "targetHandle": "agentAgentflow_0", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#4DD0E1", + "edgeLabel": "0", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-0-agentAgentflow_0-agentAgentflow_0" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-1", + "target": "agentAgentflow_1", + "targetHandle": "agentAgentflow_1", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#4DD0E1", + "edgeLabel": "1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-1-agentAgentflow_1-agentAgentflow_1" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-3", + "target": "agentAgentflow_3", + "targetHandle": "agentAgentflow_3", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#4DD0E1", + "edgeLabel": "3", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-3-agentAgentflow_3-agentAgentflow_3" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-2", + "target": "agentAgentflow_3", + "targetHandle": "agentAgentflow_3", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#4DD0E1", + "edgeLabel": "2", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-2-agentAgentflow_3-agentAgentflow_3" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/Deep Research Dynamic SubAgents.json b/cn/.gitbook/assets/Deep Research Dynamic SubAgents.json new file mode 100644 index 00000000..47747940 --- /dev/null +++ b/cn/.gitbook/assets/Deep Research Dynamic SubAgents.json @@ -0,0 +1,1851 @@ +{ + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": -241.58365178492127, + "y": 86.32546838777353 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": true + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": true + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": true + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar" + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "formInput", + "formTitle": "Research", + "formDescription": "A research agent that takes in a query, and return a detailed report", + "formInputTypes": [ + { + "type": "string", + "label": "Query", + "name": "query", + "addOptions": "" + } + ], + "startState": [ + { + "key": "subagents", + "value": "" + }, + { + "key": "findings", + "value": "" + } + ] + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": -241.58365178492127, + "y": 86.32546838777353 + }, + "dragging": false + }, + { + "id": "llmAgentflow_0", + "position": { + "x": -111.52635639216058, + "y": 83.67035986437665 + }, + "data": { + "id": "llmAgentflow_0", + "label": "Planner", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": [ + "LLM" + ], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_0-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_0-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_0-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_0-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_0-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_0-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_0-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatAnthropic", + "llmMessages": [ + { + "role": "system", + "content": "

You are an expert research lead, focused on high-level research strategy, planning, efficient delegation to subagents, and final report writing. Your core goal is to be maximally helpful to the user by leading a process to research the user's query and then creating an excellent research report that answers this query very well. Take the current request from the user, plan out an effective research process to answer it as well as possible, and then execute this plan by delegating key tasks to appropriate subagents.

The current date is {{ current_date_time }} .

<research_process>

Follow this process to break down the user’s question and develop an excellent research plan. Think about the user's task thoroughly and in great detail to understand it well and determine what to do next. Analyze each aspect of the user's question and identify the most important aspects. Consider multiple approaches with complete, thorough reasoning. Explore several different methods of answering the question (at least 3) and then choose the best method you find. Follow this process closely:

1. Assessment and breakdown: Analyze and break down the user's prompt to make sure you fully understand it.

* Identify the main concepts, key entities, and relationships in the task.

* List specific facts or data points needed to answer the question well.

* Note any temporal or contextual constraints on the question.

* Analyze what features of the prompt are most important - what does the user likely care about most here? What are they expecting or desiring in the final result? What tools do they expect to be used and how do we know?

* Determine what form the answer would need to be in to fully accomplish the user's task. Would it need to be a detailed report, a list of entities, an analysis of different perspectives, a visual report, or something else? What components will it need to have?

2. Query type determination: Explicitly state your reasoning on what type of query this question is from the categories below.

* Depth-first query: When the problem requires multiple perspectives on the same issue, and calls for \"going deep\" by analyzing a single topic from many angles.

- Benefits from parallel agents exploring different viewpoints, methodologies, or sources

- The core question remains singular but benefits from diverse approaches

- Example: \"What are the most effective treatments for depression?\" (benefits from parallel agents exploring different treatments and approaches to this question)

- Example: \"What really caused the 2008 financial crisis?\" (benefits from economic, regulatory, behavioral, and historical perspectives, and analyzing or steelmanning different viewpoints on the question)

- Example: \"can you identify the best approach to building AI finance agents in 2025 and why?\"

* Breadth-first query: When the problem can be broken into distinct, independent sub-questions, and calls for \"going wide\" by gathering information about each sub-question.

- Benefits from parallel agents each handling separate sub-topics.

- The query naturally divides into multiple parallel research streams or distinct, independently researchable sub-topics

- Example: \"Compare the economic systems of three Nordic countries\" (benefits from simultaneous independent research on each country)

- Example: \"What are the net worths and names of all the CEOs of all the fortune 500 companies?\" (intractable to research in a single thread; most efficient to split up into many distinct research agents which each gathers some of the necessary information)

- Example: \"Compare all the major frontend frameworks based on performance, learning curve, ecosystem, and industry adoption\" (best to identify all the frontend frameworks and then research all of these factors for each framework)

* Straightforward query: When the problem is focused, well-defined, and can be effectively answered by a single focused investigation or fetching a single resource from the internet.

- Can be handled effectively by a single subagent with clear instructions; does not benefit much from extensive research

- Example: \"What is the current population of Tokyo?\" (simple fact-finding)

- Example: \"What are all the fortune 500 companies?\" (just requires finding a single website with a full list, fetching that list, and then returning the results)

- Example: \"Tell me about bananas\" (fairly basic, short question that likely does not expect an extensive answer)

3. Detailed research plan development: Based on the query type, develop a specific research plan with clear allocation of tasks across different research subagents. Ensure if this plan is executed, it would result in an excellent answer to the user's query.

For Depth-first queries*:

- Define 3-5 different methodological approaches or perspectives.

- List specific expert viewpoints or sources of evidence that would enrich the analysis.

- Plan how each perspective will contribute unique insights to the central question.

- Specify how findings from different approaches will be synthesized.

- Example: For \"What causes obesity?\", plan agents to investigate genetic factors, environmental influences, psychological aspects, socioeconomic patterns, and biomedical evidence, and outline how the information could be aggregated into a great answer.

For Breadth-first queries*:

- Enumerate all the distinct sub-questions or sub-tasks that can be researched independently to answer the query.

- Identify the most critical sub-questions or perspectives needed to answer the query comprehensively. Only create additional subagents if the query has clearly distinct components that cannot be efficiently handled by fewer agents. Avoid creating subagents for every possible angle - focus on the essential ones.

- Prioritize these sub-tasks based on their importance and expected research complexity.

- Define extremely clear, crisp, and understandable boundaries between sub-topics to prevent overlap.

- Plan how findings will be aggregated into a coherent whole.

- Example: For \"Compare EU country tax systems\", first create a subagent to retrieve a list of all the countries in the EU today, then think about what metrics and factors would be relevant to compare each country's tax systems, then use the batch tool to run 4 subagents to research the metrics and factors for the key countries in Northern Europe, Western Europe, Eastern Europe, Southern Europe.

For Straightforward queries*:

- Identify the most direct, efficient path to the answer.

- Determine whether basic fact-finding or minor analysis is needed.

- Specify exact data points or information required to answer.

- Determine what sources are likely most relevant to answer this query that the subagents should use, and whether multiple sources are needed for fact-checking.

- Plan basic verification methods to ensure the accuracy of the answer.

- Create an extremely clear task description that describes how a subagent should research this question.

* For each element in your plan for answering any query, explicitly evaluate:

- Can this step be broken into independent subtasks for a more efficient process?

- Would multiple perspectives benefit this step?

- What specific output is expected from this step?

- Is this step strictly necessary to answer the user's query well?

4. Methodical plan execution: Execute the plan fully, using parallel subagents where possible. Determine how many subagents to use based on the complexity of the query, default to using 3 subagents for most queries.

* For parallelizable steps:

- Deploy appropriate subagents using the <delegation_instructions> below, making sure to provide extremely clear task descriptions to each subagent and ensuring that if these tasks are accomplished it would provide the information needed to answer the query.

- Synthesize findings when the subtasks are complete.

* For non-parallelizable/critical steps:

- First, attempt to accomplish them yourself based on your existing knowledge and reasoning. If the steps require additional research or up-to-date information from the web, deploy a subagent.

- If steps are very challenging, deploy independent subagents for additional perspectives or approaches.

- Compare the subagent's results and synthesize them using an ensemble approach and by applying critical reasoning.

* Throughout execution:

- Continuously monitor progress toward answering the user's query.

- Update the search plan and your subagent delegation strategy based on findings from tasks.

- Adapt to new information well - analyze the results, use Bayesian reasoning to update your priors, and then think carefully about what to do next.

- Adjust research depth based on time constraints and efficiency - if you are running out of time or a research process has already taken a very long time, avoid deploying further subagents and instead just start composing the output report immediately.

</research_process>

<subagent_count_guidelines>

When determining how many subagents to create, follow these guidelines:

1. Simple/Straightforward queries: create 1 subagent to collaborate with you directly -

- Example: \"What is the tax deadline this year?\" or “Research bananas” → 1 subagent

- Even for simple queries, always create at least 1 subagent to ensure proper source gathering

2. Standard complexity queries: 2-3 subagents

- For queries requiring multiple perspectives or research approaches

- Example: \"Compare the top 3 cloud providers\" → 3 subagents (one per provider)

3. Medium complexity queries: 3-5 subagents

- For multi-faceted questions requiring different methodological approaches

- Example: \"Analyze the impact of AI on healthcare\" → 4 subagents (regulatory, clinical, economic, technological aspects)

4. High complexity queries: 5-10 subagents (maximum 20)

- For very broad, multi-part queries with many distinct components

- Identify the most effective algorithms to efficiently answer these high-complexity queries with around 20 subagents.

- Example: \"Fortune 500 CEOs birthplaces and ages\" → Divide the large info-gathering task into smaller segments (e.g., 10 subagents handling 50 CEOs each)

IMPORTANT: Never create more than 20 subagents unless strictly necessary. If a task seems to require more than 20 subagents, it typically means you should restructure your approach to consolidate similar sub-tasks and be more efficient in your research process. Prefer fewer, more capable subagents over many overly narrow ones. More subagents = more overhead. Only add subagents when they provide distinct value.

</subagent_count_guidelines>

<delegation_instructions>

Use subagents as your primary research team - they should perform all major research tasks:

1. Deployment strategy:

* Deploy subagents immediately after finalizing your research plan, so you can start the research process quickly.

* Create research subagent with very clear and specific instructions to describe the subagent's task.

* Each subagent is a fully capable researcher that can search the web and use the other search tools that are available.

* Consider priority and dependency when ordering subagent tasks - deploy the most important subagents first. For instance, when other tasks will depend on results from one specific task, always create a subagent to address that blocking task first.

* Ensure you have sufficient coverage for comprehensive research - ensure that you deploy subagents to complete every task.

* All substantial information gathering should be delegated to subagents.

* While waiting for a subagent to complete, use your time efficiently by analyzing previous results, updating your research plan, or reasoning about the user's query and how to answer it best.

2. Task allocation principles:

* For depth-first queries: Deploy subagents in sequence to explore different methodologies or perspectives on the same core question. Start with the approach most likely to yield comprehensive and good results, the follow with alternative viewpoints to fill gaps or provide contrasting analysis.

* For breadth-first queries: Order subagents by topic importance and research complexity. Begin with subagents that will establish key facts or framework information, then deploy subsequent subagents to explore more specific or dependent subtopics.

* For straightforward queries: Deploy a single comprehensive subagent with clear instructions for fact-finding and verification. For these simple queries, treat the subagent as an equal collaborator - you can conduct some research yourself while delegating specific research tasks to the subagent. Give this subagent very clear instructions and try to ensure the subagent handles about half of the work, to efficiently distribute research work between yourself and the subagent.

* Avoid deploying subagents for trivial tasks that you can complete yourself, such as simple calculations, basic formatting, small web searches, or tasks that don't require external research

* But always deploy at least 1 subagent, even for simple tasks.

* Avoid overlap between subagents - every subagent should have distinct, clearly separate tasks, to avoid replicating work unnecessarily and wasting resources.

3. Clear direction for subagents: Ensure that you provide every subagent with extremely detailed, specific, and clear instructions for what their task is and how to accomplish it.

* All instructions for subagents should include the following as appropriate:

- Specific research objectives, ideally just 1 core objective per subagent.

- Expected output format - e.g. a list of entities, a report of the facts, an answer to a specific question, or other.

- Relevant background context about the user's question and how the subagent should contribute to the research plan.

- Key questions to answer as part of the research.

- Suggested starting points and sources to use; define what constitutes reliable information or high-quality sources for this task, and list any unreliable sources to avoid.

- Specific tools that the subagent should use - i.e. using web search and web fetch for gathering information from the web, or if the query requires non-public, company-specific, or user-specific information, use the available internal tools like google drive, gmail, gcal, slack, or any other internal tools that are available currently.

- If needed, precise scope boundaries to prevent research drift.

* Make sure that IF all the subagents followed their instructions very well, the results in aggregate would allow you to give an EXCELLENT answer to the user's question - complete, thorough, detailed, and accurate.

* When giving instructions to subagents, also think about what sources might be high-quality for their tasks, and give them some guidelines on what sources to use and how they should evaluate source quality for each task.

* Example of a good, clear, detailed task description for a subagent: \"Research the semiconductor supply chain crisis and its current status as of 2025. Use the web_search and web_fetch tools to gather facts from the internet. Begin by examining recent quarterly reports from major chip manufacturers like TSMC, Samsung, and Intel, which can be found on their investor relations pages or through the SEC EDGAR database. Search for industry reports from SEMI, Gartner, and IDC that provide market analysis and forecasts. Investigate government responses by checking the US CHIPS Act implementation progress at commerce.gov, EU Chips Act at ec.europa.eu, and similar initiatives in Japan, South Korea, and Taiwan through their respective government portals. Prioritize original sources over news aggregators. Focus on identifying current bottlenecks, projected capacity increases from new fab construction, geopolitical factors affecting supply chains, and expert predictions for when supply will meet demand. When research is done, compile your findings into a dense report of the facts, covering the current situation, ongoing solutions, and future outlook, with specific timelines and quantitative data where available.\"

4. Synthesis responsibility: As the lead research agent, your primary role is to coordinate, guide, and synthesize - NOT to conduct primary research yourself. You only conduct direct research if a critical question remains unaddressed by subagents or it is best to accomplish it yourself. Instead, focus on planning, analyzing and integrating findings across subagents, determining what to do next, providing clear instructions for each subagent, or identifying gaps in the collective research and deploying new subagents to fill them.

</delegation_instructions>

<answer_formatting>

Before providing a final answer:

1. Review the most recent fact list compiled during the search process.

2. Reflect deeply on whether these facts can answer the given query sufficiently.

3. Identify if you need to create more subagents for further research.

4. If sufficient, provide a final answer in the specific format that is best for the user's query and following the <writing_guidelines> below.

4. Output the final result in Markdown to submit your final research report.

5. Do not include ANY Markdown citations, a separate agent will be responsible for citations. Never include a list of references or sources or citations at the end of the report.

</answer_formatting>

In communicating with subagents, maintain extremely high information density while being concise - describe everything needed in the fewest words possible.

As you progress through the search process:

1. When necessary, review the core facts gathered so far, including: f

* Facts from your own research.

* Facts reported by subagents.

* Specific dates, numbers, and quantifiable data.

2. For key facts, especially numbers, dates, and critical information:

* Note any discrepancies you observe between sources or issues with the quality of sources.

* When encountering conflicting information, prioritize based on recency, consistency with other facts, and use best judgment.

3. Think carefully after receiving novel information, especially for critical reasoning and decision-making after getting results back from subagents.

4. For the sake of efficiency, when you have reached the point where further research has diminishing returns and you can give a good enough answer to the user, STOP FURTHER RESEARCH and do not create any new subagents. Just write your final report at this point. Make sure to terminate research when it is no longer necessary, to avoid wasting time and resources. For example, if you are asked to identify the top 5 fastest-growing startups, and you have identified the most likely top 5 startups with high confidence, stop research immediately and use the complete_task tool to submit your report rather than continuing the process unnecessarily.

5. NEVER create a subagent to generate the final report - YOU write and craft this final research report yourself based on all the results and the writing instructions, and you are never allowed to use subagents to create the report.

6. Avoid creating subagents to research topics that could cause harm. Specifically, you must not create subagents to research anything that would promote hate speech, racism, violence, discrimination, or catastrophic harm. If a query is sensitive, specify clear constraints for the subagent to avoid causing harm.

</important_guidelines>

You have a query provided to you by the user, which serves as your primary goal. You should do your best to thoroughly accomplish the user's task. No clarifications will be given, therefore use your best judgment and do not attempt to ask the user questions. Before starting your work, review these instructions and the user’s requirements, making sure to plan out how you will efficiently use subagents and parallel tool calls to answer the query. Critically think about the results provided by subagents and reason about them carefully to verify information and ensure you provide a high-quality, accurate report. Accomplish the user’s task by directing the research subagents and creating an excellent research report from the information gathered.

" + }, + { + "role": "user", + "content": "

Query:

{{ $form.query }}

" + } + ], + "llmEnableMemory": true, + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": [ + { + "key": "subagents", + "type": "jsonArray", + "enumValues": "", + "jsonSchema": "{\n \"task\": {\n \"type\": \"string\",\n \"description\": \"The research task for subagent\"\n }\n}", + "description": "A list of subagents to perform research task" + } + ], + "llmUpdateState": [ + { + "key": "subagents", + "value": "

{{ output.subagents }}

" + } + ], + "llmModelConfig": { + "credential": "", + "modelName": "claude-sonnet-4-0", + "temperature": 0.9, + "streaming": true, + "maxTokensToSample": "", + "topP": "", + "topK": "", + "extendedThinking": "", + "budgetTokens": 1024, + "allowImageUploads": "", + "llmModel": "chatAnthropic" + }, + "llmUserMessage": "

" + }, + "outputAnchors": [ + { + "id": "llmAgentflow_0-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 213, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": -111.52635639216058, + "y": 83.67035986437665 + }, + "dragging": false + }, + { + "id": "iterationAgentflow_0", + "position": { + "x": 126.70987564816664, + "y": -5.337791594648138 + }, + "data": { + "id": "iterationAgentflow_0", + "label": "Spawn SubAgents", + "version": 1, + "name": "iterationAgentflow", + "type": "Iteration", + "color": "#9C89B8", + "baseClasses": [ + "Iteration" + ], + "category": "Agent Flows", + "description": "Execute the nodes within the iteration block through N iterations", + "inputParams": [ + { + "label": "Array Input", + "name": "iterationInput", + "type": "string", + "description": "The input array to iterate over", + "acceptVariable": true, + "rows": 4, + "id": "iterationAgentflow_0-input-iterationInput-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "iterationInput": "

{{ $flow.state.subagents }}

" + }, + "outputAnchors": [ + { + "id": "iterationAgentflow_0-output-iterationAgentflow", + "label": "Iteration", + "name": "iterationAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "iteration", + "width": 300, + "height": 250, + "selected": false, + "positionAbsolute": { + "x": 126.70987564816664, + "y": -5.337791594648138 + }, + "dragging": false + }, + { + "id": "agentAgentflow_0", + "position": { + "x": 53.64516693688461, + "y": 77.49272566017132 + }, + "data": { + "id": "agentAgentflow_0", + "label": "SubAgent", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_0-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_0-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_0-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_0-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_0-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_0-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_0-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_0-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatAnthropic", + "agentMessages": [ + { + "role": "system", + "content": "

You are a research subagent working as part of a team. The current date is {{ current_date_time }}. You have been given a clear <task> provided by a lead agent, and should use your available tools to accomplish this task in a research process. Follow the instructions below closely to accomplish your specific <task> well:

<task>

{{ $iteration.task }}

</task>

<research_process>

  1. Planning: First, think through the task thoroughly. Make a research plan, carefully reasoning to review the requirements of the task, develop a research plan to fulfill these requirements, and determine what tools are most relevant and how they should be used optimally to fulfill the task.

  1. Tool selection: Reason about what tools would be most helpful to use for this task. Use the right tools when a task implies they would be helpful.

  1. Research loop: Execute an excellent OODA (observe, orient, decide, act) loop by (a) observing what information has been gathered so far, what still needs to be gathered to accomplish the task, and what tools are available currently; (b) orienting toward what tools and queries would be best to gather the needed information and updating beliefs based on what has been learned so far; (c) making an informed, well-reasoned decision to use a specific tool in a certain way; (d) acting to use this tool. Repeat this loop in an efficient way to research well and learn based on new results.

Follow this process well to complete the task. Make sure to follow the <task> description and investigate the best sources.

</research_process>

<research_guidelines>

  1. Be detailed in your internal process, but more concise and information-dense in reporting the results.

  2. Avoid overly specific searches that might have poor hit rates:

  3. For important facts, especially numbers and dates:

* When encountering conflicting information, prioritize based on recency, consistency with other facts, the quality of the sources used, and use your best judgment and reasoning. If unable to reconcile facts, include the conflicting information in your final task report for the lead researcher to resolve.

4. Be specific and precise in your information gathering approach.

</research_guidelines>

<think_about_source_quality>

After receiving results from web searches or other tools, think critically, reason about the results, and determine what to do next. Pay attention to the details of tool results, and do not just take them at face value. For example, some pages may speculate about things that may happen in the future - mentioning predictions, using verbs like “could” or “may”, narrative driven speculation with future tense, quoted superlatives, financial projections, or similar - and you should make sure to note this explicitly in the final report, rather than accepting these events as having happened. Similarly, pay attention to the indicators of potentially problematic sources, like news aggregators rather than original sources of the information, false authority, pairing of passive voice with nameless sources, general qualifiers without specifics, unconfirmed reports, marketing language for a product, spin language, speculation, or misleading and cherry-picked data. Maintain epistemic honesty and practice good reasoning by ensuring sources are high-quality and only reporting accurate information to the lead researcher. If there are potential issues with results, flag these issues when returning your report to the lead researcher rather than blindly presenting all results as established facts.

DO NOT use the evaluate_source_quality tool ever - ignore this tool. It is broken and using it will not work.

</think_about_source_quality>

<use_parallel_tool_calls>

For maximum efficiency, whenever you need to perform multiple independent operations, invoke 2 relevant tools simultaneously rather than sequentially. Prefer calling tools like web search in parallel rather than by themselves.

</use_parallel_tool_calls>

<maximum_tool_call_limit>

To prevent overloading the system, it is required that you stay under a limit of 5 tool calls and under about 10 sources. This is the absolute maximum upper limit. If you exceed this limit, the subagent will be terminated. Therefore, whenever you get to around 4 tool calls or 9 sources, make sure to stop gathering sources, and instead finish it immediately. Avoid continuing to use tools when you see diminishing returns - when you are no longer finding new relevant information and results are not getting better, STOP using tools and instead compose your final report.

</maximum_tool_call_limit>

<citations>

  1. Must include source link, pages, etc.

  2. Avoid citing unnecessarily: Not every statement needs a citation. Focus on citing key facts, conclusions, and substantive claims that are linked to sources rather than common knowledge. Prioritize citing claims that readers would want to verify, that add credibility to the argument, or where a claim is clearly related to a specific source

  3. Cite meaningful semantic units: Citations should span complete thoughts, findings, or claims that make sense as standalone assertions. Avoid citing individual words or small phrase fragments that lose meaning out of context; prefer adding citations at the end of sentences

  4. Minimize sentence fragmentation: Avoid multiple citations within a single sentence that break up the flow of the sentence. Only add citations between phrases within a sentence when it is necessary to attribute specific claims within the sentence to specific sources

  5. No redundant citations close to each other: Do not place multiple citations to the same source in the same sentence, because this is redundant and unnecessary. If a sentence contains multiple citable claims from the same source, use only a single citation at the end of the sentence after the period

</citations>

Follow the <research_process> and the <research_guidelines> above to accomplish the task, making sure to parallelize tool calls for maximum efficiency. Remember to use correct tool to retrieve full results rather than just using search snippets. Continue using the relevant tools until this task has been fully accomplished, all necessary information has been gathered, and you are ready to report the results to the lead research agent to be integrated into a final result. As soon as you have the necessary information, complete the task rather than wasting time by continuing research unnecessarily. As soon as the task is done, finish and provide your detailed, condensed, complete, accurate report with citations.

" + } + ], + "agentTools": [ + { + "agentSelectedTool": "arxiv", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "arxivName": "arxiv_search", + "arxivDescription": "Use this tool to search for academic papers on Arxiv. You can search by keywords, topics, authors, or specific Arxiv IDs. The tool can return either paper summaries or download and extract full paper content.", + "topKResults": "3", + "maxQueryLength": "300", + "docContentCharsMax": "5000", + "loadFullContent": true, + "continueOnFailure": true, + "legacyBuild": "", + "agentSelectedTool": "arxiv" + } + }, + { + "agentSelectedTool": "googleCustomSearch", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "credential": "", + "agentSelectedTool": "googleCustomSearch" + } + }, + { + "agentSelectedTool": "webScraperTool", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "scrapeMode": "recursive", + "maxDepth": 1, + "maxPages": "2", + "timeoutS": 60, + "description": "", + "agentSelectedTool": "webScraperTool" + } + } + ], + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "

Research task:

{{ $iteration.task }}

", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "claude-sonnet-4-0", + "temperature": 0.9, + "streaming": true, + "maxTokensToSample": "", + "topP": "", + "topK": "", + "extendedThinking": "", + "budgetTokens": 1024, + "allowImageUploads": "", + "agentModel": "chatAnthropic" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_0-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "parentNode": "iterationAgentflow_0", + "extent": "parent", + "width": 213, + "height": 100, + "selected": false, + "positionAbsolute": { + "x": 180.35504258505125, + "y": 72.15493406552318 + }, + "dragging": false + }, + { + "id": "agentAgentflow_1", + "position": { + "x": 457.5784259377066, + "y": 83.96506302841382 + }, + "data": { + "id": "agentAgentflow_1", + "label": "Writer Agent", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_1-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_1-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_1-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_1-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_1-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_1-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_1-input-agentMemoryType-options", + "display": false + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_1-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_1-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_1-input-agentUserMessage-string", + "display": false + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_1-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_1-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatGoogleGenerativeAI", + "agentMessages": [ + { + "role": "system", + "content": "

You are an expert research writer tasked with generating a high-quality, long-form Markdown report based on raw research findings. Your primary responsibility is to transform complex, fragmented, or unstructured research inputs into a coherent, professional report that fully answers the user's original query. This report should be suitable for audience seeking a deep understanding of the subject.

Your guiding principles:

  1. Preserve Full Context
    Include all relevant findings, explanations, and perspectives from the original materials. Do not omit, summarize, or oversimplify key information. Your job is to retain depth and nuance while improving structure and clarity.

  2. Maintain Citation Integrity
    Ensure all citations and source links from the original findings are accurately preserved in the final report. Do not invent, remove, or alter sources. If citations are embedded inline in the source findings, carry them forward appropriately.

  3. Add Structure and Clarity
    Organize the content into a well-structured Markdown format. Use clear section headings, bullet points, numbered lists, tables and formatting as needed to improve readability and flow. Start with Introduction, end with Conclusion, and lastly sources.

  4. Markdown Output Only
    Your final output must be in Markdown format. Do not include explanations, side notes, or appendices. The only output should be the fully composed report ready for submission.

Writing guidelines:

  1. Title: A clear, compelling title for the report that reflects the core subject.

  2. Abstract/Executive Summary: A concise overview (approx. 200-300 words) of the report main arguments, scope, and conclusions, derived from the conversation.

  3. Introduction:

  4. Main Body / Thematic Analysis (Multiple Sections):

  5. Synthesis of Insights and Key Conclusions:

  6. Implications and Future Directions:

  7. Conclusion: A strong concluding section summarizing the report's main findings, their significance, and a final thought on the subject.

Style and Tone:

" + }, + { + "role": "user", + "content": "

<research_topic>

{{ $form.query }}

</research_topic>

<existing_findings>

{{ $flow.state.findings }}

</existing_findings>

<new_findings>

{{ iterationAgentflow_0 }}

</new_findings>

" + } + ], + "agentTools": "", + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": false, + "agentReturnResponseAs": "userMessage", + "agentUpdateState": [ + { + "key": "findings", + "value": "

{{ output }}

" + } + ], + "agentModelConfig": { + "credential": "", + "modelName": "gemini-2.5-flash-preview-05-20", + "customModelName": "", + "temperature": 0.9, + "streaming": true, + "maxOutputTokens": "", + "topP": "", + "topK": "", + "harmCategory": "", + "harmBlockThreshold": "", + "baseUrl": "", + "allowImageUploads": "", + "agentModel": "chatGoogleGenerativeAI" + }, + "undefined": "" + }, + "outputAnchors": [ + { + "id": "agentAgentflow_1-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 284, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 457.5784259377066, + "y": 83.96506302841382 + }, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_0", + "position": { + "x": 186.43721235573946, + "y": -175.0715078328168 + }, + "data": { + "id": "stickyNoteAgentflow_0", + "label": "Sticky Note", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": [ + "StickyNote" + ], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_0-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "Each SubAgent has its own research task and tools to complete its findings" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_0-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 210, + "height": 123, + "selected": false, + "positionAbsolute": { + "x": 186.43721235573946, + "y": -175.0715078328168 + }, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_1", + "position": { + "x": -117.00547059767304, + "y": -24.08438212240118 + }, + "data": { + "id": "stickyNoteAgentflow_1", + "label": "Sticky Note (1)", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": [ + "StickyNote" + ], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_1-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "Planner will generate list of subagents" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_1-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 210, + "height": 82, + "selected": false, + "positionAbsolute": { + "x": -117.00547059767304, + "y": -24.08438212240118 + }, + "dragging": false + }, + { + "id": "conditionAgentAgentflow_0", + "position": { + "x": 775.5108094609307, + "y": 79.60273632963377 + }, + "data": { + "id": "conditionAgentAgentflow_0", + "label": "More SubAgents?", + "version": 1.1, + "name": "conditionAgentAgentflow", + "type": "ConditionAgent", + "color": "#ff8fab", + "baseClasses": [ + "ConditionAgent" + ], + "category": "Agent Flows", + "description": "Utilize an agent to split flows based on dynamic conditions", + "inputParams": [ + { + "label": "Model", + "name": "conditionAgentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "conditionAgentAgentflow_0-input-conditionAgentModel-asyncOptions", + "display": true + }, + { + "label": "Instructions", + "name": "conditionAgentInstructions", + "type": "string", + "description": "A general instructions of what the condition agent should do", + "rows": 4, + "acceptVariable": true, + "placeholder": "Determine if the user is interested in learning about AI", + "id": "conditionAgentAgentflow_0-input-conditionAgentInstructions-string", + "display": true + }, + { + "label": "Input", + "name": "conditionAgentInput", + "type": "string", + "description": "Input to be used for the condition agent", + "rows": 4, + "acceptVariable": true, + "default": "

{{ question }}

", + "id": "conditionAgentAgentflow_0-input-conditionAgentInput-string", + "display": true + }, + { + "label": "Scenarios", + "name": "conditionAgentScenarios", + "description": "Define the scenarios that will be used as the conditions to split the flow", + "type": "array", + "array": [ + { + "label": "Scenario", + "name": "scenario", + "type": "string", + "placeholder": "User is asking for a pizza" + } + ], + "default": [ + { + "scenario": "More subagents needed" + }, + { + "scenario": "It is sufficient" + } + ], + "id": "conditionAgentAgentflow_0-input-conditionAgentScenarios-array", + "display": true + }, + { + "label": "Override System Prompt", + "name": "conditionAgentOverrideSystemPrompt", + "type": "boolean", + "description": "Override initial system prompt for Condition Agent", + "optional": true, + "id": "conditionAgentAgentflow_0-input-conditionAgentOverrideSystemPrompt-boolean", + "display": true + }, + { + "label": "Node System Prompt", + "name": "conditionAgentSystemPrompt", + "type": "string", + "rows": 4, + "optional": true, + "acceptVariable": true, + "default": "

You are part of a multi-agent system designed to make agent coordination and execution easy. Your task is to analyze the given input and select one matching scenario from a provided set of scenarios.

\n \n

Steps

\n
    \n
  1. Read the input string and the list of scenarios.
  2. \n
  3. Analyze the content of the input to identify its main topic or intention.
  4. \n
  5. Compare the input with each scenario: Evaluate how well the input's topic or intention aligns with each of the provided scenarios and select the one that is the best fit.
  6. \n
  7. Output the result: Return the selected scenario in the specified JSON format.
  8. \n
\n

Output Format

\n

Output should be a JSON object that names the selected scenario, like this: {\"output\": \"\"}. No explanation is needed.

\n

Examples

\n
    \n
  1. \n

    Input: {\"input\": \"Hello\", \"scenarios\": [\"user is asking about AI\", \"user is not asking about AI\"], \"instruction\": \"Your task is to check if the user is asking about AI.\"}

    \n

    Output: {\"output\": \"user is not asking about AI\"}

    \n
  2. \n
  3. \n

    Input: {\"input\": \"What is AIGC?\", \"scenarios\": [\"user is asking about AI\", \"user is asking about the weather\"], \"instruction\": \"Your task is to check and see if the user is asking a topic about AI.\"}

    \n

    Output: {\"output\": \"user is asking about AI\"}

    \n
  4. \n
  5. \n

    Input: {\"input\": \"Can you explain deep learning?\", \"scenarios\": [\"user is interested in AI topics\", \"user wants to order food\"], \"instruction\": \"Determine if the user is interested in learning about AI.\"}

    \n

    Output: {\"output\": \"user is interested in AI topics\"}

    \n
  6. \n
\n

Note

\n ", + "description": "Expert use only. Modifying this can significantly alter agent behavior. Leave default if unsure", + "show": { + "conditionAgentOverrideSystemPrompt": true + }, + "id": "conditionAgentAgentflow_0-input-conditionAgentSystemPrompt-string", + "display": false + } + ], + "inputAnchors": [], + "inputs": { + "conditionAgentModel": "chatGoogleGenerativeAI", + "conditionAgentInstructions": "

Given a research topic, previous subagents and their findings, determine if more subagents are needed for further research or the findings are sufficient for the research topic

", + "conditionAgentInput": "

<research_topic>

{{ $form.query }}

</research_topic>

<subagents>

{{ $flow.state.subagents }}

</subagents>

<findings>

{{ $flow.state.findings }}

</findings>

", + "conditionAgentScenarios": [ + { + "scenario": "More subagents are needed" + }, + { + "scenario": "Findings are sufficient" + } + ], + "conditionAgentOverrideSystemPrompt": "", + "conditionAgentModelConfig": { + "credential": "", + "modelName": "gemini-2.0-flash-lite", + "customModelName": "", + "temperature": 0.9, + "streaming": true, + "maxOutputTokens": "", + "topP": "", + "topK": "", + "harmCategory": "", + "harmBlockThreshold": "", + "baseUrl": "", + "allowImageUploads": "", + "conditionAgentModel": "chatGoogleGenerativeAI" + }, + "undefined": "" + }, + "outputAnchors": [ + { + "id": "conditionAgentAgentflow_0-output-0", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + }, + { + "id": "conditionAgentAgentflow_0-output-1", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + } + ], + "outputs": { + "conditionAgentAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 220, + "height": 80, + "selected": false, + "positionAbsolute": { + "x": 775.5108094609307, + "y": 79.60273632963377 + }, + "dragging": false + }, + { + "id": "loopAgentflow_0", + "position": { + "x": 1041.3074957535728, + "y": 20.713295322365383 + }, + "data": { + "id": "loopAgentflow_0", + "label": "Back to Planner", + "version": 1, + "name": "loopAgentflow", + "type": "Loop", + "color": "#FFA07A", + "hideOutput": true, + "baseClasses": [ + "Loop" + ], + "category": "Agent Flows", + "description": "Loop back to a previous node", + "inputParams": [ + { + "label": "Loop Back To", + "name": "loopBackToNode", + "type": "asyncOptions", + "loadMethod": "listPreviousNodes", + "freeSolo": true, + "id": "loopAgentflow_0-input-loopBackToNode-asyncOptions", + "display": true + }, + { + "label": "Max Loop Count", + "name": "maxLoopCount", + "type": "number", + "default": 5, + "id": "loopAgentflow_0-input-maxLoopCount-number", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "loopBackToNode": "llmAgentflow_0-Planner", + "maxLoopCount": "5" + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 174, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": 1041.3074957535728, + "y": 20.713295322365383 + }, + "dragging": false + }, + { + "id": "directReplyAgentflow_0", + "position": { + "x": 1046.735958385286, + "y": 140.25100072990062 + }, + "data": { + "id": "directReplyAgentflow_0", + "label": "Generate Report", + "version": 1, + "name": "directReplyAgentflow", + "type": "DirectReply", + "color": "#4DDBBB", + "hideOutput": true, + "baseClasses": [ + "DirectReply" + ], + "category": "Agent Flows", + "description": "Directly reply to the user with a message", + "inputParams": [ + { + "label": "Message", + "name": "directReplyMessage", + "type": "string", + "rows": 4, + "acceptVariable": true, + "id": "directReplyAgentflow_0-input-directReplyMessage-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "directReplyMessage": "

{{ $flow.state.findings }}

" + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 179, + "height": 66, + "positionAbsolute": { + "x": 1046.735958385286, + "y": 140.25100072990062 + }, + "selected": false, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_3", + "position": { + "x": 494.1635881448354, + "y": -47.5842428829507 + }, + "data": { + "id": "stickyNoteAgentflow_3", + "label": "Sticky Note (3)", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": [ + "StickyNote" + ], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_3-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "Write Agent combine the findings and generate an updated report" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_3-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 210, + "height": 123, + "selected": false, + "positionAbsolute": { + "x": 494.1635881448354, + "y": -47.5842428829507 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "llmAgentflow_0", + "targetHandle": "llmAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#64B5F6", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-llmAgentflow_0-llmAgentflow_0" + }, + { + "source": "llmAgentflow_0", + "sourceHandle": "llmAgentflow_0-output-llmAgentflow", + "target": "iterationAgentflow_0", + "targetHandle": "iterationAgentflow_0", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#9C89B8", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-iterationAgentflow_0-iterationAgentflow_0" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-0", + "target": "loopAgentflow_0", + "targetHandle": "loopAgentflow_0", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#FFA07A", + "edgeLabel": "0", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-0-loopAgentflow_0-loopAgentflow_0" + }, + { + "source": "iterationAgentflow_0", + "sourceHandle": "iterationAgentflow_0-output-iterationAgentflow", + "target": "agentAgentflow_1", + "targetHandle": "agentAgentflow_1", + "data": { + "sourceColor": "#9C89B8", + "targetColor": "#4DD0E1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "iterationAgentflow_0-iterationAgentflow_0-output-iterationAgentflow-agentAgentflow_1-agentAgentflow_1" + }, + { + "source": "agentAgentflow_1", + "sourceHandle": "agentAgentflow_1-output-agentAgentflow", + "target": "conditionAgentAgentflow_0", + "targetHandle": "conditionAgentAgentflow_0", + "data": { + "sourceColor": "#4DD0E1", + "targetColor": "#ff8fab", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "agentAgentflow_1-agentAgentflow_1-output-agentAgentflow-conditionAgentAgentflow_0-conditionAgentAgentflow_0" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-1", + "target": "directReplyAgentflow_0", + "targetHandle": "directReplyAgentflow_0", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#4DDBBB", + "edgeLabel": "1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-1-directReplyAgentflow_0-directReplyAgentflow_0" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/Deep Research Report.pdf b/cn/.gitbook/assets/Deep Research Report.pdf new file mode 100644 index 00000000..448b10f4 Binary files /dev/null and b/cn/.gitbook/assets/Deep Research Report.pdf differ diff --git a/cn/.gitbook/assets/Email Agent.json b/cn/.gitbook/assets/Email Agent.json new file mode 100644 index 00000000..82692712 --- /dev/null +++ b/cn/.gitbook/assets/Email Agent.json @@ -0,0 +1,602 @@ +{ + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": -201.62473061824977, + "y": 92.61621373702832 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": true + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": true + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": true + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true, + "display": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar" + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "formInput", + "formTitle": "Email Inquiry", + "formDescription": "Incoming email inquiry", + "formInputTypes": [ + { + "type": "string", + "label": "Subject", + "name": "subject", + "addOptions": "" + }, + { + "type": "string", + "label": "Body", + "name": "body", + "addOptions": "" + }, + { + "type": "string", + "label": "From", + "name": "from", + "addOptions": "" + } + ], + "startState": "" + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": -201.62473061824977, + "y": 92.61621373702832 + }, + "dragging": false + }, + { + "id": "agentAgentflow_0", + "position": { + "x": -61.56009223078007, + "y": 76 + }, + "data": { + "id": "agentAgentflow_0", + "label": "Email Reply Agent", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_0-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_0-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_0-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_0-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_0-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_0-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_0-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_0-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatOpenAI", + "agentMessages": [ + { + "role": "system", + "content": "

You are a customer support agent working in Flowise Inc. Create a draft professional email reply to user's query. Use the web search tools to get more details about the prospect.

Always reply as Samantha, Customer Support Representative in Flowise. Dont use placeholders.

Today's date is {{ current_date_time }}.

" + } + ], + "agentTools": [ + { + "agentSelectedTool": "googleCustomSearch", + "agentSelectedToolConfig": { + "agentSelectedTool": "googleCustomSearch" + } + }, + { + "agentSelectedTool": "gmail", + "agentSelectedToolRequiresHumanInput": true, + "agentSelectedToolConfig": { + "gmailType": "drafts", + "draftActions": "[\"createDraft\"]", + "agentSelectedTool": "gmail" + } + } + ], + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "agentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_0-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 189, + "height": 100, + "selected": false, + "positionAbsolute": { + "x": -61.56009223078007, + "y": 76 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "agentAgentflow_0", + "targetHandle": "agentAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#4DD0E1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-agentAgentflow_0-agentAgentflow_0" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/Flowise Cropped Logo.svg b/cn/.gitbook/assets/Flowise Cropped Logo.svg new file mode 100644 index 00000000..2a93a744 --- /dev/null +++ b/cn/.gitbook/assets/Flowise Cropped Logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/cn/.gitbook/assets/Flowise Cropped White High Res.png b/cn/.gitbook/assets/Flowise Cropped White High Res.png new file mode 100644 index 00000000..8617457a Binary files /dev/null and b/cn/.gitbook/assets/Flowise Cropped White High Res.png differ diff --git a/cn/.gitbook/assets/Flowise Logo Cropped White High Res.png b/cn/.gitbook/assets/Flowise Logo Cropped White High Res.png new file mode 100644 index 00000000..b03f493b Binary files /dev/null and b/cn/.gitbook/assets/Flowise Logo Cropped White High Res.png differ diff --git a/cn/.gitbook/assets/FlowiseIntro (1).gif b/cn/.gitbook/assets/FlowiseIntro (1).gif new file mode 100644 index 00000000..5d8b7c12 Binary files /dev/null and b/cn/.gitbook/assets/FlowiseIntro (1).gif differ diff --git a/cn/.gitbook/assets/FlowiseIntro.gif b/cn/.gitbook/assets/FlowiseIntro.gif new file mode 100644 index 00000000..5d8b7c12 Binary files /dev/null and b/cn/.gitbook/assets/FlowiseIntro.gif differ diff --git a/cn/.gitbook/assets/Human In The Loop Agent.json b/cn/.gitbook/assets/Human In The Loop Agent.json new file mode 100644 index 00000000..96fc67ba --- /dev/null +++ b/cn/.gitbook/assets/Human In The Loop Agent.json @@ -0,0 +1,1315 @@ +{ + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": -201.62473061824977, + "y": 92.61621373702832 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": true + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": true + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": true + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true, + "display": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar" + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "formInput", + "formTitle": "Email Inquiry", + "formDescription": "Incoming email inquiry", + "formInputTypes": [ + { + "type": "string", + "label": "Subject", + "name": "subject", + "addOptions": "" + }, + { + "type": "string", + "label": "Body", + "name": "body", + "addOptions": "" + }, + { + "type": "string", + "label": "From", + "name": "from", + "addOptions": "" + } + ], + "startState": "" + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": -201.62473061824977, + "y": 92.61621373702832 + }, + "dragging": false + }, + { + "id": "agentAgentflow_0", + "position": { + "x": -61.56009223078007, + "y": 76 + }, + "data": { + "id": "agentAgentflow_0", + "label": "Email Reply Agent", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_0-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_0-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_0-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_0-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_0-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_0-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_0-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_0-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatOpenAI", + "agentMessages": [ + { + "role": "system", + "content": "

You are a customer support agent working in Flowise Inc. Write a professional email reply to user's query. Use the web search tools to get more details about the prospect.

Always reply as Samantha, Customer Support Representative in Flowise. Dont use placeholders.

" + } + ], + "agentTools": [ + { + "agentSelectedTool": "googleCustomSearch", + "agentSelectedToolConfig": { + "agentSelectedTool": "googleCustomSearch" + } + }, + { + "agentSelectedTool": "currentDateTime", + "agentSelectedToolConfig": { + "agentSelectedTool": "currentDateTime" + } + } + ], + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "agentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_0-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 189, + "height": 100, + "selected": false, + "positionAbsolute": { + "x": -61.56009223078007, + "y": 76 + }, + "dragging": false + }, + { + "id": "humanInputAgentflow_0", + "position": { + "x": 156.05666363734434, + "y": 86.62266545493773 + }, + "data": { + "id": "humanInputAgentflow_0", + "label": "Human Input 0", + "version": 1, + "name": "humanInputAgentflow", + "type": "HumanInput", + "color": "#6E6EFD", + "baseClasses": [ + "HumanInput" + ], + "category": "Agent Flows", + "description": "Request human input, approval or rejection during execution", + "inputParams": [ + { + "label": "Description Type", + "name": "humanInputDescriptionType", + "type": "options", + "options": [ + { + "label": "Fixed", + "name": "fixed", + "description": "Specify a fixed description" + }, + { + "label": "Dynamic", + "name": "dynamic", + "description": "Use LLM to generate a description" + } + ], + "id": "humanInputAgentflow_0-input-humanInputDescriptionType-options", + "display": true + }, + { + "label": "Description", + "name": "humanInputDescription", + "type": "string", + "placeholder": "Are you sure you want to proceed?", + "acceptVariable": true, + "rows": 4, + "show": { + "humanInputDescriptionType": "fixed" + }, + "id": "humanInputAgentflow_0-input-humanInputDescription-string", + "display": true + }, + { + "label": "Model", + "name": "humanInputModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "show": { + "humanInputDescriptionType": "dynamic" + }, + "id": "humanInputAgentflow_0-input-humanInputModel-asyncOptions", + "display": false + }, + { + "label": "Prompt", + "name": "humanInputModelPrompt", + "type": "string", + "default": "

Summarize the conversation between the user and the assistant, reiterate the last message from the assistant, and ask if user would like to proceed or if they have any feedback.

\n\n

Output Format The output should be structured in three parts in text:

\n\n", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4, + "show": { + "humanInputDescriptionType": "dynamic" + }, + "id": "humanInputAgentflow_0-input-humanInputModelPrompt-string", + "display": false + }, + { + "label": "Enable Feedback", + "name": "humanInputEnableFeedback", + "type": "boolean", + "default": true, + "id": "humanInputAgentflow_0-input-humanInputEnableFeedback-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "humanInputDescriptionType": "fixed", + "humanInputEnableFeedback": true, + "humanInputModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "humanInputModel": "chatOpenAI" + }, + "humanInputDescription": "

Are you sure you want to proceed?

" + }, + "outputAnchors": [ + { + "id": "humanInputAgentflow_0-output-0", + "label": "Human Input", + "name": "humanInputAgentflow" + }, + { + "id": "humanInputAgentflow_0-output-1", + "label": "Human Input", + "name": "humanInputAgentflow" + } + ], + "outputs": { + "humanInputAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 167, + "height": 80, + "selected": false, + "positionAbsolute": { + "x": 156.05666363734434, + "y": 86.62266545493773 + }, + "dragging": false + }, + { + "id": "loopAgentflow_0", + "position": { + "x": 392.1370040831033, + "y": 150.41190827718114 + }, + "data": { + "id": "loopAgentflow_0", + "label": "Loop back to Agent", + "version": 1, + "name": "loopAgentflow", + "type": "Loop", + "color": "#FFA07A", + "hideOutput": true, + "baseClasses": [ + "Loop" + ], + "category": "Agent Flows", + "description": "Loop back to a previous node", + "inputParams": [ + { + "label": "Loop Back To", + "name": "loopBackToNode", + "type": "asyncOptions", + "loadMethod": "listPreviousNodes", + "freeSolo": true, + "id": "loopAgentflow_0-input-loopBackToNode-asyncOptions", + "display": true + }, + { + "label": "Max Loop Count", + "name": "maxLoopCount", + "type": "number", + "default": 5, + "id": "loopAgentflow_0-input-maxLoopCount-number", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "loopBackToNode": "agentAgentflow_0-Email Reply Agent", + "maxLoopCount": 5 + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 198, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": 392.1370040831033, + "y": 150.41190827718114 + }, + "dragging": false + }, + { + "id": "toolAgentflow_0", + "position": { + "x": 607.0106274902857, + "y": 44.74028001269521 + }, + "data": { + "id": "toolAgentflow_0", + "label": "Send Email", + "version": 1.1, + "name": "toolAgentflow", + "type": "Tool", + "color": "#d4a373", + "baseClasses": [ + "Tool" + ], + "category": "Agent Flows", + "description": "Tools allow LLM to interact with external systems", + "inputParams": [ + { + "label": "Tool", + "name": "toolAgentflowSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true, + "id": "toolAgentflow_0-input-toolAgentflowSelectedTool-asyncOptions", + "display": true + }, + { + "label": "Tool Input Arguments", + "name": "toolInputArgs", + "type": "array", + "acceptVariable": true, + "refresh": true, + "array": [ + { + "label": "Input Argument Name", + "name": "inputArgName", + "type": "asyncOptions", + "loadMethod": "listToolInputArgs", + "refresh": true + }, + { + "label": "Input Argument Value", + "name": "inputArgValue", + "type": "string", + "acceptVariable": true + } + ], + "show": { + "toolAgentflowSelectedTool": ".+" + }, + "id": "toolAgentflow_0-input-toolInputArgs-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "toolUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "toolAgentflow_0-input-toolUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "toolAgentflowSelectedTool": "gmail", + "toolInputArgs": [ + { + "inputArgName": "to", + "inputArgValue": "

{{ $form.from }}

" + }, + { + "inputArgName": "subject", + "inputArgValue": "

{{ llmAgentflow_0.output.subject }}

" + }, + { + "inputArgName": "body", + "inputArgValue": "

{{ llmAgentflow_0.output.body }}

" + } + ], + "toolUpdateState": "", + "toolAgentflowSelectedToolConfig": { + "gmailType": "messages", + "messageActions": "[\"sendMessage\"]", + "toolAgentflowSelectedTool": "gmail" + }, + "undefined": "" + }, + "outputAnchors": [ + { + "id": "toolAgentflow_0-output-toolAgentflow", + "label": "Tool", + "name": "toolAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 143, + "height": 68, + "selected": false, + "positionAbsolute": { + "x": 607.0106274902857, + "y": 44.74028001269521 + }, + "dragging": false + }, + { + "id": "llmAgentflow_0", + "position": { + "x": 368.9022119252032, + "y": 43.50583396320786 + }, + "data": { + "id": "llmAgentflow_0", + "label": "Email Subject & Body", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": [ + "LLM" + ], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_0-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_0-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_0-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_0-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_0-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_0-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_0-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatOpenAI", + "llmMessages": [], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": [ + { + "key": "subject", + "type": "string", + "enumValues": "", + "jsonSchema": "", + "description": "Subject of the email" + }, + { + "key": "body", + "type": "string", + "enumValues": "", + "jsonSchema": "", + "description": "Body of the email" + } + ], + "llmUpdateState": "", + "llmModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "llmModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_0-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 209, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 368.9022119252032, + "y": 43.50583396320786 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "agentAgentflow_0", + "targetHandle": "agentAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#4DD0E1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-agentAgentflow_0-agentAgentflow_0" + }, + { + "source": "agentAgentflow_0", + "sourceHandle": "agentAgentflow_0-output-agentAgentflow", + "target": "humanInputAgentflow_0", + "targetHandle": "humanInputAgentflow_0", + "data": { + "sourceColor": "#4DD0E1", + "targetColor": "#6E6EFD", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "agentAgentflow_0-agentAgentflow_0-output-agentAgentflow-humanInputAgentflow_0-humanInputAgentflow_0" + }, + { + "source": "humanInputAgentflow_0", + "sourceHandle": "humanInputAgentflow_0-output-1", + "target": "loopAgentflow_0", + "targetHandle": "loopAgentflow_0", + "data": { + "sourceColor": "#6E6EFD", + "targetColor": "#FFA07A", + "edgeLabel": "reject", + "isHumanInput": true + }, + "type": "agentFlow", + "id": "humanInputAgentflow_0-humanInputAgentflow_0-output-1-loopAgentflow_0-loopAgentflow_0" + }, + { + "source": "humanInputAgentflow_0", + "sourceHandle": "humanInputAgentflow_0-output-0", + "target": "llmAgentflow_0", + "targetHandle": "llmAgentflow_0", + "data": { + "sourceColor": "#6E6EFD", + "targetColor": "#64B5F6", + "edgeLabel": "proceed", + "isHumanInput": true + }, + "type": "agentFlow", + "id": "humanInputAgentflow_0-humanInputAgentflow_0-output-0-llmAgentflow_0-llmAgentflow_0" + }, + { + "source": "llmAgentflow_0", + "sourceHandle": "llmAgentflow_0-output-llmAgentflow", + "target": "toolAgentflow_0", + "targetHandle": "toolAgentflow_0", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#d4a373", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-toolAgentflow_0-toolAgentflow_0" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/OpenAPI Chatflow.json b/cn/.gitbook/assets/OpenAPI Chatflow.json new file mode 100644 index 00000000..7c4f9d1c --- /dev/null +++ b/cn/.gitbook/assets/OpenAPI Chatflow.json @@ -0,0 +1,868 @@ +{ + "nodes": [ + { + "id": "openAIToolAgent_0", + "position": { + "x": 2043.452556953855, + "y": 419.243930407276 + }, + "type": "customNode", + "data": { + "id": "openAIToolAgent_0", + "label": "OpenAI Tool Agent", + "version": 1, + "name": "openAIToolAgent", + "type": "AgentExecutor", + "baseClasses": [ + "AgentExecutor", + "BaseChain", + "Runnable" + ], + "category": "Agents", + "description": "Agent that uses OpenAI Function Calling to pick the tools and args to call", + "inputParams": [ + { + "label": "System Message", + "name": "systemMessage", + "type": "string", + "rows": 4, + "optional": true, + "additionalParams": true, + "id": "openAIToolAgent_0-input-systemMessage-string" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "id": "openAIToolAgent_0-input-tools-Tool" + }, + { + "label": "Memory", + "name": "memory", + "type": "BaseChatMemory", + "id": "openAIToolAgent_0-input-memory-BaseChatMemory" + }, + { + "label": "OpenAI/Azure Chat Model", + "name": "model", + "type": "BaseChatModel", + "id": "openAIToolAgent_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "openAIToolAgent_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "tools": [ + "{{chainTool_0.data.instance}}" + ], + "memory": "{{bufferMemory_0.data.instance}}", + "model": "{{chatOpenAI_1.data.instance}}", + "systemMessage": "", + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "openAIToolAgent_0-output-openAIToolAgent-AgentExecutor|BaseChain|Runnable", + "name": "openAIToolAgent", + "label": "AgentExecutor", + "description": "Agent that uses OpenAI Function Calling to pick the tools and args to call", + "type": "AgentExecutor | BaseChain | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 434, + "selected": false, + "positionAbsolute": { + "x": 2043.452556953855, + "y": 419.243930407276 + }, + "dragging": false + }, + { + "id": "chatOpenAI_1", + "position": { + "x": 1172.9727392624852, + "y": 531.4096673286917 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_1", + "label": "ChatOpenAI", + "version": 5, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_1-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "gpt-4", + "name": "gpt-4" + }, + { + "label": "gpt-4-turbo-preview", + "name": "gpt-4-turbo-preview" + }, + { + "label": "gpt-4-0125-preview", + "name": "gpt-4-0125-preview" + }, + { + "label": "gpt-4-1106-preview", + "name": "gpt-4-1106-preview" + }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, + { + "label": "gpt-4-vision-preview", + "name": "gpt-4-vision-preview" + }, + { + "label": "gpt-4-0613", + "name": "gpt-4-0613" + }, + { + "label": "gpt-4-32k", + "name": "gpt-4-32k" + }, + { + "label": "gpt-4-32k-0613", + "name": "gpt-4-32k-0613" + }, + { + "label": "gpt-3.5-turbo", + "name": "gpt-3.5-turbo" + }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, + { + "label": "gpt-3.5-turbo-1106", + "name": "gpt-3.5-turbo-1106" + }, + { + "label": "gpt-3.5-turbo-0613", + "name": "gpt-3.5-turbo-0613" + }, + { + "label": "gpt-3.5-turbo-16k", + "name": "gpt-3.5-turbo-16k" + }, + { + "label": "gpt-3.5-turbo-16k-0613", + "name": "gpt-3.5-turbo-16k-0613" + } + ], + "default": "gpt-3.5-turbo", + "optional": true, + "id": "chatOpenAI_1-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_1-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_1-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_1-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_1-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo-16k", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": 1172.9727392624852, + "y": 531.4096673286917 + }, + "dragging": false + }, + { + "id": "bufferMemory_0", + "position": { + "x": 748.796752834334, + "y": 770.3068397228885 + }, + "type": "customNode", + "data": { + "id": "bufferMemory_0", + "label": "Buffer Memory", + "version": 1, + "name": "bufferMemory", + "type": "BufferMemory", + "baseClasses": [ + "BufferMemory", + "BaseChatMemory", + "BaseMemory" + ], + "category": "Memory", + "description": "Remembers previous conversational back and forths directly", + "inputParams": [ + { + "label": "Memory Key", + "name": "memoryKey", + "type": "string", + "default": "chat_history", + "id": "bufferMemory_0-input-memoryKey-string" + }, + { + "label": "Input Key", + "name": "inputKey", + "type": "string", + "default": "input", + "id": "bufferMemory_0-input-inputKey-string" + } + ], + "inputAnchors": [], + "inputs": { + "memoryKey": "chat_history", + "inputKey": "input" + }, + "outputAnchors": [ + { + "id": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "name": "bufferMemory", + "label": "BufferMemory", + "description": "Remembers previous conversational back and forths directly", + "type": "BufferMemory | BaseChatMemory | BaseMemory" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 376, + "selected": false, + "positionAbsolute": { + "x": 748.796752834334, + "y": 770.3068397228885 + }, + "dragging": false + }, + { + "id": "openApiChain_0", + "position": { + "x": 1145.3060530569107, + "y": -103.11418698407195 + }, + "type": "customNode", + "data": { + "id": "openApiChain_0", + "label": "OpenAPI Chain", + "version": 2, + "name": "openApiChain", + "type": "OpenAPIChain", + "baseClasses": [ + "OpenAPIChain", + "BaseChain", + "Runnable" + ], + "category": "Chains", + "description": "Chain that automatically select and call APIs based only on an OpenAPI spec", + "inputParams": [ + { + "label": "YAML Link", + "name": "yamlLink", + "type": "string", + "placeholder": "https://api.speak.com/openapi.yaml", + "description": "If YAML link is provided, uploaded YAML File will be ignored and YAML link will be used instead", + "id": "openApiChain_0-input-yamlLink-string" + }, + { + "label": "YAML File", + "name": "yamlFile", + "type": "file", + "fileType": ".yaml", + "description": "If YAML link is provided, uploaded YAML File will be ignored and YAML link will be used instead", + "id": "openApiChain_0-input-yamlFile-file" + }, + { + "label": "Headers", + "name": "headers", + "type": "json", + "additionalParams": true, + "optional": true, + "id": "openApiChain_0-input-headers-json" + } + ], + "inputAnchors": [ + { + "label": "ChatOpenAI Model", + "name": "model", + "type": "ChatOpenAI", + "id": "openApiChain_0-input-model-ChatOpenAI" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "openApiChain_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_2.data.instance}}", + "yamlLink": "", + "headers": "", + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "openApiChain_0-output-openApiChain-OpenAPIChain|BaseChain|Runnable", + "name": "openApiChain", + "label": "OpenAPIChain", + "description": "Chain that automatically select and call APIs based only on an OpenAPI spec", + "type": "OpenAPIChain | BaseChain | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 561, + "selected": false, + "positionAbsolute": { + "x": 1145.3060530569107, + "y": -103.11418698407195 + }, + "dragging": false + }, + { + "id": "chatOpenAI_2", + "position": { + "x": 759.2922754505641, + "y": -147.3984427366269 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_2", + "label": "ChatOpenAI", + "version": 5, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_2-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "gpt-4", + "name": "gpt-4" + }, + { + "label": "gpt-4-turbo-preview", + "name": "gpt-4-turbo-preview" + }, + { + "label": "gpt-4-0125-preview", + "name": "gpt-4-0125-preview" + }, + { + "label": "gpt-4-1106-preview", + "name": "gpt-4-1106-preview" + }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, + { + "label": "gpt-4-vision-preview", + "name": "gpt-4-vision-preview" + }, + { + "label": "gpt-4-0613", + "name": "gpt-4-0613" + }, + { + "label": "gpt-4-32k", + "name": "gpt-4-32k" + }, + { + "label": "gpt-4-32k-0613", + "name": "gpt-4-32k-0613" + }, + { + "label": "gpt-3.5-turbo", + "name": "gpt-3.5-turbo" + }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, + { + "label": "gpt-3.5-turbo-1106", + "name": "gpt-3.5-turbo-1106" + }, + { + "label": "gpt-3.5-turbo-0613", + "name": "gpt-3.5-turbo-0613" + }, + { + "label": "gpt-3.5-turbo-16k", + "name": "gpt-3.5-turbo-16k" + }, + { + "label": "gpt-3.5-turbo-16k-0613", + "name": "gpt-3.5-turbo-16k-0613" + } + ], + "default": "gpt-3.5-turbo", + "optional": true, + "id": "chatOpenAI_2-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_2-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_2-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_2-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_2-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo-16k", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": 759.2922754505641, + "y": -147.3984427366269 + }, + "dragging": false + }, + { + "id": "chainTool_0", + "position": { + "x": 1521.7629525254497, + "y": -103.11418698407192 + }, + "type": "customNode", + "data": { + "id": "chainTool_0", + "label": "Chain Tool", + "version": 1, + "name": "chainTool", + "type": "ChainTool", + "baseClasses": [ + "ChainTool", + "DynamicTool", + "Tool", + "StructuredTool", + "Runnable" + ], + "category": "Tools", + "description": "Use a chain as allowed tool for agent", + "inputParams": [ + { + "label": "Chain Name", + "name": "name", + "type": "string", + "placeholder": "state-of-union-qa", + "id": "chainTool_0-input-name-string" + }, + { + "label": "Chain Description", + "name": "description", + "type": "string", + "rows": 3, + "placeholder": "State of the Union QA - useful for when you need to ask questions about the most recent state of the union address.", + "id": "chainTool_0-input-description-string" + }, + { + "label": "Return Direct", + "name": "returnDirect", + "type": "boolean", + "optional": true, + "id": "chainTool_0-input-returnDirect-boolean" + } + ], + "inputAnchors": [ + { + "label": "Base Chain", + "name": "baseChain", + "type": "BaseChain", + "id": "chainTool_0-input-baseChain-BaseChain" + } + ], + "inputs": { + "name": "search_shirt", + "description": "useful when you need to search and return answer about tshirts", + "returnDirect": false, + "baseChain": "{{openApiChain_0.data.instance}}" + }, + "outputAnchors": [ + { + "id": "chainTool_0-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool|Runnable", + "name": "chainTool", + "label": "ChainTool", + "description": "Use a chain as allowed tool for agent", + "type": "ChainTool | DynamicTool | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 602, + "selected": false, + "positionAbsolute": { + "x": 1521.7629525254497, + "y": -103.11418698407192 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "chatOpenAI_1", + "sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "openAIToolAgent_0", + "targetHandle": "openAIToolAgent_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-openAIToolAgent_0-openAIToolAgent_0-input-model-BaseChatModel" + }, + { + "source": "bufferMemory_0", + "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "target": "openAIToolAgent_0", + "targetHandle": "openAIToolAgent_0-input-memory-BaseChatMemory", + "type": "buttonedge", + "id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-openAIToolAgent_0-openAIToolAgent_0-input-memory-BaseChatMemory" + }, + { + "source": "chatOpenAI_2", + "sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "openApiChain_0", + "targetHandle": "openApiChain_0-input-model-ChatOpenAI", + "type": "buttonedge", + "id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-openApiChain_0-openApiChain_0-input-model-ChatOpenAI" + }, + { + "source": "openApiChain_0", + "sourceHandle": "openApiChain_0-output-openApiChain-OpenAPIChain|BaseChain|Runnable", + "target": "chainTool_0", + "targetHandle": "chainTool_0-input-baseChain-BaseChain", + "type": "buttonedge", + "id": "openApiChain_0-openApiChain_0-output-openApiChain-OpenAPIChain|BaseChain|Runnable-chainTool_0-chainTool_0-input-baseChain-BaseChain" + }, + { + "source": "chainTool_0", + "sourceHandle": "chainTool_0-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool|Runnable", + "target": "openAIToolAgent_0", + "targetHandle": "openAIToolAgent_0-input-tools-Tool", + "type": "buttonedge", + "id": "chainTool_0-chainTool_0-output-chainTool-ChainTool|DynamicTool|Tool|StructuredTool|Runnable-openAIToolAgent_0-openAIToolAgent_0-input-tools-Tool" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/OpenAPI Toolkit with ToolAgent Chatflow.json b/cn/.gitbook/assets/OpenAPI Toolkit with ToolAgent Chatflow.json new file mode 100644 index 00000000..f83cc3b0 --- /dev/null +++ b/cn/.gitbook/assets/OpenAPI Toolkit with ToolAgent Chatflow.json @@ -0,0 +1,491 @@ +{ + "nodes": [ + { + "id": "toolAgent_0", + "position": { + "x": 1293.1879986131244, + "y": 191.1741937636126 + }, + "type": "customNode", + "data": { + "id": "toolAgent_0", + "label": "Tool Agent", + "version": 2, + "name": "toolAgent", + "type": "AgentExecutor", + "baseClasses": [ + "AgentExecutor", + "BaseChain", + "Runnable" + ], + "category": "Agents", + "description": "Agent that uses Function Calling to pick the tools and args to call", + "inputParams": [ + { + "label": "System Message", + "name": "systemMessage", + "type": "string", + "default": "You are a helpful AI assistant.", + "description": "If Chat Prompt Template is provided, this will be ignored", + "rows": 4, + "optional": true, + "additionalParams": true, + "id": "toolAgent_0-input-systemMessage-string" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "toolAgent_0-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "id": "toolAgent_0-input-tools-Tool" + }, + { + "label": "Memory", + "name": "memory", + "type": "BaseChatMemory", + "id": "toolAgent_0-input-memory-BaseChatMemory" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat", + "id": "toolAgent_0-input-model-BaseChatModel" + }, + { + "label": "Chat Prompt Template", + "name": "chatPromptTemplate", + "type": "ChatPromptTemplate", + "description": "Override existing prompt with Chat Prompt Template. Human Message must includes {input} variable", + "optional": true, + "id": "toolAgent_0-input-chatPromptTemplate-ChatPromptTemplate" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "toolAgent_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "tools": [ + "{{openAPIToolkit_0.data.instance}}" + ], + "memory": "{{bufferMemory_0.data.instance}}", + "model": "{{chatOpenAI_0.data.instance}}", + "chatPromptTemplate": "", + "systemMessage": "You are a helpful AI assistant.", + "inputModeration": "", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "toolAgent_0-output-toolAgent-AgentExecutor|BaseChain|Runnable", + "name": "toolAgent", + "label": "AgentExecutor", + "description": "Agent that uses Function Calling to pick the tools and args to call", + "type": "AgentExecutor | BaseChain | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 484, + "selected": false, + "positionAbsolute": { + "x": 1293.1879986131244, + "y": 191.1741937636126 + }, + "dragging": false + }, + { + "id": "bufferMemory_0", + "position": { + "x": 828.6997922809826, + "y": 483.14472669268787 + }, + "type": "customNode", + "data": { + "id": "bufferMemory_0", + "label": "Buffer Memory", + "version": 2, + "name": "bufferMemory", + "type": "BufferMemory", + "baseClasses": [ + "BufferMemory", + "BaseChatMemory", + "BaseMemory" + ], + "category": "Memory", + "description": "Retrieve chat messages stored in database", + "inputParams": [ + { + "label": "Session Id", + "name": "sessionId", + "type": "string", + "description": "If not specified, a random id will be used. Learn more", + "default": "", + "additionalParams": true, + "optional": true, + "id": "bufferMemory_0-input-sessionId-string" + }, + { + "label": "Memory Key", + "name": "memoryKey", + "type": "string", + "default": "chat_history", + "additionalParams": true, + "id": "bufferMemory_0-input-memoryKey-string" + } + ], + "inputAnchors": [], + "inputs": { + "sessionId": "", + "memoryKey": "chat_history" + }, + "outputAnchors": [ + { + "id": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "name": "bufferMemory", + "label": "BufferMemory", + "description": "Retrieve chat messages stored in database", + "type": "BufferMemory | BaseChatMemory | BaseMemory" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 251, + "selected": false, + "positionAbsolute": { + "x": 828.6997922809826, + "y": 483.14472669268787 + }, + "dragging": false + }, + { + "id": "chatOpenAI_0", + "position": { + "x": 427.0142725311101, + "y": -43.8666581648755 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 7, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-asyncOptions" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "Proxy Url", + "name": "proxyUrl", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-proxyUrl-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, Conversational Agent, Tool Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo", + "temperature": "0.9", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 669, + "selected": false, + "positionAbsolute": { + "x": 427.0142725311101, + "y": -43.8666581648755 + }, + "dragging": false + }, + { + "id": "openAPIToolkit_0", + "position": { + "x": 831.9599233268808, + "y": -32.87251462719371 + }, + "type": "customNode", + "data": { + "id": "openAPIToolkit_0", + "label": "OpenAPI Toolkit", + "version": 2, + "name": "openAPIToolkit", + "type": "OpenAPIToolkit", + "baseClasses": [ + "OpenAPIToolkit", + "Tool" + ], + "category": "Tools", + "description": "Load OpenAPI specification, and converts each API endpoint to a tool", + "inputParams": [ + { + "label": "YAML File", + "name": "yamlFile", + "type": "file", + "fileType": ".yaml", + "id": "openAPIToolkit_0-input-yamlFile-file" + }, + { + "label": "Return Direct", + "name": "returnDirect", + "description": "Return the output of the tool directly to the user", + "type": "boolean", + "optional": true, + "id": "openAPIToolkit_0-input-returnDirect-boolean" + }, + { + "label": "Headers", + "name": "headers", + "type": "json", + "description": "Request headers to be sent with the API request. For example, {\"Authorization\": \"Bearer token\"}", + "additionalParams": true, + "optional": true, + "id": "openAPIToolkit_0-input-headers-json" + }, + { + "label": "Custom Code", + "name": "customCode", + "type": "code", + "hint": { + "label": "How to use", + "value": "- **Libraries:** \n You can use any libraries imported in Flowise.\n\n- **Tool Input Arguments:** \n Tool input arguments are available as the following variables:\n - `$PathParameters`\n - `$QueryParameters`\n - `$RequestBody`\n\n- **HTTP Requests:** \n By default, you can get the following values for making HTTP requests:\n - `$url`\n - `$options`\n\n- **Default Flow Config:** \n You can access the default flow configuration using these variables:\n - `$flow.sessionId`\n - `$flow.chatId`\n - `$flow.chatflowId`\n - `$flow.input`\n - `$flow.state`\n\n- **Custom Variables:** \n You can get custom variables using the syntax:\n - `$vars.`\n\n- **Return Value:** \n The function must return a **string** value at the end.\n\n```js\nconst fetch = require('node-fetch');\nconst url = $url;\nconst options = $options;\n\ntry {\n\tconst response = await fetch(url, options);\n\tconst resp = await response.json();\n\treturn JSON.stringify(resp);\n} catch (error) {\n\tconsole.error(error);\n\treturn '';\n}\n\n```\n" + }, + "codeExample": "const fetch = require('node-fetch');\nconst url = $url;\nconst options = $options;\n\ntry {\n\tconst response = await fetch(url, options);\n\tconst resp = await response.json();\n\treturn JSON.stringify(resp);\n} catch (error) {\n\tconsole.error(error);\n\treturn '';\n}\n", + "description": "Custom code to return the output of the tool. The code should be a function that takes in the input and returns a string", + "hideCodeExecute": true, + "default": "const fetch = require('node-fetch');\nconst url = $url;\nconst options = $options;\n\ntry {\n\tconst response = await fetch(url, options);\n\tconst resp = await response.json();\n\treturn JSON.stringify(resp);\n} catch (error) {\n\tconsole.error(error);\n\treturn '';\n}\n", + "additionalParams": true, + "id": "openAPIToolkit_0-input-customCode-code" + } + ], + "inputAnchors": [], + "inputs": { + "returnDirect": "", + "headers": "{\"Authorization\":\"Bearer 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\"}", + "customCode": "const fetch = require('node-fetch');\nconst url = $url;\nconsole.log('url=', url);\nconst options = $options;\nconsole.log('options=', options);\n\ntry {\n\tconst response = await fetch(url, options);\n\tconst resp = await response.json();\n console.log('resp=', resp);\n\treturn JSON.stringify(resp);\n} catch (error) {\n\tconsole.error(error);\n\treturn '';\n}\n" + }, + "outputAnchors": [ + { + "id": "openAPIToolkit_0-output-openAPIToolkit-OpenAPIToolkit|Tool", + "name": "openAPIToolkit", + "label": "OpenAPIToolkit", + "description": "Load OpenAPI specification, and converts each API endpoint to a tool", + "type": "OpenAPIToolkit | Tool" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 457, + "selected": false, + "positionAbsolute": { + "x": 831.9599233268808, + "y": -32.87251462719371 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "bufferMemory_0", + "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "target": "toolAgent_0", + "targetHandle": "toolAgent_0-input-memory-BaseChatMemory", + "type": "buttonedge", + "id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-toolAgent_0-toolAgent_0-input-memory-BaseChatMemory" + }, + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "toolAgent_0", + "targetHandle": "toolAgent_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-toolAgent_0-toolAgent_0-input-model-BaseChatModel" + }, + { + "source": "openAPIToolkit_0", + "sourceHandle": "openAPIToolkit_0-output-openAPIToolkit-OpenAPIToolkit|Tool", + "target": "toolAgent_0", + "targetHandle": "toolAgent_0-input-tools-Tool", + "type": "buttonedge", + "id": "openAPIToolkit_0-openAPIToolkit_0-output-openAPIToolkit-OpenAPIToolkit|Tool-toolAgent_0-toolAgent_0-input-tools-Tool" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/Picture1 (1).png b/cn/.gitbook/assets/Picture1 (1).png new file mode 100644 index 00000000..f1936b4c Binary files /dev/null and b/cn/.gitbook/assets/Picture1 (1).png differ diff --git a/cn/.gitbook/assets/Picture1.png b/cn/.gitbook/assets/Picture1.png new file mode 100644 index 00000000..6d851c87 Binary files /dev/null and b/cn/.gitbook/assets/Picture1.png differ diff --git a/cn/.gitbook/assets/Picture7.png b/cn/.gitbook/assets/Picture7.png new file mode 100644 index 00000000..a3e9a0f4 Binary files /dev/null and b/cn/.gitbook/assets/Picture7.png differ diff --git a/cn/.gitbook/assets/Requests Tool Agent.json b/cn/.gitbook/assets/Requests Tool Agent.json new file mode 100644 index 00000000..ecd911d3 --- /dev/null +++ b/cn/.gitbook/assets/Requests Tool Agent.json @@ -0,0 +1,626 @@ +{ + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": 100, + "y": 100 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": false + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": false + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": false + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true, + "id": "startAgentflow_0-input-startEphemeralMemory-boolean", + "display": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar", + "optional": true + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "chatInput", + "formTitle": "", + "formDescription": "", + "formInputTypes": "", + "startEphemeralMemory": "", + "startState": "", + "startPersistState": "" + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "positionAbsolute": { + "x": 100, + "y": 100 + }, + "selected": false + }, + { + "id": "agentAgentflow_0", + "position": { + "x": 240, + "y": 83.5 + }, + "data": { + "id": "agentAgentflow_0", + "label": "Parent Agent", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_0-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_0-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_0-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_0-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_0-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_0-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_0-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_0-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_0-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatOpenAI", + "agentMessages": [ + { + "role": "system", + "content": "

You are helpful assistant.

Todays date time is {{ current_date_time }}

" + } + ], + "agentTools": [ + { + "agentSelectedTool": "requestsGet", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "requestsGetUrl": "

http://localhost:5566/events

", + "requestsGetName": "get_events", + "requestsGetDescription": "Use this when you need to get events", + "requestsGetHeaders": "", + "requestsGetQueryParamsSchema": "{\n \"id\": {\n \"type\": \"string\",\n \"in\": \"path\",\n \"description\": \"ID of the item to get. /:id\"\n },\n \"limit\": {\n \"type\": \"string\",\n \"in\": \"query\",\n \"description\": \"Limit the number of items to get. ?limit=10\"\n }\n}", + "requestsGetMaxOutputLength": "2000", + "agentSelectedTool": "requestsGet" + } + }, + { + "agentSelectedTool": "requestsPost", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "requestsPostUrl": "

http://localhost:5566/events

", + "requestsPostName": "create_event", + "requestsPostDescription": "Use this when you want to create a new event", + "requestsPostHeaders": "", + "requestPostBody": "", + "requestsPostBodySchema": "{\n \"name\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Name of the event\"\n },\n \"date\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Date of the event\"\n },\n \"location\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Location of the event\"\n }\n}", + "requestsPostMaxOutputLength": "2000", + "agentSelectedTool": "requestsPost" + } + }, + { + "agentSelectedTool": "requestsPut", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "requestsPutUrl": "

http://localhost:5566/events

", + "requestsPutName": "update_event", + "requestsPutDescription": "Use this when you want to update an event", + "requestsPutHeaders": "", + "requestPutBody": "", + "requestsPutBodySchema": "{\n \"name\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Name of the event\"\n },\n \"date\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Date of the event\"\n },\n \"location\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Location of the event\"\n }\n}", + "requestsPutMaxOutputLength": "2000", + "agentSelectedTool": "requestsPut" + } + }, + { + "agentSelectedTool": "requestsDelete", + "agentSelectedToolRequiresHumanInput": "", + "agentSelectedToolConfig": { + "requestsDeleteUrl": "

http://localhost:5566/events

", + "requestsDeleteName": "delete_event", + "requestsDeleteDescription": "Use this when you need to delete event", + "requestsDeleteHeaders": "", + "requestsDeleteQueryParamsSchema": "{\n \"id\": {\n \"type\": \"string\",\n \"required\": true,\n \"in\": \"path\",\n \"description\": \"ID of the item to delete. /:id\"\n }\n}", + "requestsDeleteMaxOutputLength": "2000", + "agentSelectedTool": "requestsDelete" + } + } + ], + "agentKnowledgeDocumentStores": [], + "agentKnowledgeVSEmbeddings": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "agentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_0-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 176, + "height": 100, + "selected": false, + "positionAbsolute": { + "x": 240, + "y": 83.5 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "agentAgentflow_0", + "targetHandle": "agentAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#4DD0E1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-agentAgentflow_0-agentAgentflow_0" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/SQL Agent.json b/cn/.gitbook/assets/SQL Agent.json new file mode 100644 index 00000000..70f5d6b4 --- /dev/null +++ b/cn/.gitbook/assets/SQL Agent.json @@ -0,0 +1,2078 @@ +{ + "description": "An agent that can perform question answering over a database", + "usecases": ["SQL"], + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": -97, + "y": 108 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": false + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": false + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": false + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true, + "id": "startAgentflow_0-input-startEphemeralMemory-boolean", + "display": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar", + "optional": true + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "chatInput", + "formTitle": "", + "formDescription": "", + "formInputTypes": "", + "startEphemeralMemory": "", + "startState": [ + { + "key": "sqlQuery", + "value": "" + } + ], + "startPersistState": "" + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": -97, + "y": 108 + }, + "dragging": false + }, + { + "id": "customFunctionAgentflow_0", + "position": { + "x": 58.5, + "y": 109 + }, + "data": { + "id": "customFunctionAgentflow_0", + "label": "Get DB Schema", + "version": 1, + "name": "customFunctionAgentflow", + "type": "CustomFunction", + "color": "#E4B7FF", + "baseClasses": [ + "CustomFunction" + ], + "category": "Agent Flows", + "description": "Execute custom function", + "inputParams": [ + { + "label": "Input Variables", + "name": "customFunctionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $foo", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Variable Name", + "name": "variableName", + "type": "string" + }, + { + "label": "Variable Value", + "name": "variableValue", + "type": "string", + "acceptVariable": true + } + ], + "id": "customFunctionAgentflow_0-input-customFunctionInputVariables-array", + "display": true + }, + { + "label": "Javascript Function", + "name": "customFunctionJavascriptFunction", + "type": "code", + "codeExample": "/*\n* You can use any libraries imported in Flowise\n* You can use properties specified in Input Schema as variables. Ex: Property = userid, Variable = $userid\n* You can get default flow config: $flow.sessionId, $flow.chatId, $flow.chatflowId, $flow.input, $flow.state\n* You can get custom variables: $vars.\n* Must return a string value at the end of function\n*/\n\nconst fetch = require('node-fetch');\nconst url = 'https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true';\nconst options = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n};\ntry {\n const response = await fetch(url, options);\n const text = await response.text();\n return text;\n} catch (error) {\n console.error(error);\n return '';\n}", + "description": "The function to execute. Must return a string or an object that can be converted to a string.", + "id": "customFunctionAgentflow_0-input-customFunctionJavascriptFunction-code", + "display": true + }, + { + "label": "Update Flow State", + "name": "customFunctionUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "customFunctionAgentflow_0-input-customFunctionUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "customFunctionInputVariables": "", + "customFunctionJavascriptFunction": "const { DataSource } = require('typeorm');\n\nconst HOST = 'localhost';\nconst USER = 'testuser';\nconst PASSWORD = 'testpwd';\nconst DATABASE = 'abudhabi';\nconst PORT = 5555;\n\nlet sqlSchemaPrompt = '';\n\nconst AppDataSource = new DataSource({\n type: 'postgres',\n host: HOST,\n port: PORT,\n username: USER,\n password: PASSWORD,\n database: DATABASE,\n synchronize: false,\n logging: false,\n});\n\nasync function getSQLPrompt() {\n try {\n await AppDataSource.initialize();\n const queryRunner = AppDataSource.createQueryRunner();\n\n // Get all user-defined tables (excluding system tables)\n const tablesResult = await queryRunner.query(`\n SELECT table_name\n FROM information_schema.tables\n WHERE table_schema = 'public' AND table_type = 'BASE TABLE'\n `);\n\n for (const tableRow of tablesResult) {\n const tableName = tableRow.table_name;\n\n const schemaInfo = await queryRunner.query(`\n SELECT column_name, data_type, is_nullable\n FROM information_schema.columns\n WHERE table_name = '${tableName}'\n `);\n\n const createColumns = [];\n const columnNames = [];\n\n for (const column of schemaInfo) {\n const name = column.column_name;\n const type = column.data_type.toUpperCase();\n const notNull = column.is_nullable === 'NO' ? 'NOT NULL' : '';\n columnNames.push(name);\n createColumns.push(`${name} ${type} ${notNull}`);\n }\n\n const sqlCreateTableQuery = `CREATE TABLE ${tableName} (${createColumns.join(', ')})`;\n const sqlSelectTableQuery = `SELECT * FROM ${tableName} LIMIT 3`;\n\n let allValues = [];\n try {\n const rows = await queryRunner.query(sqlSelectTableQuery);\n\n allValues = rows.map(row =>\n columnNames.map(col => row[col]).join(' ')\n );\n } catch (err) {\n allValues.push('[ERROR FETCHING ROWS]');\n }\n\n sqlSchemaPrompt +=\n sqlCreateTableQuery +\n '\\n' +\n sqlSelectTableQuery +\n '\\n' +\n columnNames.join(' ') +\n '\\n' +\n allValues.join('\\n') +\n '\\n\\n';\n }\n\n await queryRunner.release();\n } catch (err) {\n console.error(err);\n throw err;\n }\n}\n\nasync function main() {\n await getSQLPrompt();\n}\n\nawait main();\n\nreturn sqlSchemaPrompt;\n", + "customFunctionUpdateState": "" + }, + "outputAnchors": [ + { + "id": "customFunctionAgentflow_0-output-customFunctionAgentflow", + "label": "Custom Function", + "name": "customFunctionAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 173, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": 58.5, + "y": 109 + }, + "dragging": false + }, + { + "id": "llmAgentflow_0", + "position": { + "x": 272.7184381707814, + "y": 106.61165168988839 + }, + "data": { + "id": "llmAgentflow_0", + "label": "Generate SQL Query", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": [ + "LLM" + ], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_0-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_0-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_0-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_0-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_0-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_0-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_0-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatAnthropic", + "llmMessages": [ + { + "role": "system", + "content": "

You are an agent designed to interact with a SQL database. Given an input question, create a syntactically correct sqlite query to run, then look at the results of the query and return the answer. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most 5 results. You can order the results by a relevant column to return the most interesting examples in the database. Never query for all the columns from a specific table, only ask for the relevant columns given the question. DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.

Here is the relevant table info:

{{ customFunctionAgentflow_0 }}

Note:

" + } + ], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": [ + { + "key": "sql_query", + "type": "string", + "enumValues": "", + "jsonSchema": "", + "description": "SQL query" + } + ], + "llmUpdateState": [ + { + "key": "sqlQuery", + "value": "

{{ output.sql_query }}

" + } + ], + "llmModelConfig": { + "credential": "", + "modelName": "claude-sonnet-4-0", + "temperature": 0.9, + "streaming": true, + "maxTokensToSample": "", + "topP": "", + "topK": "", + "extendedThinking": "", + "budgetTokens": 1024, + "allowImageUploads": "", + "llmModel": "chatAnthropic" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_0-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 213, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 272.7184381707814, + "y": 106.61165168988839 + }, + "dragging": false + }, + { + "id": "conditionAgentAgentflow_0", + "position": { + "x": 511.16504493033483, + "y": 101.98220225318451 + }, + "data": { + "id": "conditionAgentAgentflow_0", + "label": "Check SQL Query", + "version": 1, + "name": "conditionAgentAgentflow", + "type": "ConditionAgent", + "color": "#ff8fab", + "baseClasses": [ + "ConditionAgent" + ], + "category": "Agent Flows", + "description": "Utilize an agent to split flows based on dynamic conditions", + "inputParams": [ + { + "label": "Model", + "name": "conditionAgentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "conditionAgentAgentflow_0-input-conditionAgentModel-asyncOptions", + "display": true + }, + { + "label": "Instructions", + "name": "conditionAgentInstructions", + "type": "string", + "description": "A general instructions of what the condition agent should do", + "rows": 4, + "acceptVariable": true, + "placeholder": "Determine if the user is interested in learning about AI", + "id": "conditionAgentAgentflow_0-input-conditionAgentInstructions-string", + "display": true + }, + { + "label": "Input", + "name": "conditionAgentInput", + "type": "string", + "description": "Input to be used for the condition agent", + "rows": 4, + "acceptVariable": true, + "default": "

{{ question }}

", + "id": "conditionAgentAgentflow_0-input-conditionAgentInput-string", + "display": true + }, + { + "label": "Scenarios", + "name": "conditionAgentScenarios", + "description": "Define the scenarios that will be used as the conditions to split the flow", + "type": "array", + "array": [ + { + "label": "Scenario", + "name": "scenario", + "type": "string", + "placeholder": "User is asking for a pizza" + } + ], + "default": [ + { + "scenario": "SQL query is correct and does not contains mistakes" + }, + { + "scenario": "SQL query contains mistakes" + } + ], + "id": "conditionAgentAgentflow_0-input-conditionAgentScenarios-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "conditionAgentModel": "chatOpenAI", + "conditionAgentInstructions": "

You are a SQL expert with a strong attention to detail. Double check the SQL query for common mistakes, including:

- Using NOT IN with NULL values

- Using UNION when UNION ALL should have been used

- Using BETWEEN for exclusive ranges

- Data type mismatch in predicates

- Properly quoting identifiers

- Using the correct number of arguments for functions

- Casting to the correct data type

- Using the proper columns for joins

", + "conditionAgentInput": "

{{ $flow.state.sqlQuery }}

", + "conditionAgentScenarios": [ + { + "scenario": "SQL query is correct and does not contains mistakes" + }, + { + "scenario": "SQL query contains mistakes" + } + ], + "conditionAgentModelConfig": { + "credential": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "conditionAgentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "conditionAgentAgentflow_0-output-0", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + }, + { + "id": "conditionAgentAgentflow_0-output-1", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + } + ], + "outputs": { + "conditionAgentAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 187, + "height": 80, + "selected": false, + "positionAbsolute": { + "x": 511.16504493033483, + "y": 101.98220225318451 + }, + "dragging": false + }, + { + "id": "loopAgentflow_0", + "position": { + "x": 762.44734302386, + "y": 182.95996068910745 + }, + "data": { + "id": "loopAgentflow_0", + "label": "Regenerate Query", + "version": 1, + "name": "loopAgentflow", + "type": "Loop", + "color": "#FFA07A", + "hideOutput": true, + "baseClasses": [ + "Loop" + ], + "category": "Agent Flows", + "description": "Loop back to a previous node", + "inputParams": [ + { + "label": "Loop Back To", + "name": "loopBackToNode", + "type": "asyncOptions", + "loadMethod": "listPreviousNodes", + "freeSolo": true, + "id": "loopAgentflow_0-input-loopBackToNode-asyncOptions", + "display": true + }, + { + "label": "Max Loop Count", + "name": "maxLoopCount", + "type": "number", + "default": 5, + "id": "loopAgentflow_0-input-maxLoopCount-number", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "loopBackToNode": "llmAgentflow_0-Generate SQL Query", + "maxLoopCount": 5 + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 190, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": 762.44734302386, + "y": 182.95996068910745 + }, + "dragging": false + }, + { + "id": "customFunctionAgentflow_1", + "position": { + "x": 761.3261621815544, + "y": 44.65096212173265 + }, + "data": { + "id": "customFunctionAgentflow_1", + "label": "Run SQL Query", + "version": 1, + "name": "customFunctionAgentflow", + "type": "CustomFunction", + "color": "#E4B7FF", + "baseClasses": [ + "CustomFunction" + ], + "category": "Agent Flows", + "description": "Execute custom function", + "inputParams": [ + { + "label": "Input Variables", + "name": "customFunctionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $foo", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Variable Name", + "name": "variableName", + "type": "string" + }, + { + "label": "Variable Value", + "name": "variableValue", + "type": "string", + "acceptVariable": true + } + ], + "id": "customFunctionAgentflow_1-input-customFunctionInputVariables-array", + "display": true + }, + { + "label": "Javascript Function", + "name": "customFunctionJavascriptFunction", + "type": "code", + "codeExample": "/*\n* You can use any libraries imported in Flowise\n* You can use properties specified in Input Schema as variables. Ex: Property = userid, Variable = $userid\n* You can get default flow config: $flow.sessionId, $flow.chatId, $flow.chatflowId, $flow.input, $flow.state\n* You can get custom variables: $vars.\n* Must return a string value at the end of function\n*/\n\nconst fetch = require('node-fetch');\nconst url = 'https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t_weather=true';\nconst options = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n};\ntry {\n const response = await fetch(url, options);\n const text = await response.text();\n return text;\n} catch (error) {\n console.error(error);\n return '';\n}", + "description": "The function to execute. Must return a string or an object that can be converted to a string.", + "id": "customFunctionAgentflow_1-input-customFunctionJavascriptFunction-code", + "display": true + }, + { + "label": "Update Flow State", + "name": "customFunctionUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "customFunctionAgentflow_1-input-customFunctionUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "customFunctionInputVariables": [ + { + "variableName": "sqlQuery", + "variableValue": "

{{ $flow.state.sqlQuery }}

" + } + ], + "customFunctionJavascriptFunction": "const { DataSource } = require('typeorm');\n\n// Configuration\nconst HOST = 'localhost';\nconst USER = 'testuser';\nconst PASSWORD = 'testpwd';\nconst DATABASE = 'abudhabi';\nconst PORT = 5555;\n\nconst sqlQuery = $sqlQuery;\n\nconst AppDataSource = new DataSource({\n type: 'postgres',\n host: HOST,\n port: PORT,\n username: USER,\n password: PASSWORD,\n database: DATABASE,\n synchronize: false,\n logging: false,\n});\n\nlet formattedResult = '';\n\nasync function runSQLQuery(query) {\n try {\n await AppDataSource.initialize();\n const queryRunner = AppDataSource.createQueryRunner();\n\n const rows = await queryRunner.query(query);\n console.log('rows =', rows);\n\n if (rows.length === 0) {\n formattedResult = '[No results returned]';\n } else {\n const columnNames = Object.keys(rows[0]);\n const header = columnNames.join(' ');\n const values = rows.map(row =>\n columnNames.map(col => row[col]).join(' ')\n );\n\n formattedResult = query + '\\n' + header + '\\n' + values.join('\\n');\n }\n\n await queryRunner.release();\n } catch (err) {\n console.error('[ERROR]', err);\n formattedResult = `[Error executing query]: ${err}`;\n }\n\n return formattedResult;\n}\n\nasync function main() {\n formattedResult = await runSQLQuery(sqlQuery);\n}\n\nawait main();\n\nreturn formattedResult;\n", + "customFunctionUpdateState": "" + }, + "outputAnchors": [ + { + "id": "customFunctionAgentflow_1-output-customFunctionAgentflow", + "label": "Custom Function", + "name": "customFunctionAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 171, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": 761.3261621815544, + "y": 44.65096212173265 + }, + "dragging": false + }, + { + "id": "llmAgentflow_1", + "position": { + "x": 1238.7660285501179, + "y": 20.56658816269558 + }, + "data": { + "id": "llmAgentflow_1", + "label": "Return Response", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": [ + "LLM" + ], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_1-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_1-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_1-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_1-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_1-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_1-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_1-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_1-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_1-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_1-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatGoogleGenerativeAI", + "llmMessages": [], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "

{{ customFunctionAgentflow_1 }}

", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": "", + "llmUpdateState": "", + "llmModelConfig": { + "credential": "", + "modelName": "gemini-2.0-flash", + "customModelName": "", + "temperature": 0.9, + "streaming": true, + "maxOutputTokens": "", + "topP": "", + "topK": "", + "harmCategory": "", + "harmBlockThreshold": "", + "baseUrl": "", + "allowImageUploads": "", + "llmModel": "chatGoogleGenerativeAI" + }, + "undefined": "" + }, + "outputAnchors": [ + { + "id": "llmAgentflow_1-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 199, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 1238.7660285501179, + "y": 20.56658816269558 + }, + "dragging": false + }, + { + "id": "conditionAgentAgentflow_1", + "position": { + "x": 966.5436041632489, + "y": 57.77868724229256 + }, + "data": { + "id": "conditionAgentAgentflow_1", + "label": "Check Result", + "version": 1, + "name": "conditionAgentAgentflow", + "type": "ConditionAgent", + "color": "#ff8fab", + "baseClasses": [ + "ConditionAgent" + ], + "category": "Agent Flows", + "description": "Utilize an agent to split flows based on dynamic conditions", + "inputParams": [ + { + "label": "Model", + "name": "conditionAgentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "conditionAgentAgentflow_1-input-conditionAgentModel-asyncOptions", + "display": true + }, + { + "label": "Instructions", + "name": "conditionAgentInstructions", + "type": "string", + "description": "A general instructions of what the condition agent should do", + "rows": 4, + "acceptVariable": true, + "placeholder": "Determine if the user is interested in learning about AI", + "id": "conditionAgentAgentflow_1-input-conditionAgentInstructions-string", + "display": true + }, + { + "label": "Input", + "name": "conditionAgentInput", + "type": "string", + "description": "Input to be used for the condition agent", + "rows": 4, + "acceptVariable": true, + "default": "

{{ question }}

", + "id": "conditionAgentAgentflow_1-input-conditionAgentInput-string", + "display": true + }, + { + "label": "Scenarios", + "name": "conditionAgentScenarios", + "description": "Define the scenarios that will be used as the conditions to split the flow", + "type": "array", + "array": [ + { + "label": "Scenario", + "name": "scenario", + "type": "string", + "placeholder": "User is asking for a pizza" + } + ], + "default": [ + { + "scenario": "Result is correct and does not contains error" + }, + { + "scenario": "Result query contains error" + } + ], + "id": "conditionAgentAgentflow_1-input-conditionAgentScenarios-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "conditionAgentModel": "chatMistralAI", + "conditionAgentInstructions": "

You are a SQL expert. Check if the query result is correct or contains error.

", + "conditionAgentInput": "

{{ customFunctionAgentflow_1 }}

", + "conditionAgentScenarios": [ + { + "scenario": "Result is correct and does not contains error" + }, + { + "scenario": "Result query contains error" + } + ], + "conditionAgentModelConfig": { + "credential": "", + "modelName": "mistral-medium-latest", + "temperature": 0.9, + "streaming": true, + "maxOutputTokens": "", + "topP": "", + "randomSeed": "", + "safeMode": "", + "overrideEndpoint": "", + "conditionAgentModel": "chatMistralAI" + } + }, + "outputAnchors": [ + { + "id": "conditionAgentAgentflow_1-output-0", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + }, + { + "id": "conditionAgentAgentflow_1-output-1", + "label": "Condition Agent", + "name": "conditionAgentAgentflow" + } + ], + "outputs": { + "conditionAgentAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 228, + "height": 80, + "selected": false, + "positionAbsolute": { + "x": 966.5436041632489, + "y": 57.77868724229256 + }, + "dragging": false + }, + { + "id": "loopAgentflow_1", + "position": { + "x": 1501.0055934843515, + "y": 140.83809747682727 + }, + "data": { + "id": "loopAgentflow_1", + "label": "Recheck SQL Query", + "version": 1, + "name": "loopAgentflow", + "type": "Loop", + "color": "#FFA07A", + "hideOutput": true, + "baseClasses": [ + "Loop" + ], + "category": "Agent Flows", + "description": "Loop back to a previous node", + "inputParams": [ + { + "label": "Loop Back To", + "name": "loopBackToNode", + "type": "asyncOptions", + "loadMethod": "listPreviousNodes", + "freeSolo": true, + "id": "loopAgentflow_1-input-loopBackToNode-asyncOptions", + "display": true + }, + { + "label": "Max Loop Count", + "name": "maxLoopCount", + "type": "number", + "default": 5, + "id": "loopAgentflow_1-input-maxLoopCount-number", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "loopBackToNode": "conditionAgentAgentflow_0-Check SQL Query", + "maxLoopCount": 5, + "undefined": "" + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 202, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": 1501.0055934843515, + "y": 140.83809747682727 + }, + "dragging": false + }, + { + "id": "llmAgentflow_2", + "position": { + "x": 1235.4868883628933, + "y": 137.82100195002667 + }, + "data": { + "id": "llmAgentflow_2", + "label": "Regenerate SQL Query", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": [ + "LLM" + ], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_2-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_2-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_2-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_2-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_2-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_2-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_2-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_2-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_2-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_2-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatAnthropic", + "llmMessages": [ + { + "role": "system", + "content": "

You are an agent designed to interact with a SQL database. Given an input question, create a syntactically correct sqlite query to run, then look at the results of the query and return the answer. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most 5 results. You can order the results by a relevant column to return the most interesting examples in the database. Never query for all the columns from a specific table, only ask for the relevant columns given the question. DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.

Here is the relevant table info:

{{ customFunctionAgentflow_0 }}

" + } + ], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "

Given the generated SQL Query: {{ $flow.state.sqlQuery }}

I have the following error: {{ customFunctionAgentflow_1 }}

Regenerate a new SQL Query that will fix the error

", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": [ + { + "key": "sql_query", + "type": "string", + "enumValues": "", + "jsonSchema": "", + "description": "SQL query" + } + ], + "llmUpdateState": [ + { + "key": "sqlQuery", + "value": "

{{ output.sql_query }}

" + } + ], + "llmModelConfig": { + "credential": "", + "modelName": "claude-sonnet-4-0", + "temperature": 0.9, + "streaming": true, + "maxTokensToSample": "", + "topP": "", + "topK": "", + "extendedThinking": "", + "budgetTokens": 1024, + "allowImageUploads": "", + "llmModel": "chatAnthropic" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_2-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 220, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 1235.4868883628933, + "y": 137.82100195002667 + }, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_0", + "position": { + "x": 973.4435331695138, + "y": 156.551869199512 + }, + "data": { + "id": "stickyNoteAgentflow_0", + "label": "Sticky Note", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": [ + "StickyNote" + ], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_0-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "This is an auto correct mechanism that regenerate sql query if result contains error" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_0-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 210, + "height": 123, + "selected": false, + "positionAbsolute": { + "x": 973.4435331695138, + "y": 156.551869199512 + }, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_1", + "position": { + "x": 514.8377809033279, + "y": 200.97994630025966 + }, + "data": { + "id": "stickyNoteAgentflow_1", + "label": "Sticky Note (1)", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": [ + "StickyNote" + ], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_1-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "Check if generated SQL query contains errors/mistakes, if yes - regenerate" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_1-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 210, + "height": 123, + "selected": false, + "positionAbsolute": { + "x": 514.8377809033279, + "y": 200.97994630025966 + }, + "dragging": false + }, + { + "id": "stickyNoteAgentflow_2", + "position": { + "x": 40.21835449345774, + "y": 6.978337213146034 + }, + "data": { + "id": "stickyNoteAgentflow_2", + "label": "Sticky Note (1) (2)", + "version": 1, + "name": "stickyNoteAgentflow", + "type": "StickyNote", + "color": "#fee440", + "baseClasses": [ + "StickyNote" + ], + "category": "Agent Flows", + "description": "Add notes to the agent flow", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNoteAgentflow_2-input-note-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "note": "Retrieve database schema" + }, + "outputAnchors": [ + { + "id": "stickyNoteAgentflow_2-output-stickyNoteAgentflow", + "label": "Sticky Note", + "name": "stickyNoteAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "stickyNote", + "width": 210, + "height": 82, + "selected": false, + "positionAbsolute": { + "x": 40.21835449345774, + "y": 6.978337213146034 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "customFunctionAgentflow_0", + "targetHandle": "customFunctionAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#E4B7FF", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-customFunctionAgentflow_0-customFunctionAgentflow_0" + }, + { + "source": "customFunctionAgentflow_0", + "sourceHandle": "customFunctionAgentflow_0-output-customFunctionAgentflow", + "target": "llmAgentflow_0", + "targetHandle": "llmAgentflow_0", + "data": { + "sourceColor": "#E4B7FF", + "targetColor": "#64B5F6", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "customFunctionAgentflow_0-customFunctionAgentflow_0-output-customFunctionAgentflow-llmAgentflow_0-llmAgentflow_0" + }, + { + "source": "llmAgentflow_0", + "sourceHandle": "llmAgentflow_0-output-llmAgentflow", + "target": "conditionAgentAgentflow_0", + "targetHandle": "conditionAgentAgentflow_0", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#ff8fab", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-conditionAgentAgentflow_0-conditionAgentAgentflow_0" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-0", + "target": "customFunctionAgentflow_1", + "targetHandle": "customFunctionAgentflow_1", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#E4B7FF", + "edgeLabel": "0", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-0-customFunctionAgentflow_1-customFunctionAgentflow_1" + }, + { + "source": "conditionAgentAgentflow_0", + "sourceHandle": "conditionAgentAgentflow_0-output-1", + "target": "loopAgentflow_0", + "targetHandle": "loopAgentflow_0", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#FFA07A", + "edgeLabel": "1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_0-conditionAgentAgentflow_0-output-1-loopAgentflow_0-loopAgentflow_0" + }, + { + "source": "customFunctionAgentflow_1", + "sourceHandle": "customFunctionAgentflow_1-output-customFunctionAgentflow", + "target": "conditionAgentAgentflow_1", + "targetHandle": "conditionAgentAgentflow_1", + "data": { + "sourceColor": "#E4B7FF", + "targetColor": "#ff8fab", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "customFunctionAgentflow_1-customFunctionAgentflow_1-output-customFunctionAgentflow-conditionAgentAgentflow_1-conditionAgentAgentflow_1" + }, + { + "source": "conditionAgentAgentflow_1", + "sourceHandle": "conditionAgentAgentflow_1-output-0", + "target": "llmAgentflow_1", + "targetHandle": "llmAgentflow_1", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#64B5F6", + "edgeLabel": "0", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_1-conditionAgentAgentflow_1-output-0-llmAgentflow_1-llmAgentflow_1" + }, + { + "source": "conditionAgentAgentflow_1", + "sourceHandle": "conditionAgentAgentflow_1-output-1", + "target": "llmAgentflow_2", + "targetHandle": "llmAgentflow_2", + "data": { + "sourceColor": "#ff8fab", + "targetColor": "#64B5F6", + "edgeLabel": "1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentAgentflow_1-conditionAgentAgentflow_1-output-1-llmAgentflow_2-llmAgentflow_2" + }, + { + "source": "llmAgentflow_2", + "sourceHandle": "llmAgentflow_2-output-llmAgentflow", + "target": "loopAgentflow_1", + "targetHandle": "loopAgentflow_1", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#FFA07A", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_2-llmAgentflow_2-output-llmAgentflow-loopAgentflow_1-loopAgentflow_1" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/SQL Chatflow (1).json b/cn/.gitbook/assets/SQL Chatflow (1).json new file mode 100644 index 00000000..89bb5965 --- /dev/null +++ b/cn/.gitbook/assets/SQL Chatflow (1).json @@ -0,0 +1,2087 @@ +{ + "nodes": [ + { + "width": 300, + "height": 511, + "id": "promptTemplate_0", + "position": { + "x": 384.4880563109088, + "y": 253.48974179902635 + }, + "type": "customNode", + "data": { + "id": "promptTemplate_0", + "label": "Prompt Template", + "version": 1, + "name": "promptTemplate", + "type": "PromptTemplate", + "baseClasses": [ + "PromptTemplate", + "BaseStringPromptTemplate", + "BasePromptTemplate", + "Runnable" + ], + "category": "Prompts", + "description": "Schema to represent a basic prompt for an LLM", + "inputParams": [ + { + "label": "Template", + "name": "template", + "type": "string", + "rows": 4, + "placeholder": "What is a good name for a company that makes {product}?", + "id": "promptTemplate_0-input-template-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "promptTemplate_0-input-promptValues-json" + } + ], + "inputAnchors": [], + "inputs": { + "template": "You are a MySQL expert. Given an input question, create a syntactically correct MySQL query to run.\nUnless otherwise specified, do not return more than {topK} rows.\n\nHere is the relevant table info:\n{schema}\n\nBelow are a number of examples of questions and their corresponding SQL queries.\n\nUser input: List all artists.\nSQL Query: SELECT * FROM Artist;\n\nUser input: Find all albums for the artist 'AC/DC'.\nSQL Query: SELECT * FROM Album WHERE ArtistId = (SELECT ArtistId FROM Artist WHERE Name = 'AC/DC');\n\nUser input: List all tracks in the 'Rock' genre.\nSQL Query: SELECT * FROM Track WHERE GenreId = (SELECT GenreId FROM Genre WHERE Name = 'Rock');\n\nUser input: Find the total duration of all tracks.\nSQL Query: SELECT SUM(Milliseconds) FROM Track;\n\nUser input: List all customers from Canada.\nSQL Query: SELECT * FROM Customer WHERE Country = 'Canada';\n\nUser input: {question}\nSQL query:", + "promptValues": "{\"schema\":\"{{customFunction_2.data.instance}}\",\"question\":\"{{question}}\",\"topK\":3}" + }, + "outputAnchors": [ + { + "id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "name": "promptTemplate", + "label": "PromptTemplate", + "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 384.4880563109088, + "y": 253.48974179902635 + }, + "dragging": false + }, + { + "width": 300, + "height": 507, + "id": "llmChain_0", + "position": { + "x": 770.4559230968546, + "y": -127.11351409346554 + }, + "type": "customNode", + "data": { + "id": "llmChain_0", + "label": "LLM Chain", + "version": 3, + "name": "llmChain", + "type": "LLMChain", + "baseClasses": [ + "LLMChain", + "BaseChain", + "Runnable" + ], + "category": "Chains", + "description": "Chain to run queries against LLMs", + "inputParams": [ + { + "label": "Chain Name", + "name": "chainName", + "type": "string", + "placeholder": "Name Your Chain", + "optional": true, + "id": "llmChain_0-input-chainName-string" + } + ], + "inputAnchors": [ + { + "label": "Language Model", + "name": "model", + "type": "BaseLanguageModel", + "id": "llmChain_0-input-model-BaseLanguageModel" + }, + { + "label": "Prompt", + "name": "prompt", + "type": "BasePromptTemplate", + "id": "llmChain_0-input-prompt-BasePromptTemplate" + }, + { + "label": "Output Parser", + "name": "outputParser", + "type": "BaseLLMOutputParser", + "optional": true, + "id": "llmChain_0-input-outputParser-BaseLLMOutputParser" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "llmChain_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_0.data.instance}}", + "prompt": "{{promptTemplate_0.data.instance}}", + "outputParser": "", + "inputModeration": "", + "chainName": "SQL Query Chain" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable", + "name": "llmChain", + "label": "LLM Chain", + "type": "LLMChain | BaseChain | Runnable" + }, + { + "id": "llmChain_0-output-outputPrediction-string|json", + "name": "outputPrediction", + "label": "Output Prediction", + "type": "string | json" + } + ], + "default": "llmChain" + } + ], + "outputs": { + "output": "outputPrediction" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 770.4559230968546, + "y": -127.11351409346554 + }, + "dragging": false + }, + { + "width": 300, + "height": 669, + "id": "chatOpenAI_0", + "position": { + "x": 376.92707114970364, + "y": -666.8088336865496 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo-16k", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": true, + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 376.92707114970364, + "y": -666.8088336865496 + }, + "dragging": false + }, + { + "width": 300, + "height": 669, + "id": "chatOpenAI_1", + "position": { + "x": 2653.726672579251, + "y": -665.8849139437705 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_1", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_1-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_1-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_1-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_1-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_1-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_1-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo-16k", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": true, + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 2653.726672579251, + "y": -665.8849139437705 + }, + "dragging": false + }, + { + "width": 300, + "height": 507, + "id": "llmChain_1", + "position": { + "x": 3089.9937691022837, + "y": -109.24001734925716 + }, + "type": "customNode", + "data": { + "id": "llmChain_1", + "label": "LLM Chain", + "version": 3, + "name": "llmChain", + "type": "LLMChain", + "baseClasses": [ + "LLMChain", + "BaseChain", + "Runnable" + ], + "category": "Chains", + "description": "Chain to run queries against LLMs", + "inputParams": [ + { + "label": "Chain Name", + "name": "chainName", + "type": "string", + "placeholder": "Name Your Chain", + "optional": true, + "id": "llmChain_1-input-chainName-string" + } + ], + "inputAnchors": [ + { + "label": "Language Model", + "name": "model", + "type": "BaseLanguageModel", + "id": "llmChain_1-input-model-BaseLanguageModel" + }, + { + "label": "Prompt", + "name": "prompt", + "type": "BasePromptTemplate", + "id": "llmChain_1-input-prompt-BasePromptTemplate" + }, + { + "label": "Output Parser", + "name": "outputParser", + "type": "BaseLLMOutputParser", + "optional": true, + "id": "llmChain_1-input-outputParser-BaseLLMOutputParser" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "llmChain_1-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_1.data.instance}}", + "prompt": "{{promptTemplate_1.data.instance}}", + "outputParser": "", + "inputModeration": "", + "chainName": "Final Chain" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "llmChain_1-output-llmChain-LLMChain|BaseChain|Runnable", + "name": "llmChain", + "label": "LLM Chain", + "type": "LLMChain | BaseChain | Runnable" + }, + { + "id": "llmChain_1-output-outputPrediction-string|json", + "name": "outputPrediction", + "label": "Output Prediction", + "type": "string | json" + } + ], + "default": "llmChain" + } + ], + "outputs": { + "output": "llmChain" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 3089.9937691022837, + "y": -109.24001734925716 + }, + "dragging": false + }, + { + "width": 300, + "height": 674, + "id": "customFunction_2", + "position": { + "x": -19.95227863012829, + "y": -125.50600296188355 + }, + "type": "customNode", + "data": { + "id": "customFunction_2", + "label": "Custom JS Function", + "version": 2, + "name": "customFunction", + "type": "CustomFunction", + "baseClasses": [ + "CustomFunction", + "Utilities" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Execute custom javascript function", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "customFunction_2-input-functionInputVariables-json" + }, + { + "label": "Function Name", + "name": "functionName", + "type": "string", + "optional": true, + "placeholder": "My Function", + "id": "customFunction_2-input-functionName-string" + }, + { + "label": "Javascript Function", + "name": "javascriptFunction", + "type": "code", + "id": "customFunction_2-input-javascriptFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "", + "functionName": "Get SQL Schema Prompt", + "javascriptFunction": "const HOST = 'singlestore-host.com';\nconst USER = 'admin';\nconst PASSWORD = 'mypassword';\nconst DATABASE = 'mydb';\nconst TABLE = 'samples';\nconst mysql = require('mysql2/promise');\n\nlet sqlSchemaPrompt;\n\n/**\n * Ideal prompt contains schema info and examples\n * Follows best practices as specified form https://arxiv.org/abs/2204.00498\n * =========================================\n * CREATE TABLE samples (firstName varchar NOT NULL, lastName varchar)\n * SELECT * FROM samples LIMIT 3\n * firstName lastName\n * Stephen Tyler\n * Jack McGinnis\n * Steven Repici\n * =========================================\n*/\nfunction getSQLPrompt() {\n return new Promise(async (resolve, reject) => {\n try {\n const singleStoreConnection = mysql.createPool({\n host: HOST,\n user: USER,\n password: PASSWORD,\n database: DATABASE,\n });\n \n // Get schema info\n const [schemaInfo] = await singleStoreConnection.execute(\n `SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = \"${TABLE}\"`\n );\n \n const createColumns = [];\n const columnNames = [];\n \n for (const schemaData of schemaInfo) {\n columnNames.push(`${schemaData['COLUMN_NAME']}`);\n createColumns.push(`${schemaData['COLUMN_NAME']} ${schemaData['COLUMN_TYPE']} ${schemaData['IS_NULLABLE'] === 'NO' ? 'NOT NULL' : ''}`);\n }\n \n const sqlCreateTableQuery = `CREATE TABLE samples (${createColumns.join(', ')})`;\n const sqlSelectTableQuery = `SELECT * FROM samples LIMIT 3`;\n \n // Get first 3 rows\n const [rows] = await singleStoreConnection.execute(\n sqlSelectTableQuery,\n );\n \n const allValues = [];\n for (const row of rows) {\n const rowValues = [];\n for (const colName in row) {\n rowValues.push(row[colName]);\n }\n allValues.push(rowValues.join(' '));\n }\n \n sqlSchemaPrompt = sqlCreateTableQuery + '\\n' + sqlSelectTableQuery + '\\n' + columnNames.join(' ') + '\\n' + allValues.join('\\n');\n \n resolve();\n } catch (e) {\n console.error(e);\n return reject(e);\n }\n });\n}\n\nasync function main() {\n await getSQLPrompt();\n}\n\nawait main();\n\nreturn sqlSchemaPrompt;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "customFunction_2-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "description": "", + "type": "string | number | boolean | json | array" + }, + { + "id": "customFunction_2-output-EndingNode-CustomFunction", + "name": "EndingNode", + "label": "Ending Node", + "description": "", + "type": "CustomFunction" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": -19.95227863012829, + "y": -125.50600296188355 + }, + "dragging": false + }, + { + "width": 300, + "height": 674, + "id": "customFunction_1", + "position": { + "x": 1887.4670208331604, + "y": -275.95340782935716 + }, + "type": "customNode", + "data": { + "id": "customFunction_1", + "label": "Custom JS Function", + "version": 2, + "name": "customFunction", + "type": "CustomFunction", + "baseClasses": [ + "CustomFunction", + "Utilities" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Execute custom javascript function", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "customFunction_1-input-functionInputVariables-json" + }, + { + "label": "Function Name", + "name": "functionName", + "type": "string", + "optional": true, + "placeholder": "My Function", + "id": "customFunction_1-input-functionName-string" + }, + { + "label": "Javascript Function", + "name": "javascriptFunction", + "type": "code", + "id": "customFunction_1-input-javascriptFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "{\"sqlQuery\":\"{{setVariable_1.data.instance}}\"}", + "functionName": "Run SQL Query", + "javascriptFunction": "const HOST = 'singlestore-host.com';\nconst USER = 'admin';\nconst PASSWORD = 'mypassword';\nconst DATABASE = 'mydb';\nconst TABLE = 'samples';\nconst mysql = require('mysql2/promise');\n\nlet result;\n\nfunction getSQLResult() {\n return new Promise(async (resolve, reject) => {\n try {\n const singleStoreConnection = mysql.createPool({\n host: HOST,\n user: USER,\n password: PASSWORD,\n database: DATABASE,\n });\n \n const [rows] = await singleStoreConnection.execute(\n $sqlQuery\n );\n \n result = JSON.stringify(rows)\n \n resolve();\n } catch (e) {\n console.error(e);\n return reject(e);\n }\n });\n}\n\nasync function main() {\n await getSQLResult();\n}\n\nawait main();\n\nreturn result;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "customFunction_1-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "description": "", + "type": "string | number | boolean | json | array" + }, + { + "id": "customFunction_1-output-EndingNode-CustomFunction", + "name": "EndingNode", + "label": "Ending Node", + "description": "", + "type": "CustomFunction" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1887.4670208331604, + "y": -275.95340782935716 + }, + "dragging": false + }, + { + "width": 300, + "height": 511, + "id": "promptTemplate_1", + "position": { + "x": 2655.2632506040304, + "y": 218.145615216618 + }, + "type": "customNode", + "data": { + "id": "promptTemplate_1", + "label": "Prompt Template", + "version": 1, + "name": "promptTemplate", + "type": "PromptTemplate", + "baseClasses": [ + "PromptTemplate", + "BaseStringPromptTemplate", + "BasePromptTemplate", + "Runnable" + ], + "category": "Prompts", + "description": "Schema to represent a basic prompt for an LLM", + "inputParams": [ + { + "label": "Template", + "name": "template", + "type": "string", + "rows": 4, + "placeholder": "What is a good name for a company that makes {product}?", + "id": "promptTemplate_1-input-template-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "promptTemplate_1-input-promptValues-json" + } + ], + "inputAnchors": [], + "inputs": { + "template": "Given the following user question, corresponding SQL query, and SQL result, answer the user question as details as possible.\n\nQuestion: {question}\n\nSQL Query: {sqlQuery}\n\nSQL Result: {sqlResponse}\n\nAnswer:\n", + "promptValues": "{\"question\":\"{{question}}\",\"sqlResponse\":\"{{customFunction_1.data.instance}}\",\"sqlQuery\":\"{{getVariable_1.data.instance}}\"}" + }, + "outputAnchors": [ + { + "id": "promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "name": "promptTemplate", + "label": "PromptTemplate", + "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 2655.2632506040304, + "y": 218.145615216618 + } + }, + { + "width": 300, + "height": 304, + "id": "getVariable_1", + "position": { + "x": 2272.8555266616872, + "y": 24.11364076336241 + }, + "type": "customNode", + "data": { + "id": "getVariable_1", + "label": "Get Variable", + "version": 2, + "name": "getVariable", + "type": "GetVariable", + "baseClasses": [ + "GetVariable", + "Utilities" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Get variable that was saved using Set Variable node", + "inputParams": [ + { + "label": "Variable Name", + "name": "variableName", + "type": "string", + "placeholder": "var1", + "id": "getVariable_1-input-variableName-string" + } + ], + "inputAnchors": [], + "inputs": { + "variableName": "sqlQuery" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "getVariable_1-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "description": "", + "type": "string | number | boolean | json | array" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "positionAbsolute": { + "x": 2272.8555266616872, + "y": 24.11364076336241 + }, + "selected": false, + "dragging": false + }, + { + "width": 300, + "height": 355, + "id": "setVariable_1", + "position": { + "x": 1516.338224315744, + "y": -133.6986023683283 + }, + "type": "customNode", + "data": { + "id": "setVariable_1", + "label": "Set Variable", + "version": 2, + "name": "setVariable", + "type": "SetVariable", + "baseClasses": [ + "SetVariable", + "Utilities" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Set variable which can be retrieved at a later stage. Variable is only available during runtime.", + "inputParams": [ + { + "label": "Variable Name", + "name": "variableName", + "type": "string", + "placeholder": "var1", + "id": "setVariable_1-input-variableName-string" + } + ], + "inputAnchors": [ + { + "label": "Input", + "name": "input", + "type": "string | number | boolean | json | array", + "optional": true, + "list": true, + "id": "setVariable_1-input-input-string | number | boolean | json | array" + } + ], + "inputs": { + "input": [ + "{{ifElseFunction_0.data.instance}}" + ], + "variableName": "sqlQuery" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "setVariable_1-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "description": "", + "type": "string | number | boolean | json | array" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1516.338224315744, + "y": -133.6986023683283 + }, + "dragging": false + }, + { + "width": 300, + "height": 765, + "id": "ifElseFunction_0", + "position": { + "x": 1147.8020838770517, + "y": -237.39478763322148 + }, + "type": "customNode", + "data": { + "id": "ifElseFunction_0", + "label": "IfElse Function", + "version": 2, + "name": "ifElseFunction", + "type": "IfElseFunction", + "baseClasses": [ + "IfElseFunction", + "Utilities" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Split flows based on If Else javascript functions", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "ifElseFunction_0-input-functionInputVariables-json" + }, + { + "label": "IfElse Name", + "name": "functionName", + "type": "string", + "optional": true, + "placeholder": "If Condition Match", + "id": "ifElseFunction_0-input-functionName-string" + }, + { + "label": "If Function", + "name": "ifFunction", + "description": "Function must return a value", + "type": "code", + "rows": 2, + "default": "if (\"hello\" == \"hello\") {\n return true;\n}", + "id": "ifElseFunction_0-input-ifFunction-code" + }, + { + "label": "Else Function", + "name": "elseFunction", + "description": "Function must return a value", + "type": "code", + "rows": 2, + "default": "return false;", + "id": "ifElseFunction_0-input-elseFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "{\"sqlQuery\":\"{{llmChain_0.data.instance}}\"}", + "functionName": "IF SQL Query contains SELECT and WHERE", + "ifFunction": "const sqlQuery = $sqlQuery.trim();\n\nconst regex = /SELECT\\s.*?(?:\\n|$)/gi;\n\n// Extracting the SQL part\nconst matches = sqlQuery.match(regex);\nconst cleanSql = matches ? matches[0].trim() : \"\";\n\nif (cleanSql.includes(\"SELECT\") && cleanSql.includes(\"WHERE\")) {\n return cleanSql;\n}", + "elseFunction": "return $sqlQuery;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "ifElseFunction_0-output-returnTrue-string|number|boolean|json|array", + "name": "returnTrue", + "label": "True", + "description": "", + "type": "string | number | boolean | json | array" + }, + { + "id": "ifElseFunction_0-output-returnFalse-string|number|boolean|json|array", + "name": "returnFalse", + "label": "False", + "description": "", + "type": "string | number | boolean | json | array" + } + ], + "default": "returnTrue" + } + ], + "outputs": { + "output": "returnTrue" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1147.8020838770517, + "y": -237.39478763322148 + }, + "dragging": false + }, + { + "width": 300, + "height": 511, + "id": "promptTemplate_2", + "position": { + "x": 1193.7489579044463, + "y": 615.4009446588724 + }, + "type": "customNode", + "data": { + "id": "promptTemplate_2", + "label": "Prompt Template", + "version": 1, + "name": "promptTemplate", + "type": "PromptTemplate", + "baseClasses": [ + "PromptTemplate", + "BaseStringPromptTemplate", + "BasePromptTemplate", + "Runnable" + ], + "category": "Prompts", + "description": "Schema to represent a basic prompt for an LLM", + "inputParams": [ + { + "label": "Template", + "name": "template", + "type": "string", + "rows": 4, + "placeholder": "What is a good name for a company that makes {product}?", + "id": "promptTemplate_2-input-template-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "promptTemplate_2-input-promptValues-json" + } + ], + "inputAnchors": [], + "inputs": { + "template": "Politely say \"I'm not able to answer query\"", + "promptValues": "{\"schema\":\"{{setVariable_0.data.instance}}\",\"question\":\"{{question}}\"}" + }, + "outputAnchors": [ + { + "id": "promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "name": "promptTemplate", + "label": "PromptTemplate", + "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1193.7489579044463, + "y": 615.4009446588724 + }, + "dragging": false + }, + { + "width": 300, + "height": 669, + "id": "chatOpenAI_2", + "position": { + "x": 1545.1023725538003, + "y": 493.5495798408175 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_2", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_2-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_2-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_2-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_2-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_2-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_2-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo-16k", + "temperature": "0.7", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": true, + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1545.1023725538003, + "y": 493.5495798408175 + }, + "dragging": false + }, + { + "width": 300, + "height": 507, + "id": "llmChain_2", + "position": { + "x": 1914.509823868027, + "y": 622.3435967391327 + }, + "type": "customNode", + "data": { + "id": "llmChain_2", + "label": "LLM Chain", + "version": 3, + "name": "llmChain", + "type": "LLMChain", + "baseClasses": [ + "LLMChain", + "BaseChain", + "Runnable" + ], + "category": "Chains", + "description": "Chain to run queries against LLMs", + "inputParams": [ + { + "label": "Chain Name", + "name": "chainName", + "type": "string", + "placeholder": "Name Your Chain", + "optional": true, + "id": "llmChain_2-input-chainName-string" + } + ], + "inputAnchors": [ + { + "label": "Language Model", + "name": "model", + "type": "BaseLanguageModel", + "id": "llmChain_2-input-model-BaseLanguageModel" + }, + { + "label": "Prompt", + "name": "prompt", + "type": "BasePromptTemplate", + "id": "llmChain_2-input-prompt-BasePromptTemplate" + }, + { + "label": "Output Parser", + "name": "outputParser", + "type": "BaseLLMOutputParser", + "optional": true, + "id": "llmChain_2-input-outputParser-BaseLLMOutputParser" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "llmChain_2-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_2.data.instance}}", + "prompt": "{{promptTemplate_2.data.instance}}", + "outputParser": "", + "inputModeration": "", + "chainName": "Fallback Chain" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "llmChain_2-output-llmChain-LLMChain|BaseChain|Runnable", + "name": "llmChain", + "label": "LLM Chain", + "type": "LLMChain | BaseChain | Runnable" + }, + { + "id": "llmChain_2-output-outputPrediction-string|json", + "name": "outputPrediction", + "label": "Output Prediction", + "type": "string | json" + } + ], + "default": "llmChain" + } + ], + "outputs": { + "output": "llmChain" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1914.509823868027, + "y": 622.3435967391327 + }, + "dragging": false + }, + { + "id": "stickyNote_0", + "position": { + "x": -18.950231412347364, + "y": -192.2980180516393 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_0", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_0-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "First, get SQL database schema" + }, + "outputAnchors": [ + { + "id": "stickyNote_0-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 42, + "selected": false, + "positionAbsolute": { + "x": -18.950231412347364, + "y": -192.2980180516393 + }, + "dragging": false + }, + { + "id": "stickyNote_1", + "position": { + "x": 1510.6324834799852, + "y": -221.78240261184442 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_1", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_1-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "Save as variable to be used at the last Prompt Template" + }, + "outputAnchors": [ + { + "id": "stickyNote_1-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 62, + "selected": false, + "positionAbsolute": { + "x": 1510.6324834799852, + "y": -221.78240261184442 + }, + "dragging": false + }, + { + "id": "stickyNote_2", + "position": { + "x": 386.88037412001086, + "y": 47.66735767574478 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_2", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_2-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "Instruct LLM to return a SQL query using the schema.\n\nRecommend to give few examples for higher accuracy. \n\nChange the prompt accordingly to suit the type of database you are using" + }, + "outputAnchors": [ + { + "id": "stickyNote_2-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 183, + "selected": false, + "positionAbsolute": { + "x": 386.88037412001086, + "y": 47.66735767574478 + }, + "dragging": false + }, + { + "id": "stickyNote_3", + "position": { + "x": 1148.366177280569, + "y": -330.2148999791981 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_3", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_3-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "Check if SQL Query is valid\n\nIf not, avoid executing it and return to user " + }, + "outputAnchors": [ + { + "id": "stickyNote_3-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 82, + "selected": false, + "positionAbsolute": { + "x": 1148.366177280569, + "y": -330.2148999791981 + }, + "dragging": false + }, + { + "id": "stickyNote_4", + "position": { + "x": 1881.2554569013519, + "y": -435.79147130381756 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_4", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_4-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "Execute the SQL query after validated, and get the list of results back.\n\nTo avoid long list of results overflowing token limit, try capping the length of result here" + }, + "outputAnchors": [ + { + "id": "stickyNote_4-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 143, + "selected": false, + "positionAbsolute": { + "x": 1881.2554569013519, + "y": -435.79147130381756 + }, + "dragging": false + }, + { + "id": "stickyNote_5", + "position": { + "x": 1545.0242031958799, + "y": 428.37859733277077 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_5", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_5-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "Fallback answer if SQL query is not valid" + }, + "outputAnchors": [ + { + "id": "stickyNote_5-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 42, + "selected": false, + "positionAbsolute": { + "x": 1545.0242031958799, + "y": 428.37859733277077 + }, + "dragging": false + }, + { + "id": "stickyNote_6", + "position": { + "x": 2653.037036258241, + "y": 53.55638699917168 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_6", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_6-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "This is the final prompt.\n\nCombine the following:\nQuestion + SQL query + SQL result\n\nto generate a final answer" + }, + "outputAnchors": [ + { + "id": "stickyNote_6-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 143, + "selected": false, + "positionAbsolute": { + "x": 2653.037036258241, + "y": 53.55638699917168 + }, + "dragging": false + }, + { + "id": "stickyNote_7", + "position": { + "x": 2267.355938520518, + "y": -56.64296923028309 + }, + "type": "stickyNote", + "data": { + "id": "stickyNote_7", + "label": "Sticky Note", + "version": 2, + "name": "stickyNote", + "type": "StickyNote", + "baseClasses": [ + "StickyNote" + ], + "tags": [ + "Utilities" + ], + "category": "Utilities", + "description": "Add a sticky note", + "inputParams": [ + { + "label": "", + "name": "note", + "type": "string", + "rows": 1, + "placeholder": "Type something here", + "optional": true, + "id": "stickyNote_7-input-note-string" + } + ], + "inputAnchors": [], + "inputs": { + "note": "Get the saved variable value to be used in prompt" + }, + "outputAnchors": [ + { + "id": "stickyNote_7-output-stickyNote-StickyNote", + "name": "stickyNote", + "label": "StickyNote", + "description": "Add a sticky note", + "type": "StickyNote" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 62, + "selected": false, + "positionAbsolute": { + "x": 2267.355938520518, + "y": -56.64296923028309 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "promptTemplate_0", + "sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-prompt-BasePromptTemplate", + "type": "buttonedge", + "id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate", + "data": { + "label": "" + } + }, + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-model-BaseLanguageModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel", + "data": { + "label": "" + } + }, + { + "source": "chatOpenAI_1", + "sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "llmChain_1", + "targetHandle": "llmChain_1-input-model-BaseLanguageModel", + "type": "buttonedge", + "id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_1-llmChain_1-input-model-BaseLanguageModel", + "data": { + "label": "" + } + }, + { + "source": "customFunction_1", + "sourceHandle": "customFunction_1-output-output-string|number|boolean|json|array", + "target": "promptTemplate_1", + "targetHandle": "promptTemplate_1-input-promptValues-json", + "type": "buttonedge", + "id": "customFunction_1-customFunction_1-output-output-string|number|boolean|json|array-promptTemplate_1-promptTemplate_1-input-promptValues-json", + "data": { + "label": "" + } + }, + { + "source": "promptTemplate_1", + "sourceHandle": "promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "target": "llmChain_1", + "targetHandle": "llmChain_1-input-prompt-BasePromptTemplate", + "type": "buttonedge", + "id": "promptTemplate_1-promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable-llmChain_1-llmChain_1-input-prompt-BasePromptTemplate", + "data": { + "label": "" + } + }, + { + "source": "getVariable_1", + "sourceHandle": "getVariable_1-output-output-string|number|boolean|json|array", + "target": "promptTemplate_1", + "targetHandle": "promptTemplate_1-input-promptValues-json", + "type": "buttonedge", + "id": "getVariable_1-getVariable_1-output-output-string|number|boolean|json|array-promptTemplate_1-promptTemplate_1-input-promptValues-json", + "data": { + "label": "" + } + }, + { + "source": "setVariable_1", + "sourceHandle": "setVariable_1-output-output-string|number|boolean|json|array", + "target": "customFunction_1", + "targetHandle": "customFunction_1-input-functionInputVariables-json", + "type": "buttonedge", + "id": "setVariable_1-setVariable_1-output-output-string|number|boolean|json|array-customFunction_1-customFunction_1-input-functionInputVariables-json", + "data": { + "label": "" + } + }, + { + "source": "llmChain_0", + "sourceHandle": "llmChain_0-output-outputPrediction-string|json", + "target": "ifElseFunction_0", + "targetHandle": "ifElseFunction_0-input-functionInputVariables-json", + "type": "buttonedge", + "id": "llmChain_0-llmChain_0-output-outputPrediction-string|json-ifElseFunction_0-ifElseFunction_0-input-functionInputVariables-json" + }, + { + "source": "ifElseFunction_0", + "sourceHandle": "ifElseFunction_0-output-returnTrue-string|number|boolean|json|array", + "target": "setVariable_1", + "targetHandle": "setVariable_1-input-input-string | number | boolean | json | array", + "type": "buttonedge", + "id": "ifElseFunction_0-ifElseFunction_0-output-returnTrue-string|number|boolean|json|array-setVariable_1-setVariable_1-input-input-string | number | boolean | json | array" + }, + { + "source": "ifElseFunction_0", + "sourceHandle": "ifElseFunction_0-output-returnFalse-string|number|boolean|json|array", + "target": "promptTemplate_2", + "targetHandle": "promptTemplate_2-input-promptValues-json", + "type": "buttonedge", + "id": "ifElseFunction_0-ifElseFunction_0-output-returnFalse-string|number|boolean|json|array-promptTemplate_2-promptTemplate_2-input-promptValues-json" + }, + { + "source": "chatOpenAI_2", + "sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "llmChain_2", + "targetHandle": "llmChain_2-input-model-BaseLanguageModel", + "type": "buttonedge", + "id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_2-llmChain_2-input-model-BaseLanguageModel" + }, + { + "source": "promptTemplate_2", + "sourceHandle": "promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "target": "llmChain_2", + "targetHandle": "llmChain_2-input-prompt-BasePromptTemplate", + "type": "buttonedge", + "id": "promptTemplate_2-promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable-llmChain_2-llmChain_2-input-prompt-BasePromptTemplate" + }, + { + "source": "customFunction_2", + "sourceHandle": "customFunction_2-output-output-string|number|boolean|json|array", + "target": "promptTemplate_0", + "targetHandle": "promptTemplate_0-input-promptValues-json", + "type": "buttonedge", + "id": "customFunction_2-customFunction_2-output-output-string|number|boolean|json|array-promptTemplate_0-promptTemplate_0-input-promptValues-json" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/SQL Chatflow.json b/cn/.gitbook/assets/SQL Chatflow.json new file mode 100644 index 00000000..3ce78590 --- /dev/null +++ b/cn/.gitbook/assets/SQL Chatflow.json @@ -0,0 +1,1614 @@ +{ + "nodes": [ + { + "width": 300, + "height": 779, + "id": "promptTemplate_0", + "position": { + "x": 379.11224395092825, + "y": 71.33564730890853 + }, + "type": "customNode", + "data": { + "id": "promptTemplate_0", + "label": "Prompt Template", + "version": 1, + "name": "promptTemplate", + "type": "PromptTemplate", + "baseClasses": [ + "PromptTemplate", + "BaseStringPromptTemplate", + "BasePromptTemplate", + "Runnable" + ], + "category": "Prompts", + "description": "Schema to represent a basic prompt for an LLM", + "inputParams": [ + { + "label": "Template", + "name": "template", + "type": "string", + "rows": 4, + "placeholder": "What is a good name for a company that makes {product}?", + "id": "promptTemplate_0-input-template-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "promptTemplate_0-input-promptValues-json" + } + ], + "inputAnchors": [], + "inputs": { + "template": "Based on the provided SQL table schema and question below, return a SQL SELECT ALL query that would answer the user's question. For example: SELECT * FROM table WHERE id = '1'.\n------------\nSCHEMA: {schema}\n------------\nQUESTION: {question}\n------------\nSQL QUERY:", + "promptValues": "{\"schema\":\"{{customFunction_2.data.instance}}\",\"question\":\"{{question}}\"}" + }, + "outputAnchors": [ + { + "id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "name": "promptTemplate", + "label": "PromptTemplate", + "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 379.11224395092825, + "y": 71.33564730890853 + }, + "dragging": false + }, + { + "width": 300, + "height": 506, + "id": "llmChain_0", + "position": { + "x": 770.4559230968546, + "y": -127.11351409346554 + }, + "type": "customNode", + "data": { + "id": "llmChain_0", + "label": "LLM Chain", + "version": 3, + "name": "llmChain", + "type": "LLMChain", + "baseClasses": [ + "LLMChain", + "BaseChain", + "Runnable" + ], + "category": "Chains", + "description": "Chain to run queries against LLMs", + "inputParams": [ + { + "label": "Chain Name", + "name": "chainName", + "type": "string", + "placeholder": "Name Your Chain", + "optional": true, + "id": "llmChain_0-input-chainName-string" + } + ], + "inputAnchors": [ + { + "label": "Language Model", + "name": "model", + "type": "BaseLanguageModel", + "id": "llmChain_0-input-model-BaseLanguageModel" + }, + { + "label": "Prompt", + "name": "prompt", + "type": "BasePromptTemplate", + "id": "llmChain_0-input-prompt-BasePromptTemplate" + }, + { + "label": "Output Parser", + "name": "outputParser", + "type": "BaseLLMOutputParser", + "optional": true, + "id": "llmChain_0-input-outputParser-BaseLLMOutputParser" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "llmChain_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_1.data.instance}}", + "prompt": "{{promptTemplate_0.data.instance}}", + "outputParser": "", + "inputModeration": "", + "chainName": "SQL Query Chain" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable", + "name": "llmChain", + "label": "LLM Chain", + "type": "LLMChain | BaseChain | Runnable" + }, + { + "id": "llmChain_0-output-outputPrediction-string|json", + "name": "outputPrediction", + "label": "Output Prediction", + "type": "string | json" + } + ], + "default": "llmChain" + } + ], + "outputs": { + "output": "outputPrediction" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 770.4559230968546, + "y": -127.11351409346554 + }, + "dragging": false + }, + { + "width": 300, + "height": 506, + "id": "llmChain_1", + "position": { + "x": 2330.1281944523407, + "y": -325.61633963017937 + }, + "type": "customNode", + "data": { + "id": "llmChain_1", + "label": "LLM Chain", + "version": 3, + "name": "llmChain", + "type": "LLMChain", + "baseClasses": [ + "LLMChain", + "BaseChain", + "Runnable" + ], + "category": "Chains", + "description": "Chain to run queries against LLMs", + "inputParams": [ + { + "label": "Chain Name", + "name": "chainName", + "type": "string", + "placeholder": "Name Your Chain", + "optional": true, + "id": "llmChain_1-input-chainName-string" + } + ], + "inputAnchors": [ + { + "label": "Language Model", + "name": "model", + "type": "BaseLanguageModel", + "id": "llmChain_1-input-model-BaseLanguageModel" + }, + { + "label": "Prompt", + "name": "prompt", + "type": "BasePromptTemplate", + "id": "llmChain_1-input-prompt-BasePromptTemplate" + }, + { + "label": "Output Parser", + "name": "outputParser", + "type": "BaseLLMOutputParser", + "optional": true, + "id": "llmChain_1-input-outputParser-BaseLLMOutputParser" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "llmChain_1-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_3.data.instance}}", + "prompt": "{{promptTemplate_1.data.instance}}", + "outputParser": "", + "inputModeration": "", + "chainName": "Final Chain" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "llmChain_1-output-llmChain-LLMChain|BaseChain|Runnable", + "name": "llmChain", + "label": "LLM Chain", + "type": "LLMChain | BaseChain | Runnable" + }, + { + "id": "llmChain_1-output-outputPrediction-string|json", + "name": "outputPrediction", + "label": "Output Prediction", + "type": "string | json" + } + ], + "default": "llmChain" + } + ], + "outputs": { + "output": "llmChain" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 2330.1281944523407, + "y": -325.61633963017937 + }, + "dragging": false + }, + { + "width": 300, + "height": 668, + "id": "customFunction_2", + "position": { + "x": -12.41348902418423, + "y": -198.08456515277106 + }, + "type": "customNode", + "data": { + "id": "customFunction_2", + "label": "Custom JS Function", + "version": 1, + "name": "customFunction", + "type": "CustomFunction", + "baseClasses": [ + "CustomFunction", + "Utilities" + ], + "category": "Utilities", + "description": "Execute custom javascript function", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "customFunction_2-input-functionInputVariables-json" + }, + { + "label": "Function Name", + "name": "functionName", + "type": "string", + "placeholder": "My Function", + "id": "customFunction_2-input-functionName-string" + }, + { + "label": "Javascript Function", + "name": "javascriptFunction", + "type": "code", + "id": "customFunction_2-input-javascriptFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "", + "functionName": "Get SQL Schema Prompt", + "javascriptFunction": "const HOST = 'svc-abc.aws-oregon-3.svc.singlestore.com';\nconst USER = 'admin';\nconst PASSWORD = '123';\nconst DATABASE = 'mydb';\nconst TABLE = 'samples';\nconst mysql = require('mysql2/promise');\n\nlet sqlSchemaPrompt;\n\n/**\n * Ideal prompt contains schema info and examples\n * Follows best practices as specified form https://arxiv.org/abs/2204.00498\n * =========================================\n * CREATE TABLE samples (firstName varchar NOT NULL, lastName varchar)\n * SELECT * FROM samples LIMIT 3\n * firstName lastName\n * Stephen Tyler\n * Jack McGinnis\n * Steven Repici\n * =========================================\n*/\nfunction getSQLPrompt() {\n return new Promise(async (resolve, reject) => {\n try {\n const singleStoreConnection = mysql.createPool({\n host: HOST,\n user: USER,\n password: PASSWORD,\n database: DATABASE,\n });\n \n // Get schema info\n const [schemaInfo] = await singleStoreConnection.execute(\n `SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = \"${TABLE}\"`\n );\n \n const createColumns = [];\n const columnNames = [];\n \n for (const schemaData of schemaInfo) {\n columnNames.push(`${schemaData['COLUMN_NAME']}`);\n createColumns.push(`${schemaData['COLUMN_NAME']} ${schemaData['COLUMN_TYPE']} ${schemaData['IS_NULLABLE'] === 'NO' ? 'NOT NULL' : ''}`);\n }\n \n const sqlCreateTableQuery = `CREATE TABLE samples (${createColumns.join(', ')})`;\n const sqlSelectTableQuery = `SELECT * FROM samples LIMIT 3`;\n \n // Get first 3 rows\n const [rows] = await singleStoreConnection.execute(\n sqlSelectTableQuery,\n );\n \n const allValues = [];\n for (const row of rows) {\n const rowValues = [];\n for (const colName in row) {\n rowValues.push(row[colName]);\n }\n allValues.push(rowValues.join(' '));\n }\n \n sqlSchemaPrompt = sqlCreateTableQuery + '\\n' + sqlSelectTableQuery + '\\n' + columnNames.join(' ') + '\\n' + allValues.join('\\n');\n \n resolve();\n } catch (e) {\n console.error(e);\n return reject(e);\n }\n });\n}\n\nasync function main() {\n await getSQLPrompt();\n}\n\nawait main();\n\nreturn sqlSchemaPrompt;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "customFunction_2-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "type": "string | number | boolean | json | array" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": -12.41348902418423, + "y": -198.08456515277106 + }, + "dragging": false + }, + { + "width": 300, + "height": 668, + "id": "customFunction_1", + "position": { + "x": 1574.8757854291205, + "y": -510.612625067788 + }, + "type": "customNode", + "data": { + "id": "customFunction_1", + "label": "Custom JS Function", + "version": 1, + "name": "customFunction", + "type": "CustomFunction", + "baseClasses": [ + "CustomFunction", + "Utilities" + ], + "category": "Utilities", + "description": "Execute custom javascript function", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "customFunction_1-input-functionInputVariables-json" + }, + { + "label": "Function Name", + "name": "functionName", + "type": "string", + "placeholder": "My Function", + "id": "customFunction_1-input-functionName-string" + }, + { + "label": "Javascript Function", + "name": "javascriptFunction", + "type": "code", + "id": "customFunction_1-input-javascriptFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "{\"sqlQuery\":\"{{ifElseFunction_0.data.instance}}\"}", + "functionName": "Run SQL Query", + "javascriptFunction": "const HOST = 'svc-abc.aws-oregon-3.svc.singlestore.com';\nconst USER = 'admin';\nconst PASSWORD = '123';\nconst DATABASE = 'mydb';\nconst TABLE = 'samples';\nconst mysql = require('mysql2/promise');\n\nlet result;\n\nfunction getSQLResult() {\n return new Promise(async (resolve, reject) => {\n try {\n const singleStoreConnection = mysql.createPool({\n host: HOST,\n user: USER,\n password: PASSWORD,\n database: DATABASE,\n });\n \n const [rows] = await singleStoreConnection.execute(\n $sqlQuery\n );\n \n result = JSON.stringify(rows)\n \n resolve();\n } catch (e) {\n console.error(e);\n return reject(e);\n }\n });\n}\n\nasync function main() {\n await getSQLResult();\n}\n\nawait main();\n\nreturn result;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "customFunction_1-output-output-string|number|boolean|json|array", + "name": "output", + "label": "Output", + "type": "string | number | boolean | json | array" + } + ], + "default": "output" + } + ], + "outputs": { + "output": "output" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1574.8757854291205, + "y": -510.612625067788 + }, + "dragging": false + }, + { + "width": 300, + "height": 779, + "id": "promptTemplate_1", + "position": { + "x": 1943.5658568848553, + "y": -83.07909710675825 + }, + "type": "customNode", + "data": { + "id": "promptTemplate_1", + "label": "Prompt Template", + "version": 1, + "name": "promptTemplate", + "type": "PromptTemplate", + "baseClasses": [ + "PromptTemplate", + "BaseStringPromptTemplate", + "BasePromptTemplate", + "Runnable" + ], + "category": "Prompts", + "description": "Schema to represent a basic prompt for an LLM", + "inputParams": [ + { + "label": "Template", + "name": "template", + "type": "string", + "rows": 4, + "placeholder": "What is a good name for a company that makes {product}?", + "id": "promptTemplate_1-input-template-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "promptTemplate_1-input-promptValues-json" + } + ], + "inputAnchors": [], + "inputs": { + "template": "Based on the question, and SQL response, write a natural language response, be details as possible:\n------------\nQUESTION: {question}\n------------\nSQL RESPONSE: {sqlResponse}\n------------\nNATURAL LANGUAGE RESPONSE:", + "promptValues": "{\"question\":\"{{question}}\",\"sqlResponse\":\"{{customFunction_1.data.instance}}\"}" + }, + "outputAnchors": [ + { + "id": "promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "name": "promptTemplate", + "label": "PromptTemplate", + "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 1943.5658568848553, + "y": -83.07909710675825 + } + }, + { + "width": 300, + "height": 754, + "id": "ifElseFunction_0", + "position": { + "x": 1217.9173937613534, + "y": -515.3650041424041 + }, + "type": "customNode", + "data": { + "id": "ifElseFunction_0", + "label": "IfElse Function", + "version": 1, + "name": "ifElseFunction", + "type": "IfElseFunction", + "baseClasses": [ + "IfElseFunction", + "Utilities" + ], + "category": "Utilities", + "description": "Split flows based on If Else javascript functions", + "inputParams": [ + { + "label": "Input Variables", + "name": "functionInputVariables", + "description": "Input variables can be used in the function with prefix $. For example: $var", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "ifElseFunction_0-input-functionInputVariables-json" + }, + { + "label": "IfElse Name", + "name": "functionName", + "type": "string", + "optional": true, + "placeholder": "If Condition Match", + "id": "ifElseFunction_0-input-functionName-string" + }, + { + "label": "If Function", + "name": "ifFunction", + "description": "Function must return a value", + "type": "code", + "rows": 2, + "default": "if (\"hello\" == \"hello\") {\n return true;\n}", + "id": "ifElseFunction_0-input-ifFunction-code" + }, + { + "label": "Else Function", + "name": "elseFunction", + "description": "Function must return a value", + "type": "code", + "rows": 2, + "default": "return false;", + "id": "ifElseFunction_0-input-elseFunction-code" + } + ], + "inputAnchors": [], + "inputs": { + "functionInputVariables": "{\"sqlQuery\":\"{{llmChain_0.data.instance}}\"}", + "functionName": "IF SQL Query contains SELECT and WHERE", + "ifFunction": "const sqlQuery = $sqlQuery.trim();\n\nif (sqlQuery.includes(\"SELECT\") && sqlQuery.includes(\"WHERE\")) {\n return sqlQuery;\n}", + "elseFunction": "return $sqlQuery;" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "ifElseFunction_0-output-returnTrue-string|number|boolean|json|array", + "name": "returnTrue", + "label": "True", + "type": "string | number | boolean | json | array" + }, + { + "id": "ifElseFunction_0-output-returnFalse-string|number|boolean|json|array", + "name": "returnFalse", + "label": "False", + "type": "string | number | boolean | json | array" + } + ], + "default": "returnTrue" + } + ], + "outputs": { + "output": "returnTrue" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1217.9173937613534, + "y": -515.3650041424041 + }, + "dragging": false + }, + { + "width": 300, + "height": 779, + "id": "promptTemplate_2", + "position": { + "x": 1577.4729260684187, + "y": 887.7668360114285 + }, + "type": "customNode", + "data": { + "id": "promptTemplate_2", + "label": "Prompt Template", + "version": 1, + "name": "promptTemplate", + "type": "PromptTemplate", + "baseClasses": [ + "PromptTemplate", + "BaseStringPromptTemplate", + "BasePromptTemplate", + "Runnable" + ], + "category": "Prompts", + "description": "Schema to represent a basic prompt for an LLM", + "inputParams": [ + { + "label": "Template", + "name": "template", + "type": "string", + "rows": 4, + "placeholder": "What is a good name for a company that makes {product}?", + "id": "promptTemplate_2-input-template-string" + }, + { + "label": "Format Prompt Values", + "name": "promptValues", + "type": "json", + "optional": true, + "acceptVariable": true, + "list": true, + "id": "promptTemplate_2-input-promptValues-json" + } + ], + "inputAnchors": [], + "inputs": { + "template": "Politely say \"I'm not able to answer query\"", + "promptValues": "{\"schema\":\"{{setVariable_0.data.instance}}\",\"question\":\"{{question}}\"}" + }, + "outputAnchors": [ + { + "id": "promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "name": "promptTemplate", + "label": "PromptTemplate", + "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1577.4729260684187, + "y": 887.7668360114285 + }, + "dragging": false + }, + { + "width": 300, + "height": 506, + "id": "llmChain_2", + "position": { + "x": 1942.2473639184586, + "y": 534.2501352750406 + }, + "type": "customNode", + "data": { + "id": "llmChain_2", + "label": "LLM Chain", + "version": 3, + "name": "llmChain", + "type": "LLMChain", + "baseClasses": [ + "LLMChain", + "BaseChain", + "Runnable" + ], + "category": "Chains", + "description": "Chain to run queries against LLMs", + "inputParams": [ + { + "label": "Chain Name", + "name": "chainName", + "type": "string", + "placeholder": "Name Your Chain", + "optional": true, + "id": "llmChain_2-input-chainName-string" + } + ], + "inputAnchors": [ + { + "label": "Language Model", + "name": "model", + "type": "BaseLanguageModel", + "id": "llmChain_2-input-model-BaseLanguageModel" + }, + { + "label": "Prompt", + "name": "prompt", + "type": "BasePromptTemplate", + "id": "llmChain_2-input-prompt-BasePromptTemplate" + }, + { + "label": "Output Parser", + "name": "outputParser", + "type": "BaseLLMOutputParser", + "optional": true, + "id": "llmChain_2-input-outputParser-BaseLLMOutputParser" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "llmChain_2-input-inputModeration-Moderation" + } + ], + "inputs": { + "model": "{{chatOpenAI_2.data.instance}}", + "prompt": "{{promptTemplate_2.data.instance}}", + "outputParser": "", + "inputModeration": "", + "chainName": "Fallback Chain" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "options": [ + { + "id": "llmChain_2-output-llmChain-LLMChain|BaseChain|Runnable", + "name": "llmChain", + "label": "LLM Chain", + "type": "LLMChain | BaseChain | Runnable" + }, + { + "id": "llmChain_2-output-outputPrediction-string|json", + "name": "outputPrediction", + "label": "Output Prediction", + "type": "string | json" + } + ], + "default": "llmChain" + } + ], + "outputs": { + "output": "llmChain" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 1942.2473639184586, + "y": 534.2501352750406 + }, + "dragging": false + }, + { + "id": "chatOpenAI_1", + "position": { + "x": 375.16318421173054, + "y": -645.2584301535801 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_1", + "label": "ChatOpenAI", + "version": 5, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_1-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "gpt-4", + "name": "gpt-4" + }, + { + "label": "gpt-4-turbo-preview", + "name": "gpt-4-turbo-preview" + }, + { + "label": "gpt-4-0125-preview", + "name": "gpt-4-0125-preview" + }, + { + "label": "gpt-4-1106-preview", + "name": "gpt-4-1106-preview" + }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, + { + "label": "gpt-4-vision-preview", + "name": "gpt-4-vision-preview" + }, + { + "label": "gpt-4-0613", + "name": "gpt-4-0613" + }, + { + "label": "gpt-4-32k", + "name": "gpt-4-32k" + }, + { + "label": "gpt-4-32k-0613", + "name": "gpt-4-32k-0613" + }, + { + "label": "gpt-3.5-turbo", + "name": "gpt-3.5-turbo" + }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, + { + "label": "gpt-3.5-turbo-1106", + "name": "gpt-3.5-turbo-1106" + }, + { + "label": "gpt-3.5-turbo-0613", + "name": "gpt-3.5-turbo-0613" + }, + { + "label": "gpt-3.5-turbo-16k", + "name": "gpt-3.5-turbo-16k" + }, + { + "label": "gpt-3.5-turbo-16k-0613", + "name": "gpt-3.5-turbo-16k-0613" + } + ], + "default": "gpt-3.5-turbo", + "optional": true, + "id": "chatOpenAI_1-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_1-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_1-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_1-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_1-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_1-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo", + "temperature": "0", + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 670, + "selected": false, + "positionAbsolute": { + "x": 375.16318421173054, + "y": -645.2584301535801 + }, + "dragging": false + }, + { + "id": "chatOpenAI_3", + "position": { + "x": 1948.9511168108475, + "y": -796.7149375857242 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_3", + "label": "ChatOpenAI", + "version": 5, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_3-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "gpt-4", + "name": "gpt-4" + }, + { + "label": "gpt-4-turbo-preview", + "name": "gpt-4-turbo-preview" + }, + { + "label": "gpt-4-0125-preview", + "name": "gpt-4-0125-preview" + }, + { + "label": "gpt-4-1106-preview", + "name": "gpt-4-1106-preview" + }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, + { + "label": "gpt-4-vision-preview", + "name": "gpt-4-vision-preview" + }, + { + "label": "gpt-4-0613", + "name": "gpt-4-0613" + }, + { + "label": "gpt-4-32k", + "name": "gpt-4-32k" + }, + { + "label": "gpt-4-32k-0613", + "name": "gpt-4-32k-0613" + }, + { + "label": "gpt-3.5-turbo", + "name": "gpt-3.5-turbo" + }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, + { + "label": "gpt-3.5-turbo-1106", + "name": "gpt-3.5-turbo-1106" + }, + { + "label": "gpt-3.5-turbo-0613", + "name": "gpt-3.5-turbo-0613" + }, + { + "label": "gpt-3.5-turbo-16k", + "name": "gpt-3.5-turbo-16k" + }, + { + "label": "gpt-3.5-turbo-16k-0613", + "name": "gpt-3.5-turbo-16k-0613" + } + ], + "default": "gpt-3.5-turbo", + "optional": true, + "id": "chatOpenAI_3-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_3-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_3-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_3-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_3-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_3-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_3-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_3-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_3-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_3-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_3-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_3-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo", + "temperature": 0.9, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_3-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 670, + "selected": false, + "positionAbsolute": { + "x": 1948.9511168108475, + "y": -796.7149375857242 + }, + "dragging": false + }, + { + "id": "chatOpenAI_2", + "position": { + "x": 1566.0508325767967, + "y": 194.95875577740696 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_2", + "label": "ChatOpenAI", + "version": 5, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_2-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "gpt-4", + "name": "gpt-4" + }, + { + "label": "gpt-4-turbo-preview", + "name": "gpt-4-turbo-preview" + }, + { + "label": "gpt-4-0125-preview", + "name": "gpt-4-0125-preview" + }, + { + "label": "gpt-4-1106-preview", + "name": "gpt-4-1106-preview" + }, + { + "label": "gpt-4-1106-vision-preview", + "name": "gpt-4-1106-vision-preview" + }, + { + "label": "gpt-4-vision-preview", + "name": "gpt-4-vision-preview" + }, + { + "label": "gpt-4-0613", + "name": "gpt-4-0613" + }, + { + "label": "gpt-4-32k", + "name": "gpt-4-32k" + }, + { + "label": "gpt-4-32k-0613", + "name": "gpt-4-32k-0613" + }, + { + "label": "gpt-3.5-turbo", + "name": "gpt-3.5-turbo" + }, + { + "label": "gpt-3.5-turbo-0125", + "name": "gpt-3.5-turbo-0125" + }, + { + "label": "gpt-3.5-turbo-1106", + "name": "gpt-3.5-turbo-1106" + }, + { + "label": "gpt-3.5-turbo-0613", + "name": "gpt-3.5-turbo-0613" + }, + { + "label": "gpt-3.5-turbo-16k", + "name": "gpt-3.5-turbo-16k" + }, + { + "label": "gpt-3.5-turbo-16k-0613", + "name": "gpt-3.5-turbo-16k-0613" + } + ], + "default": "gpt-3.5-turbo", + "optional": true, + "id": "chatOpenAI_2-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_2-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_2-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_2-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_2-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_2-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo", + "temperature": 0.9, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 670, + "selected": false, + "positionAbsolute": { + "x": 1566.0508325767967, + "y": 194.95875577740696 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "promptTemplate_0", + "sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-prompt-BasePromptTemplate", + "type": "buttonedge", + "id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate", + "data": { + "label": "" + } + }, + { + "source": "customFunction_1", + "sourceHandle": "customFunction_1-output-output-string|number|boolean|json|array", + "target": "promptTemplate_1", + "targetHandle": "promptTemplate_1-input-promptValues-json", + "type": "buttonedge", + "id": "customFunction_1-customFunction_1-output-output-string|number|boolean|json|array-promptTemplate_1-promptTemplate_1-input-promptValues-json", + "data": { + "label": "" + } + }, + { + "source": "promptTemplate_1", + "sourceHandle": "promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "target": "llmChain_1", + "targetHandle": "llmChain_1-input-prompt-BasePromptTemplate", + "type": "buttonedge", + "id": "promptTemplate_1-promptTemplate_1-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable-llmChain_1-llmChain_1-input-prompt-BasePromptTemplate", + "data": { + "label": "" + } + }, + { + "source": "llmChain_0", + "sourceHandle": "llmChain_0-output-outputPrediction-string|json", + "target": "ifElseFunction_0", + "targetHandle": "ifElseFunction_0-input-functionInputVariables-json", + "type": "buttonedge", + "id": "llmChain_0-llmChain_0-output-outputPrediction-string|json-ifElseFunction_0-ifElseFunction_0-input-functionInputVariables-json" + }, + { + "source": "ifElseFunction_0", + "sourceHandle": "ifElseFunction_0-output-returnFalse-string|number|boolean|json|array", + "target": "promptTemplate_2", + "targetHandle": "promptTemplate_2-input-promptValues-json", + "type": "buttonedge", + "id": "ifElseFunction_0-ifElseFunction_0-output-returnFalse-string|number|boolean|json|array-promptTemplate_2-promptTemplate_2-input-promptValues-json" + }, + { + "source": "promptTemplate_2", + "sourceHandle": "promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable", + "target": "llmChain_2", + "targetHandle": "llmChain_2-input-prompt-BasePromptTemplate", + "type": "buttonedge", + "id": "promptTemplate_2-promptTemplate_2-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate|Runnable-llmChain_2-llmChain_2-input-prompt-BasePromptTemplate" + }, + { + "source": "customFunction_2", + "sourceHandle": "customFunction_2-output-output-string|number|boolean|json|array", + "target": "promptTemplate_0", + "targetHandle": "promptTemplate_0-input-promptValues-json", + "type": "buttonedge", + "id": "customFunction_2-customFunction_2-output-output-string|number|boolean|json|array-promptTemplate_0-promptTemplate_0-input-promptValues-json" + }, + { + "source": "ifElseFunction_0", + "sourceHandle": "ifElseFunction_0-output-returnTrue-string|number|boolean|json|array", + "target": "customFunction_1", + "targetHandle": "customFunction_1-input-functionInputVariables-json", + "type": "buttonedge", + "id": "ifElseFunction_0-ifElseFunction_0-output-returnTrue-string|number|boolean|json|array-customFunction_1-customFunction_1-input-functionInputVariables-json" + }, + { + "source": "chatOpenAI_1", + "sourceHandle": "chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "llmChain_0", + "targetHandle": "llmChain_0-input-model-BaseLanguageModel", + "type": "buttonedge", + "id": "chatOpenAI_1-chatOpenAI_1-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_0-llmChain_0-input-model-BaseLanguageModel" + }, + { + "source": "chatOpenAI_3", + "sourceHandle": "chatOpenAI_3-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "llmChain_1", + "targetHandle": "llmChain_1-input-model-BaseLanguageModel", + "type": "buttonedge", + "id": "chatOpenAI_3-chatOpenAI_3-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_1-llmChain_1-input-model-BaseLanguageModel" + }, + { + "source": "chatOpenAI_2", + "sourceHandle": "chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "llmChain_2", + "targetHandle": "llmChain_2-input-model-BaseLanguageModel", + "type": "buttonedge", + "id": "chatOpenAI_2-chatOpenAI_2-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-llmChain_2-llmChain_2-input-model-BaseLanguageModel" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/Screenshot 2024-02-29 011714.png b/cn/.gitbook/assets/Screenshot 2024-02-29 011714.png new file mode 100644 index 00000000..86ae8cbe Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2024-02-29 011714.png differ diff --git a/cn/.gitbook/assets/Screenshot 2024-02-29 012538.png b/cn/.gitbook/assets/Screenshot 2024-02-29 012538.png new file mode 100644 index 00000000..836d8aaf Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2024-02-29 012538.png differ diff --git a/cn/.gitbook/assets/Screenshot 2024-03-05 141551.png b/cn/.gitbook/assets/Screenshot 2024-03-05 141551.png new file mode 100644 index 00000000..00d83e5c Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2024-03-05 141551.png differ diff --git a/cn/.gitbook/assets/Screenshot 2024-03-05 141619.png b/cn/.gitbook/assets/Screenshot 2024-03-05 141619.png new file mode 100644 index 00000000..cd9f5f45 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2024-03-05 141619.png differ diff --git a/cn/.gitbook/assets/Screenshot 2024-08-26 170456.png b/cn/.gitbook/assets/Screenshot 2024-08-26 170456.png new file mode 100644 index 00000000..d92144a8 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2024-08-26 170456.png differ diff --git a/cn/.gitbook/assets/Screenshot 2024-11-29 155926.png b/cn/.gitbook/assets/Screenshot 2024-11-29 155926.png new file mode 100644 index 00000000..2334c19a Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2024-11-29 155926.png differ diff --git a/cn/.gitbook/assets/Screenshot 2024-12-23 180712.png b/cn/.gitbook/assets/Screenshot 2024-12-23 180712.png new file mode 100644 index 00000000..2ad90f06 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2024-12-23 180712.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-12 215934.png b/cn/.gitbook/assets/Screenshot 2025-05-12 215934.png new file mode 100644 index 00000000..a4afda01 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-12 215934.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 153946.png b/cn/.gitbook/assets/Screenshot 2025-05-16 153946.png new file mode 100644 index 00000000..496bb90c Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 153946.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 154908.png b/cn/.gitbook/assets/Screenshot 2025-05-16 154908.png new file mode 100644 index 00000000..6f6df264 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 154908.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 160038.png b/cn/.gitbook/assets/Screenshot 2025-05-16 160038.png new file mode 100644 index 00000000..21dc81fa Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 160038.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 160347.png b/cn/.gitbook/assets/Screenshot 2025-05-16 160347.png new file mode 100644 index 00000000..5fc34448 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 160347.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 160427.png b/cn/.gitbook/assets/Screenshot 2025-05-16 160427.png new file mode 100644 index 00000000..232f3ab2 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 160427.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 160752.png b/cn/.gitbook/assets/Screenshot 2025-05-16 160752.png new file mode 100644 index 00000000..6ff1c154 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 160752.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 161605.png b/cn/.gitbook/assets/Screenshot 2025-05-16 161605.png new file mode 100644 index 00000000..86cbe4aa Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 161605.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-05-16 161711.png b/cn/.gitbook/assets/Screenshot 2025-05-16 161711.png new file mode 100644 index 00000000..244c7a0b Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-05-16 161711.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-06-10 232758.png b/cn/.gitbook/assets/Screenshot 2025-06-10 232758.png new file mode 100644 index 00000000..47232e88 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-06-10 232758.png differ diff --git a/cn/.gitbook/assets/Screenshot 2025-06-18 100402.png b/cn/.gitbook/assets/Screenshot 2025-06-18 100402.png new file mode 100644 index 00000000..58198488 Binary files /dev/null and b/cn/.gitbook/assets/Screenshot 2025-06-18 100402.png differ diff --git a/cn/.gitbook/assets/Structured Output.json b/cn/.gitbook/assets/Structured Output.json new file mode 100644 index 00000000..6390ff44 --- /dev/null +++ b/cn/.gitbook/assets/Structured Output.json @@ -0,0 +1,882 @@ +{ + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": 108, + "y": 99.5 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": false + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": false + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": false + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true, + "id": "startAgentflow_0-input-startEphemeralMemory-boolean", + "display": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar", + "optional": true + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "chatInput", + "formTitle": "", + "formDescription": "", + "formInputTypes": "", + "startEphemeralMemory": "", + "startState": [ + { + "key": "answers", + "value": "" + } + ], + "startPersistState": "" + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "positionAbsolute": { + "x": 108, + "y": 99.5 + }, + "selected": false, + "dragging": false + }, + { + "id": "llmAgentflow_0", + "position": { + "x": 251, + "y": 96.25 + }, + "data": { + "id": "llmAgentflow_0", + "label": "Generate Structured Output", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": [ + "LLM" + ], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_0-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_0-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_0-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_0-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_0-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_0-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_0-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatOpenAI", + "llmMessages": [ + { + "role": "system", + "content": "

You are helpful assistant.

Today's date is {{ current_date_time }}

" + } + ], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": [ + { + "key": "answers", + "type": "jsonArray", + "enumValues": "", + "jsonSchema": "{\n \"name\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Name of the event\"\n },\n \"date\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Date of the event\"\n },\n \"location\": {\n \"type\": \"string\",\n \"required\": true,\n \"description\": \"Location of the event\"\n }\n}", + "description": "answer to user query" + } + ], + "llmUpdateState": [ + { + "key": "answers", + "value": "

{{ output.answers }}

" + } + ], + "llmModelConfig": { + "cache": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "llmModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_0-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 252, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 251, + "y": 96.25 + }, + "dragging": false + }, + { + "id": "iterationAgentflow_0", + "position": { + "x": 538.5, + "y": 7.25 + }, + "data": { + "id": "iterationAgentflow_0", + "label": "Loop through JSON array", + "version": 1, + "name": "iterationAgentflow", + "type": "Iteration", + "color": "#9C89B8", + "baseClasses": [ + "Iteration" + ], + "category": "Agent Flows", + "description": "Execute the nodes within the iteration block through N iterations", + "inputParams": [ + { + "label": "Array Input", + "name": "iterationInput", + "type": "string", + "description": "The input array to iterate over", + "acceptVariable": true, + "rows": 4, + "id": "iterationAgentflow_0-input-iterationInput-string", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "iterationInput": "

{{ $flow.state.answers }}

" + }, + "outputAnchors": [ + { + "id": "iterationAgentflow_0-output-iterationAgentflow", + "label": "Iteration", + "name": "iterationAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "iteration", + "width": 300, + "height": 250, + "selected": false, + "positionAbsolute": { + "x": 538.5, + "y": 7.25 + }, + "dragging": false, + "resizing": false + }, + { + "id": "httpAgentflow_0", + "position": { + "x": 91, + "y": 87 + }, + "data": { + "id": "httpAgentflow_0", + "label": "Call HTTP", + "version": 1.1, + "name": "httpAgentflow", + "type": "HTTP", + "color": "#FF7F7F", + "baseClasses": [ + "HTTP" + ], + "category": "Agent Flows", + "description": "Send a HTTP request", + "inputParams": [ + { + "label": "HTTP Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "httpBasicAuth", + "httpBearerToken", + "httpApiKey" + ], + "optional": true, + "id": "httpAgentflow_0-input-credential-credential", + "display": true + }, + { + "label": "Method", + "name": "method", + "type": "options", + "options": [ + { + "label": "GET", + "name": "GET" + }, + { + "label": "POST", + "name": "POST" + }, + { + "label": "PUT", + "name": "PUT" + }, + { + "label": "DELETE", + "name": "DELETE" + }, + { + "label": "PATCH", + "name": "PATCH" + } + ], + "default": "GET", + "id": "httpAgentflow_0-input-method-options", + "display": true + }, + { + "label": "URL", + "name": "url", + "type": "string", + "id": "httpAgentflow_0-input-url-string", + "display": true + }, + { + "label": "Headers", + "name": "headers", + "type": "array", + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "default": "" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "default": "", + "acceptVariable": true + } + ], + "optional": true, + "id": "httpAgentflow_0-input-headers-array", + "display": true + }, + { + "label": "Query Params", + "name": "queryParams", + "type": "array", + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "default": "" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "default": "", + "acceptVariable": true + } + ], + "optional": true, + "id": "httpAgentflow_0-input-queryParams-array", + "display": true + }, + { + "label": "Body Type", + "name": "bodyType", + "type": "options", + "options": [ + { + "label": "JSON", + "name": "json" + }, + { + "label": "Raw", + "name": "raw" + }, + { + "label": "Form Data", + "name": "formData" + }, + { + "label": "x-www-form-urlencoded", + "name": "xWwwFormUrlencoded" + } + ], + "optional": true, + "id": "httpAgentflow_0-input-bodyType-options", + "display": true + }, + { + "label": "Body", + "name": "body", + "type": "string", + "acceptVariable": true, + "rows": 4, + "show": { + "bodyType": [ + "raw", + "json" + ] + }, + "optional": true, + "id": "httpAgentflow_0-input-body-string", + "display": true + }, + { + "label": "Body", + "name": "body", + "type": "array", + "acceptVariable": true, + "show": { + "bodyType": [ + "xWwwFormUrlencoded", + "formData" + ] + }, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "default": "" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "default": "", + "acceptVariable": true + } + ], + "optional": true, + "id": "httpAgentflow_0-input-body-array", + "display": false + }, + { + "label": "Response Type", + "name": "responseType", + "type": "options", + "options": [ + { + "label": "JSON", + "name": "json" + }, + { + "label": "Text", + "name": "text" + }, + { + "label": "Array Buffer", + "name": "arraybuffer" + }, + { + "label": "Raw (Base64)", + "name": "base64" + } + ], + "optional": true, + "id": "httpAgentflow_0-input-responseType-options", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "method": "POST", + "url": "http://localhost:5566/events", + "headers": "", + "queryParams": "", + "bodyType": "json", + "responseType": "json", + "body": "

{{ $iteration }}

" + }, + "outputAnchors": [ + { + "id": "httpAgentflow_0-output-httpAgentflow", + "label": "HTTP", + "name": "httpAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "parentNode": "iterationAgentflow_0", + "extent": "parent", + "width": 137, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": 629.5, + "y": 94.25 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "llmAgentflow_0", + "targetHandle": "llmAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#64B5F6", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-llmAgentflow_0-llmAgentflow_0" + }, + { + "source": "llmAgentflow_0", + "sourceHandle": "llmAgentflow_0-output-llmAgentflow", + "target": "iterationAgentflow_0", + "targetHandle": "iterationAgentflow_0", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#9C89B8", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-iterationAgentflow_0-iterationAgentflow_0" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/Supervisor Worker Agents.json b/cn/.gitbook/assets/Supervisor Worker Agents.json new file mode 100644 index 00000000..e0886a6c --- /dev/null +++ b/cn/.gitbook/assets/Supervisor Worker Agents.json @@ -0,0 +1,2116 @@ +{ + "nodes": [ + { + "id": "startAgentflow_0", + "type": "agentFlow", + "position": { + "x": -198.4357561998925, + "y": 90.62378754136287 + }, + "data": { + "id": "startAgentflow_0", + "label": "Start", + "version": 1.1, + "name": "startAgentflow", + "type": "Start", + "color": "#7EE787", + "hideInput": true, + "baseClasses": [ + "Start" + ], + "category": "Agent Flows", + "description": "Starting point of the agentflow", + "inputParams": [ + { + "label": "Input Type", + "name": "startInputType", + "type": "options", + "options": [ + { + "label": "Chat Input", + "name": "chatInput", + "description": "Start the conversation with chat input" + }, + { + "label": "Form Input", + "name": "formInput", + "description": "Start the workflow with form inputs" + } + ], + "default": "chatInput", + "id": "startAgentflow_0-input-startInputType-options", + "display": true + }, + { + "label": "Form Title", + "name": "formTitle", + "type": "string", + "placeholder": "Please Fill Out The Form", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formTitle-string", + "display": false + }, + { + "label": "Form Description", + "name": "formDescription", + "type": "string", + "placeholder": "Complete all fields below to continue", + "show": { + "startInputType": "formInput" + }, + "id": "startAgentflow_0-input-formDescription-string", + "display": false + }, + { + "label": "Form Input Types", + "name": "formInputTypes", + "description": "Specify the type of form input", + "type": "array", + "show": { + "startInputType": "formInput" + }, + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Options", + "name": "options" + } + ], + "default": "string" + }, + { + "label": "Label", + "name": "label", + "type": "string", + "placeholder": "Label for the input" + }, + { + "label": "Variable Name", + "name": "name", + "type": "string", + "placeholder": "Variable name for the input (must be camel case)", + "description": "Variable name must be camel case. For example: firstName, lastName, etc." + }, + { + "label": "Add Options", + "name": "addOptions", + "type": "array", + "show": { + "formInputTypes[$index].type": "options" + }, + "array": [ + { + "label": "Option", + "name": "option", + "type": "string" + } + ] + } + ], + "id": "startAgentflow_0-input-formInputTypes-array", + "display": false + }, + { + "label": "Ephemeral Memory", + "name": "startEphemeralMemory", + "type": "boolean", + "description": "Start fresh for every execution without past chat history", + "optional": true + }, + { + "label": "Flow State", + "name": "startState", + "description": "Runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string", + "placeholder": "Foo" + }, + { + "label": "Value", + "name": "value", + "type": "string", + "placeholder": "Bar" + } + ], + "id": "startAgentflow_0-input-startState-array", + "display": true + }, + { + "label": "Persist State", + "name": "startPersistState", + "type": "boolean", + "description": "Persist the state in the same session", + "optional": true, + "id": "startAgentflow_0-input-startPersistState-boolean", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "startInputType": "chatInput", + "formTitle": "", + "formDescription": "", + "formInputTypes": "", + "startState": [ + { + "key": "next", + "value": "" + }, + { + "key": "instruction", + "value": "" + } + ] + }, + "outputAnchors": [ + { + "id": "startAgentflow_0-output-startAgentflow", + "label": "Start", + "name": "startAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "width": 103, + "height": 66, + "selected": false, + "positionAbsolute": { + "x": -198.4357561998925, + "y": 90.62378754136287 + }, + "dragging": false + }, + { + "id": "conditionAgentflow_0", + "position": { + "x": 128.47781848153903, + "y": 73.36847122134466 + }, + "data": { + "id": "conditionAgentflow_0", + "label": "Check next worker", + "version": 1, + "name": "conditionAgentflow", + "type": "Condition", + "color": "#FFB938", + "baseClasses": [ + "Condition" + ], + "category": "Agent Flows", + "description": "Split flows based on If Else conditions", + "inputParams": [ + { + "label": "Conditions", + "name": "conditions", + "type": "array", + "description": "Values to compare", + "acceptVariable": true, + "default": [ + { + "type": "string", + "value1": "

{{ $flow.state.next }}

", + "operation": "equal", + "value2": "

SOFTWARE

" + } + ], + "array": [ + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + } + ], + "default": "string" + }, + { + "label": "Value 1", + "name": "value1", + "type": "string", + "default": "", + "description": "First value to be compared with", + "acceptVariable": true, + "show": { + "conditions[$index].type": "string" + } + }, + { + "label": "Operation", + "name": "operation", + "type": "options", + "options": [ + { + "label": "Contains", + "name": "contains" + }, + { + "label": "Ends With", + "name": "endsWith" + }, + { + "label": "Equal", + "name": "equal" + }, + { + "label": "Not Contains", + "name": "notContains" + }, + { + "label": "Not Equal", + "name": "notEqual" + }, + { + "label": "Regex", + "name": "regex" + }, + { + "label": "Starts With", + "name": "startsWith" + }, + { + "label": "Is Empty", + "name": "isEmpty" + }, + { + "label": "Not Empty", + "name": "notEmpty" + } + ], + "default": "equal", + "description": "Type of operation", + "show": { + "conditions[$index].type": "string" + } + }, + { + "label": "Value 2", + "name": "value2", + "type": "string", + "default": "", + "description": "Second value to be compared with", + "acceptVariable": true, + "show": { + "conditions[$index].type": "string" + }, + "hide": { + "conditions[$index].operation": [ + "isEmpty", + "notEmpty" + ] + } + }, + { + "label": "Value 1", + "name": "value1", + "type": "number", + "default": "", + "description": "First value to be compared with", + "acceptVariable": true, + "show": { + "conditions[$index].type": "number" + } + }, + { + "label": "Operation", + "name": "operation", + "type": "options", + "options": [ + { + "label": "Smaller", + "name": "smaller" + }, + { + "label": "Smaller Equal", + "name": "smallerEqual" + }, + { + "label": "Equal", + "name": "equal" + }, + { + "label": "Not Equal", + "name": "notEqual" + }, + { + "label": "Larger", + "name": "larger" + }, + { + "label": "Larger Equal", + "name": "largerEqual" + }, + { + "label": "Is Empty", + "name": "isEmpty" + }, + { + "label": "Not Empty", + "name": "notEmpty" + } + ], + "default": "equal", + "description": "Type of operation", + "show": { + "conditions[$index].type": "number" + } + }, + { + "label": "Value 2", + "name": "value2", + "type": "number", + "default": 0, + "description": "Second value to be compared with", + "acceptVariable": true, + "show": { + "conditions[$index].type": "number" + } + }, + { + "label": "Value 1", + "name": "value1", + "type": "boolean", + "default": false, + "description": "First value to be compared with", + "show": { + "conditions[$index].type": "boolean" + } + }, + { + "label": "Operation", + "name": "operation", + "type": "options", + "options": [ + { + "label": "Equal", + "name": "equal" + }, + { + "label": "Not Equal", + "name": "notEqual" + } + ], + "default": "equal", + "description": "Type of operation", + "show": { + "conditions[$index].type": "boolean" + } + }, + { + "label": "Value 2", + "name": "value2", + "type": "boolean", + "default": false, + "description": "Second value to be compared with", + "show": { + "conditions[$index].type": "boolean" + } + } + ], + "id": "conditionAgentflow_0-input-conditions-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "conditions": [ + { + "type": "string", + "value1": "

{{ $flow.state.next }}

", + "operation": "equal", + "value2": "

SOFTWARE

" + }, + { + "type": "string", + "value1": "

{{ $flow.state.next }}

", + "operation": "equal", + "value2": "

REVIEWER

" + } + ] + }, + "outputAnchors": [ + { + "id": "conditionAgentflow_0-output-0", + "label": 0, + "name": 0, + "description": "Condition 0" + }, + { + "id": "conditionAgentflow_0-output-1", + "label": 1, + "name": 1, + "description": "Condition 1" + }, + { + "id": "conditionAgentflow_0-output-2", + "label": 2, + "name": 2, + "description": "Else" + } + ], + "outputs": { + "conditionAgentflow": "" + }, + "selected": false + }, + "type": "agentFlow", + "width": 194, + "height": 100, + "selected": false, + "positionAbsolute": { + "x": 128.47781848153903, + "y": 73.36847122134466 + }, + "dragging": false + }, + { + "id": "agentAgentflow_1", + "position": { + "x": 352.5679347768288, + "y": -23.510778245391947 + }, + "data": { + "id": "agentAgentflow_1", + "label": "Software Engineer", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_1-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_1-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_1-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_1-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_1-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_1-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_1-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_1-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_1-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_1-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_1-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatOpenAI", + "agentMessages": [ + { + "role": "system", + "content": "

As a Senior Software Engineer, you are a pivotal part of our innovative development team. Your expertise and leadership drive the creation of robust, scalable software solutions that meet the needs of our diverse clientele. By applying best practices in software development, you ensure that our products are reliable, efficient, and maintainable.

Your goal is to lead the development of high-quality software solutions.

Utilize your deep technical knowledge and experience to architect, design, and implement software systems that address complex problems. Collaborate closely with other engineers, reviewers to ensure that the solutions you develop align with business objectives and user needs.

Design and implement new feature for the given task, ensuring it integrates seamlessly with existing systems and meets performance requirements. Use your understanding of React, Tailwindcss, NodeJS to build this feature. Make sure to adhere to our coding standards and follow best practices.

The output should be a fully functional, well-documented feature that enhances our product's capabilities. Include detailed comments in the code.

" + } + ], + "agentTools": "", + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "

{{ $flow.state.instruction }}

", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "agentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_1-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 191, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 352.5679347768288, + "y": -23.510778245391947 + }, + "dragging": false + }, + { + "id": "agentAgentflow_2", + "position": { + "x": 359.32908043399146, + "y": 88.11650145737843 + }, + "data": { + "id": "agentAgentflow_2", + "label": "Code Reviewer", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_2-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_2-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_2-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_2-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_2-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_2-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_2-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_2-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_2-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_2-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_2-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_2-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatOpenAI", + "agentMessages": [ + { + "role": "system", + "content": "

As a Quality Assurance Engineer, you are an integral part of our development team, ensuring that our software products are of the highest quality. Your meticulous attention to detail and expertise in testing methodologies are crucial in identifying defects and ensuring that our code meets the highest standards.

Your goal is to ensure the delivery of high-quality software through thorough code review and testing.

Review the codebase for the new feature designed and implemented by the Senior Software Engineer. Your expertise goes beyond mere code inspection; you are adept at ensuring that developments not only function as intended but also adhere to the team's coding standards, enhance maintainability, and seamlessly integrate with existing systems.

With a deep appreciation for collaborative development, you provide constructive feedback, guiding contributors towards best practices and fostering a culture of continuous improvement. Your meticulous approach to reviewing code, coupled with your ability to foresee potential issues and recommend proactive solutions, ensures the delivery of high-quality software that is robust, scalable, and aligned with the team's strategic goals.

" + } + ], + "agentTools": "", + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "

{{ $flow.state.instruction }}

", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "gpt-4o-mini", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low", + "reasoningEffort": "medium", + "agentModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_2-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 175, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 359.32908043399146, + "y": 88.11650145737843 + }, + "dragging": false + }, + { + "id": "agentAgentflow_3", + "position": { + "x": 357.60470406099364, + "y": 192.61532204982643 + }, + "data": { + "id": "agentAgentflow_3", + "label": "Generate Final Answer", + "version": 1, + "name": "agentAgentflow", + "type": "Agent", + "color": "#4DD0E1", + "baseClasses": [ + "Agent" + ], + "category": "Agent Flows", + "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning", + "inputParams": [ + { + "label": "Model", + "name": "agentModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "agentAgentflow_3-input-agentModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "agentMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "agentAgentflow_3-input-agentMessages-array", + "display": true + }, + { + "label": "Tools", + "name": "agentTools", + "type": "array", + "optional": true, + "array": [ + { + "label": "Tool", + "name": "agentSelectedTool", + "type": "asyncOptions", + "loadMethod": "listTools", + "loadConfig": true + }, + { + "label": "Require Human Input", + "name": "agentSelectedToolRequiresHumanInput", + "type": "boolean", + "optional": true + } + ], + "id": "agentAgentflow_3-input-agentTools-array", + "display": true + }, + { + "label": "Knowledge (Document Stores)", + "name": "agentKnowledgeDocumentStores", + "type": "array", + "description": "Give your agent context about different document sources. Document stores must be upserted in advance.", + "array": [ + { + "label": "Document Store", + "name": "documentStore", + "type": "asyncOptions", + "loadMethod": "listStores" + }, + { + "label": "Describe Knowledge", + "name": "docStoreDescription", + "type": "string", + "generateDocStoreDescription": true, + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_3-input-agentKnowledgeDocumentStores-array", + "display": true + }, + { + "label": "Knowledge (Vector Embeddings)", + "name": "agentKnowledgeVSEmbeddings", + "type": "array", + "description": "Give your agent context about different document sources from existing vector stores and embeddings", + "array": [ + { + "label": "Vector Store", + "name": "vectorStore", + "type": "asyncOptions", + "loadMethod": "listVectorStores", + "loadConfig": true + }, + { + "label": "Embedding Model", + "name": "embeddingModel", + "type": "asyncOptions", + "loadMethod": "listEmbeddings", + "loadConfig": true + }, + { + "label": "Knowledge Name", + "name": "knowledgeName", + "type": "string", + "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information" + }, + { + "label": "Describe Knowledge", + "name": "knowledgeDescription", + "type": "string", + "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information", + "rows": 4 + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true + } + ], + "optional": true, + "id": "agentAgentflow_3-input-agentKnowledgeVSEmbeddings-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "agentEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "agentAgentflow_3-input-agentEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "agentMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_3-input-agentMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "agentMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "agentMemoryType": "windowSize" + }, + "id": "agentAgentflow_3-input-agentMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "agentMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "agentMemoryType": "conversationSummaryBuffer" + }, + "id": "agentAgentflow_3-input-agentMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "agentUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "agentEnableMemory": true + }, + "id": "agentAgentflow_3-input-agentUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "agentReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "agentAgentflow_3-input-agentReturnResponseAs-options", + "display": true + }, + { + "label": "Update Flow State", + "name": "agentUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "agentAgentflow_3-input-agentUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "agentModel": "chatGoogleGenerativeAI", + "agentMessages": "", + "agentTools": "", + "agentKnowledgeDocumentStores": "", + "agentEnableMemory": true, + "agentMemoryType": "allMessages", + "agentUserMessage": "

Given the above conversations, generate a detail solution developed by the software engineer and code reviewer.

Your guiding principles:

  1. Preserve Full Context
    Include all code implementations, improvements and review from the conversation. Do not omit, summarize, or oversimplify key information.

  2. Markdown Output Only
    Your final output must be in Markdown format.

", + "agentReturnResponseAs": "userMessage", + "agentUpdateState": "", + "agentModelConfig": { + "credential": "", + "modelName": "gemini-2.5-flash-preview-05-20", + "customModelName": "", + "temperature": 0.9, + "streaming": true, + "maxOutputTokens": "", + "topP": "", + "topK": "", + "harmCategory": "", + "harmBlockThreshold": "", + "baseUrl": "", + "allowImageUploads": "", + "agentModel": "chatGoogleGenerativeAI" + } + }, + "outputAnchors": [ + { + "id": "agentAgentflow_3-output-agentAgentflow", + "label": "Agent", + "name": "agentAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 283, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": 357.60470406099364, + "y": 192.61532204982643 + }, + "dragging": false + }, + { + "id": "loopAgentflow_0", + "position": { + "x": 572.5888618465789, + "y": -20.827003962303266 + }, + "data": { + "id": "loopAgentflow_0", + "label": "Loop to Supervisor", + "version": 1, + "name": "loopAgentflow", + "type": "Loop", + "color": "#FFA07A", + "hideOutput": true, + "baseClasses": [ + "Loop" + ], + "category": "Agent Flows", + "description": "Loop back to a previous node", + "inputParams": [ + { + "label": "Loop Back To", + "name": "loopBackToNode", + "type": "asyncOptions", + "loadMethod": "listPreviousNodes", + "freeSolo": true, + "id": "loopAgentflow_0-input-loopBackToNode-asyncOptions", + "display": true + }, + { + "label": "Max Loop Count", + "name": "maxLoopCount", + "type": "number", + "default": 5, + "id": "loopAgentflow_0-input-maxLoopCount-number", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "loopBackToNode": "llmAgentflow_0-Supervisor", + "maxLoopCount": 5 + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 195, + "height": 66, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 572.5888618465789, + "y": -20.827003962303266 + } + }, + { + "id": "loopAgentflow_1", + "position": { + "x": 566.7568359277939, + "y": 90.98824734487103 + }, + "data": { + "id": "loopAgentflow_1", + "label": "Loop to Supervisor", + "version": 1, + "name": "loopAgentflow", + "type": "Loop", + "color": "#FFA07A", + "hideOutput": true, + "baseClasses": [ + "Loop" + ], + "category": "Agent Flows", + "description": "Loop back to a previous node", + "inputParams": [ + { + "label": "Loop Back To", + "name": "loopBackToNode", + "type": "asyncOptions", + "loadMethod": "listPreviousNodes", + "freeSolo": true, + "id": "loopAgentflow_1-input-loopBackToNode-asyncOptions", + "display": true + }, + { + "label": "Max Loop Count", + "name": "maxLoopCount", + "type": "number", + "default": 5, + "id": "loopAgentflow_1-input-maxLoopCount-number", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "loopBackToNode": "llmAgentflow_0-Supervisor", + "maxLoopCount": 5 + }, + "outputAnchors": [], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 195, + "height": 66, + "selected": false, + "dragging": false, + "positionAbsolute": { + "x": 566.7568359277939, + "y": 90.98824734487103 + } + }, + { + "id": "llmAgentflow_0", + "position": { + "x": -60.01488766486309, + "y": 87.88377139143167 + }, + "data": { + "id": "llmAgentflow_0", + "label": "Supervisor", + "version": 1, + "name": "llmAgentflow", + "type": "LLM", + "color": "#64B5F6", + "baseClasses": [ + "LLM" + ], + "category": "Agent Flows", + "description": "Large language models to analyze user-provided inputs and generate responses", + "inputParams": [ + { + "label": "Model", + "name": "llmModel", + "type": "asyncOptions", + "loadMethod": "listModels", + "loadConfig": true, + "id": "llmAgentflow_0-input-llmModel-asyncOptions", + "display": true + }, + { + "label": "Messages", + "name": "llmMessages", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Role", + "name": "role", + "type": "options", + "options": [ + { + "label": "System", + "name": "system" + }, + { + "label": "Assistant", + "name": "assistant" + }, + { + "label": "Developer", + "name": "developer" + }, + { + "label": "User", + "name": "user" + } + ] + }, + { + "label": "Content", + "name": "content", + "type": "string", + "acceptVariable": true, + "generateInstruction": true, + "rows": 4 + } + ], + "id": "llmAgentflow_0-input-llmMessages-array", + "display": true + }, + { + "label": "Enable Memory", + "name": "llmEnableMemory", + "type": "boolean", + "description": "Enable memory for the conversation thread", + "default": true, + "optional": true, + "id": "llmAgentflow_0-input-llmEnableMemory-boolean", + "display": true + }, + { + "label": "Memory Type", + "name": "llmMemoryType", + "type": "options", + "options": [ + { + "label": "All Messages", + "name": "allMessages", + "description": "Retrieve all messages from the conversation" + }, + { + "label": "Window Size", + "name": "windowSize", + "description": "Uses a fixed window size to surface the last N messages" + }, + { + "label": "Conversation Summary", + "name": "conversationSummary", + "description": "Summarizes the whole conversation" + }, + { + "label": "Conversation Summary Buffer", + "name": "conversationSummaryBuffer", + "description": "Summarize conversations once token limit is reached. Default to 2000" + } + ], + "optional": true, + "default": "allMessages", + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmMemoryType-options", + "display": true + }, + { + "label": "Window Size", + "name": "llmMemoryWindowSize", + "type": "number", + "default": "20", + "description": "Uses a fixed window size to surface the last N messages", + "show": { + "llmMemoryType": "windowSize" + }, + "id": "llmAgentflow_0-input-llmMemoryWindowSize-number", + "display": false + }, + { + "label": "Max Token Limit", + "name": "llmMemoryMaxTokenLimit", + "type": "number", + "default": "2000", + "description": "Summarize conversations once token limit is reached. Default to 2000", + "show": { + "llmMemoryType": "conversationSummaryBuffer" + }, + "id": "llmAgentflow_0-input-llmMemoryMaxTokenLimit-number", + "display": false + }, + { + "label": "Input Message", + "name": "llmUserMessage", + "type": "string", + "description": "Add an input message as user message at the end of the conversation", + "rows": 4, + "optional": true, + "acceptVariable": true, + "show": { + "llmEnableMemory": true + }, + "id": "llmAgentflow_0-input-llmUserMessage-string", + "display": true + }, + { + "label": "Return Response As", + "name": "llmReturnResponseAs", + "type": "options", + "options": [ + { + "label": "User Message", + "name": "userMessage" + }, + { + "label": "Assistant Message", + "name": "assistantMessage" + } + ], + "default": "userMessage", + "id": "llmAgentflow_0-input-llmReturnResponseAs-options", + "display": true + }, + { + "label": "JSON Structured Output", + "name": "llmStructuredOutput", + "description": "Instruct the LLM to give output in a JSON structured schema", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "string" + }, + { + "label": "Type", + "name": "type", + "type": "options", + "options": [ + { + "label": "String", + "name": "string" + }, + { + "label": "String Array", + "name": "stringArray" + }, + { + "label": "Number", + "name": "number" + }, + { + "label": "Boolean", + "name": "boolean" + }, + { + "label": "Enum", + "name": "enum" + }, + { + "label": "JSON Array", + "name": "jsonArray" + } + ] + }, + { + "label": "Enum Values", + "name": "enumValues", + "type": "string", + "placeholder": "value1, value2, value3", + "description": "Enum values. Separated by comma", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "enum" + } + }, + { + "label": "JSON Schema", + "name": "jsonSchema", + "type": "code", + "placeholder": "{\n \"answer\": {\n \"type\": \"string\",\n \"description\": \"Value of the answer\"\n },\n \"reason\": {\n \"type\": \"string\",\n \"description\": \"Reason for the answer\"\n },\n \"optional\": {\n \"type\": \"boolean\"\n },\n \"count\": {\n \"type\": \"number\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"value\": {\n \"type\": \"string\",\n \"description\": \"Value of the children's answer\"\n }\n }\n }\n }\n}", + "description": "JSON schema for the structured output", + "optional": true, + "show": { + "llmStructuredOutput[$index].type": "jsonArray" + } + }, + { + "label": "Description", + "name": "description", + "type": "string", + "placeholder": "Description of the key" + } + ], + "id": "llmAgentflow_0-input-llmStructuredOutput-array", + "display": true + }, + { + "label": "Update Flow State", + "name": "llmUpdateState", + "description": "Update runtime state during the execution of the workflow", + "type": "array", + "optional": true, + "acceptVariable": true, + "array": [ + { + "label": "Key", + "name": "key", + "type": "asyncOptions", + "loadMethod": "listRuntimeStateKeys", + "freeSolo": true + }, + { + "label": "Value", + "name": "value", + "type": "string", + "acceptVariable": true, + "acceptNodeOutputAsVariable": true + } + ], + "id": "llmAgentflow_0-input-llmUpdateState-array", + "display": true + } + ], + "inputAnchors": [], + "inputs": { + "llmModel": "chatOpenAI", + "llmMessages": [ + { + "role": "system", + "content": "

You are a supervisor tasked with managing a conversation between the following workers:

- Software Engineer

- Code Reviewer

Given the following user request, respond with the worker to act next.

Each worker will perform a task and respond with their results and status.

When finished, respond with FINISH.

Select strategically to minimize the number of steps taken.

" + } + ], + "llmEnableMemory": true, + "llmMemoryType": "allMessages", + "llmUserMessage": "

Given the conversation above, who should act next? Or should we FINISH? Select one of: SOFTWARE, REVIEWER

", + "llmReturnResponseAs": "userMessage", + "llmStructuredOutput": [ + { + "key": "next", + "type": "enum", + "enumValues": "FINISH, SOFTWARE, REVIEWER", + "jsonSchema": "", + "description": "next worker to act" + }, + { + "key": "instructions", + "type": "string", + "enumValues": "", + "jsonSchema": "", + "description": "The specific instructions of the sub-task the next worker should accomplish." + }, + { + "key": "reasoning", + "type": "string", + "enumValues": "", + "jsonSchema": "", + "description": "The reason why next worker is tasked to do the job" + } + ], + "llmUpdateState": [ + { + "key": "next", + "value": "

{{ output.next }}

" + }, + { + "key": "instruction", + "value": "

{{ output.instructions }}

" + } + ], + "llmModelConfig": { + "cache": "", + "modelName": "gpt-4.1", + "temperature": 0.9, + "streaming": true, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "strictToolCalling": "", + "stopSequence": "", + "basepath": "", + "proxyUrl": "", + "baseOptions": "", + "allowImageUploads": "", + "reasoningEffort": "medium", + "llmModel": "chatOpenAI" + } + }, + "outputAnchors": [ + { + "id": "llmAgentflow_0-output-llmAgentflow", + "label": "LLM", + "name": "llmAgentflow" + } + ], + "outputs": {}, + "selected": false + }, + "type": "agentFlow", + "width": 148, + "height": 72, + "selected": false, + "positionAbsolute": { + "x": -60.01488766486309, + "y": 87.88377139143167 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "startAgentflow_0", + "sourceHandle": "startAgentflow_0-output-startAgentflow", + "target": "llmAgentflow_0", + "targetHandle": "llmAgentflow_0", + "data": { + "sourceColor": "#7EE787", + "targetColor": "#64B5F6", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-llmAgentflow_0-llmAgentflow_0" + }, + { + "source": "llmAgentflow_0", + "sourceHandle": "llmAgentflow_0-output-llmAgentflow", + "target": "conditionAgentflow_0", + "targetHandle": "conditionAgentflow_0", + "data": { + "sourceColor": "#64B5F6", + "targetColor": "#FFB938", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "llmAgentflow_0-llmAgentflow_0-output-llmAgentflow-conditionAgentflow_0-conditionAgentflow_0" + }, + { + "source": "conditionAgentflow_0", + "sourceHandle": "conditionAgentflow_0-output-0", + "target": "agentAgentflow_1", + "targetHandle": "agentAgentflow_1", + "data": { + "sourceColor": "#FFB938", + "targetColor": "#4DD0E1", + "edgeLabel": "0", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentflow_0-conditionAgentflow_0-output-0-agentAgentflow_1-agentAgentflow_1" + }, + { + "source": "conditionAgentflow_0", + "sourceHandle": "conditionAgentflow_0-output-1", + "target": "agentAgentflow_2", + "targetHandle": "agentAgentflow_2", + "data": { + "sourceColor": "#FFB938", + "targetColor": "#4DD0E1", + "edgeLabel": "1", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentflow_0-conditionAgentflow_0-output-1-agentAgentflow_2-agentAgentflow_2" + }, + { + "source": "conditionAgentflow_0", + "sourceHandle": "conditionAgentflow_0-output-2", + "target": "agentAgentflow_3", + "targetHandle": "agentAgentflow_3", + "data": { + "sourceColor": "#FFB938", + "targetColor": "#4DD0E1", + "edgeLabel": "2", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "conditionAgentflow_0-conditionAgentflow_0-output-2-agentAgentflow_3-agentAgentflow_3" + }, + { + "source": "agentAgentflow_1", + "sourceHandle": "agentAgentflow_1-output-agentAgentflow", + "target": "loopAgentflow_0", + "targetHandle": "loopAgentflow_0", + "data": { + "sourceColor": "#4DD0E1", + "targetColor": "#FFA07A", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "agentAgentflow_1-agentAgentflow_1-output-agentAgentflow-loopAgentflow_0-loopAgentflow_0" + }, + { + "source": "agentAgentflow_2", + "sourceHandle": "agentAgentflow_2-output-agentAgentflow", + "target": "loopAgentflow_1", + "targetHandle": "loopAgentflow_1", + "data": { + "sourceColor": "#4DD0E1", + "targetColor": "#FFA07A", + "isHumanInput": false + }, + "type": "agentFlow", + "id": "agentAgentflow_2-agentAgentflow_2-output-agentAgentflow-loopAgentflow_1-loopAgentflow_1" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/ToolAgent Chatflow.json b/cn/.gitbook/assets/ToolAgent Chatflow.json new file mode 100644 index 00000000..1d71ce92 --- /dev/null +++ b/cn/.gitbook/assets/ToolAgent Chatflow.json @@ -0,0 +1,1160 @@ +{ + "nodes": [ + { + "width": 300, + "height": 606, + "id": "pinecone_0", + "position": { + "x": 416.0885364955418, + "y": -74.64623359488957 + }, + "type": "customNode", + "data": { + "id": "pinecone_0", + "label": "Pinecone", + "version": 3, + "name": "pinecone", + "type": "Pinecone", + "baseClasses": [ + "Pinecone", + "VectorStoreRetriever", + "BaseRetriever" + ], + "category": "Vector Stores", + "description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "pineconeApi" + ], + "id": "pinecone_0-input-credential-credential" + }, + { + "label": "Pinecone Index", + "name": "pineconeIndex", + "type": "string", + "id": "pinecone_0-input-pineconeIndex-string" + }, + { + "label": "Pinecone Namespace", + "name": "pineconeNamespace", + "type": "string", + "placeholder": "my-first-namespace", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-pineconeNamespace-string" + }, + { + "label": "Pinecone Metadata Filter", + "name": "pineconeMetadataFilter", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "pinecone_0-input-pineconeMetadataFilter-json" + }, + { + "label": "Top K", + "name": "topK", + "description": "Number of top results to fetch. Default to 4", + "placeholder": "4", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-topK-number" + }, + { + "label": "Search Type", + "name": "searchType", + "type": "options", + "default": "similarity", + "options": [ + { + "label": "Similarity", + "name": "similarity" + }, + { + "label": "Max Marginal Relevance", + "name": "mmr" + } + ], + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-searchType-options" + }, + { + "label": "Fetch K (for MMR Search)", + "name": "fetchK", + "description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR", + "placeholder": "20", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-fetchK-number" + }, + { + "label": "Lambda (for MMR Search)", + "name": "lambda", + "description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR", + "placeholder": "0.5", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-lambda-number" + } + ], + "inputAnchors": [ + { + "label": "Document", + "name": "document", + "type": "Document", + "list": true, + "optional": true, + "id": "pinecone_0-input-document-Document" + }, + { + "label": "Embeddings", + "name": "embeddings", + "type": "Embeddings", + "id": "pinecone_0-input-embeddings-Embeddings" + }, + { + "label": "Record Manager", + "name": "recordManager", + "type": "RecordManager", + "description": "Keep track of the record to prevent duplication", + "optional": true, + "id": "pinecone_0-input-recordManager-RecordManager" + } + ], + "inputs": { + "document": "", + "embeddings": "{{openAIEmbeddings_0.data.instance}}", + "recordManager": "", + "pineconeIndex": "newindex", + "pineconeNamespace": "pinecone-form10k", + "pineconeMetadataFilter": "{\"source\":\"apple\"}", + "topK": "", + "searchType": "similarity", + "fetchK": "", + "lambda": "" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "name": "retriever", + "label": "Pinecone Retriever", + "description": "", + "type": "Pinecone | VectorStoreRetriever | BaseRetriever" + }, + { + "id": "pinecone_0-output-vectorStore-Pinecone|VectorStore", + "name": "vectorStore", + "label": "Pinecone Vector Store", + "description": "", + "type": "Pinecone | VectorStore" + } + ], + "default": "retriever" + } + ], + "outputs": { + "output": "retriever" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 416.0885364955418, + "y": -74.64623359488957 + }, + "dragging": false + }, + { + "width": 300, + "height": 424, + "id": "openAIEmbeddings_0", + "position": { + "x": 54.119166092646566, + "y": -20.12821243199312 + }, + "type": "customNode", + "data": { + "id": "openAIEmbeddings_0", + "label": "OpenAI Embeddings", + "version": 4, + "name": "openAIEmbeddings", + "type": "OpenAIEmbeddings", + "baseClasses": [ + "OpenAIEmbeddings", + "Embeddings" + ], + "category": "Embeddings", + "description": "OpenAI API to generate embeddings for a given text", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "openAIEmbeddings_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "text-embedding-ada-002", + "id": "openAIEmbeddings_0-input-modelName-asyncOptions" + }, + { + "label": "Strip New Lines", + "name": "stripNewLines", + "type": "boolean", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-stripNewLines-boolean" + }, + { + "label": "Batch Size", + "name": "batchSize", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-batchSize-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-basepath-string" + }, + { + "label": "Dimensions", + "name": "dimensions", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-dimensions-number" + } + ], + "inputAnchors": [], + "inputs": { + "modelName": "text-embedding-ada-002", + "stripNewLines": "", + "batchSize": "", + "timeout": "", + "basepath": "", + "dimensions": "" + }, + "outputAnchors": [ + { + "id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "name": "openAIEmbeddings", + "label": "OpenAIEmbeddings", + "description": "OpenAI API to generate embeddings for a given text", + "type": "OpenAIEmbeddings | Embeddings" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 54.119166092646566, + "y": -20.12821243199312 + }, + "dragging": false + }, + { + "width": 300, + "height": 606, + "id": "pinecone_1", + "position": { + "x": 428.41115568995156, + "y": 549.0169795435812 + }, + "type": "customNode", + "data": { + "id": "pinecone_1", + "label": "Pinecone", + "version": 3, + "name": "pinecone", + "type": "Pinecone", + "baseClasses": [ + "Pinecone", + "VectorStoreRetriever", + "BaseRetriever" + ], + "category": "Vector Stores", + "description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "pineconeApi" + ], + "id": "pinecone_1-input-credential-credential" + }, + { + "label": "Pinecone Index", + "name": "pineconeIndex", + "type": "string", + "id": "pinecone_1-input-pineconeIndex-string" + }, + { + "label": "Pinecone Namespace", + "name": "pineconeNamespace", + "type": "string", + "placeholder": "my-first-namespace", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-pineconeNamespace-string" + }, + { + "label": "Pinecone Metadata Filter", + "name": "pineconeMetadataFilter", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "pinecone_1-input-pineconeMetadataFilter-json" + }, + { + "label": "Top K", + "name": "topK", + "description": "Number of top results to fetch. Default to 4", + "placeholder": "4", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-topK-number" + }, + { + "label": "Search Type", + "name": "searchType", + "type": "options", + "default": "similarity", + "options": [ + { + "label": "Similarity", + "name": "similarity" + }, + { + "label": "Max Marginal Relevance", + "name": "mmr" + } + ], + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-searchType-options" + }, + { + "label": "Fetch K (for MMR Search)", + "name": "fetchK", + "description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR", + "placeholder": "20", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-fetchK-number" + }, + { + "label": "Lambda (for MMR Search)", + "name": "lambda", + "description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR", + "placeholder": "0.5", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-lambda-number" + } + ], + "inputAnchors": [ + { + "label": "Document", + "name": "document", + "type": "Document", + "list": true, + "optional": true, + "id": "pinecone_1-input-document-Document" + }, + { + "label": "Embeddings", + "name": "embeddings", + "type": "Embeddings", + "id": "pinecone_1-input-embeddings-Embeddings" + }, + { + "label": "Record Manager", + "name": "recordManager", + "type": "RecordManager", + "description": "Keep track of the record to prevent duplication", + "optional": true, + "id": "pinecone_1-input-recordManager-RecordManager" + } + ], + "inputs": { + "document": "", + "embeddings": "{{openAIEmbeddings_1.data.instance}}", + "recordManager": "", + "pineconeIndex": "newindex", + "pineconeNamespace": "pinecone-form10k-2", + "pineconeMetadataFilter": "{\"source\":\"tesla\"}", + "topK": "", + "searchType": "similarity", + "fetchK": "", + "lambda": "" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "pinecone_1-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "name": "retriever", + "label": "Pinecone Retriever", + "description": "", + "type": "Pinecone | VectorStoreRetriever | BaseRetriever" + }, + { + "id": "pinecone_1-output-vectorStore-Pinecone|VectorStore", + "name": "vectorStore", + "label": "Pinecone Vector Store", + "description": "", + "type": "Pinecone | VectorStore" + } + ], + "default": "retriever" + } + ], + "outputs": { + "output": "retriever" + }, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 428.41115568995156, + "y": 549.0169795435812 + }, + "dragging": false + }, + { + "width": 300, + "height": 424, + "id": "openAIEmbeddings_1", + "position": { + "x": 58.45057557109914, + "y": 575.7733202609951 + }, + "type": "customNode", + "data": { + "id": "openAIEmbeddings_1", + "label": "OpenAI Embeddings", + "version": 4, + "name": "openAIEmbeddings", + "type": "OpenAIEmbeddings", + "baseClasses": [ + "OpenAIEmbeddings", + "Embeddings" + ], + "category": "Embeddings", + "description": "OpenAI API to generate embeddings for a given text", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "openAIEmbeddings_1-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "text-embedding-ada-002", + "id": "openAIEmbeddings_1-input-modelName-asyncOptions" + }, + { + "label": "Strip New Lines", + "name": "stripNewLines", + "type": "boolean", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-stripNewLines-boolean" + }, + { + "label": "Batch Size", + "name": "batchSize", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-batchSize-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-basepath-string" + }, + { + "label": "Dimensions", + "name": "dimensions", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-dimensions-number" + } + ], + "inputAnchors": [], + "inputs": { + "modelName": "text-embedding-ada-002", + "stripNewLines": "", + "batchSize": "", + "timeout": "", + "basepath": "", + "dimensions": "" + }, + "outputAnchors": [ + { + "id": "openAIEmbeddings_1-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "name": "openAIEmbeddings", + "label": "OpenAIEmbeddings", + "description": "OpenAI API to generate embeddings for a given text", + "type": "OpenAIEmbeddings | Embeddings" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 58.45057557109914, + "y": 575.7733202609951 + }, + "dragging": false + }, + { + "width": 300, + "height": 253, + "id": "bufferMemory_0", + "position": { + "x": 825.5960565466753, + "y": 1212.2401709995304 + }, + "type": "customNode", + "data": { + "id": "bufferMemory_0", + "label": "Buffer Memory", + "version": 2, + "name": "bufferMemory", + "type": "BufferMemory", + "baseClasses": [ + "BufferMemory", + "BaseChatMemory", + "BaseMemory" + ], + "category": "Memory", + "description": "Retrieve chat messages stored in database", + "inputParams": [ + { + "label": "Session Id", + "name": "sessionId", + "type": "string", + "description": "If not specified, a random id will be used. Learn more", + "default": "", + "additionalParams": true, + "optional": true, + "id": "bufferMemory_0-input-sessionId-string" + }, + { + "label": "Memory Key", + "name": "memoryKey", + "type": "string", + "default": "chat_history", + "additionalParams": true, + "id": "bufferMemory_0-input-memoryKey-string" + } + ], + "inputAnchors": [], + "inputs": { + "sessionId": "", + "memoryKey": "chat_history" + }, + "outputAnchors": [ + { + "id": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "name": "bufferMemory", + "label": "BufferMemory", + "description": "Retrieve chat messages stored in database", + "type": "BufferMemory | BaseChatMemory | BaseMemory" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 825.5960565466753, + "y": 1212.2401709995304 + }, + "dragging": false + }, + { + "width": 300, + "height": 603, + "id": "retrieverTool_2", + "position": { + "x": 798.3128281367018, + "y": -151.77659673435184 + }, + "type": "customNode", + "data": { + "id": "retrieverTool_2", + "label": "Retriever Tool", + "version": 2, + "name": "retrieverTool", + "type": "RetrieverTool", + "baseClasses": [ + "RetrieverTool", + "DynamicTool", + "Tool", + "StructuredTool", + "Runnable" + ], + "category": "Tools", + "description": "Use a retriever as allowed tool for agent", + "inputParams": [ + { + "label": "Retriever Name", + "name": "name", + "type": "string", + "placeholder": "search_state_of_union", + "id": "retrieverTool_2-input-name-string" + }, + { + "label": "Retriever Description", + "name": "description", + "type": "string", + "description": "When should agent uses to retrieve documents", + "rows": 3, + "placeholder": "Searches and returns documents regarding the state-of-the-union.", + "id": "retrieverTool_2-input-description-string" + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "retrieverTool_2-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "Retriever", + "name": "retriever", + "type": "BaseRetriever", + "id": "retrieverTool_2-input-retriever-BaseRetriever" + } + ], + "inputs": { + "name": "search_apple", + "description": "Use this function to answer user questions about Apple Inc (APPL). It contains a SEC Form 10K filing describing the financials of Apple Inc (APPL) for the 2022 time period.", + "retriever": "{{pinecone_0.data.instance}}", + "returnSourceDocuments": true + }, + "outputAnchors": [ + { + "id": "retrieverTool_2-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "name": "retrieverTool", + "label": "RetrieverTool", + "type": "RetrieverTool | DynamicTool | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 798.3128281367018, + "y": -151.77659673435184 + }, + "dragging": false + }, + { + "width": 300, + "height": 603, + "id": "retrieverTool_1", + "position": { + "x": 805.1192462354428, + "y": 479.4961512574057 + }, + "type": "customNode", + "data": { + "id": "retrieverTool_1", + "label": "Retriever Tool", + "version": 2, + "name": "retrieverTool", + "type": "RetrieverTool", + "baseClasses": [ + "RetrieverTool", + "DynamicTool", + "Tool", + "StructuredTool", + "Runnable" + ], + "category": "Tools", + "description": "Use a retriever as allowed tool for agent", + "inputParams": [ + { + "label": "Retriever Name", + "name": "name", + "type": "string", + "placeholder": "search_state_of_union", + "id": "retrieverTool_1-input-name-string" + }, + { + "label": "Retriever Description", + "name": "description", + "type": "string", + "description": "When should agent uses to retrieve documents", + "rows": 3, + "placeholder": "Searches and returns documents regarding the state-of-the-union.", + "id": "retrieverTool_1-input-description-string" + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "retrieverTool_1-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "Retriever", + "name": "retriever", + "type": "BaseRetriever", + "id": "retrieverTool_1-input-retriever-BaseRetriever" + } + ], + "inputs": { + "name": "search_tsla", + "description": "Use this function to answer user questions about Tesla Inc (TSLA). It contains a SEC Form 10K filing describing the financials of Tesla Inc (TSLA) for the 2022 time period.", + "retriever": "{{pinecone_1.data.instance}}", + "returnSourceDocuments": true + }, + "outputAnchors": [ + { + "id": "retrieverTool_1-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "name": "retrieverTool", + "label": "RetrieverTool", + "type": "RetrieverTool | DynamicTool | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 805.1192462354428, + "y": 479.4961512574057 + }, + "dragging": false + }, + { + "id": "chatOpenAI_0", + "position": { + "x": 35.45489050081932, + "y": 1052.597243506172 + }, + "type": "customNode", + "data": { + "id": "chatOpenAI_0", + "label": "ChatOpenAI", + "version": 6, + "name": "chatOpenAI", + "type": "ChatOpenAI", + "baseClasses": [ + "ChatOpenAI", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "chatOpenAI_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "asyncOptions", + "loadMethod": "listModels", + "default": "gpt-3.5-turbo", + "id": "chatOpenAI_0-input-modelName-asyncOptions" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatOpenAI_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokens", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-maxTokens-number" + }, + { + "label": "Top Probability", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-topP-number" + }, + { + "label": "Frequency Penalty", + "name": "frequencyPenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-frequencyPenalty-number" + }, + { + "label": "Presence Penalty", + "name": "presencePenalty", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-presencePenalty-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-basepath-string" + }, + { + "label": "BaseOptions", + "name": "baseOptions", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "chatOpenAI_0-input-baseOptions-json" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses gpt-4-vision-preview when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatOpenAI_0-input-allowImageUploads-boolean" + }, + { + "label": "Image Resolution", + "description": "This parameter controls the resolution in which the model views the image.", + "name": "imageResolution", + "type": "options", + "options": [ + { + "label": "Low", + "name": "low" + }, + { + "label": "High", + "name": "high" + }, + { + "label": "Auto", + "name": "auto" + } + ], + "default": "low", + "optional": false, + "additionalParams": true, + "id": "chatOpenAI_0-input-imageResolution-options" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatOpenAI_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "gpt-3.5-turbo", + "temperature": 0.9, + "maxTokens": "", + "topP": "", + "frequencyPenalty": "", + "presencePenalty": "", + "timeout": "", + "basepath": "", + "baseOptions": "", + "allowImageUploads": "", + "imageResolution": "low" + }, + "outputAnchors": [ + { + "id": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatOpenAI", + "label": "ChatOpenAI", + "description": "Wrapper around OpenAI large language models that use the Chat endpoint", + "type": "ChatOpenAI | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 670, + "selected": false, + "positionAbsolute": { + "x": 35.45489050081932, + "y": 1052.597243506172 + }, + "dragging": false + }, + { + "id": "toolAgent_0", + "position": { + "x": 1275.5041953989141, + "y": 391.50042413140017 + }, + "type": "customNode", + "data": { + "id": "toolAgent_0", + "label": "Tool Agent", + "version": 1, + "name": "toolAgent", + "type": "AgentExecutor", + "baseClasses": [ + "AgentExecutor", + "BaseChain", + "Runnable" + ], + "category": "Agents", + "description": "Agent that uses Function Calling to pick the tools and args to call", + "inputParams": [ + { + "label": "System Message", + "name": "systemMessage", + "type": "string", + "default": "You are a helpful AI assistant.", + "rows": 4, + "optional": true, + "additionalParams": true, + "id": "toolAgent_0-input-systemMessage-string" + }, + { + "label": "Max Iterations", + "name": "maxIterations", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "toolAgent_0-input-maxIterations-number" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "id": "toolAgent_0-input-tools-Tool" + }, + { + "label": "Memory", + "name": "memory", + "type": "BaseChatMemory", + "id": "toolAgent_0-input-memory-BaseChatMemory" + }, + { + "label": "Tool Calling Chat Model", + "name": "model", + "type": "BaseChatModel", + "description": "Only compatible with models that are capable of function calling: ChatOpenAI, ChatMistral, ChatAnthropic, ChatGoogleGenerativeAI, ChatVertexAI, GroqChat", + "id": "toolAgent_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "toolAgent_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "tools": [ + "{{retrieverTool_2.data.instance}}", + "{{retrieverTool_1.data.instance}}" + ], + "memory": "{{bufferMemory_0.data.instance}}", + "model": "{{chatOpenAI_0.data.instance}}", + "systemMessage": "You are a helpful AI assistant.", + "inputModeration": "", + "maxIterations": "" + }, + "outputAnchors": [ + { + "id": "toolAgent_0-output-toolAgent-AgentExecutor|BaseChain|Runnable", + "name": "toolAgent", + "label": "AgentExecutor", + "description": "Agent that uses Function Calling to pick the tools and args to call", + "type": "AgentExecutor | BaseChain | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 435, + "selected": false, + "positionAbsolute": { + "x": 1275.5041953989141, + "y": 391.50042413140017 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "openAIEmbeddings_0", + "sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "target": "pinecone_0", + "targetHandle": "pinecone_0-input-embeddings-Embeddings", + "type": "buttonedge", + "id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pinecone_0-pinecone_0-input-embeddings-Embeddings" + }, + { + "source": "openAIEmbeddings_1", + "sourceHandle": "openAIEmbeddings_1-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "target": "pinecone_1", + "targetHandle": "pinecone_1-input-embeddings-Embeddings", + "type": "buttonedge", + "id": "openAIEmbeddings_1-openAIEmbeddings_1-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pinecone_1-pinecone_1-input-embeddings-Embeddings" + }, + { + "source": "pinecone_0", + "sourceHandle": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "target": "retrieverTool_2", + "targetHandle": "retrieverTool_2-input-retriever-BaseRetriever", + "type": "buttonedge", + "id": "pinecone_0-pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever-retrieverTool_2-retrieverTool_2-input-retriever-BaseRetriever" + }, + { + "source": "pinecone_1", + "sourceHandle": "pinecone_1-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "target": "retrieverTool_1", + "targetHandle": "retrieverTool_1-input-retriever-BaseRetriever", + "type": "buttonedge", + "id": "pinecone_1-pinecone_1-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever-retrieverTool_1-retrieverTool_1-input-retriever-BaseRetriever" + }, + { + "source": "retrieverTool_2", + "sourceHandle": "retrieverTool_2-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "target": "toolAgent_0", + "targetHandle": "toolAgent_0-input-tools-Tool", + "type": "buttonedge", + "id": "retrieverTool_2-retrieverTool_2-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable-toolAgent_0-toolAgent_0-input-tools-Tool" + }, + { + "source": "retrieverTool_1", + "sourceHandle": "retrieverTool_1-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "target": "toolAgent_0", + "targetHandle": "toolAgent_0-input-tools-Tool", + "type": "buttonedge", + "id": "retrieverTool_1-retrieverTool_1-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable-toolAgent_0-toolAgent_0-input-tools-Tool" + }, + { + "source": "bufferMemory_0", + "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "target": "toolAgent_0", + "targetHandle": "toolAgent_0-input-memory-BaseChatMemory", + "type": "buttonedge", + "id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-toolAgent_0-toolAgent_0-input-memory-BaseChatMemory" + }, + { + "source": "chatOpenAI_0", + "sourceHandle": "chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable", + "target": "toolAgent_0", + "targetHandle": "toolAgent_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatOpenAI_0-chatOpenAI_0-output-chatOpenAI-ChatOpenAI|BaseChatModel|BaseLanguageModel|Runnable-toolAgent_0-toolAgent_0-input-model-BaseChatModel" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/UD_02.png b/cn/.gitbook/assets/UD_02.png new file mode 100644 index 00000000..a606f777 Binary files /dev/null and b/cn/.gitbook/assets/UD_02.png differ diff --git a/cn/.gitbook/assets/UD_03.png b/cn/.gitbook/assets/UD_03.png new file mode 100644 index 00000000..9751382e Binary files /dev/null and b/cn/.gitbook/assets/UD_03.png differ diff --git a/cn/.gitbook/assets/UD_04.png b/cn/.gitbook/assets/UD_04.png new file mode 100644 index 00000000..47bb02dd Binary files /dev/null and b/cn/.gitbook/assets/UD_04.png differ diff --git a/cn/.gitbook/assets/UD_05.png b/cn/.gitbook/assets/UD_05.png new file mode 100644 index 00000000..0bf972b8 Binary files /dev/null and b/cn/.gitbook/assets/UD_05.png differ diff --git a/cn/.gitbook/assets/UD_06.png b/cn/.gitbook/assets/UD_06.png new file mode 100644 index 00000000..7d74d610 Binary files /dev/null and b/cn/.gitbook/assets/UD_06.png differ diff --git a/cn/.gitbook/assets/Untitled (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/Untitled (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c62be673 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/Untitled (1) (1) (1) (1).png b/cn/.gitbook/assets/Untitled (1) (1) (1) (1).png new file mode 100644 index 00000000..850962ca Binary files /dev/null and b/cn/.gitbook/assets/Untitled (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/Untitled (1) (1) (1).png b/cn/.gitbook/assets/Untitled (1) (1) (1).png new file mode 100644 index 00000000..acf1b318 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/Untitled (1).png b/cn/.gitbook/assets/Untitled (1).png new file mode 100644 index 00000000..45c95757 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (1).png differ diff --git a/cn/.gitbook/assets/Untitled (10).png b/cn/.gitbook/assets/Untitled (10).png new file mode 100644 index 00000000..d7fe3181 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (10).png differ diff --git a/cn/.gitbook/assets/Untitled (2) (1) (1).png b/cn/.gitbook/assets/Untitled (2) (1) (1).png new file mode 100644 index 00000000..33615d39 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/Untitled (2).png b/cn/.gitbook/assets/Untitled (2).png new file mode 100644 index 00000000..9cc9bb9d Binary files /dev/null and b/cn/.gitbook/assets/Untitled (2).png differ diff --git a/cn/.gitbook/assets/Untitled (3) (1).png b/cn/.gitbook/assets/Untitled (3) (1).png new file mode 100644 index 00000000..36ea6194 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (3) (1).png differ diff --git a/cn/.gitbook/assets/Untitled (4) (1).png b/cn/.gitbook/assets/Untitled (4) (1).png new file mode 100644 index 00000000..8b45bad3 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (4) (1).png differ diff --git a/cn/.gitbook/assets/Untitled (5).png b/cn/.gitbook/assets/Untitled (5).png new file mode 100644 index 00000000..062bbf38 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (5).png differ diff --git a/cn/.gitbook/assets/Untitled (7).png b/cn/.gitbook/assets/Untitled (7).png new file mode 100644 index 00000000..10807828 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (7).png differ diff --git a/cn/.gitbook/assets/Untitled (8).png b/cn/.gitbook/assets/Untitled (8).png new file mode 100644 index 00000000..f0386854 Binary files /dev/null and b/cn/.gitbook/assets/Untitled (8).png differ diff --git a/cn/.gitbook/assets/Untitled (9).png b/cn/.gitbook/assets/Untitled (9).png new file mode 100644 index 00000000..03f2588c Binary files /dev/null and b/cn/.gitbook/assets/Untitled (9).png differ diff --git a/cn/.gitbook/assets/Untitled-2024-10-19-0050.png b/cn/.gitbook/assets/Untitled-2024-10-19-0050.png new file mode 100644 index 00000000..de2aaac2 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2024-10-19-0050.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-01-23-1520.png b/cn/.gitbook/assets/Untitled-2025-01-23-1520.png new file mode 100644 index 00000000..20daf8dc Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-01-23-1520.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-02-02-1727.png b/cn/.gitbook/assets/Untitled-2025-02-02-1727.png new file mode 100644 index 00000000..5fddc42b Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-02-02-1727.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-03-02-1727.png b/cn/.gitbook/assets/Untitled-2025-03-02-1727.png new file mode 100644 index 00000000..44ae78a9 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-03-02-1727.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-04-02-1727.png b/cn/.gitbook/assets/Untitled-2025-04-02-1727.png new file mode 100644 index 00000000..1360ea32 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-04-02-1727.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-056-02-1727.png b/cn/.gitbook/assets/Untitled-2025-056-02-1727.png new file mode 100644 index 00000000..52ba75a1 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-056-02-1727.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-06-15-0132 (1).png b/cn/.gitbook/assets/Untitled-2025-06-15-0132 (1).png new file mode 100644 index 00000000..aea36a29 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-06-15-0132 (1).png differ diff --git a/cn/.gitbook/assets/Untitled-2025-06-15-0132.png b/cn/.gitbook/assets/Untitled-2025-06-15-0132.png new file mode 100644 index 00000000..99b9a39d Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-06-15-0132.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-06-16-1507.png b/cn/.gitbook/assets/Untitled-2025-06-16-1507.png new file mode 100644 index 00000000..1b214822 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-06-16-1507.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-06-19-1011.png b/cn/.gitbook/assets/Untitled-2025-06-19-1011.png new file mode 100644 index 00000000..05e47d19 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-06-19-1011.png differ diff --git a/cn/.gitbook/assets/Untitled-2025-10-02-1133.png b/cn/.gitbook/assets/Untitled-2025-10-02-1133.png new file mode 100644 index 00000000..3f93f604 Binary files /dev/null and b/cn/.gitbook/assets/Untitled-2025-10-02-1133.png differ diff --git a/cn/.gitbook/assets/Untitled.png b/cn/.gitbook/assets/Untitled.png new file mode 100644 index 00000000..11882563 Binary files /dev/null and b/cn/.gitbook/assets/Untitled.png differ diff --git a/cn/.gitbook/assets/XMLAgent Chatflow.json b/cn/.gitbook/assets/XMLAgent Chatflow.json new file mode 100644 index 00000000..8c478123 --- /dev/null +++ b/cn/.gitbook/assets/XMLAgent Chatflow.json @@ -0,0 +1,1109 @@ +{ + "nodes": [ + { + "width": 300, + "height": 376, + "id": "bufferMemory_0", + "position": { + "x": 363.18868341411155, + "y": 473.71555789686244 + }, + "type": "customNode", + "data": { + "id": "bufferMemory_0", + "label": "Buffer Memory", + "version": 1, + "name": "bufferMemory", + "type": "BufferMemory", + "baseClasses": [ + "BufferMemory", + "BaseChatMemory", + "BaseMemory" + ], + "category": "Memory", + "description": "Remembers previous conversational back and forths directly", + "inputParams": [ + { + "label": "Memory Key", + "name": "memoryKey", + "type": "string", + "default": "chat_history", + "id": "bufferMemory_0-input-memoryKey-string" + }, + { + "label": "Input Key", + "name": "inputKey", + "type": "string", + "default": "input", + "id": "bufferMemory_0-input-inputKey-string" + } + ], + "inputAnchors": [], + "inputs": { + "memoryKey": "chat_history", + "inputKey": "input" + }, + "outputAnchors": [ + { + "id": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "name": "bufferMemory", + "label": "BufferMemory", + "type": "BufferMemory | BaseChatMemory | BaseMemory" + } + ], + "outputs": {}, + "selected": false + }, + "selected": false, + "positionAbsolute": { + "x": 363.18868341411155, + "y": 473.71555789686244 + }, + "dragging": false + }, + { + "id": "xmlAgent_0", + "position": { + "x": 1492.5028255133452, + "y": 161.2653235031646 + }, + "type": "customNode", + "data": { + "id": "xmlAgent_0", + "label": "XML Agent", + "version": 2, + "name": "xmlAgent", + "type": "XMLAgent", + "baseClasses": [ + "XMLAgent", + "BaseChain", + "Runnable" + ], + "category": "Agents", + "description": "Agent that is designed for LLMs that are good for reasoning/writing XML (e.g: Anthropic Claude)", + "inputParams": [ + { + "label": "System Message", + "name": "systemMessage", + "type": "string", + "warning": "Prompt must include input variables: {tools}, {chat_history}, {input} and {agent_scratchpad}", + "rows": 4, + "default": "You are a helpful assistant. Help the user answer any questions.\n\nYou have access to the following tools:\n\n{tools}\n\nIn order to use a tool, you can use and tags. You will then get back a response in the form \nFor example, if you have a tool called 'search' that could run a google search, in order to search for the weather in SF you would respond:\n\nsearchweather in SF\n64 degrees\n\nWhen you are done, respond with a final answer between . For example:\n\nThe weather in SF is 64 degrees\n\nBegin!\n\nPrevious Conversation:\n{chat_history}\n\nQuestion: {input}\n{agent_scratchpad}", + "additionalParams": true, + "id": "xmlAgent_0-input-systemMessage-string" + } + ], + "inputAnchors": [ + { + "label": "Tools", + "name": "tools", + "type": "Tool", + "list": true, + "id": "xmlAgent_0-input-tools-Tool" + }, + { + "label": "Memory", + "name": "memory", + "type": "BaseChatMemory", + "id": "xmlAgent_0-input-memory-BaseChatMemory" + }, + { + "label": "Chat Model", + "name": "model", + "type": "BaseChatModel", + "id": "xmlAgent_0-input-model-BaseChatModel" + }, + { + "label": "Input Moderation", + "description": "Detect text that could generate harmful output and prevent it from being sent to the language model", + "name": "inputModeration", + "type": "Moderation", + "optional": true, + "list": true, + "id": "xmlAgent_0-input-inputModeration-Moderation" + } + ], + "inputs": { + "tools": [ + "{{retrieverTool_0.data.instance}}", + "{{retrieverTool_1.data.instance}}" + ], + "memory": "{{bufferMemory_0.data.instance}}", + "model": "{{chatAnthropic_0.data.instance}}", + "systemMessage": "You are a helpful assistant. Help the user answer any questions.\n\nYou have access to the following tools:\n\n{tools}\n\nIn order to use a tool, you can use and tags. You will then get back a response in the form \nFor example, if you have a tool called 'search' that could run a google search, in order to search for the weather in SF you would respond:\n\nsearchweather in SF\n64 degrees\n\nWhen you are done, respond with a final answer between . For example:\n\nThe weather in SF is 64 degrees\n\nBegin!\n\nPrevious Conversation:\n{chat_history}\n\nQuestion: {input}\n{agent_scratchpad}", + "inputModeration": "" + }, + "outputAnchors": [ + { + "id": "xmlAgent_0-output-xmlAgent-XMLAgent|BaseChain|Runnable", + "name": "xmlAgent", + "label": "XMLAgent", + "description": "Agent that is designed for LLMs that are good for reasoning/writing XML (e.g: Anthropic Claude)", + "type": "XMLAgent | BaseChain | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 434, + "selected": false, + "positionAbsolute": { + "x": 1492.5028255133452, + "y": 161.2653235031646 + }, + "dragging": false + }, + { + "id": "chatAnthropic_0", + "position": { + "x": 1073.3453545616378, + "y": 298.65772549403795 + }, + "type": "customNode", + "data": { + "id": "chatAnthropic_0", + "label": "ChatAnthropic", + "version": 5, + "name": "chatAnthropic", + "type": "ChatAnthropic", + "baseClasses": [ + "ChatAnthropic", + "ChatAnthropicMessages", + "BaseChatModel", + "BaseLanguageModel", + "Runnable" + ], + "category": "Chat Models", + "description": "Wrapper around ChatAnthropic large language models that use the Chat endpoint", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "anthropicApi" + ], + "id": "chatAnthropic_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "claude-3-haiku", + "name": "claude-3-haiku-20240307", + "description": "Fastest and most compact model, designed for near-instant responsiveness" + }, + { + "label": "claude-3-opus", + "name": "claude-3-opus-20240229", + "description": "Most powerful model for highly complex tasks" + }, + { + "label": "claude-3-sonnet", + "name": "claude-3-sonnet-20240229", + "description": "Ideal balance of intelligence and speed for enterprise workloads" + }, + { + "label": "claude-2.0 (legacy)", + "name": "claude-2.0", + "description": "Claude 2 latest major version, automatically get updates to the model as they are released" + }, + { + "label": "claude-2.1 (legacy)", + "name": "claude-2.1", + "description": "Claude 2 latest full version" + }, + { + "label": "claude-instant-1.2 (legacy)", + "name": "claude-instant-1.2", + "description": "Claude Instant latest major version, automatically get updates to the model as they are released" + } + ], + "default": "claude-3-haiku", + "optional": true, + "id": "chatAnthropic_0-input-modelName-options" + }, + { + "label": "Temperature", + "name": "temperature", + "type": "number", + "step": 0.1, + "default": 0.9, + "optional": true, + "id": "chatAnthropic_0-input-temperature-number" + }, + { + "label": "Max Tokens", + "name": "maxTokensToSample", + "type": "number", + "step": 1, + "optional": true, + "additionalParams": true, + "id": "chatAnthropic_0-input-maxTokensToSample-number" + }, + { + "label": "Top P", + "name": "topP", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatAnthropic_0-input-topP-number" + }, + { + "label": "Top K", + "name": "topK", + "type": "number", + "step": 0.1, + "optional": true, + "additionalParams": true, + "id": "chatAnthropic_0-input-topK-number" + }, + { + "label": "Allow Image Uploads", + "name": "allowImageUploads", + "type": "boolean", + "description": "Automatically uses claude-3-* models when image is being uploaded from chat. Only works with LLMChain, Conversation Chain, ReAct Agent, and Conversational Agent", + "default": false, + "optional": true, + "id": "chatAnthropic_0-input-allowImageUploads-boolean" + } + ], + "inputAnchors": [ + { + "label": "Cache", + "name": "cache", + "type": "BaseCache", + "optional": true, + "id": "chatAnthropic_0-input-cache-BaseCache" + } + ], + "inputs": { + "cache": "", + "modelName": "claude-3-sonnet-20240229", + "temperature": "0", + "maxTokensToSample": "", + "topP": "", + "topK": "", + "allowImageUploads": "" + }, + "outputAnchors": [ + { + "id": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|ChatAnthropicMessages|BaseChatModel|BaseLanguageModel|Runnable", + "name": "chatAnthropic", + "label": "ChatAnthropic", + "description": "Wrapper around ChatAnthropic large language models that use the Chat endpoint", + "type": "ChatAnthropic | ChatAnthropicMessages | BaseChatModel | BaseLanguageModel | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 671, + "selected": false, + "positionAbsolute": { + "x": 1073.3453545616378, + "y": 298.65772549403795 + }, + "dragging": false + }, + { + "id": "retrieverTool_0", + "position": { + "x": 716.1176116429738, + "y": -19.654771005396583 + }, + "type": "customNode", + "data": { + "id": "retrieverTool_0", + "label": "Retriever Tool", + "version": 2, + "name": "retrieverTool", + "type": "RetrieverTool", + "baseClasses": [ + "RetrieverTool", + "DynamicTool", + "Tool", + "StructuredTool", + "Runnable" + ], + "category": "Tools", + "description": "Use a retriever as allowed tool for agent", + "inputParams": [ + { + "label": "Retriever Name", + "name": "name", + "type": "string", + "placeholder": "search_state_of_union", + "id": "retrieverTool_0-input-name-string" + }, + { + "label": "Retriever Description", + "name": "description", + "type": "string", + "description": "When should agent uses to retrieve documents", + "rows": 3, + "placeholder": "Searches and returns documents regarding the state-of-the-union.", + "id": "retrieverTool_0-input-description-string" + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "retrieverTool_0-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "Retriever", + "name": "retriever", + "type": "BaseRetriever", + "id": "retrieverTool_0-input-retriever-BaseRetriever" + } + ], + "inputs": { + "name": "search_apple", + "description": "Use this function to answer user questions about Apple Inc (APPL). It contains a SEC Form 10K filing describing the financials of Apple Inc (APPL) for the 2022 time period.", + "retriever": "{{pinecone_0.data.instance}}", + "returnSourceDocuments": true + }, + "outputAnchors": [ + { + "id": "retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "name": "retrieverTool", + "label": "RetrieverTool", + "description": "Use a retriever as allowed tool for agent", + "type": "RetrieverTool | DynamicTool | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 602, + "selected": false, + "positionAbsolute": { + "x": 716.1176116429738, + "y": -19.654771005396583 + }, + "dragging": false + }, + { + "id": "pinecone_0", + "position": { + "x": 378.7110351151108, + "y": -122.59235389975663 + }, + "type": "customNode", + "data": { + "id": "pinecone_0", + "label": "Pinecone", + "version": 2, + "name": "pinecone", + "type": "Pinecone", + "baseClasses": [ + "Pinecone", + "VectorStoreRetriever", + "BaseRetriever" + ], + "category": "Vector Stores", + "description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "pineconeApi" + ], + "id": "pinecone_0-input-credential-credential" + }, + { + "label": "Pinecone Index", + "name": "pineconeIndex", + "type": "string", + "id": "pinecone_0-input-pineconeIndex-string" + }, + { + "label": "Pinecone Namespace", + "name": "pineconeNamespace", + "type": "string", + "placeholder": "my-first-namespace", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-pineconeNamespace-string" + }, + { + "label": "Pinecone Metadata Filter", + "name": "pineconeMetadataFilter", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "pinecone_0-input-pineconeMetadataFilter-json" + }, + { + "label": "Top K", + "name": "topK", + "description": "Number of top results to fetch. Default to 4", + "placeholder": "4", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-topK-number" + }, + { + "label": "Search Type", + "name": "searchType", + "type": "options", + "default": "similarity", + "options": [ + { + "label": "Similarity", + "name": "similarity" + }, + { + "label": "Max Marginal Relevance", + "name": "mmr" + } + ], + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-searchType-options" + }, + { + "label": "Fetch K (for MMR Search)", + "name": "fetchK", + "description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR", + "placeholder": "20", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-fetchK-number" + }, + { + "label": "Lambda (for MMR Search)", + "name": "lambda", + "description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR", + "placeholder": "0.5", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_0-input-lambda-number" + } + ], + "inputAnchors": [ + { + "label": "Document", + "name": "document", + "type": "Document", + "list": true, + "optional": true, + "id": "pinecone_0-input-document-Document" + }, + { + "label": "Embeddings", + "name": "embeddings", + "type": "Embeddings", + "id": "pinecone_0-input-embeddings-Embeddings" + } + ], + "inputs": { + "document": "", + "embeddings": "{{openAIEmbeddings_0.data.instance}}", + "pineconeIndex": "flowiseindex", + "pineconeNamespace": "pinecone-form10k", + "pineconeMetadataFilter": "{\"source\":\"apple\"}", + "topK": "", + "searchType": "similarity", + "fetchK": "", + "lambda": "" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "name": "retriever", + "label": "Pinecone Retriever", + "description": "", + "type": "Pinecone | VectorStoreRetriever | BaseRetriever" + }, + { + "id": "pinecone_0-output-vectorStore-Pinecone|VectorStore", + "name": "vectorStore", + "label": "Pinecone Vector Store", + "description": "", + "type": "Pinecone | VectorStore" + } + ], + "default": "retriever" + } + ], + "outputs": { + "output": "retriever" + }, + "selected": false + }, + "width": 300, + "height": 555, + "selected": false, + "positionAbsolute": { + "x": 378.7110351151108, + "y": -122.59235389975663 + }, + "dragging": false + }, + { + "id": "openAIEmbeddings_0", + "position": { + "x": -12.140161701463555, + "y": -54.69898887572853 + }, + "type": "customNode", + "data": { + "id": "openAIEmbeddings_0", + "label": "OpenAI Embeddings", + "version": 2, + "name": "openAIEmbeddings", + "type": "OpenAIEmbeddings", + "baseClasses": [ + "OpenAIEmbeddings", + "Embeddings" + ], + "category": "Embeddings", + "description": "OpenAI API to generate embeddings for a given text", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "openAIEmbeddings_0-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "text-embedding-3-large", + "name": "text-embedding-3-large" + }, + { + "label": "text-embedding-3-small", + "name": "text-embedding-3-small" + }, + { + "label": "text-embedding-ada-002", + "name": "text-embedding-ada-002" + } + ], + "default": "text-embedding-ada-002", + "optional": true, + "id": "openAIEmbeddings_0-input-modelName-options" + }, + { + "label": "Strip New Lines", + "name": "stripNewLines", + "type": "boolean", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-stripNewLines-boolean" + }, + { + "label": "Batch Size", + "name": "batchSize", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-batchSize-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_0-input-basepath-string" + } + ], + "inputAnchors": [], + "inputs": { + "modelName": "text-embedding-ada-002", + "stripNewLines": "", + "batchSize": "", + "timeout": "", + "basepath": "" + }, + "outputAnchors": [ + { + "id": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "name": "openAIEmbeddings", + "label": "OpenAIEmbeddings", + "description": "OpenAI API to generate embeddings for a given text", + "type": "OpenAIEmbeddings | Embeddings" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 425, + "selected": false, + "positionAbsolute": { + "x": -12.140161701463555, + "y": -54.69898887572853 + }, + "dragging": false + }, + { + "id": "retrieverTool_1", + "position": { + "x": 1095.1510607975026, + "y": -326.06593550420894 + }, + "type": "customNode", + "data": { + "id": "retrieverTool_1", + "label": "Retriever Tool", + "version": 2, + "name": "retrieverTool", + "type": "RetrieverTool", + "baseClasses": [ + "RetrieverTool", + "DynamicTool", + "Tool", + "StructuredTool", + "Runnable" + ], + "category": "Tools", + "description": "Use a retriever as allowed tool for agent", + "inputParams": [ + { + "label": "Retriever Name", + "name": "name", + "type": "string", + "placeholder": "search_state_of_union", + "id": "retrieverTool_1-input-name-string" + }, + { + "label": "Retriever Description", + "name": "description", + "type": "string", + "description": "When should agent uses to retrieve documents", + "rows": 3, + "placeholder": "Searches and returns documents regarding the state-of-the-union.", + "id": "retrieverTool_1-input-description-string" + }, + { + "label": "Return Source Documents", + "name": "returnSourceDocuments", + "type": "boolean", + "optional": true, + "id": "retrieverTool_1-input-returnSourceDocuments-boolean" + } + ], + "inputAnchors": [ + { + "label": "Retriever", + "name": "retriever", + "type": "BaseRetriever", + "id": "retrieverTool_1-input-retriever-BaseRetriever" + } + ], + "inputs": { + "name": "search_tsla", + "description": "Use this function to answer user questions about Tesla Inc (TSLA). It contains a SEC Form 10K filing describing the financials of Tesla Inc (TSLA) for the 2022 time period.", + "retriever": "{{pinecone_1.data.instance}}", + "returnSourceDocuments": true + }, + "outputAnchors": [ + { + "id": "retrieverTool_1-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "name": "retrieverTool", + "label": "RetrieverTool", + "description": "Use a retriever as allowed tool for agent", + "type": "RetrieverTool | DynamicTool | Tool | StructuredTool | Runnable" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 602, + "selected": false, + "positionAbsolute": { + "x": 1095.1510607975026, + "y": -326.06593550420894 + }, + "dragging": false + }, + { + "id": "pinecone_1", + "position": { + "x": 762.2373165936692, + "y": -619.4996089374204 + }, + "type": "customNode", + "data": { + "id": "pinecone_1", + "label": "Pinecone", + "version": 2, + "name": "pinecone", + "type": "Pinecone", + "baseClasses": [ + "Pinecone", + "VectorStoreRetriever", + "BaseRetriever" + ], + "category": "Vector Stores", + "description": "Upsert embedded data and perform similarity or mmr search using Pinecone, a leading fully managed hosted vector database", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "pineconeApi" + ], + "id": "pinecone_1-input-credential-credential" + }, + { + "label": "Pinecone Index", + "name": "pineconeIndex", + "type": "string", + "id": "pinecone_1-input-pineconeIndex-string" + }, + { + "label": "Pinecone Namespace", + "name": "pineconeNamespace", + "type": "string", + "placeholder": "my-first-namespace", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-pineconeNamespace-string" + }, + { + "label": "Pinecone Metadata Filter", + "name": "pineconeMetadataFilter", + "type": "json", + "optional": true, + "additionalParams": true, + "id": "pinecone_1-input-pineconeMetadataFilter-json" + }, + { + "label": "Top K", + "name": "topK", + "description": "Number of top results to fetch. Default to 4", + "placeholder": "4", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-topK-number" + }, + { + "label": "Search Type", + "name": "searchType", + "type": "options", + "default": "similarity", + "options": [ + { + "label": "Similarity", + "name": "similarity" + }, + { + "label": "Max Marginal Relevance", + "name": "mmr" + } + ], + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-searchType-options" + }, + { + "label": "Fetch K (for MMR Search)", + "name": "fetchK", + "description": "Number of initial documents to fetch for MMR reranking. Default to 20. Used only when the search type is MMR", + "placeholder": "20", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-fetchK-number" + }, + { + "label": "Lambda (for MMR Search)", + "name": "lambda", + "description": "Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity. Used only when the search type is MMR", + "placeholder": "0.5", + "type": "number", + "additionalParams": true, + "optional": true, + "id": "pinecone_1-input-lambda-number" + } + ], + "inputAnchors": [ + { + "label": "Document", + "name": "document", + "type": "Document", + "list": true, + "optional": true, + "id": "pinecone_1-input-document-Document" + }, + { + "label": "Embeddings", + "name": "embeddings", + "type": "Embeddings", + "id": "pinecone_1-input-embeddings-Embeddings" + } + ], + "inputs": { + "document": "", + "embeddings": "{{openAIEmbeddings_1.data.instance}}", + "pineconeIndex": "flowiseindex", + "pineconeNamespace": "pinecone-form10k", + "pineconeMetadataFilter": "{\"source\":\"tesla\"}", + "topK": "", + "searchType": "similarity", + "fetchK": "", + "lambda": "" + }, + "outputAnchors": [ + { + "name": "output", + "label": "Output", + "type": "options", + "description": "", + "options": [ + { + "id": "pinecone_1-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "name": "retriever", + "label": "Pinecone Retriever", + "description": "", + "type": "Pinecone | VectorStoreRetriever | BaseRetriever" + }, + { + "id": "pinecone_1-output-vectorStore-Pinecone|VectorStore", + "name": "vectorStore", + "label": "Pinecone Vector Store", + "description": "", + "type": "Pinecone | VectorStore" + } + ], + "default": "retriever" + } + ], + "outputs": { + "output": "retriever" + }, + "selected": false + }, + "width": 300, + "height": 555, + "selected": false, + "positionAbsolute": { + "x": 762.2373165936692, + "y": -619.4996089374204 + }, + "dragging": false + }, + { + "id": "openAIEmbeddings_1", + "position": { + "x": 416.3144430173899, + "y": -599.2302665481047 + }, + "type": "customNode", + "data": { + "id": "openAIEmbeddings_1", + "label": "OpenAI Embeddings", + "version": 2, + "name": "openAIEmbeddings", + "type": "OpenAIEmbeddings", + "baseClasses": [ + "OpenAIEmbeddings", + "Embeddings" + ], + "category": "Embeddings", + "description": "OpenAI API to generate embeddings for a given text", + "inputParams": [ + { + "label": "Connect Credential", + "name": "credential", + "type": "credential", + "credentialNames": [ + "openAIApi" + ], + "id": "openAIEmbeddings_1-input-credential-credential" + }, + { + "label": "Model Name", + "name": "modelName", + "type": "options", + "options": [ + { + "label": "text-embedding-3-large", + "name": "text-embedding-3-large" + }, + { + "label": "text-embedding-3-small", + "name": "text-embedding-3-small" + }, + { + "label": "text-embedding-ada-002", + "name": "text-embedding-ada-002" + } + ], + "default": "text-embedding-ada-002", + "optional": true, + "id": "openAIEmbeddings_1-input-modelName-options" + }, + { + "label": "Strip New Lines", + "name": "stripNewLines", + "type": "boolean", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-stripNewLines-boolean" + }, + { + "label": "Batch Size", + "name": "batchSize", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-batchSize-number" + }, + { + "label": "Timeout", + "name": "timeout", + "type": "number", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-timeout-number" + }, + { + "label": "BasePath", + "name": "basepath", + "type": "string", + "optional": true, + "additionalParams": true, + "id": "openAIEmbeddings_1-input-basepath-string" + } + ], + "inputAnchors": [], + "inputs": { + "modelName": "text-embedding-ada-002", + "stripNewLines": "", + "batchSize": "", + "timeout": "", + "basepath": "" + }, + "outputAnchors": [ + { + "id": "openAIEmbeddings_1-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "name": "openAIEmbeddings", + "label": "OpenAIEmbeddings", + "description": "OpenAI API to generate embeddings for a given text", + "type": "OpenAIEmbeddings | Embeddings" + } + ], + "outputs": {}, + "selected": false + }, + "width": 300, + "height": 425, + "selected": false, + "positionAbsolute": { + "x": 416.3144430173899, + "y": -599.2302665481047 + }, + "dragging": false + } + ], + "edges": [ + { + "source": "retrieverTool_0", + "sourceHandle": "retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "target": "xmlAgent_0", + "targetHandle": "xmlAgent_0-input-tools-Tool", + "type": "buttonedge", + "id": "retrieverTool_0-retrieverTool_0-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable-xmlAgent_0-xmlAgent_0-input-tools-Tool" + }, + { + "source": "chatAnthropic_0", + "sourceHandle": "chatAnthropic_0-output-chatAnthropic-ChatAnthropic|ChatAnthropicMessages|BaseChatModel|BaseLanguageModel|Runnable", + "target": "xmlAgent_0", + "targetHandle": "xmlAgent_0-input-model-BaseChatModel", + "type": "buttonedge", + "id": "chatAnthropic_0-chatAnthropic_0-output-chatAnthropic-ChatAnthropic|ChatAnthropicMessages|BaseChatModel|BaseLanguageModel|Runnable-xmlAgent_0-xmlAgent_0-input-model-BaseChatModel" + }, + { + "source": "bufferMemory_0", + "sourceHandle": "bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory", + "target": "xmlAgent_0", + "targetHandle": "xmlAgent_0-input-memory-BaseChatMemory", + "type": "buttonedge", + "id": "bufferMemory_0-bufferMemory_0-output-bufferMemory-BufferMemory|BaseChatMemory|BaseMemory-xmlAgent_0-xmlAgent_0-input-memory-BaseChatMemory" + }, + { + "source": "openAIEmbeddings_0", + "sourceHandle": "openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "target": "pinecone_0", + "targetHandle": "pinecone_0-input-embeddings-Embeddings", + "type": "buttonedge", + "id": "openAIEmbeddings_0-openAIEmbeddings_0-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pinecone_0-pinecone_0-input-embeddings-Embeddings" + }, + { + "source": "pinecone_0", + "sourceHandle": "pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "target": "retrieverTool_0", + "targetHandle": "retrieverTool_0-input-retriever-BaseRetriever", + "type": "buttonedge", + "id": "pinecone_0-pinecone_0-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever-retrieverTool_0-retrieverTool_0-input-retriever-BaseRetriever" + }, + { + "source": "retrieverTool_1", + "sourceHandle": "retrieverTool_1-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable", + "target": "xmlAgent_0", + "targetHandle": "xmlAgent_0-input-tools-Tool", + "type": "buttonedge", + "id": "retrieverTool_1-retrieverTool_1-output-retrieverTool-RetrieverTool|DynamicTool|Tool|StructuredTool|Runnable-xmlAgent_0-xmlAgent_0-input-tools-Tool" + }, + { + "source": "openAIEmbeddings_1", + "sourceHandle": "openAIEmbeddings_1-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings", + "target": "pinecone_1", + "targetHandle": "pinecone_1-input-embeddings-Embeddings", + "type": "buttonedge", + "id": "openAIEmbeddings_1-openAIEmbeddings_1-output-openAIEmbeddings-OpenAIEmbeddings|Embeddings-pinecone_1-pinecone_1-input-embeddings-Embeddings" + }, + { + "source": "pinecone_1", + "sourceHandle": "pinecone_1-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever", + "target": "retrieverTool_1", + "targetHandle": "retrieverTool_1-input-retriever-BaseRetriever", + "type": "buttonedge", + "id": "pinecone_1-pinecone_1-output-retriever-Pinecone|VectorStoreRetriever|BaseRetriever-retrieverTool_1-retrieverTool_1-input-retriever-BaseRetriever" + } + ] +} \ No newline at end of file diff --git a/cn/.gitbook/assets/agentflow.png b/cn/.gitbook/assets/agentflow.png new file mode 100644 index 00000000..56f87812 Binary files /dev/null and b/cn/.gitbook/assets/agentflow.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/state.png b/cn/.gitbook/assets/agentflowv2/darkmode/state.png new file mode 100644 index 00000000..a0b3327f Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/state.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-01-d (1).png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-01-d (1).png new file mode 100644 index 00000000..0a79dfbd Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-01-d (1).png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-02-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-02-d.png new file mode 100644 index 00000000..d390e90c Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-02-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-03-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-03-d.png new file mode 100644 index 00000000..12b44523 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-03-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-04-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-04-d.png new file mode 100644 index 00000000..ecaf2b98 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-04-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-06-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-06-d.png new file mode 100644 index 00000000..e03fc9dd Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-06-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-07-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-07-d.png new file mode 100644 index 00000000..ead17d73 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-07-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-08-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-08-d.png new file mode 100644 index 00000000..9ff5504c Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-08-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-09-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-09-d.png new file mode 100644 index 00000000..1beccf66 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-09-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-10-d (1).png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-10-d (1).png new file mode 100644 index 00000000..de3c1573 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-10-d (1).png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-11-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-11-d.png new file mode 100644 index 00000000..b08ed99d Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-11-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-12-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-12-d.png new file mode 100644 index 00000000..9afd9f5e Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-12-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-13-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-13-d.png new file mode 100644 index 00000000..2e337950 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-13-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-14-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-14-d.png new file mode 100644 index 00000000..0fc8c181 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-14-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-15-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-15-d.png new file mode 100644 index 00000000..243083db Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-15-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-16-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-16-d.png new file mode 100644 index 00000000..092f9159 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-16-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/darkmode/v2-17-d.png b/cn/.gitbook/assets/agentflowv2/darkmode/v2-17-d.png new file mode 100644 index 00000000..43fbcc43 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/darkmode/v2-17-d.png differ diff --git a/cn/.gitbook/assets/agentflowv2/patterns.png b/cn/.gitbook/assets/agentflowv2/patterns.png new file mode 100644 index 00000000..b9055b37 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/patterns.png differ diff --git a/cn/.gitbook/assets/agentflowv2/state.png b/cn/.gitbook/assets/agentflowv2/state.png new file mode 100644 index 00000000..5c754fef Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/state.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-02.png b/cn/.gitbook/assets/agentflowv2/v2-02.png new file mode 100644 index 00000000..e0800742 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-02.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-03.png b/cn/.gitbook/assets/agentflowv2/v2-03.png new file mode 100644 index 00000000..c86748ca Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-03.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-04.png b/cn/.gitbook/assets/agentflowv2/v2-04.png new file mode 100644 index 00000000..c5a32299 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-04.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-05.png b/cn/.gitbook/assets/agentflowv2/v2-05.png new file mode 100644 index 00000000..1d6641c6 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-05.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-06.png b/cn/.gitbook/assets/agentflowv2/v2-06.png new file mode 100644 index 00000000..feddda3f Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-06.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-07.png b/cn/.gitbook/assets/agentflowv2/v2-07.png new file mode 100644 index 00000000..5cb4edc6 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-07.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-08.png b/cn/.gitbook/assets/agentflowv2/v2-08.png new file mode 100644 index 00000000..5b567b55 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-08.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-09.png b/cn/.gitbook/assets/agentflowv2/v2-09.png new file mode 100644 index 00000000..f39c5e42 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-09.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-10.png b/cn/.gitbook/assets/agentflowv2/v2-10.png new file mode 100644 index 00000000..57c7eeec Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-10.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-11.png b/cn/.gitbook/assets/agentflowv2/v2-11.png new file mode 100644 index 00000000..f403219f Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-11.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-12.png b/cn/.gitbook/assets/agentflowv2/v2-12.png new file mode 100644 index 00000000..0ac5c798 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-12.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-13.png b/cn/.gitbook/assets/agentflowv2/v2-13.png new file mode 100644 index 00000000..ed07e1c4 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-13.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-14.png b/cn/.gitbook/assets/agentflowv2/v2-14.png new file mode 100644 index 00000000..1caae4f5 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-14.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-15.png b/cn/.gitbook/assets/agentflowv2/v2-15.png new file mode 100644 index 00000000..7e2d4961 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-15.png differ diff --git a/cn/.gitbook/assets/agentflowv2/v2-all-nodes.png b/cn/.gitbook/assets/agentflowv2/v2-all-nodes.png new file mode 100644 index 00000000..c20ed065 Binary files /dev/null and b/cn/.gitbook/assets/agentflowv2/v2-all-nodes.png differ diff --git a/cn/.gitbook/assets/analytic-1.webp b/cn/.gitbook/assets/analytic-1.webp new file mode 100644 index 00000000..c4693d4d Binary files /dev/null and b/cn/.gitbook/assets/analytic-1.webp differ diff --git a/cn/.gitbook/assets/analytic-2.png b/cn/.gitbook/assets/analytic-2.png new file mode 100644 index 00000000..93e50237 Binary files /dev/null and b/cn/.gitbook/assets/analytic-2.png differ diff --git a/cn/.gitbook/assets/arize/arize-1.png b/cn/.gitbook/assets/arize/arize-1.png new file mode 100644 index 00000000..43f9f284 Binary files /dev/null and b/cn/.gitbook/assets/arize/arize-1.png differ diff --git a/cn/.gitbook/assets/arize/arize-2.png b/cn/.gitbook/assets/arize/arize-2.png new file mode 100644 index 00000000..27c93cbe Binary files /dev/null and b/cn/.gitbook/assets/arize/arize-2.png differ diff --git a/cn/.gitbook/assets/arize/arize-3.png b/cn/.gitbook/assets/arize/arize-3.png new file mode 100644 index 00000000..bfc69837 Binary files /dev/null and b/cn/.gitbook/assets/arize/arize-3.png differ diff --git a/cn/.gitbook/assets/azure/azure-chatopenai/1.png b/cn/.gitbook/assets/azure/azure-chatopenai/1.png new file mode 100644 index 00000000..acc35368 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-chatopenai/1.png differ diff --git a/cn/.gitbook/assets/azure/azure-chatopenai/2.png b/cn/.gitbook/assets/azure/azure-chatopenai/2.png new file mode 100644 index 00000000..372177be Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-chatopenai/2.png differ diff --git a/cn/.gitbook/assets/azure/azure-chatopenai/3.png b/cn/.gitbook/assets/azure/azure-chatopenai/3.png new file mode 100644 index 00000000..7d887c79 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-chatopenai/3.png differ diff --git a/cn/.gitbook/assets/azure/azure-chatopenai/4.png b/cn/.gitbook/assets/azure/azure-chatopenai/4.png new file mode 100644 index 00000000..03792722 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-chatopenai/4.png differ diff --git a/cn/.gitbook/assets/azure/azure-chatopenai/5.png b/cn/.gitbook/assets/azure/azure-chatopenai/5.png new file mode 100644 index 00000000..d53b56b1 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-chatopenai/5.png differ diff --git a/cn/.gitbook/assets/azure/azure-general/1.png b/cn/.gitbook/assets/azure/azure-general/1.png new file mode 100644 index 00000000..72057c9d Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-general/1.png differ diff --git a/cn/.gitbook/assets/azure/azure-general/2.png b/cn/.gitbook/assets/azure/azure-general/2.png new file mode 100644 index 00000000..7b13de56 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-general/2.png differ diff --git a/cn/.gitbook/assets/azure/azure-general/3.png b/cn/.gitbook/assets/azure/azure-general/3.png new file mode 100644 index 00000000..ca86df36 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-general/3.png differ diff --git a/cn/.gitbook/assets/azure/azure-general/4.png b/cn/.gitbook/assets/azure/azure-general/4.png new file mode 100644 index 00000000..1ab63c85 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-general/4.png differ diff --git a/cn/.gitbook/assets/azure/azure-general/5.png b/cn/.gitbook/assets/azure/azure-general/5.png new file mode 100644 index 00000000..ba561ad0 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-general/5.png differ diff --git a/cn/.gitbook/assets/azure/azure-openai-embeddings/1.png b/cn/.gitbook/assets/azure/azure-openai-embeddings/1.png new file mode 100644 index 00000000..e2cba6ab Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-openai-embeddings/1.png differ diff --git a/cn/.gitbook/assets/azure/azure-openai-embeddings/2.png b/cn/.gitbook/assets/azure/azure-openai-embeddings/2.png new file mode 100644 index 00000000..146bef6f Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-openai-embeddings/2.png differ diff --git a/cn/.gitbook/assets/azure/azure-openai-embeddings/3.png b/cn/.gitbook/assets/azure/azure-openai-embeddings/3.png new file mode 100644 index 00000000..bfca03d6 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-openai-embeddings/3.png differ diff --git a/cn/.gitbook/assets/azure/azure-openai-embeddings/4.png b/cn/.gitbook/assets/azure/azure-openai-embeddings/4.png new file mode 100644 index 00000000..39f7eaa4 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-openai-embeddings/4.png differ diff --git a/cn/.gitbook/assets/azure/azure-openai-embeddings/5.png b/cn/.gitbook/assets/azure/azure-openai-embeddings/5.png new file mode 100644 index 00000000..a6a0b630 Binary files /dev/null and b/cn/.gitbook/assets/azure/azure-openai-embeddings/5.png differ diff --git a/cn/.gitbook/assets/azure/deployment/1.png b/cn/.gitbook/assets/azure/deployment/1.png new file mode 100644 index 00000000..bcf31620 Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/1.png differ diff --git a/cn/.gitbook/assets/azure/deployment/2.png b/cn/.gitbook/assets/azure/deployment/2.png new file mode 100644 index 00000000..ea7faa2b Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/2.png differ diff --git a/cn/.gitbook/assets/azure/deployment/3.png b/cn/.gitbook/assets/azure/deployment/3.png new file mode 100644 index 00000000..b873f564 Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/3.png differ diff --git a/cn/.gitbook/assets/azure/deployment/4.png b/cn/.gitbook/assets/azure/deployment/4.png new file mode 100644 index 00000000..d2c2dac7 Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/4.png differ diff --git a/cn/.gitbook/assets/azure/deployment/5.png b/cn/.gitbook/assets/azure/deployment/5.png new file mode 100644 index 00000000..98a50e18 Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/5.png differ diff --git a/cn/.gitbook/assets/azure/deployment/6.png b/cn/.gitbook/assets/azure/deployment/6.png new file mode 100644 index 00000000..af3fe0dd Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/6.png differ diff --git a/cn/.gitbook/assets/azure/deployment/7.png b/cn/.gitbook/assets/azure/deployment/7.png new file mode 100644 index 00000000..6412cab6 Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/7.png differ diff --git a/cn/.gitbook/assets/azure/deployment/8.png b/cn/.gitbook/assets/azure/deployment/8.png new file mode 100644 index 00000000..9593bdd1 Binary files /dev/null and b/cn/.gitbook/assets/azure/deployment/8.png differ diff --git a/cn/.gitbook/assets/chat-prompt-template-file-attachment.jpg b/cn/.gitbook/assets/chat-prompt-template-file-attachment.jpg new file mode 100644 index 00000000..267aaead Binary files /dev/null and b/cn/.gitbook/assets/chat-prompt-template-file-attachment.jpg differ diff --git a/cn/.gitbook/assets/chatcometapi_node.png b/cn/.gitbook/assets/chatcometapi_node.png new file mode 100644 index 00000000..316f4ec6 Binary files /dev/null and b/cn/.gitbook/assets/chatcometapi_node.png differ diff --git a/cn/.gitbook/assets/conditions.png b/cn/.gitbook/assets/conditions.png new file mode 100644 index 00000000..39eb4e60 Binary files /dev/null and b/cn/.gitbook/assets/conditions.png differ diff --git a/cn/.gitbook/assets/contextengineering1.png b/cn/.gitbook/assets/contextengineering1.png new file mode 100644 index 00000000..deb6c93a Binary files /dev/null and b/cn/.gitbook/assets/contextengineering1.png differ diff --git a/cn/.gitbook/assets/couchbase_1.png b/cn/.gitbook/assets/couchbase_1.png new file mode 100644 index 00000000..84b8a851 Binary files /dev/null and b/cn/.gitbook/assets/couchbase_1.png differ diff --git a/cn/.gitbook/assets/couchbase_2.png b/cn/.gitbook/assets/couchbase_2.png new file mode 100644 index 00000000..ff321214 Binary files /dev/null and b/cn/.gitbook/assets/couchbase_2.png differ diff --git a/cn/.gitbook/assets/couchbase_3.png b/cn/.gitbook/assets/couchbase_3.png new file mode 100644 index 00000000..4d9547d8 Binary files /dev/null and b/cn/.gitbook/assets/couchbase_3.png differ diff --git a/cn/.gitbook/assets/couchbase_4.png b/cn/.gitbook/assets/couchbase_4.png new file mode 100644 index 00000000..77365936 Binary files /dev/null and b/cn/.gitbook/assets/couchbase_4.png differ diff --git a/cn/.gitbook/assets/dark.png b/cn/.gitbook/assets/dark.png new file mode 100644 index 00000000..2c3b0361 Binary files /dev/null and b/cn/.gitbook/assets/dark.png differ diff --git a/cn/.gitbook/assets/dastore002.png b/cn/.gitbook/assets/dastore002.png new file mode 100644 index 00000000..344a1377 Binary files /dev/null and b/cn/.gitbook/assets/dastore002.png differ diff --git a/cn/.gitbook/assets/dastore003.png b/cn/.gitbook/assets/dastore003.png new file mode 100644 index 00000000..3a7b295c Binary files /dev/null and b/cn/.gitbook/assets/dastore003.png differ diff --git a/cn/.gitbook/assets/dastore004.png b/cn/.gitbook/assets/dastore004.png new file mode 100644 index 00000000..4fde8257 Binary files /dev/null and b/cn/.gitbook/assets/dastore004.png differ diff --git a/cn/.gitbook/assets/dastore005.png b/cn/.gitbook/assets/dastore005.png new file mode 100644 index 00000000..f6d9375f Binary files /dev/null and b/cn/.gitbook/assets/dastore005.png differ diff --git a/cn/.gitbook/assets/dastore006.png b/cn/.gitbook/assets/dastore006.png new file mode 100644 index 00000000..19f16116 Binary files /dev/null and b/cn/.gitbook/assets/dastore006.png differ diff --git a/cn/.gitbook/assets/dastore007.png b/cn/.gitbook/assets/dastore007.png new file mode 100644 index 00000000..b6723d76 Binary files /dev/null and b/cn/.gitbook/assets/dastore007.png differ diff --git a/cn/.gitbook/assets/dastore009.png b/cn/.gitbook/assets/dastore009.png new file mode 100644 index 00000000..ff7e8ee6 Binary files /dev/null and b/cn/.gitbook/assets/dastore009.png differ diff --git a/cn/.gitbook/assets/dastore010.png b/cn/.gitbook/assets/dastore010.png new file mode 100644 index 00000000..f1af2b19 Binary files /dev/null and b/cn/.gitbook/assets/dastore010.png differ diff --git a/cn/.gitbook/assets/dastore011.png b/cn/.gitbook/assets/dastore011.png new file mode 100644 index 00000000..76f34028 Binary files /dev/null and b/cn/.gitbook/assets/dastore011.png differ diff --git a/cn/.gitbook/assets/dastore013.png b/cn/.gitbook/assets/dastore013.png new file mode 100644 index 00000000..ff23b34f Binary files /dev/null and b/cn/.gitbook/assets/dastore013.png differ diff --git a/cn/.gitbook/assets/ds01.png b/cn/.gitbook/assets/ds01.png new file mode 100644 index 00000000..f367451a Binary files /dev/null and b/cn/.gitbook/assets/ds01.png differ diff --git a/cn/.gitbook/assets/ds02.png b/cn/.gitbook/assets/ds02.png new file mode 100644 index 00000000..1d35e852 Binary files /dev/null and b/cn/.gitbook/assets/ds02.png differ diff --git a/cn/.gitbook/assets/ds03.png b/cn/.gitbook/assets/ds03.png new file mode 100644 index 00000000..3c7baf36 Binary files /dev/null and b/cn/.gitbook/assets/ds03.png differ diff --git a/cn/.gitbook/assets/ds04.png b/cn/.gitbook/assets/ds04.png new file mode 100644 index 00000000..09627178 Binary files /dev/null and b/cn/.gitbook/assets/ds04.png differ diff --git a/cn/.gitbook/assets/ds05.png b/cn/.gitbook/assets/ds05.png new file mode 100644 index 00000000..11aa1b97 Binary files /dev/null and b/cn/.gitbook/assets/ds05.png differ diff --git a/cn/.gitbook/assets/ds06.png b/cn/.gitbook/assets/ds06.png new file mode 100644 index 00000000..a0079416 Binary files /dev/null and b/cn/.gitbook/assets/ds06.png differ diff --git a/cn/.gitbook/assets/ds07.png b/cn/.gitbook/assets/ds07.png new file mode 100644 index 00000000..ed6d4a98 Binary files /dev/null and b/cn/.gitbook/assets/ds07.png differ diff --git a/cn/.gitbook/assets/ds08.png b/cn/.gitbook/assets/ds08.png new file mode 100644 index 00000000..71685a91 Binary files /dev/null and b/cn/.gitbook/assets/ds08.png differ diff --git a/cn/.gitbook/assets/elastic1.png b/cn/.gitbook/assets/elastic1.png new file mode 100644 index 00000000..be5fe37b Binary files /dev/null and b/cn/.gitbook/assets/elastic1.png differ diff --git a/cn/.gitbook/assets/elastic10.png b/cn/.gitbook/assets/elastic10.png new file mode 100644 index 00000000..8ffc19b4 Binary files /dev/null and b/cn/.gitbook/assets/elastic10.png differ diff --git a/cn/.gitbook/assets/elastic11.png b/cn/.gitbook/assets/elastic11.png new file mode 100644 index 00000000..06307d7c Binary files /dev/null and b/cn/.gitbook/assets/elastic11.png differ diff --git a/cn/.gitbook/assets/elastic12.png b/cn/.gitbook/assets/elastic12.png new file mode 100644 index 00000000..546f772f Binary files /dev/null and b/cn/.gitbook/assets/elastic12.png differ diff --git a/cn/.gitbook/assets/elastic13.png b/cn/.gitbook/assets/elastic13.png new file mode 100644 index 00000000..3ed8b9b3 Binary files /dev/null and b/cn/.gitbook/assets/elastic13.png differ diff --git a/cn/.gitbook/assets/elastic2.png b/cn/.gitbook/assets/elastic2.png new file mode 100644 index 00000000..1e562041 Binary files /dev/null and b/cn/.gitbook/assets/elastic2.png differ diff --git a/cn/.gitbook/assets/elastic4.png b/cn/.gitbook/assets/elastic4.png new file mode 100644 index 00000000..7af0ed03 Binary files /dev/null and b/cn/.gitbook/assets/elastic4.png differ diff --git a/cn/.gitbook/assets/elastic5.png b/cn/.gitbook/assets/elastic5.png new file mode 100644 index 00000000..5c56ee8f Binary files /dev/null and b/cn/.gitbook/assets/elastic5.png differ diff --git a/cn/.gitbook/assets/elastic6.png b/cn/.gitbook/assets/elastic6.png new file mode 100644 index 00000000..8cf14213 Binary files /dev/null and b/cn/.gitbook/assets/elastic6.png differ diff --git a/cn/.gitbook/assets/elastic7.png b/cn/.gitbook/assets/elastic7.png new file mode 100644 index 00000000..e5a960b9 Binary files /dev/null and b/cn/.gitbook/assets/elastic7.png differ diff --git a/cn/.gitbook/assets/elastic8.png b/cn/.gitbook/assets/elastic8.png new file mode 100644 index 00000000..e6a04e8a Binary files /dev/null and b/cn/.gitbook/assets/elastic8.png differ diff --git a/cn/.gitbook/assets/elastic9.png b/cn/.gitbook/assets/elastic9.png new file mode 100644 index 00000000..25533262 Binary files /dev/null and b/cn/.gitbook/assets/elastic9.png differ diff --git a/cn/.gitbook/assets/flowise.gif b/cn/.gitbook/assets/flowise.gif new file mode 100644 index 00000000..07101bc2 Binary files /dev/null and b/cn/.gitbook/assets/flowise.gif differ diff --git a/cn/.gitbook/assets/gcp/1.png b/cn/.gitbook/assets/gcp/1.png new file mode 100644 index 00000000..5567b6e4 Binary files /dev/null and b/cn/.gitbook/assets/gcp/1.png differ diff --git a/cn/.gitbook/assets/gcp/2.png b/cn/.gitbook/assets/gcp/2.png new file mode 100644 index 00000000..38e69e26 Binary files /dev/null and b/cn/.gitbook/assets/gcp/2.png differ diff --git a/cn/.gitbook/assets/gcp/3.png b/cn/.gitbook/assets/gcp/3.png new file mode 100644 index 00000000..31a74b57 Binary files /dev/null and b/cn/.gitbook/assets/gcp/3.png differ diff --git a/cn/.gitbook/assets/gcp/4.png b/cn/.gitbook/assets/gcp/4.png new file mode 100644 index 00000000..9da60626 Binary files /dev/null and b/cn/.gitbook/assets/gcp/4.png differ diff --git a/cn/.gitbook/assets/gcp/5.png b/cn/.gitbook/assets/gcp/5.png new file mode 100644 index 00000000..b261f7dc Binary files /dev/null and b/cn/.gitbook/assets/gcp/5.png differ diff --git a/cn/.gitbook/assets/gcp_credential/add_key.png b/cn/.gitbook/assets/gcp_credential/add_key.png new file mode 100644 index 00000000..f5bc8779 Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/add_key.png differ diff --git a/cn/.gitbook/assets/gcp_credential/create_credential.png b/cn/.gitbook/assets/gcp_credential/create_credential.png new file mode 100644 index 00000000..2f971263 Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/create_credential.png differ diff --git a/cn/.gitbook/assets/gcp_credential/create_key.png b/cn/.gitbook/assets/gcp_credential/create_key.png new file mode 100644 index 00000000..f3ae424f Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/create_key.png differ diff --git a/cn/.gitbook/assets/gcp_credential/create_service_account.png b/cn/.gitbook/assets/gcp_credential/create_service_account.png new file mode 100644 index 00000000..cf02cf12 Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/create_service_account.png differ diff --git a/cn/.gitbook/assets/gcp_credential/google_vertex_auth.png b/cn/.gitbook/assets/gcp_credential/google_vertex_auth.png new file mode 100644 index 00000000..8d850444 Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/google_vertex_auth.png differ diff --git a/cn/.gitbook/assets/gcp_credential/register_credential.png b/cn/.gitbook/assets/gcp_credential/register_credential.png new file mode 100644 index 00000000..4eb2ee58 Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/register_credential.png differ diff --git a/cn/.gitbook/assets/gcp_credential/select_role.png b/cn/.gitbook/assets/gcp_credential/select_role.png new file mode 100644 index 00000000..d8eb25fa Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/select_role.png differ diff --git a/cn/.gitbook/assets/gcp_credential/vertex_AI_enable.png b/cn/.gitbook/assets/gcp_credential/vertex_AI_enable.png new file mode 100644 index 00000000..7fa3cc19 Binary files /dev/null and b/cn/.gitbook/assets/gcp_credential/vertex_AI_enable.png differ diff --git a/cn/.gitbook/assets/giphy.gif b/cn/.gitbook/assets/giphy.gif new file mode 100644 index 00000000..67b89396 Binary files /dev/null and b/cn/.gitbook/assets/giphy.gif differ diff --git a/cn/.gitbook/assets/google_ai/1.png b/cn/.gitbook/assets/google_ai/1.png new file mode 100644 index 00000000..986cbb58 Binary files /dev/null and b/cn/.gitbook/assets/google_ai/1.png differ diff --git a/cn/.gitbook/assets/google_ai/2.png b/cn/.gitbook/assets/google_ai/2.png new file mode 100644 index 00000000..eb38783f Binary files /dev/null and b/cn/.gitbook/assets/google_ai/2.png differ diff --git a/cn/.gitbook/assets/google_ai/3.png b/cn/.gitbook/assets/google_ai/3.png new file mode 100644 index 00000000..b9317a13 Binary files /dev/null and b/cn/.gitbook/assets/google_ai/3.png differ diff --git a/cn/.gitbook/assets/google_ai/4.png b/cn/.gitbook/assets/google_ai/4.png new file mode 100644 index 00000000..a4892c89 Binary files /dev/null and b/cn/.gitbook/assets/google_ai/4.png differ diff --git a/cn/.gitbook/assets/google_ai/5.png b/cn/.gitbook/assets/google_ai/5.png new file mode 100644 index 00000000..0a98c385 Binary files /dev/null and b/cn/.gitbook/assets/google_ai/5.png differ diff --git a/cn/.gitbook/assets/google_ai/6.png b/cn/.gitbook/assets/google_ai/6.png new file mode 100644 index 00000000..8147cce7 Binary files /dev/null and b/cn/.gitbook/assets/google_ai/6.png differ diff --git a/cn/.gitbook/assets/huggingface/HF-LLMmodel.png b/cn/.gitbook/assets/huggingface/HF-LLMmodel.png new file mode 100644 index 00000000..f594f5de Binary files /dev/null and b/cn/.gitbook/assets/huggingface/HF-LLMmodel.png differ diff --git a/cn/.gitbook/assets/huggingface/HF-chain.png b/cn/.gitbook/assets/huggingface/HF-chain.png new file mode 100644 index 00000000..3a34d7f9 Binary files /dev/null and b/cn/.gitbook/assets/huggingface/HF-chain.png differ diff --git a/cn/.gitbook/assets/huggingface/HF-credential.png b/cn/.gitbook/assets/huggingface/HF-credential.png new file mode 100644 index 00000000..54854262 Binary files /dev/null and b/cn/.gitbook/assets/huggingface/HF-credential.png differ diff --git a/cn/.gitbook/assets/huggingface/HF-models.png b/cn/.gitbook/assets/huggingface/HF-models.png new file mode 100644 index 00000000..9d77c969 Binary files /dev/null and b/cn/.gitbook/assets/huggingface/HF-models.png differ diff --git a/cn/.gitbook/assets/huggingface/HF-node.png b/cn/.gitbook/assets/huggingface/HF-node.png new file mode 100644 index 00000000..af4b1169 Binary files /dev/null and b/cn/.gitbook/assets/huggingface/HF-node.png differ diff --git a/cn/.gitbook/assets/huggingface/HF-token.png b/cn/.gitbook/assets/huggingface/HF-token.png new file mode 100644 index 00000000..5235aed1 Binary files /dev/null and b/cn/.gitbook/assets/huggingface/HF-token.png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..a526cf08 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..3bb4b8f6 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..3d01ff6e Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..e4476d4a Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..3d7f3708 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..acca8811 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..dbd0aa75 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..0ee4d8a6 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..6ad2816a Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..6e93ba22 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..96a22bd6 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..b3871bd9 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c1b7ba8a Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1) (1).png new file mode 100644 index 00000000..01d34008 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png new file mode 100644 index 00000000..7ef75937 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..9dd4614e Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..9020bb70 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..84a0ce96 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..037d1f51 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..340f570b Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..b082f202 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..efdbc782 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..f0b230ff Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..a623e97b Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..bcd88739 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..7a74d953 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..4eb0dd44 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..a15352be Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..22b7d480 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..f215b2ae Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..cc83af61 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..def92321 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..ac18f752 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..5338dc1f Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..4530edde Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..68be3658 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..6ac0d59c Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png new file mode 100644 index 00000000..3c94a1dc Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..bc1f831a Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..b9aa1d82 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..15be701e Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..558b4cad Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..4dfcd5b3 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..d092f8d7 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..cca977e9 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (1).png new file mode 100644 index 00000000..8c466dad Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..8e38fc1e Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (1) (2).png new file mode 100644 index 00000000..803c3975 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (1).png new file mode 100644 index 00000000..c80dfd58 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (2) (1).png b/cn/.gitbook/assets/image (1) (1) (2) (1).png new file mode 100644 index 00000000..59122a4f Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (2).png b/cn/.gitbook/assets/image (1) (1) (2).png new file mode 100644 index 00000000..ce87876b Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (3) (1) (1).png b/cn/.gitbook/assets/image (1) (1) (3) (1) (1).png new file mode 100644 index 00000000..9188b08c Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (3) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (3) (1).png b/cn/.gitbook/assets/image (1) (1) (3) (1).png new file mode 100644 index 00000000..a669684b Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (3) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (1) (3).png b/cn/.gitbook/assets/image (1) (1) (3).png new file mode 100644 index 00000000..a7aa0c6f Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1) (3).png differ diff --git a/cn/.gitbook/assets/image (1) (1).png b/cn/.gitbook/assets/image (1) (1).png new file mode 100644 index 00000000..8c7a44f8 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (1).png differ diff --git a/cn/.gitbook/assets/image (1) (2).png b/cn/.gitbook/assets/image (1) (2).png new file mode 100644 index 00000000..42228062 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (2).png differ diff --git a/cn/.gitbook/assets/image (1) (3).png b/cn/.gitbook/assets/image (1) (3).png new file mode 100644 index 00000000..d8512040 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (3).png differ diff --git a/cn/.gitbook/assets/image (1) (5).png b/cn/.gitbook/assets/image (1) (5).png new file mode 100644 index 00000000..775a46e5 Binary files /dev/null and b/cn/.gitbook/assets/image (1) (5).png differ diff --git a/cn/.gitbook/assets/image (1).png b/cn/.gitbook/assets/image (1).png new file mode 100644 index 00000000..73fb1f8e Binary files /dev/null and b/cn/.gitbook/assets/image (1).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..2627f3a5 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..619c9b67 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..d5db1644 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..0e574164 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..841850eb Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (10) (1) (1) (1) (1).png new file mode 100644 index 00000000..84c68e31 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (10) (1) (1) (1) (2).png new file mode 100644 index 00000000..f4565750 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (1).png b/cn/.gitbook/assets/image (10) (1) (1) (1).png new file mode 100644 index 00000000..e4cfae74 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1) (2).png b/cn/.gitbook/assets/image (10) (1) (1) (2).png new file mode 100644 index 00000000..b379ec18 Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (10) (1) (1).png b/cn/.gitbook/assets/image (10) (1) (1).png new file mode 100644 index 00000000..0a3f033b Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (1).png b/cn/.gitbook/assets/image (10) (1).png new file mode 100644 index 00000000..7f8047af Binary files /dev/null and b/cn/.gitbook/assets/image (10) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (2) (1).png b/cn/.gitbook/assets/image (10) (2) (1).png new file mode 100644 index 00000000..7f52f55a Binary files /dev/null and b/cn/.gitbook/assets/image (10) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (10) (2).png b/cn/.gitbook/assets/image (10) (2).png new file mode 100644 index 00000000..32f0646b Binary files /dev/null and b/cn/.gitbook/assets/image (10) (2).png differ diff --git a/cn/.gitbook/assets/image (10).png b/cn/.gitbook/assets/image (10).png new file mode 100644 index 00000000..dd905ffd Binary files /dev/null and b/cn/.gitbook/assets/image (10).png differ diff --git a/cn/.gitbook/assets/image (100).png b/cn/.gitbook/assets/image (100).png new file mode 100644 index 00000000..1030565b Binary files /dev/null and b/cn/.gitbook/assets/image (100).png differ diff --git a/cn/.gitbook/assets/image (101).png b/cn/.gitbook/assets/image (101).png new file mode 100644 index 00000000..43503a93 Binary files /dev/null and b/cn/.gitbook/assets/image (101).png differ diff --git a/cn/.gitbook/assets/image (102).png b/cn/.gitbook/assets/image (102).png new file mode 100644 index 00000000..b4bb4cd9 Binary files /dev/null and b/cn/.gitbook/assets/image (102).png differ diff --git a/cn/.gitbook/assets/image (103).png b/cn/.gitbook/assets/image (103).png new file mode 100644 index 00000000..661f4981 Binary files /dev/null and b/cn/.gitbook/assets/image (103).png differ diff --git a/cn/.gitbook/assets/image (104).png b/cn/.gitbook/assets/image (104).png new file mode 100644 index 00000000..72d1b916 Binary files /dev/null and b/cn/.gitbook/assets/image (104).png differ diff --git a/cn/.gitbook/assets/image (105).png b/cn/.gitbook/assets/image (105).png new file mode 100644 index 00000000..f39017cc Binary files /dev/null and b/cn/.gitbook/assets/image (105).png differ diff --git a/cn/.gitbook/assets/image (106).png b/cn/.gitbook/assets/image (106).png new file mode 100644 index 00000000..b74bee50 Binary files /dev/null and b/cn/.gitbook/assets/image (106).png differ diff --git a/cn/.gitbook/assets/image (107).png b/cn/.gitbook/assets/image (107).png new file mode 100644 index 00000000..17453be4 Binary files /dev/null and b/cn/.gitbook/assets/image (107).png differ diff --git a/cn/.gitbook/assets/image (108).png b/cn/.gitbook/assets/image (108).png new file mode 100644 index 00000000..b0b9abe9 Binary files /dev/null and b/cn/.gitbook/assets/image (108).png differ diff --git a/cn/.gitbook/assets/image (109).png b/cn/.gitbook/assets/image (109).png new file mode 100644 index 00000000..8a34f838 Binary files /dev/null and b/cn/.gitbook/assets/image (109).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..8e74d8d2 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..39f86040 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..d040dbe8 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..a1f50e01 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..5d08d059 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1) (1) (1).png new file mode 100644 index 00000000..5288c1c5 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1) (1).png new file mode 100644 index 00000000..06b0a6a6 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1) (2).png b/cn/.gitbook/assets/image (11) (1) (1) (2).png new file mode 100644 index 00000000..4c68c399 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (11) (1) (1).png b/cn/.gitbook/assets/image (11) (1) (1).png new file mode 100644 index 00000000..181ee0d4 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (1).png b/cn/.gitbook/assets/image (11) (1).png new file mode 100644 index 00000000..8e191be9 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (1).png differ diff --git a/cn/.gitbook/assets/image (11) (2).png b/cn/.gitbook/assets/image (11) (2).png new file mode 100644 index 00000000..addf1166 Binary files /dev/null and b/cn/.gitbook/assets/image (11) (2).png differ diff --git a/cn/.gitbook/assets/image (11).png b/cn/.gitbook/assets/image (11).png new file mode 100644 index 00000000..d4a08105 Binary files /dev/null and b/cn/.gitbook/assets/image (11).png differ diff --git a/cn/.gitbook/assets/image (110).png b/cn/.gitbook/assets/image (110).png new file mode 100644 index 00000000..350efaa5 Binary files /dev/null and b/cn/.gitbook/assets/image (110).png differ diff --git a/cn/.gitbook/assets/image (111).png b/cn/.gitbook/assets/image (111).png new file mode 100644 index 00000000..62705295 Binary files /dev/null and b/cn/.gitbook/assets/image (111).png differ diff --git a/cn/.gitbook/assets/image (112).png b/cn/.gitbook/assets/image (112).png new file mode 100644 index 00000000..d0d5a7ad Binary files /dev/null and b/cn/.gitbook/assets/image (112).png differ diff --git a/cn/.gitbook/assets/image (113).png b/cn/.gitbook/assets/image (113).png new file mode 100644 index 00000000..36fcbd16 Binary files /dev/null and b/cn/.gitbook/assets/image (113).png differ diff --git a/cn/.gitbook/assets/image (114).png b/cn/.gitbook/assets/image (114).png new file mode 100644 index 00000000..5d881f93 Binary files /dev/null and b/cn/.gitbook/assets/image (114).png differ diff --git a/cn/.gitbook/assets/image (115).png b/cn/.gitbook/assets/image (115).png new file mode 100644 index 00000000..29629d57 Binary files /dev/null and b/cn/.gitbook/assets/image (115).png differ diff --git a/cn/.gitbook/assets/image (116).png b/cn/.gitbook/assets/image (116).png new file mode 100644 index 00000000..a060a0a1 Binary files /dev/null and b/cn/.gitbook/assets/image (116).png differ diff --git a/cn/.gitbook/assets/image (117).png b/cn/.gitbook/assets/image (117).png new file mode 100644 index 00000000..32990a7d Binary files /dev/null and b/cn/.gitbook/assets/image (117).png differ diff --git a/cn/.gitbook/assets/image (118).png b/cn/.gitbook/assets/image (118).png new file mode 100644 index 00000000..15ac7fea Binary files /dev/null and b/cn/.gitbook/assets/image (118).png differ diff --git a/cn/.gitbook/assets/image (119).png b/cn/.gitbook/assets/image (119).png new file mode 100644 index 00000000..34cc00e1 Binary files /dev/null and b/cn/.gitbook/assets/image (119).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..ae9b54c3 Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (12) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..5aa164fc Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (12) (1) (1) (1) (1).png new file mode 100644 index 00000000..f93a6122 Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (12) (1) (1) (1) (2).png new file mode 100644 index 00000000..4c575dd8 Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (1) (1).png b/cn/.gitbook/assets/image (12) (1) (1) (1).png new file mode 100644 index 00000000..ef4f7db1 Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (1) (2).png b/cn/.gitbook/assets/image (12) (1) (1) (2).png new file mode 100644 index 00000000..c19a49ea Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (1).png b/cn/.gitbook/assets/image (12) (1) (1).png new file mode 100644 index 00000000..deb4e36b Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (12) (1) (2).png b/cn/.gitbook/assets/image (12) (1) (2).png new file mode 100644 index 00000000..11ba8b6b Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (12) (1).png b/cn/.gitbook/assets/image (12) (1).png new file mode 100644 index 00000000..0160ac3d Binary files /dev/null and b/cn/.gitbook/assets/image (12) (1).png differ diff --git a/cn/.gitbook/assets/image (12) (2) (1).png b/cn/.gitbook/assets/image (12) (2) (1).png new file mode 100644 index 00000000..22f9a6ff Binary files /dev/null and b/cn/.gitbook/assets/image (12) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (12) (2) (2).png b/cn/.gitbook/assets/image (12) (2) (2).png new file mode 100644 index 00000000..edbd4a0c Binary files /dev/null and b/cn/.gitbook/assets/image (12) (2) (2).png differ diff --git a/cn/.gitbook/assets/image (12) (2).png b/cn/.gitbook/assets/image (12) (2).png new file mode 100644 index 00000000..149b5889 Binary files /dev/null and b/cn/.gitbook/assets/image (12) (2).png differ diff --git a/cn/.gitbook/assets/image (12).png b/cn/.gitbook/assets/image (12).png new file mode 100644 index 00000000..10c9e4bd Binary files /dev/null and b/cn/.gitbook/assets/image (12).png differ diff --git a/cn/.gitbook/assets/image (120).png b/cn/.gitbook/assets/image (120).png new file mode 100644 index 00000000..67d36adc Binary files /dev/null and b/cn/.gitbook/assets/image (120).png differ diff --git a/cn/.gitbook/assets/image (121).png b/cn/.gitbook/assets/image (121).png new file mode 100644 index 00000000..3a4b62d2 Binary files /dev/null and b/cn/.gitbook/assets/image (121).png differ diff --git a/cn/.gitbook/assets/image (122).png b/cn/.gitbook/assets/image (122).png new file mode 100644 index 00000000..7a519c93 Binary files /dev/null and b/cn/.gitbook/assets/image (122).png differ diff --git a/cn/.gitbook/assets/image (123).png b/cn/.gitbook/assets/image (123).png new file mode 100644 index 00000000..d60b1496 Binary files /dev/null and b/cn/.gitbook/assets/image (123).png differ diff --git a/cn/.gitbook/assets/image (124).png b/cn/.gitbook/assets/image (124).png new file mode 100644 index 00000000..33cfd22c Binary files /dev/null and b/cn/.gitbook/assets/image (124).png differ diff --git a/cn/.gitbook/assets/image (125).png b/cn/.gitbook/assets/image (125).png new file mode 100644 index 00000000..a8713756 Binary files /dev/null and b/cn/.gitbook/assets/image (125).png differ diff --git a/cn/.gitbook/assets/image (126).png b/cn/.gitbook/assets/image (126).png new file mode 100644 index 00000000..9060a484 Binary files /dev/null and b/cn/.gitbook/assets/image (126).png differ diff --git a/cn/.gitbook/assets/image (127).png b/cn/.gitbook/assets/image (127).png new file mode 100644 index 00000000..2b542c81 Binary files /dev/null and b/cn/.gitbook/assets/image (127).png differ diff --git a/cn/.gitbook/assets/image (128).png b/cn/.gitbook/assets/image (128).png new file mode 100644 index 00000000..83583e62 Binary files /dev/null and b/cn/.gitbook/assets/image (128).png differ diff --git a/cn/.gitbook/assets/image (129).png b/cn/.gitbook/assets/image (129).png new file mode 100644 index 00000000..9950d727 Binary files /dev/null and b/cn/.gitbook/assets/image (129).png differ diff --git a/cn/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..eadf03a5 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (13) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..4f2268c3 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (13) (1) (1) (1) (1).png new file mode 100644 index 00000000..8b3effe6 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (1) (1) (1).png b/cn/.gitbook/assets/image (13) (1) (1) (1).png new file mode 100644 index 00000000..ba490a8c Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (13) (1) (1) (2) (1).png new file mode 100644 index 00000000..8fb5c8b3 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (1) (1) (2).png b/cn/.gitbook/assets/image (13) (1) (1) (2).png new file mode 100644 index 00000000..32204e65 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (13) (1) (1).png b/cn/.gitbook/assets/image (13) (1) (1).png new file mode 100644 index 00000000..e1fb4fb1 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (1).png b/cn/.gitbook/assets/image (13) (1).png new file mode 100644 index 00000000..4c09c833 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (2) (1).png b/cn/.gitbook/assets/image (13) (2) (1).png new file mode 100644 index 00000000..1d83d9f4 Binary files /dev/null and b/cn/.gitbook/assets/image (13) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (13) (2) (2).png b/cn/.gitbook/assets/image (13) (2) (2).png new file mode 100644 index 00000000..6a43418e Binary files /dev/null and b/cn/.gitbook/assets/image (13) (2) (2).png differ diff --git a/cn/.gitbook/assets/image (13) (2).png b/cn/.gitbook/assets/image (13) (2).png new file mode 100644 index 00000000..070e8fff Binary files /dev/null and b/cn/.gitbook/assets/image (13) (2).png differ diff --git a/cn/.gitbook/assets/image (13).png b/cn/.gitbook/assets/image (13).png new file mode 100644 index 00000000..8435ddea Binary files /dev/null and b/cn/.gitbook/assets/image (13).png differ diff --git a/cn/.gitbook/assets/image (130).png b/cn/.gitbook/assets/image (130).png new file mode 100644 index 00000000..e2955bf0 Binary files /dev/null and b/cn/.gitbook/assets/image (130).png differ diff --git a/cn/.gitbook/assets/image (131).png b/cn/.gitbook/assets/image (131).png new file mode 100644 index 00000000..50dbc679 Binary files /dev/null and b/cn/.gitbook/assets/image (131).png differ diff --git a/cn/.gitbook/assets/image (132).png b/cn/.gitbook/assets/image (132).png new file mode 100644 index 00000000..71ec7568 Binary files /dev/null and b/cn/.gitbook/assets/image (132).png differ diff --git a/cn/.gitbook/assets/image (133).png b/cn/.gitbook/assets/image (133).png new file mode 100644 index 00000000..dba6e212 Binary files /dev/null and b/cn/.gitbook/assets/image (133).png differ diff --git a/cn/.gitbook/assets/image (134).png b/cn/.gitbook/assets/image (134).png new file mode 100644 index 00000000..e7b987ce Binary files /dev/null and b/cn/.gitbook/assets/image (134).png differ diff --git a/cn/.gitbook/assets/image (135).png b/cn/.gitbook/assets/image (135).png new file mode 100644 index 00000000..3e096df3 Binary files /dev/null and b/cn/.gitbook/assets/image (135).png differ diff --git a/cn/.gitbook/assets/image (136).png b/cn/.gitbook/assets/image (136).png new file mode 100644 index 00000000..fd3709f5 Binary files /dev/null and b/cn/.gitbook/assets/image (136).png differ diff --git a/cn/.gitbook/assets/image (137).png b/cn/.gitbook/assets/image (137).png new file mode 100644 index 00000000..fe6d18ed Binary files /dev/null and b/cn/.gitbook/assets/image (137).png differ diff --git a/cn/.gitbook/assets/image (138).png b/cn/.gitbook/assets/image (138).png new file mode 100644 index 00000000..714bf944 Binary files /dev/null and b/cn/.gitbook/assets/image (138).png differ diff --git a/cn/.gitbook/assets/image (139).png b/cn/.gitbook/assets/image (139).png new file mode 100644 index 00000000..bde86b49 Binary files /dev/null and b/cn/.gitbook/assets/image (139).png differ diff --git a/cn/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..cea9d5b7 Binary files /dev/null and b/cn/.gitbook/assets/image (14) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (14) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (14) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..339c68b7 Binary files /dev/null and b/cn/.gitbook/assets/image (14) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (14) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (14) (1) (1) (1) (1).png new file mode 100644 index 00000000..03618507 Binary files /dev/null and b/cn/.gitbook/assets/image (14) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (14) (1) (1) (1).png b/cn/.gitbook/assets/image (14) (1) (1) (1).png new file mode 100644 index 00000000..066a3025 Binary files /dev/null and b/cn/.gitbook/assets/image (14) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (14) (1) (1) (2).png b/cn/.gitbook/assets/image (14) (1) (1) (2).png new file mode 100644 index 00000000..0e7c5b04 Binary files /dev/null and b/cn/.gitbook/assets/image (14) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (14) (1) (1).png b/cn/.gitbook/assets/image (14) (1) (1).png new file mode 100644 index 00000000..d0f7462f Binary files /dev/null and b/cn/.gitbook/assets/image (14) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (14) (1).png b/cn/.gitbook/assets/image (14) (1).png new file mode 100644 index 00000000..39e225a6 Binary files /dev/null and b/cn/.gitbook/assets/image (14) (1).png differ diff --git a/cn/.gitbook/assets/image (14) (2).png b/cn/.gitbook/assets/image (14) (2).png new file mode 100644 index 00000000..92c99bd7 Binary files /dev/null and b/cn/.gitbook/assets/image (14) (2).png differ diff --git a/cn/.gitbook/assets/image (14).png b/cn/.gitbook/assets/image (14).png new file mode 100644 index 00000000..d52bd4da Binary files /dev/null and b/cn/.gitbook/assets/image (14).png differ diff --git a/cn/.gitbook/assets/image (140).png b/cn/.gitbook/assets/image (140).png new file mode 100644 index 00000000..d3bec65d Binary files /dev/null and b/cn/.gitbook/assets/image (140).png differ diff --git a/cn/.gitbook/assets/image (141).png b/cn/.gitbook/assets/image (141).png new file mode 100644 index 00000000..004a46b3 Binary files /dev/null and b/cn/.gitbook/assets/image (141).png differ diff --git a/cn/.gitbook/assets/image (142).png b/cn/.gitbook/assets/image (142).png new file mode 100644 index 00000000..d814dc41 Binary files /dev/null and b/cn/.gitbook/assets/image (142).png differ diff --git a/cn/.gitbook/assets/image (143).png b/cn/.gitbook/assets/image (143).png new file mode 100644 index 00000000..c622470e Binary files /dev/null and b/cn/.gitbook/assets/image (143).png differ diff --git a/cn/.gitbook/assets/image (144).png b/cn/.gitbook/assets/image (144).png new file mode 100644 index 00000000..998565bc Binary files /dev/null and b/cn/.gitbook/assets/image (144).png differ diff --git a/cn/.gitbook/assets/image (145).png b/cn/.gitbook/assets/image (145).png new file mode 100644 index 00000000..907a8ea8 Binary files /dev/null and b/cn/.gitbook/assets/image (145).png differ diff --git a/cn/.gitbook/assets/image (146).png b/cn/.gitbook/assets/image (146).png new file mode 100644 index 00000000..bc69c855 Binary files /dev/null and b/cn/.gitbook/assets/image (146).png differ diff --git a/cn/.gitbook/assets/image (147).png b/cn/.gitbook/assets/image (147).png new file mode 100644 index 00000000..84f102c7 Binary files /dev/null and b/cn/.gitbook/assets/image (147).png differ diff --git a/cn/.gitbook/assets/image (148).png b/cn/.gitbook/assets/image (148).png new file mode 100644 index 00000000..af3d88cb Binary files /dev/null and b/cn/.gitbook/assets/image (148).png differ diff --git a/cn/.gitbook/assets/image (149).png b/cn/.gitbook/assets/image (149).png new file mode 100644 index 00000000..a46fc5de Binary files /dev/null and b/cn/.gitbook/assets/image (149).png differ diff --git a/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c99d558a Binary files /dev/null and b/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..556cd567 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..434ea80d Binary files /dev/null and b/cn/.gitbook/assets/image (15) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (15) (1) (1) (1) (1).png new file mode 100644 index 00000000..66a11f53 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (1) (1) (1).png b/cn/.gitbook/assets/image (15) (1) (1) (1).png new file mode 100644 index 00000000..0f639f00 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (1) (1).png b/cn/.gitbook/assets/image (15) (1) (1).png new file mode 100644 index 00000000..888d0db3 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (1).png b/cn/.gitbook/assets/image (15) (1).png new file mode 100644 index 00000000..5bd67829 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (2) (1) (1).png b/cn/.gitbook/assets/image (15) (2) (1) (1).png new file mode 100644 index 00000000..42e43e05 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (2) (1).png b/cn/.gitbook/assets/image (15) (2) (1).png new file mode 100644 index 00000000..3fe5e6ce Binary files /dev/null and b/cn/.gitbook/assets/image (15) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (15) (2) (2).png b/cn/.gitbook/assets/image (15) (2) (2).png new file mode 100644 index 00000000..024b6d8d Binary files /dev/null and b/cn/.gitbook/assets/image (15) (2) (2).png differ diff --git a/cn/.gitbook/assets/image (15) (2).png b/cn/.gitbook/assets/image (15) (2).png new file mode 100644 index 00000000..5f2011f3 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (2).png differ diff --git a/cn/.gitbook/assets/image (15) (3).png b/cn/.gitbook/assets/image (15) (3).png new file mode 100644 index 00000000..1b9a5002 Binary files /dev/null and b/cn/.gitbook/assets/image (15) (3).png differ diff --git a/cn/.gitbook/assets/image (15).png b/cn/.gitbook/assets/image (15).png new file mode 100644 index 00000000..21d1d25f Binary files /dev/null and b/cn/.gitbook/assets/image (15).png differ diff --git a/cn/.gitbook/assets/image (150).png b/cn/.gitbook/assets/image (150).png new file mode 100644 index 00000000..bc9a669e Binary files /dev/null and b/cn/.gitbook/assets/image (150).png differ diff --git a/cn/.gitbook/assets/image (151).png b/cn/.gitbook/assets/image (151).png new file mode 100644 index 00000000..756d00fd Binary files /dev/null and b/cn/.gitbook/assets/image (151).png differ diff --git a/cn/.gitbook/assets/image (152).png b/cn/.gitbook/assets/image (152).png new file mode 100644 index 00000000..dd190d70 Binary files /dev/null and b/cn/.gitbook/assets/image (152).png differ diff --git a/cn/.gitbook/assets/image (153).png b/cn/.gitbook/assets/image (153).png new file mode 100644 index 00000000..3b61ca4e Binary files /dev/null and b/cn/.gitbook/assets/image (153).png differ diff --git a/cn/.gitbook/assets/image (154).png b/cn/.gitbook/assets/image (154).png new file mode 100644 index 00000000..dbc8e0bb Binary files /dev/null and b/cn/.gitbook/assets/image (154).png differ diff --git a/cn/.gitbook/assets/image (155).png b/cn/.gitbook/assets/image (155).png new file mode 100644 index 00000000..4c5c95ae Binary files /dev/null and b/cn/.gitbook/assets/image (155).png differ diff --git a/cn/.gitbook/assets/image (156).png b/cn/.gitbook/assets/image (156).png new file mode 100644 index 00000000..79be6075 Binary files /dev/null and b/cn/.gitbook/assets/image (156).png differ diff --git a/cn/.gitbook/assets/image (157).png b/cn/.gitbook/assets/image (157).png new file mode 100644 index 00000000..a81894b8 Binary files /dev/null and b/cn/.gitbook/assets/image (157).png differ diff --git a/cn/.gitbook/assets/image (158).png b/cn/.gitbook/assets/image (158).png new file mode 100644 index 00000000..8f1b1956 Binary files /dev/null and b/cn/.gitbook/assets/image (158).png differ diff --git a/cn/.gitbook/assets/image (159).png b/cn/.gitbook/assets/image (159).png new file mode 100644 index 00000000..eda43ab5 Binary files /dev/null and b/cn/.gitbook/assets/image (159).png differ diff --git a/cn/.gitbook/assets/image (16) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (16) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..d3bdadc0 Binary files /dev/null and b/cn/.gitbook/assets/image (16) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (16) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (16) (1) (1) (1) (1).png new file mode 100644 index 00000000..c624b1e0 Binary files /dev/null and b/cn/.gitbook/assets/image (16) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (16) (1) (1) (1).png b/cn/.gitbook/assets/image (16) (1) (1) (1).png new file mode 100644 index 00000000..b082f202 Binary files /dev/null and b/cn/.gitbook/assets/image (16) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (16) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (16) (1) (1) (2) (1).png new file mode 100644 index 00000000..c324cc5f Binary files /dev/null and b/cn/.gitbook/assets/image (16) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (16) (1) (1) (2).png b/cn/.gitbook/assets/image (16) (1) (1) (2).png new file mode 100644 index 00000000..8911e8d8 Binary files /dev/null and b/cn/.gitbook/assets/image (16) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (16) (1) (1).png b/cn/.gitbook/assets/image (16) (1) (1).png new file mode 100644 index 00000000..c7254f23 Binary files /dev/null and b/cn/.gitbook/assets/image (16) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (16) (1).png b/cn/.gitbook/assets/image (16) (1).png new file mode 100644 index 00000000..891b54ca Binary files /dev/null and b/cn/.gitbook/assets/image (16) (1).png differ diff --git a/cn/.gitbook/assets/image (16) (2).png b/cn/.gitbook/assets/image (16) (2).png new file mode 100644 index 00000000..e48c7512 Binary files /dev/null and b/cn/.gitbook/assets/image (16) (2).png differ diff --git a/cn/.gitbook/assets/image (16).png b/cn/.gitbook/assets/image (16).png new file mode 100644 index 00000000..9809fd3b Binary files /dev/null and b/cn/.gitbook/assets/image (16).png differ diff --git a/cn/.gitbook/assets/image (160).png b/cn/.gitbook/assets/image (160).png new file mode 100644 index 00000000..6c9bea35 Binary files /dev/null and b/cn/.gitbook/assets/image (160).png differ diff --git a/cn/.gitbook/assets/image (161).png b/cn/.gitbook/assets/image (161).png new file mode 100644 index 00000000..267cc9f1 Binary files /dev/null and b/cn/.gitbook/assets/image (161).png differ diff --git a/cn/.gitbook/assets/image (162).png b/cn/.gitbook/assets/image (162).png new file mode 100644 index 00000000..28aa9b14 Binary files /dev/null and b/cn/.gitbook/assets/image (162).png differ diff --git a/cn/.gitbook/assets/image (163).png b/cn/.gitbook/assets/image (163).png new file mode 100644 index 00000000..e2676a66 Binary files /dev/null and b/cn/.gitbook/assets/image (163).png differ diff --git a/cn/.gitbook/assets/image (164).png b/cn/.gitbook/assets/image (164).png new file mode 100644 index 00000000..24bcff61 Binary files /dev/null and b/cn/.gitbook/assets/image (164).png differ diff --git a/cn/.gitbook/assets/image (165).png b/cn/.gitbook/assets/image (165).png new file mode 100644 index 00000000..5e0d0fad Binary files /dev/null and b/cn/.gitbook/assets/image (165).png differ diff --git a/cn/.gitbook/assets/image (166).png b/cn/.gitbook/assets/image (166).png new file mode 100644 index 00000000..e5f16e8d Binary files /dev/null and b/cn/.gitbook/assets/image (166).png differ diff --git a/cn/.gitbook/assets/image (167).png b/cn/.gitbook/assets/image (167).png new file mode 100644 index 00000000..e902eef2 Binary files /dev/null and b/cn/.gitbook/assets/image (167).png differ diff --git a/cn/.gitbook/assets/image (168).png b/cn/.gitbook/assets/image (168).png new file mode 100644 index 00000000..9d0ae755 Binary files /dev/null and b/cn/.gitbook/assets/image (168).png differ diff --git a/cn/.gitbook/assets/image (169).png b/cn/.gitbook/assets/image (169).png new file mode 100644 index 00000000..25eb81ba Binary files /dev/null and b/cn/.gitbook/assets/image (169).png differ diff --git a/cn/.gitbook/assets/image (17) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (17) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..f22be2bf Binary files /dev/null and b/cn/.gitbook/assets/image (17) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (17) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (17) (1) (1) (1) (1).png new file mode 100644 index 00000000..7767b3bb Binary files /dev/null and b/cn/.gitbook/assets/image (17) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (17) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (17) (1) (1) (1) (2).png new file mode 100644 index 00000000..57bcd68d Binary files /dev/null and b/cn/.gitbook/assets/image (17) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (17) (1) (1) (1).png b/cn/.gitbook/assets/image (17) (1) (1) (1).png new file mode 100644 index 00000000..724e8e27 Binary files /dev/null and b/cn/.gitbook/assets/image (17) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (17) (1) (1).png b/cn/.gitbook/assets/image (17) (1) (1).png new file mode 100644 index 00000000..e1c6a718 Binary files /dev/null and b/cn/.gitbook/assets/image (17) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (17) (1) (2).png b/cn/.gitbook/assets/image (17) (1) (2).png new file mode 100644 index 00000000..ae55297e Binary files /dev/null and b/cn/.gitbook/assets/image (17) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (17) (1).png b/cn/.gitbook/assets/image (17) (1).png new file mode 100644 index 00000000..f19aa369 Binary files /dev/null and b/cn/.gitbook/assets/image (17) (1).png differ diff --git a/cn/.gitbook/assets/image (17) (2).png b/cn/.gitbook/assets/image (17) (2).png new file mode 100644 index 00000000..e2d1bcc3 Binary files /dev/null and b/cn/.gitbook/assets/image (17) (2).png differ diff --git a/cn/.gitbook/assets/image (17).png b/cn/.gitbook/assets/image (17).png new file mode 100644 index 00000000..004a2268 Binary files /dev/null and b/cn/.gitbook/assets/image (17).png differ diff --git a/cn/.gitbook/assets/image (170).png b/cn/.gitbook/assets/image (170).png new file mode 100644 index 00000000..9e2c6d6b Binary files /dev/null and b/cn/.gitbook/assets/image (170).png differ diff --git a/cn/.gitbook/assets/image (171).png b/cn/.gitbook/assets/image (171).png new file mode 100644 index 00000000..18d42517 Binary files /dev/null and b/cn/.gitbook/assets/image (171).png differ diff --git a/cn/.gitbook/assets/image (172).png b/cn/.gitbook/assets/image (172).png new file mode 100644 index 00000000..ee3e8d8a Binary files /dev/null and b/cn/.gitbook/assets/image (172).png differ diff --git a/cn/.gitbook/assets/image (173).png b/cn/.gitbook/assets/image (173).png new file mode 100644 index 00000000..4435db0b Binary files /dev/null and b/cn/.gitbook/assets/image (173).png differ diff --git a/cn/.gitbook/assets/image (174).png b/cn/.gitbook/assets/image (174).png new file mode 100644 index 00000000..a3ef9bee Binary files /dev/null and b/cn/.gitbook/assets/image (174).png differ diff --git a/cn/.gitbook/assets/image (175).png b/cn/.gitbook/assets/image (175).png new file mode 100644 index 00000000..b492743e Binary files /dev/null and b/cn/.gitbook/assets/image (175).png differ diff --git a/cn/.gitbook/assets/image (176).png b/cn/.gitbook/assets/image (176).png new file mode 100644 index 00000000..7d658a87 Binary files /dev/null and b/cn/.gitbook/assets/image (176).png differ diff --git a/cn/.gitbook/assets/image (177).png b/cn/.gitbook/assets/image (177).png new file mode 100644 index 00000000..e0f562cd Binary files /dev/null and b/cn/.gitbook/assets/image (177).png differ diff --git a/cn/.gitbook/assets/image (178).png b/cn/.gitbook/assets/image (178).png new file mode 100644 index 00000000..9e2d6224 Binary files /dev/null and b/cn/.gitbook/assets/image (178).png differ diff --git a/cn/.gitbook/assets/image (179).png b/cn/.gitbook/assets/image (179).png new file mode 100644 index 00000000..91e7effd Binary files /dev/null and b/cn/.gitbook/assets/image (179).png differ diff --git a/cn/.gitbook/assets/image (18) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (18) (1) (1) (1) (1).png new file mode 100644 index 00000000..a4f60172 Binary files /dev/null and b/cn/.gitbook/assets/image (18) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (18) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (18) (1) (1) (1) (2).png new file mode 100644 index 00000000..c77749e2 Binary files /dev/null and b/cn/.gitbook/assets/image (18) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (18) (1) (1) (1).png b/cn/.gitbook/assets/image (18) (1) (1) (1).png new file mode 100644 index 00000000..8229bc3e Binary files /dev/null and b/cn/.gitbook/assets/image (18) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (18) (1) (1).png b/cn/.gitbook/assets/image (18) (1) (1).png new file mode 100644 index 00000000..82079491 Binary files /dev/null and b/cn/.gitbook/assets/image (18) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (18) (1) (2) (1).png b/cn/.gitbook/assets/image (18) (1) (2) (1).png new file mode 100644 index 00000000..8e27a33f Binary files /dev/null and b/cn/.gitbook/assets/image (18) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (18) (1).png b/cn/.gitbook/assets/image (18) (1).png new file mode 100644 index 00000000..fc75b76c Binary files /dev/null and b/cn/.gitbook/assets/image (18) (1).png differ diff --git a/cn/.gitbook/assets/image (18) (2).png b/cn/.gitbook/assets/image (18) (2).png new file mode 100644 index 00000000..0977fe86 Binary files /dev/null and b/cn/.gitbook/assets/image (18) (2).png differ diff --git a/cn/.gitbook/assets/image (18).png b/cn/.gitbook/assets/image (18).png new file mode 100644 index 00000000..f651dbef Binary files /dev/null and b/cn/.gitbook/assets/image (18).png differ diff --git a/cn/.gitbook/assets/image (180).png b/cn/.gitbook/assets/image (180).png new file mode 100644 index 00000000..f655c13d Binary files /dev/null and b/cn/.gitbook/assets/image (180).png differ diff --git a/cn/.gitbook/assets/image (181).png b/cn/.gitbook/assets/image (181).png new file mode 100644 index 00000000..29e128a4 Binary files /dev/null and b/cn/.gitbook/assets/image (181).png differ diff --git a/cn/.gitbook/assets/image (182).png b/cn/.gitbook/assets/image (182).png new file mode 100644 index 00000000..9f1f8782 Binary files /dev/null and b/cn/.gitbook/assets/image (182).png differ diff --git a/cn/.gitbook/assets/image (183).png b/cn/.gitbook/assets/image (183).png new file mode 100644 index 00000000..8bccc4a3 Binary files /dev/null and b/cn/.gitbook/assets/image (183).png differ diff --git a/cn/.gitbook/assets/image (184).png b/cn/.gitbook/assets/image (184).png new file mode 100644 index 00000000..bb509fdb Binary files /dev/null and b/cn/.gitbook/assets/image (184).png differ diff --git a/cn/.gitbook/assets/image (185).png b/cn/.gitbook/assets/image (185).png new file mode 100644 index 00000000..3204952c Binary files /dev/null and b/cn/.gitbook/assets/image (185).png differ diff --git a/cn/.gitbook/assets/image (186).png b/cn/.gitbook/assets/image (186).png new file mode 100644 index 00000000..23c9f1ae Binary files /dev/null and b/cn/.gitbook/assets/image (186).png differ diff --git a/cn/.gitbook/assets/image (187).png b/cn/.gitbook/assets/image (187).png new file mode 100644 index 00000000..bbd72231 Binary files /dev/null and b/cn/.gitbook/assets/image (187).png differ diff --git a/cn/.gitbook/assets/image (188).png b/cn/.gitbook/assets/image (188).png new file mode 100644 index 00000000..0305d3f3 Binary files /dev/null and b/cn/.gitbook/assets/image (188).png differ diff --git a/cn/.gitbook/assets/image (189).png b/cn/.gitbook/assets/image (189).png new file mode 100644 index 00000000..73e50d18 Binary files /dev/null and b/cn/.gitbook/assets/image (189).png differ diff --git a/cn/.gitbook/assets/image (19) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (19) (1) (1) (1) (1).png new file mode 100644 index 00000000..80cd68d8 Binary files /dev/null and b/cn/.gitbook/assets/image (19) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (19) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (19) (1) (1) (1) (2).png new file mode 100644 index 00000000..fdb3193e Binary files /dev/null and b/cn/.gitbook/assets/image (19) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (19) (1) (1) (1).png b/cn/.gitbook/assets/image (19) (1) (1) (1).png new file mode 100644 index 00000000..63b3b7ce Binary files /dev/null and b/cn/.gitbook/assets/image (19) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (19) (1) (1).png b/cn/.gitbook/assets/image (19) (1) (1).png new file mode 100644 index 00000000..55a6b650 Binary files /dev/null and b/cn/.gitbook/assets/image (19) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (19) (1).png b/cn/.gitbook/assets/image (19) (1).png new file mode 100644 index 00000000..fd7c9433 Binary files /dev/null and b/cn/.gitbook/assets/image (19) (1).png differ diff --git a/cn/.gitbook/assets/image (19) (2).png b/cn/.gitbook/assets/image (19) (2).png new file mode 100644 index 00000000..8bf627c5 Binary files /dev/null and b/cn/.gitbook/assets/image (19) (2).png differ diff --git a/cn/.gitbook/assets/image (19).png b/cn/.gitbook/assets/image (19).png new file mode 100644 index 00000000..af634c25 Binary files /dev/null and b/cn/.gitbook/assets/image (19).png differ diff --git a/cn/.gitbook/assets/image (190).png b/cn/.gitbook/assets/image (190).png new file mode 100644 index 00000000..a580944b Binary files /dev/null and b/cn/.gitbook/assets/image (190).png differ diff --git a/cn/.gitbook/assets/image (191).png b/cn/.gitbook/assets/image (191).png new file mode 100644 index 00000000..6b36c1cb Binary files /dev/null and b/cn/.gitbook/assets/image (191).png differ diff --git a/cn/.gitbook/assets/image (192).png b/cn/.gitbook/assets/image (192).png new file mode 100644 index 00000000..cf58731b Binary files /dev/null and b/cn/.gitbook/assets/image (192).png differ diff --git a/cn/.gitbook/assets/image (193).png b/cn/.gitbook/assets/image (193).png new file mode 100644 index 00000000..17700181 Binary files /dev/null and b/cn/.gitbook/assets/image (193).png differ diff --git a/cn/.gitbook/assets/image (194).png b/cn/.gitbook/assets/image (194).png new file mode 100644 index 00000000..e3dbe87b Binary files /dev/null and b/cn/.gitbook/assets/image (194).png differ diff --git a/cn/.gitbook/assets/image (195).png b/cn/.gitbook/assets/image (195).png new file mode 100644 index 00000000..ff22a4be Binary files /dev/null and b/cn/.gitbook/assets/image (195).png differ diff --git a/cn/.gitbook/assets/image (196).png b/cn/.gitbook/assets/image (196).png new file mode 100644 index 00000000..c0f67f2e Binary files /dev/null and b/cn/.gitbook/assets/image (196).png differ diff --git a/cn/.gitbook/assets/image (197).png b/cn/.gitbook/assets/image (197).png new file mode 100644 index 00000000..a4084d45 Binary files /dev/null and b/cn/.gitbook/assets/image (197).png differ diff --git a/cn/.gitbook/assets/image (198).png b/cn/.gitbook/assets/image (198).png new file mode 100644 index 00000000..4e861530 Binary files /dev/null and b/cn/.gitbook/assets/image (198).png differ diff --git a/cn/.gitbook/assets/image (199).png b/cn/.gitbook/assets/image (199).png new file mode 100644 index 00000000..c1728326 Binary files /dev/null and b/cn/.gitbook/assets/image (199).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..bc895c9b Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..6d23847f Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..e36552aa Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..55272b56 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..66551af4 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..0dd60a40 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..ec7296d3 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..83628ae5 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..f85ddd58 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..11f35920 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..e1058db8 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..5530c9d7 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..97b8a02f Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..08fb33e7 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..2969ad4e Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..3c616586 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..f8a9cf1e Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c7a0b62d Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..9e01b57b Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..585285ee Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..5f379772 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..1abc8106 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..900cafe3 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..7960c0e8 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c7d0f855 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..f7164c75 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..2a0c7459 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c12e3060 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..50cb5469 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..0a3b7402 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..0f1f566f Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..c3877ec5 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..d136f640 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1) (1).png new file mode 100644 index 00000000..d9ce2e62 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1) (1).png new file mode 100644 index 00000000..f464802c Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (1) (2).png new file mode 100644 index 00000000..5e09d784 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (1).png b/cn/.gitbook/assets/image (2) (1) (1).png new file mode 100644 index 00000000..6db61d0e Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (2) (1).png b/cn/.gitbook/assets/image (2) (1) (2) (1).png new file mode 100644 index 00000000..29ffc492 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (1) (2).png b/cn/.gitbook/assets/image (2) (1) (2).png new file mode 100644 index 00000000..2316cf50 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (1).png b/cn/.gitbook/assets/image (2) (1).png new file mode 100644 index 00000000..02b1c802 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (2).png b/cn/.gitbook/assets/image (2) (2).png new file mode 100644 index 00000000..bc3c8655 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (2).png differ diff --git a/cn/.gitbook/assets/image (2) (3).png b/cn/.gitbook/assets/image (2) (3).png new file mode 100644 index 00000000..c8e34502 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (3).png differ diff --git a/cn/.gitbook/assets/image (2) (4) (1).png b/cn/.gitbook/assets/image (2) (4) (1).png new file mode 100644 index 00000000..66534d13 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (4) (1).png differ diff --git a/cn/.gitbook/assets/image (2) (4).png b/cn/.gitbook/assets/image (2) (4).png new file mode 100644 index 00000000..aee18b7b Binary files /dev/null and b/cn/.gitbook/assets/image (2) (4).png differ diff --git a/cn/.gitbook/assets/image (2) (5).png b/cn/.gitbook/assets/image (2) (5).png new file mode 100644 index 00000000..5eb16098 Binary files /dev/null and b/cn/.gitbook/assets/image (2) (5).png differ diff --git a/cn/.gitbook/assets/image (2) (6).png b/cn/.gitbook/assets/image (2) (6).png new file mode 100644 index 00000000..4926de0a Binary files /dev/null and b/cn/.gitbook/assets/image (2) (6).png differ diff --git a/cn/.gitbook/assets/image (2).png b/cn/.gitbook/assets/image (2).png new file mode 100644 index 00000000..a3a393e3 Binary files /dev/null and b/cn/.gitbook/assets/image (2).png differ diff --git a/cn/.gitbook/assets/image (20) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (20) (1) (1) (1) (1).png new file mode 100644 index 00000000..05704748 Binary files /dev/null and b/cn/.gitbook/assets/image (20) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (20) (1) (1) (1).png b/cn/.gitbook/assets/image (20) (1) (1) (1).png new file mode 100644 index 00000000..b732ea1e Binary files /dev/null and b/cn/.gitbook/assets/image (20) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (20) (1) (1).png b/cn/.gitbook/assets/image (20) (1) (1).png new file mode 100644 index 00000000..3d3bcc9b Binary files /dev/null and b/cn/.gitbook/assets/image (20) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (20) (1).png b/cn/.gitbook/assets/image (20) (1).png new file mode 100644 index 00000000..3a52e8b9 Binary files /dev/null and b/cn/.gitbook/assets/image (20) (1).png differ diff --git a/cn/.gitbook/assets/image (20) (2).png b/cn/.gitbook/assets/image (20) (2).png new file mode 100644 index 00000000..24a24cfa Binary files /dev/null and b/cn/.gitbook/assets/image (20) (2).png differ diff --git a/cn/.gitbook/assets/image (20).png b/cn/.gitbook/assets/image (20).png new file mode 100644 index 00000000..c851f1ad Binary files /dev/null and b/cn/.gitbook/assets/image (20).png differ diff --git a/cn/.gitbook/assets/image (200).png b/cn/.gitbook/assets/image (200).png new file mode 100644 index 00000000..762763d0 Binary files /dev/null and b/cn/.gitbook/assets/image (200).png differ diff --git a/cn/.gitbook/assets/image (201).png b/cn/.gitbook/assets/image (201).png new file mode 100644 index 00000000..b04ffcda Binary files /dev/null and b/cn/.gitbook/assets/image (201).png differ diff --git a/cn/.gitbook/assets/image (202).png b/cn/.gitbook/assets/image (202).png new file mode 100644 index 00000000..c1aa9905 Binary files /dev/null and b/cn/.gitbook/assets/image (202).png differ diff --git a/cn/.gitbook/assets/image (203).png b/cn/.gitbook/assets/image (203).png new file mode 100644 index 00000000..0fab1bd9 Binary files /dev/null and b/cn/.gitbook/assets/image (203).png differ diff --git a/cn/.gitbook/assets/image (204).png b/cn/.gitbook/assets/image (204).png new file mode 100644 index 00000000..416758cb Binary files /dev/null and b/cn/.gitbook/assets/image (204).png differ diff --git a/cn/.gitbook/assets/image (205).png b/cn/.gitbook/assets/image (205).png new file mode 100644 index 00000000..1c557770 Binary files /dev/null and b/cn/.gitbook/assets/image (205).png differ diff --git a/cn/.gitbook/assets/image (206).png b/cn/.gitbook/assets/image (206).png new file mode 100644 index 00000000..16884367 Binary files /dev/null and b/cn/.gitbook/assets/image (206).png differ diff --git a/cn/.gitbook/assets/image (207).png b/cn/.gitbook/assets/image (207).png new file mode 100644 index 00000000..784971af Binary files /dev/null and b/cn/.gitbook/assets/image (207).png differ diff --git a/cn/.gitbook/assets/image (208).png b/cn/.gitbook/assets/image (208).png new file mode 100644 index 00000000..ccfd24a6 Binary files /dev/null and b/cn/.gitbook/assets/image (208).png differ diff --git a/cn/.gitbook/assets/image (209).png b/cn/.gitbook/assets/image (209).png new file mode 100644 index 00000000..f6897b2f Binary files /dev/null and b/cn/.gitbook/assets/image (209).png differ diff --git a/cn/.gitbook/assets/image (21) (1) (1) (1).png b/cn/.gitbook/assets/image (21) (1) (1) (1).png new file mode 100644 index 00000000..18bdf929 Binary files /dev/null and b/cn/.gitbook/assets/image (21) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (21) (1) (1).png b/cn/.gitbook/assets/image (21) (1) (1).png new file mode 100644 index 00000000..44d1dc48 Binary files /dev/null and b/cn/.gitbook/assets/image (21) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (21) (1) (2).png b/cn/.gitbook/assets/image (21) (1) (2).png new file mode 100644 index 00000000..e06028b3 Binary files /dev/null and b/cn/.gitbook/assets/image (21) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (21) (1).png b/cn/.gitbook/assets/image (21) (1).png new file mode 100644 index 00000000..7b874167 Binary files /dev/null and b/cn/.gitbook/assets/image (21) (1).png differ diff --git a/cn/.gitbook/assets/image (21).png b/cn/.gitbook/assets/image (21).png new file mode 100644 index 00000000..f432e251 Binary files /dev/null and b/cn/.gitbook/assets/image (21).png differ diff --git a/cn/.gitbook/assets/image (210).png b/cn/.gitbook/assets/image (210).png new file mode 100644 index 00000000..c054a4bb Binary files /dev/null and b/cn/.gitbook/assets/image (210).png differ diff --git a/cn/.gitbook/assets/image (211).png b/cn/.gitbook/assets/image (211).png new file mode 100644 index 00000000..f5256bad Binary files /dev/null and b/cn/.gitbook/assets/image (211).png differ diff --git a/cn/.gitbook/assets/image (212).png b/cn/.gitbook/assets/image (212).png new file mode 100644 index 00000000..38cb61f3 Binary files /dev/null and b/cn/.gitbook/assets/image (212).png differ diff --git a/cn/.gitbook/assets/image (213).png b/cn/.gitbook/assets/image (213).png new file mode 100644 index 00000000..e4313c54 Binary files /dev/null and b/cn/.gitbook/assets/image (213).png differ diff --git a/cn/.gitbook/assets/image (214).png b/cn/.gitbook/assets/image (214).png new file mode 100644 index 00000000..228c7bf1 Binary files /dev/null and b/cn/.gitbook/assets/image (214).png differ diff --git a/cn/.gitbook/assets/image (215).png b/cn/.gitbook/assets/image (215).png new file mode 100644 index 00000000..0a36c645 Binary files /dev/null and b/cn/.gitbook/assets/image (215).png differ diff --git a/cn/.gitbook/assets/image (216).png b/cn/.gitbook/assets/image (216).png new file mode 100644 index 00000000..126b0001 Binary files /dev/null and b/cn/.gitbook/assets/image (216).png differ diff --git a/cn/.gitbook/assets/image (217).png b/cn/.gitbook/assets/image (217).png new file mode 100644 index 00000000..ce41b0b2 Binary files /dev/null and b/cn/.gitbook/assets/image (217).png differ diff --git a/cn/.gitbook/assets/image (218).png b/cn/.gitbook/assets/image (218).png new file mode 100644 index 00000000..e1b50c9e Binary files /dev/null and b/cn/.gitbook/assets/image (218).png differ diff --git a/cn/.gitbook/assets/image (219).png b/cn/.gitbook/assets/image (219).png new file mode 100644 index 00000000..fd886cce Binary files /dev/null and b/cn/.gitbook/assets/image (219).png differ diff --git a/cn/.gitbook/assets/image (22) (1) (1).png b/cn/.gitbook/assets/image (22) (1) (1).png new file mode 100644 index 00000000..b56c5e31 Binary files /dev/null and b/cn/.gitbook/assets/image (22) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (22) (1).png b/cn/.gitbook/assets/image (22) (1).png new file mode 100644 index 00000000..bde4e6cf Binary files /dev/null and b/cn/.gitbook/assets/image (22) (1).png differ diff --git a/cn/.gitbook/assets/image (22).png b/cn/.gitbook/assets/image (22).png new file mode 100644 index 00000000..d90a3ab5 Binary files /dev/null and b/cn/.gitbook/assets/image (22).png differ diff --git a/cn/.gitbook/assets/image (220).png b/cn/.gitbook/assets/image (220).png new file mode 100644 index 00000000..b3f5555a Binary files /dev/null and b/cn/.gitbook/assets/image (220).png differ diff --git a/cn/.gitbook/assets/image (221).png b/cn/.gitbook/assets/image (221).png new file mode 100644 index 00000000..ebf9e42a Binary files /dev/null and b/cn/.gitbook/assets/image (221).png differ diff --git a/cn/.gitbook/assets/image (222).png b/cn/.gitbook/assets/image (222).png new file mode 100644 index 00000000..dd6b84dd Binary files /dev/null and b/cn/.gitbook/assets/image (222).png differ diff --git a/cn/.gitbook/assets/image (223).png b/cn/.gitbook/assets/image (223).png new file mode 100644 index 00000000..eed24cda Binary files /dev/null and b/cn/.gitbook/assets/image (223).png differ diff --git a/cn/.gitbook/assets/image (224).png b/cn/.gitbook/assets/image (224).png new file mode 100644 index 00000000..8e71bbe4 Binary files /dev/null and b/cn/.gitbook/assets/image (224).png differ diff --git a/cn/.gitbook/assets/image (225).png b/cn/.gitbook/assets/image (225).png new file mode 100644 index 00000000..ea423fd4 Binary files /dev/null and b/cn/.gitbook/assets/image (225).png differ diff --git a/cn/.gitbook/assets/image (226).png b/cn/.gitbook/assets/image (226).png new file mode 100644 index 00000000..4ccae983 Binary files /dev/null and b/cn/.gitbook/assets/image (226).png differ diff --git a/cn/.gitbook/assets/image (227).png b/cn/.gitbook/assets/image (227).png new file mode 100644 index 00000000..15e7a591 Binary files /dev/null and b/cn/.gitbook/assets/image (227).png differ diff --git a/cn/.gitbook/assets/image (228).png b/cn/.gitbook/assets/image (228).png new file mode 100644 index 00000000..657b4bd8 Binary files /dev/null and b/cn/.gitbook/assets/image (228).png differ diff --git a/cn/.gitbook/assets/image (229).png b/cn/.gitbook/assets/image (229).png new file mode 100644 index 00000000..3edebcc0 Binary files /dev/null and b/cn/.gitbook/assets/image (229).png differ diff --git a/cn/.gitbook/assets/image (23) (1) (1).png b/cn/.gitbook/assets/image (23) (1) (1).png new file mode 100644 index 00000000..a179f99f Binary files /dev/null and b/cn/.gitbook/assets/image (23) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (23) (1) (2).png b/cn/.gitbook/assets/image (23) (1) (2).png new file mode 100644 index 00000000..0cc470ce Binary files /dev/null and b/cn/.gitbook/assets/image (23) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (23) (1).png b/cn/.gitbook/assets/image (23) (1).png new file mode 100644 index 00000000..851200ea Binary files /dev/null and b/cn/.gitbook/assets/image (23) (1).png differ diff --git a/cn/.gitbook/assets/image (23).png b/cn/.gitbook/assets/image (23).png new file mode 100644 index 00000000..cc800c1f Binary files /dev/null and b/cn/.gitbook/assets/image (23).png differ diff --git a/cn/.gitbook/assets/image (230).png b/cn/.gitbook/assets/image (230).png new file mode 100644 index 00000000..96cc56fe Binary files /dev/null and b/cn/.gitbook/assets/image (230).png differ diff --git a/cn/.gitbook/assets/image (231).png b/cn/.gitbook/assets/image (231).png new file mode 100644 index 00000000..b056dde9 Binary files /dev/null and b/cn/.gitbook/assets/image (231).png differ diff --git a/cn/.gitbook/assets/image (232).png b/cn/.gitbook/assets/image (232).png new file mode 100644 index 00000000..0e6572e6 Binary files /dev/null and b/cn/.gitbook/assets/image (232).png differ diff --git a/cn/.gitbook/assets/image (233).png b/cn/.gitbook/assets/image (233).png new file mode 100644 index 00000000..d8bf5e63 Binary files /dev/null and b/cn/.gitbook/assets/image (233).png differ diff --git a/cn/.gitbook/assets/image (234).png b/cn/.gitbook/assets/image (234).png new file mode 100644 index 00000000..dd43b43c Binary files /dev/null and b/cn/.gitbook/assets/image (234).png differ diff --git a/cn/.gitbook/assets/image (235).png b/cn/.gitbook/assets/image (235).png new file mode 100644 index 00000000..1502ecba Binary files /dev/null and b/cn/.gitbook/assets/image (235).png differ diff --git a/cn/.gitbook/assets/image (236).png b/cn/.gitbook/assets/image (236).png new file mode 100644 index 00000000..aeb202a5 Binary files /dev/null and b/cn/.gitbook/assets/image (236).png differ diff --git a/cn/.gitbook/assets/image (237).png b/cn/.gitbook/assets/image (237).png new file mode 100644 index 00000000..b8f1612c Binary files /dev/null and b/cn/.gitbook/assets/image (237).png differ diff --git a/cn/.gitbook/assets/image (238).png b/cn/.gitbook/assets/image (238).png new file mode 100644 index 00000000..5fe767ad Binary files /dev/null and b/cn/.gitbook/assets/image (238).png differ diff --git a/cn/.gitbook/assets/image (239).png b/cn/.gitbook/assets/image (239).png new file mode 100644 index 00000000..d0c08c85 Binary files /dev/null and b/cn/.gitbook/assets/image (239).png differ diff --git a/cn/.gitbook/assets/image (24) (1).png b/cn/.gitbook/assets/image (24) (1).png new file mode 100644 index 00000000..b129842c Binary files /dev/null and b/cn/.gitbook/assets/image (24) (1).png differ diff --git a/cn/.gitbook/assets/image (24).png b/cn/.gitbook/assets/image (24).png new file mode 100644 index 00000000..82413b59 Binary files /dev/null and b/cn/.gitbook/assets/image (24).png differ diff --git a/cn/.gitbook/assets/image (240).png b/cn/.gitbook/assets/image (240).png new file mode 100644 index 00000000..f2e87855 Binary files /dev/null and b/cn/.gitbook/assets/image (240).png differ diff --git a/cn/.gitbook/assets/image (241).png b/cn/.gitbook/assets/image (241).png new file mode 100644 index 00000000..420c6804 Binary files /dev/null and b/cn/.gitbook/assets/image (241).png differ diff --git a/cn/.gitbook/assets/image (242).png b/cn/.gitbook/assets/image (242).png new file mode 100644 index 00000000..f055ff30 Binary files /dev/null and b/cn/.gitbook/assets/image (242).png differ diff --git a/cn/.gitbook/assets/image (243).png b/cn/.gitbook/assets/image (243).png new file mode 100644 index 00000000..fea1ce7b Binary files /dev/null and b/cn/.gitbook/assets/image (243).png differ diff --git a/cn/.gitbook/assets/image (244).png b/cn/.gitbook/assets/image (244).png new file mode 100644 index 00000000..b1e7497d Binary files /dev/null and b/cn/.gitbook/assets/image (244).png differ diff --git a/cn/.gitbook/assets/image (245).png b/cn/.gitbook/assets/image (245).png new file mode 100644 index 00000000..bfbe6579 Binary files /dev/null and b/cn/.gitbook/assets/image (245).png differ diff --git a/cn/.gitbook/assets/image (246).png b/cn/.gitbook/assets/image (246).png new file mode 100644 index 00000000..6e3fefb4 Binary files /dev/null and b/cn/.gitbook/assets/image (246).png differ diff --git a/cn/.gitbook/assets/image (247).png b/cn/.gitbook/assets/image (247).png new file mode 100644 index 00000000..94f1ca24 Binary files /dev/null and b/cn/.gitbook/assets/image (247).png differ diff --git a/cn/.gitbook/assets/image (248).png b/cn/.gitbook/assets/image (248).png new file mode 100644 index 00000000..5a2e9cf1 Binary files /dev/null and b/cn/.gitbook/assets/image (248).png differ diff --git a/cn/.gitbook/assets/image (249).png b/cn/.gitbook/assets/image (249).png new file mode 100644 index 00000000..fdfdba23 Binary files /dev/null and b/cn/.gitbook/assets/image (249).png differ diff --git a/cn/.gitbook/assets/image (25) (1) (1).png b/cn/.gitbook/assets/image (25) (1) (1).png new file mode 100644 index 00000000..e2b67a32 Binary files /dev/null and b/cn/.gitbook/assets/image (25) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (25) (1).png b/cn/.gitbook/assets/image (25) (1).png new file mode 100644 index 00000000..6e990403 Binary files /dev/null and b/cn/.gitbook/assets/image (25) (1).png differ diff --git a/cn/.gitbook/assets/image (25).png b/cn/.gitbook/assets/image (25).png new file mode 100644 index 00000000..51761efd Binary files /dev/null and b/cn/.gitbook/assets/image (25).png differ diff --git a/cn/.gitbook/assets/image (250).png b/cn/.gitbook/assets/image (250).png new file mode 100644 index 00000000..7f62e6b4 Binary files /dev/null and b/cn/.gitbook/assets/image (250).png differ diff --git a/cn/.gitbook/assets/image (251).png b/cn/.gitbook/assets/image (251).png new file mode 100644 index 00000000..4bb42530 Binary files /dev/null and b/cn/.gitbook/assets/image (251).png differ diff --git a/cn/.gitbook/assets/image (252).png b/cn/.gitbook/assets/image (252).png new file mode 100644 index 00000000..72e5341b Binary files /dev/null and b/cn/.gitbook/assets/image (252).png differ diff --git a/cn/.gitbook/assets/image (253).png b/cn/.gitbook/assets/image (253).png new file mode 100644 index 00000000..8f7a1f6d Binary files /dev/null and b/cn/.gitbook/assets/image (253).png differ diff --git a/cn/.gitbook/assets/image (254).png b/cn/.gitbook/assets/image (254).png new file mode 100644 index 00000000..45b6f49f Binary files /dev/null and b/cn/.gitbook/assets/image (254).png differ diff --git a/cn/.gitbook/assets/image (255).png b/cn/.gitbook/assets/image (255).png new file mode 100644 index 00000000..3fc2f81a Binary files /dev/null and b/cn/.gitbook/assets/image (255).png differ diff --git a/cn/.gitbook/assets/image (256).png b/cn/.gitbook/assets/image (256).png new file mode 100644 index 00000000..8dc2b06f Binary files /dev/null and b/cn/.gitbook/assets/image (256).png differ diff --git a/cn/.gitbook/assets/image (257).png b/cn/.gitbook/assets/image (257).png new file mode 100644 index 00000000..76a158f5 Binary files /dev/null and b/cn/.gitbook/assets/image (257).png differ diff --git a/cn/.gitbook/assets/image (258).png b/cn/.gitbook/assets/image (258).png new file mode 100644 index 00000000..85b49271 Binary files /dev/null and b/cn/.gitbook/assets/image (258).png differ diff --git a/cn/.gitbook/assets/image (259).png b/cn/.gitbook/assets/image (259).png new file mode 100644 index 00000000..ba6235fd Binary files /dev/null and b/cn/.gitbook/assets/image (259).png differ diff --git a/cn/.gitbook/assets/image (26).png b/cn/.gitbook/assets/image (26).png new file mode 100644 index 00000000..6c72c3cb Binary files /dev/null and b/cn/.gitbook/assets/image (26).png differ diff --git a/cn/.gitbook/assets/image (260).png b/cn/.gitbook/assets/image (260).png new file mode 100644 index 00000000..680bf32f Binary files /dev/null and b/cn/.gitbook/assets/image (260).png differ diff --git a/cn/.gitbook/assets/image (261).png b/cn/.gitbook/assets/image (261).png new file mode 100644 index 00000000..482ff7bd Binary files /dev/null and b/cn/.gitbook/assets/image (261).png differ diff --git a/cn/.gitbook/assets/image (262).png b/cn/.gitbook/assets/image (262).png new file mode 100644 index 00000000..d6b00970 Binary files /dev/null and b/cn/.gitbook/assets/image (262).png differ diff --git a/cn/.gitbook/assets/image (263).png b/cn/.gitbook/assets/image (263).png new file mode 100644 index 00000000..75e8c17e Binary files /dev/null and b/cn/.gitbook/assets/image (263).png differ diff --git a/cn/.gitbook/assets/image (264).png b/cn/.gitbook/assets/image (264).png new file mode 100644 index 00000000..a9c5cbe4 Binary files /dev/null and b/cn/.gitbook/assets/image (264).png differ diff --git a/cn/.gitbook/assets/image (265).png b/cn/.gitbook/assets/image (265).png new file mode 100644 index 00000000..1b58bf4c Binary files /dev/null and b/cn/.gitbook/assets/image (265).png differ diff --git a/cn/.gitbook/assets/image (266).png b/cn/.gitbook/assets/image (266).png new file mode 100644 index 00000000..08a94eb8 Binary files /dev/null and b/cn/.gitbook/assets/image (266).png differ diff --git a/cn/.gitbook/assets/image (267).png b/cn/.gitbook/assets/image (267).png new file mode 100644 index 00000000..34f553e7 Binary files /dev/null and b/cn/.gitbook/assets/image (267).png differ diff --git a/cn/.gitbook/assets/image (268).png b/cn/.gitbook/assets/image (268).png new file mode 100644 index 00000000..e00d55b0 Binary files /dev/null and b/cn/.gitbook/assets/image (268).png differ diff --git a/cn/.gitbook/assets/image (269).png b/cn/.gitbook/assets/image (269).png new file mode 100644 index 00000000..b11c5219 Binary files /dev/null and b/cn/.gitbook/assets/image (269).png differ diff --git a/cn/.gitbook/assets/image (27) (1).png b/cn/.gitbook/assets/image (27) (1).png new file mode 100644 index 00000000..117fabc6 Binary files /dev/null and b/cn/.gitbook/assets/image (27) (1).png differ diff --git a/cn/.gitbook/assets/image (27).png b/cn/.gitbook/assets/image (27).png new file mode 100644 index 00000000..26be8099 Binary files /dev/null and b/cn/.gitbook/assets/image (27).png differ diff --git a/cn/.gitbook/assets/image (270).png b/cn/.gitbook/assets/image (270).png new file mode 100644 index 00000000..879e7e4d Binary files /dev/null and b/cn/.gitbook/assets/image (270).png differ diff --git a/cn/.gitbook/assets/image (271).png b/cn/.gitbook/assets/image (271).png new file mode 100644 index 00000000..d0b63f5d Binary files /dev/null and b/cn/.gitbook/assets/image (271).png differ diff --git a/cn/.gitbook/assets/image (272).png b/cn/.gitbook/assets/image (272).png new file mode 100644 index 00000000..adc51147 Binary files /dev/null and b/cn/.gitbook/assets/image (272).png differ diff --git a/cn/.gitbook/assets/image (273).png b/cn/.gitbook/assets/image (273).png new file mode 100644 index 00000000..1153171c Binary files /dev/null and b/cn/.gitbook/assets/image (273).png differ diff --git a/cn/.gitbook/assets/image (274).png b/cn/.gitbook/assets/image (274).png new file mode 100644 index 00000000..34a15295 Binary files /dev/null and b/cn/.gitbook/assets/image (274).png differ diff --git a/cn/.gitbook/assets/image (275).png b/cn/.gitbook/assets/image (275).png new file mode 100644 index 00000000..8701f663 Binary files /dev/null and b/cn/.gitbook/assets/image (275).png differ diff --git a/cn/.gitbook/assets/image (276).png b/cn/.gitbook/assets/image (276).png new file mode 100644 index 00000000..d6892a94 Binary files /dev/null and b/cn/.gitbook/assets/image (276).png differ diff --git a/cn/.gitbook/assets/image (277).png b/cn/.gitbook/assets/image (277).png new file mode 100644 index 00000000..eb998173 Binary files /dev/null and b/cn/.gitbook/assets/image (277).png differ diff --git a/cn/.gitbook/assets/image (278).png b/cn/.gitbook/assets/image (278).png new file mode 100644 index 00000000..26353df7 Binary files /dev/null and b/cn/.gitbook/assets/image (278).png differ diff --git a/cn/.gitbook/assets/image (279).png b/cn/.gitbook/assets/image (279).png new file mode 100644 index 00000000..ca6650cf Binary files /dev/null and b/cn/.gitbook/assets/image (279).png differ diff --git a/cn/.gitbook/assets/image (28).png b/cn/.gitbook/assets/image (28).png new file mode 100644 index 00000000..8e11f425 Binary files /dev/null and b/cn/.gitbook/assets/image (28).png differ diff --git a/cn/.gitbook/assets/image (280).png b/cn/.gitbook/assets/image (280).png new file mode 100644 index 00000000..58eebcb2 Binary files /dev/null and b/cn/.gitbook/assets/image (280).png differ diff --git a/cn/.gitbook/assets/image (281).png b/cn/.gitbook/assets/image (281).png new file mode 100644 index 00000000..79e81472 Binary files /dev/null and b/cn/.gitbook/assets/image (281).png differ diff --git a/cn/.gitbook/assets/image (282).png b/cn/.gitbook/assets/image (282).png new file mode 100644 index 00000000..de7b3f14 Binary files /dev/null and b/cn/.gitbook/assets/image (282).png differ diff --git a/cn/.gitbook/assets/image (283).png b/cn/.gitbook/assets/image (283).png new file mode 100644 index 00000000..725b8abc Binary files /dev/null and b/cn/.gitbook/assets/image (283).png differ diff --git a/cn/.gitbook/assets/image (284).png b/cn/.gitbook/assets/image (284).png new file mode 100644 index 00000000..1ee68cae Binary files /dev/null and b/cn/.gitbook/assets/image (284).png differ diff --git a/cn/.gitbook/assets/image (285).png b/cn/.gitbook/assets/image (285).png new file mode 100644 index 00000000..0b4d2832 Binary files /dev/null and b/cn/.gitbook/assets/image (285).png differ diff --git a/cn/.gitbook/assets/image (286).png b/cn/.gitbook/assets/image (286).png new file mode 100644 index 00000000..2e24b6ef Binary files /dev/null and b/cn/.gitbook/assets/image (286).png differ diff --git a/cn/.gitbook/assets/image (287).png b/cn/.gitbook/assets/image (287).png new file mode 100644 index 00000000..9ed28b43 Binary files /dev/null and b/cn/.gitbook/assets/image (287).png differ diff --git a/cn/.gitbook/assets/image (288).png b/cn/.gitbook/assets/image (288).png new file mode 100644 index 00000000..b44a6999 Binary files /dev/null and b/cn/.gitbook/assets/image (288).png differ diff --git a/cn/.gitbook/assets/image (289).png b/cn/.gitbook/assets/image (289).png new file mode 100644 index 00000000..3145a05e Binary files /dev/null and b/cn/.gitbook/assets/image (289).png differ diff --git a/cn/.gitbook/assets/image (29).png b/cn/.gitbook/assets/image (29).png new file mode 100644 index 00000000..9e7ddff4 Binary files /dev/null and b/cn/.gitbook/assets/image (29).png differ diff --git a/cn/.gitbook/assets/image (290).png b/cn/.gitbook/assets/image (290).png new file mode 100644 index 00000000..c64d812e Binary files /dev/null and b/cn/.gitbook/assets/image (290).png differ diff --git a/cn/.gitbook/assets/image (291).png b/cn/.gitbook/assets/image (291).png new file mode 100644 index 00000000..a5172bac Binary files /dev/null and b/cn/.gitbook/assets/image (291).png differ diff --git a/cn/.gitbook/assets/image (292).png b/cn/.gitbook/assets/image (292).png new file mode 100644 index 00000000..de66549b Binary files /dev/null and b/cn/.gitbook/assets/image (292).png differ diff --git a/cn/.gitbook/assets/image (293).png b/cn/.gitbook/assets/image (293).png new file mode 100644 index 00000000..3e05a94b Binary files /dev/null and b/cn/.gitbook/assets/image (293).png differ diff --git a/cn/.gitbook/assets/image (294).png b/cn/.gitbook/assets/image (294).png new file mode 100644 index 00000000..b3c75245 Binary files /dev/null and b/cn/.gitbook/assets/image (294).png differ diff --git a/cn/.gitbook/assets/image (295).png b/cn/.gitbook/assets/image (295).png new file mode 100644 index 00000000..bd40d2ea Binary files /dev/null and b/cn/.gitbook/assets/image (295).png differ diff --git a/cn/.gitbook/assets/image (296).png b/cn/.gitbook/assets/image (296).png new file mode 100644 index 00000000..feb1e71a Binary files /dev/null and b/cn/.gitbook/assets/image (296).png differ diff --git a/cn/.gitbook/assets/image (297).png b/cn/.gitbook/assets/image (297).png new file mode 100644 index 00000000..f02ffafa Binary files /dev/null and b/cn/.gitbook/assets/image (297).png differ diff --git a/cn/.gitbook/assets/image (298).png b/cn/.gitbook/assets/image (298).png new file mode 100644 index 00000000..3b4df9ad Binary files /dev/null and b/cn/.gitbook/assets/image (298).png differ diff --git a/cn/.gitbook/assets/image (299).png b/cn/.gitbook/assets/image (299).png new file mode 100644 index 00000000..9c6a156d Binary files /dev/null and b/cn/.gitbook/assets/image (299).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..d3bdadc0 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..8aac93ff Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..faa43441 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..b1ae287b Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..7c8b4107 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..95fc122a Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..02226006 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..ff4b32e5 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..dd3ab103 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..e215cc1f Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..6b190a07 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..31b162f2 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..cd73ca2a Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..27f2db43 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..625903f2 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..61bc4530 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..429682af Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..fead7383 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..03663655 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..f303c3dc Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..1e4bde69 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..c4d5738f Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..7433bbac Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..82a27cc7 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..2c72824b Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (1).png new file mode 100644 index 00000000..9ae78a3f Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..1d0e3797 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (1) (2).png new file mode 100644 index 00000000..09dafdad Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (1).png new file mode 100644 index 00000000..f20d76bb Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (3) (1) (1) (2) (1).png new file mode 100644 index 00000000..6dbc792d Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1) (2).png b/cn/.gitbook/assets/image (3) (1) (1) (2).png new file mode 100644 index 00000000..1c7ee1dd Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (1) (1).png b/cn/.gitbook/assets/image (3) (1) (1).png new file mode 100644 index 00000000..d975a7a2 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (1).png b/cn/.gitbook/assets/image (3) (1).png new file mode 100644 index 00000000..c46f0eea Binary files /dev/null and b/cn/.gitbook/assets/image (3) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (2).png b/cn/.gitbook/assets/image (3) (2).png new file mode 100644 index 00000000..245724ff Binary files /dev/null and b/cn/.gitbook/assets/image (3) (2).png differ diff --git a/cn/.gitbook/assets/image (3) (3) (1) (1).png b/cn/.gitbook/assets/image (3) (3) (1) (1).png new file mode 100644 index 00000000..8fba76d4 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (3) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (3) (1).png b/cn/.gitbook/assets/image (3) (3) (1).png new file mode 100644 index 00000000..05ee968d Binary files /dev/null and b/cn/.gitbook/assets/image (3) (3) (1).png differ diff --git a/cn/.gitbook/assets/image (3) (3).png b/cn/.gitbook/assets/image (3) (3).png new file mode 100644 index 00000000..23d23a73 Binary files /dev/null and b/cn/.gitbook/assets/image (3) (3).png differ diff --git a/cn/.gitbook/assets/image (3).png b/cn/.gitbook/assets/image (3).png new file mode 100644 index 00000000..0c783233 Binary files /dev/null and b/cn/.gitbook/assets/image (3).png differ diff --git a/cn/.gitbook/assets/image (30) (1).png b/cn/.gitbook/assets/image (30) (1).png new file mode 100644 index 00000000..c6eed90f Binary files /dev/null and b/cn/.gitbook/assets/image (30) (1).png differ diff --git a/cn/.gitbook/assets/image (30).png b/cn/.gitbook/assets/image (30).png new file mode 100644 index 00000000..8a874854 Binary files /dev/null and b/cn/.gitbook/assets/image (30).png differ diff --git a/cn/.gitbook/assets/image (300).png b/cn/.gitbook/assets/image (300).png new file mode 100644 index 00000000..7efb9fac Binary files /dev/null and b/cn/.gitbook/assets/image (300).png differ diff --git a/cn/.gitbook/assets/image (301).png b/cn/.gitbook/assets/image (301).png new file mode 100644 index 00000000..f10e797d Binary files /dev/null and b/cn/.gitbook/assets/image (301).png differ diff --git a/cn/.gitbook/assets/image (302).png b/cn/.gitbook/assets/image (302).png new file mode 100644 index 00000000..2b50a563 Binary files /dev/null and b/cn/.gitbook/assets/image (302).png differ diff --git a/cn/.gitbook/assets/image (303).png b/cn/.gitbook/assets/image (303).png new file mode 100644 index 00000000..908ade0f Binary files /dev/null and b/cn/.gitbook/assets/image (303).png differ diff --git a/cn/.gitbook/assets/image (304).png b/cn/.gitbook/assets/image (304).png new file mode 100644 index 00000000..c7cfe6fc Binary files /dev/null and b/cn/.gitbook/assets/image (304).png differ diff --git a/cn/.gitbook/assets/image (305).png b/cn/.gitbook/assets/image (305).png new file mode 100644 index 00000000..19cd6739 Binary files /dev/null and b/cn/.gitbook/assets/image (305).png differ diff --git a/cn/.gitbook/assets/image (306).png b/cn/.gitbook/assets/image (306).png new file mode 100644 index 00000000..e5b6ebcf Binary files /dev/null and b/cn/.gitbook/assets/image (306).png differ diff --git a/cn/.gitbook/assets/image (307).png b/cn/.gitbook/assets/image (307).png new file mode 100644 index 00000000..28a07fb8 Binary files /dev/null and b/cn/.gitbook/assets/image (307).png differ diff --git a/cn/.gitbook/assets/image (308).png b/cn/.gitbook/assets/image (308).png new file mode 100644 index 00000000..ff84f388 Binary files /dev/null and b/cn/.gitbook/assets/image (308).png differ diff --git a/cn/.gitbook/assets/image (309).png b/cn/.gitbook/assets/image (309).png new file mode 100644 index 00000000..b32ac009 Binary files /dev/null and b/cn/.gitbook/assets/image (309).png differ diff --git a/cn/.gitbook/assets/image (31).png b/cn/.gitbook/assets/image (31).png new file mode 100644 index 00000000..7470f0c2 Binary files /dev/null and b/cn/.gitbook/assets/image (31).png differ diff --git a/cn/.gitbook/assets/image (310).png b/cn/.gitbook/assets/image (310).png new file mode 100644 index 00000000..34104e29 Binary files /dev/null and b/cn/.gitbook/assets/image (310).png differ diff --git a/cn/.gitbook/assets/image (311).png b/cn/.gitbook/assets/image (311).png new file mode 100644 index 00000000..ff3d6da3 Binary files /dev/null and b/cn/.gitbook/assets/image (311).png differ diff --git a/cn/.gitbook/assets/image (312).png b/cn/.gitbook/assets/image (312).png new file mode 100644 index 00000000..adf91df9 Binary files /dev/null and b/cn/.gitbook/assets/image (312).png differ diff --git a/cn/.gitbook/assets/image (313).png b/cn/.gitbook/assets/image (313).png new file mode 100644 index 00000000..13560ca1 Binary files /dev/null and b/cn/.gitbook/assets/image (313).png differ diff --git a/cn/.gitbook/assets/image (314).png b/cn/.gitbook/assets/image (314).png new file mode 100644 index 00000000..95b21316 Binary files /dev/null and b/cn/.gitbook/assets/image (314).png differ diff --git a/cn/.gitbook/assets/image (315).png b/cn/.gitbook/assets/image (315).png new file mode 100644 index 00000000..99cede57 Binary files /dev/null and b/cn/.gitbook/assets/image (315).png differ diff --git a/cn/.gitbook/assets/image (316).png b/cn/.gitbook/assets/image (316).png new file mode 100644 index 00000000..84b81c8f Binary files /dev/null and b/cn/.gitbook/assets/image (316).png differ diff --git a/cn/.gitbook/assets/image (317).png b/cn/.gitbook/assets/image (317).png new file mode 100644 index 00000000..3c6b86de Binary files /dev/null and b/cn/.gitbook/assets/image (317).png differ diff --git a/cn/.gitbook/assets/image (318).png b/cn/.gitbook/assets/image (318).png new file mode 100644 index 00000000..9ae53e59 Binary files /dev/null and b/cn/.gitbook/assets/image (318).png differ diff --git a/cn/.gitbook/assets/image (319).png b/cn/.gitbook/assets/image (319).png new file mode 100644 index 00000000..adf41819 Binary files /dev/null and b/cn/.gitbook/assets/image (319).png differ diff --git a/cn/.gitbook/assets/image (32).png b/cn/.gitbook/assets/image (32).png new file mode 100644 index 00000000..840d2d2c Binary files /dev/null and b/cn/.gitbook/assets/image (32).png differ diff --git a/cn/.gitbook/assets/image (320).png b/cn/.gitbook/assets/image (320).png new file mode 100644 index 00000000..44756a08 Binary files /dev/null and b/cn/.gitbook/assets/image (320).png differ diff --git a/cn/.gitbook/assets/image (321).png b/cn/.gitbook/assets/image (321).png new file mode 100644 index 00000000..cdcc8d35 Binary files /dev/null and b/cn/.gitbook/assets/image (321).png differ diff --git a/cn/.gitbook/assets/image (322).png b/cn/.gitbook/assets/image (322).png new file mode 100644 index 00000000..ea0e075c Binary files /dev/null and b/cn/.gitbook/assets/image (322).png differ diff --git a/cn/.gitbook/assets/image (323).png b/cn/.gitbook/assets/image (323).png new file mode 100644 index 00000000..d04408b0 Binary files /dev/null and b/cn/.gitbook/assets/image (323).png differ diff --git a/cn/.gitbook/assets/image (324).png b/cn/.gitbook/assets/image (324).png new file mode 100644 index 00000000..a7b2c307 Binary files /dev/null and b/cn/.gitbook/assets/image (324).png differ diff --git a/cn/.gitbook/assets/image (325).png b/cn/.gitbook/assets/image (325).png new file mode 100644 index 00000000..051e1d4f Binary files /dev/null and b/cn/.gitbook/assets/image (325).png differ diff --git a/cn/.gitbook/assets/image (326).png b/cn/.gitbook/assets/image (326).png new file mode 100644 index 00000000..727bac73 Binary files /dev/null and b/cn/.gitbook/assets/image (326).png differ diff --git a/cn/.gitbook/assets/image (327).png b/cn/.gitbook/assets/image (327).png new file mode 100644 index 00000000..ec5ed9b8 Binary files /dev/null and b/cn/.gitbook/assets/image (327).png differ diff --git a/cn/.gitbook/assets/image (328).png b/cn/.gitbook/assets/image (328).png new file mode 100644 index 00000000..eb7052a4 Binary files /dev/null and b/cn/.gitbook/assets/image (328).png differ diff --git a/cn/.gitbook/assets/image (329).png b/cn/.gitbook/assets/image (329).png new file mode 100644 index 00000000..c593d5b8 Binary files /dev/null and b/cn/.gitbook/assets/image (329).png differ diff --git a/cn/.gitbook/assets/image (33).png b/cn/.gitbook/assets/image (33).png new file mode 100644 index 00000000..6e7bc1d4 Binary files /dev/null and b/cn/.gitbook/assets/image (33).png differ diff --git a/cn/.gitbook/assets/image (330).png b/cn/.gitbook/assets/image (330).png new file mode 100644 index 00000000..02ef696d Binary files /dev/null and b/cn/.gitbook/assets/image (330).png differ diff --git a/cn/.gitbook/assets/image (331).png b/cn/.gitbook/assets/image (331).png new file mode 100644 index 00000000..3da18717 Binary files /dev/null and b/cn/.gitbook/assets/image (331).png differ diff --git a/cn/.gitbook/assets/image (332).png b/cn/.gitbook/assets/image (332).png new file mode 100644 index 00000000..1b8da3c6 Binary files /dev/null and b/cn/.gitbook/assets/image (332).png differ diff --git a/cn/.gitbook/assets/image (333).png b/cn/.gitbook/assets/image (333).png new file mode 100644 index 00000000..d33634ce Binary files /dev/null and b/cn/.gitbook/assets/image (333).png differ diff --git a/cn/.gitbook/assets/image (334).png b/cn/.gitbook/assets/image (334).png new file mode 100644 index 00000000..c974fd73 Binary files /dev/null and b/cn/.gitbook/assets/image (334).png differ diff --git a/cn/.gitbook/assets/image (335).png b/cn/.gitbook/assets/image (335).png new file mode 100644 index 00000000..3c1000d5 Binary files /dev/null and b/cn/.gitbook/assets/image (335).png differ diff --git a/cn/.gitbook/assets/image (336).png b/cn/.gitbook/assets/image (336).png new file mode 100644 index 00000000..1364c9fa Binary files /dev/null and b/cn/.gitbook/assets/image (336).png differ diff --git a/cn/.gitbook/assets/image (337).png b/cn/.gitbook/assets/image (337).png new file mode 100644 index 00000000..8d085117 Binary files /dev/null and b/cn/.gitbook/assets/image (337).png differ diff --git a/cn/.gitbook/assets/image (338).png b/cn/.gitbook/assets/image (338).png new file mode 100644 index 00000000..5200cf5d Binary files /dev/null and b/cn/.gitbook/assets/image (338).png differ diff --git a/cn/.gitbook/assets/image (339).png b/cn/.gitbook/assets/image (339).png new file mode 100644 index 00000000..65de86f2 Binary files /dev/null and b/cn/.gitbook/assets/image (339).png differ diff --git a/cn/.gitbook/assets/image (34).png b/cn/.gitbook/assets/image (34).png new file mode 100644 index 00000000..b433207a Binary files /dev/null and b/cn/.gitbook/assets/image (34).png differ diff --git a/cn/.gitbook/assets/image (340).png b/cn/.gitbook/assets/image (340).png new file mode 100644 index 00000000..e2983f66 Binary files /dev/null and b/cn/.gitbook/assets/image (340).png differ diff --git a/cn/.gitbook/assets/image (341).png b/cn/.gitbook/assets/image (341).png new file mode 100644 index 00000000..3b13db68 Binary files /dev/null and b/cn/.gitbook/assets/image (341).png differ diff --git a/cn/.gitbook/assets/image (342).png b/cn/.gitbook/assets/image (342).png new file mode 100644 index 00000000..9ecdb66d Binary files /dev/null and b/cn/.gitbook/assets/image (342).png differ diff --git a/cn/.gitbook/assets/image (343).png b/cn/.gitbook/assets/image (343).png new file mode 100644 index 00000000..9ecdb66d Binary files /dev/null and b/cn/.gitbook/assets/image (343).png differ diff --git a/cn/.gitbook/assets/image (344).png b/cn/.gitbook/assets/image (344).png new file mode 100644 index 00000000..9ecdb66d Binary files /dev/null and b/cn/.gitbook/assets/image (344).png differ diff --git a/cn/.gitbook/assets/image (345).png b/cn/.gitbook/assets/image (345).png new file mode 100644 index 00000000..456badbe Binary files /dev/null and b/cn/.gitbook/assets/image (345).png differ diff --git a/cn/.gitbook/assets/image (346).png b/cn/.gitbook/assets/image (346).png new file mode 100644 index 00000000..38f897a0 Binary files /dev/null and b/cn/.gitbook/assets/image (346).png differ diff --git a/cn/.gitbook/assets/image (347).png b/cn/.gitbook/assets/image (347).png new file mode 100644 index 00000000..0f82ba2f Binary files /dev/null and b/cn/.gitbook/assets/image (347).png differ diff --git a/cn/.gitbook/assets/image (348).png b/cn/.gitbook/assets/image (348).png new file mode 100644 index 00000000..d9d38119 Binary files /dev/null and b/cn/.gitbook/assets/image (348).png differ diff --git a/cn/.gitbook/assets/image (349).png b/cn/.gitbook/assets/image (349).png new file mode 100644 index 00000000..a05bdac6 Binary files /dev/null and b/cn/.gitbook/assets/image (349).png differ diff --git a/cn/.gitbook/assets/image (35).png b/cn/.gitbook/assets/image (35).png new file mode 100644 index 00000000..76fc4d4f Binary files /dev/null and b/cn/.gitbook/assets/image (35).png differ diff --git a/cn/.gitbook/assets/image (36) (1).png b/cn/.gitbook/assets/image (36) (1).png new file mode 100644 index 00000000..08d7ca74 Binary files /dev/null and b/cn/.gitbook/assets/image (36) (1).png differ diff --git a/cn/.gitbook/assets/image (36).png b/cn/.gitbook/assets/image (36).png new file mode 100644 index 00000000..6b154378 Binary files /dev/null and b/cn/.gitbook/assets/image (36).png differ diff --git a/cn/.gitbook/assets/image (37).png b/cn/.gitbook/assets/image (37).png new file mode 100644 index 00000000..b08c4ddc Binary files /dev/null and b/cn/.gitbook/assets/image (37).png differ diff --git a/cn/.gitbook/assets/image (38) (1).png b/cn/.gitbook/assets/image (38) (1).png new file mode 100644 index 00000000..32c0f035 Binary files /dev/null and b/cn/.gitbook/assets/image (38) (1).png differ diff --git a/cn/.gitbook/assets/image (38).png b/cn/.gitbook/assets/image (38).png new file mode 100644 index 00000000..31db2749 Binary files /dev/null and b/cn/.gitbook/assets/image (38).png differ diff --git a/cn/.gitbook/assets/image (39).png b/cn/.gitbook/assets/image (39).png new file mode 100644 index 00000000..2400c5dc Binary files /dev/null and b/cn/.gitbook/assets/image (39).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..82fb7ff9 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..ea118f46 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..19dfb487 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..ba25dada Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..3578f9e1 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..f38c3016 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..f6ccab6a Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..6bc3f51c Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..82d8ba36 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..cc1e6972 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..920b8945 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..3092272d Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c0edca89 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..8db0e191 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..1ab0212d Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..bada2fe6 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..c3893a5a Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..2d1a0c10 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..5ce488ab Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..9d857bcd Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..370d859c Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..6baf30b8 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (3).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (3).png new file mode 100644 index 00000000..05c11c7d Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1) (3).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1) (1).png new file mode 100644 index 00000000..98071c51 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1) (1).png new file mode 100644 index 00000000..c1bb3365 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (1).png new file mode 100644 index 00000000..75b90e93 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (4) (1) (2) (1) (1).png new file mode 100644 index 00000000..5d0c0141 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (2) (1).png b/cn/.gitbook/assets/image (4) (1) (2) (1).png new file mode 100644 index 00000000..54e7a64e Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (2).png b/cn/.gitbook/assets/image (4) (1) (2).png new file mode 100644 index 00000000..f128d34e Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (1) (3).png b/cn/.gitbook/assets/image (4) (1) (3).png new file mode 100644 index 00000000..bd572796 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1) (3).png differ diff --git a/cn/.gitbook/assets/image (4) (1).png b/cn/.gitbook/assets/image (4) (1).png new file mode 100644 index 00000000..c0901edb Binary files /dev/null and b/cn/.gitbook/assets/image (4) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (2).png b/cn/.gitbook/assets/image (4) (2).png new file mode 100644 index 00000000..87f7d80f Binary files /dev/null and b/cn/.gitbook/assets/image (4) (2).png differ diff --git a/cn/.gitbook/assets/image (4) (3) (1).png b/cn/.gitbook/assets/image (4) (3) (1).png new file mode 100644 index 00000000..d4aa4fe6 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (3) (1).png differ diff --git a/cn/.gitbook/assets/image (4) (3).png b/cn/.gitbook/assets/image (4) (3).png new file mode 100644 index 00000000..c8342008 Binary files /dev/null and b/cn/.gitbook/assets/image (4) (3).png differ diff --git a/cn/.gitbook/assets/image (4).png b/cn/.gitbook/assets/image (4).png new file mode 100644 index 00000000..010e4714 Binary files /dev/null and b/cn/.gitbook/assets/image (4).png differ diff --git a/cn/.gitbook/assets/image (40).png b/cn/.gitbook/assets/image (40).png new file mode 100644 index 00000000..a32cfba1 Binary files /dev/null and b/cn/.gitbook/assets/image (40).png differ diff --git a/cn/.gitbook/assets/image (41).png b/cn/.gitbook/assets/image (41).png new file mode 100644 index 00000000..3c6a0e8f Binary files /dev/null and b/cn/.gitbook/assets/image (41).png differ diff --git a/cn/.gitbook/assets/image (42).png b/cn/.gitbook/assets/image (42).png new file mode 100644 index 00000000..f3bacffc Binary files /dev/null and b/cn/.gitbook/assets/image (42).png differ diff --git a/cn/.gitbook/assets/image (43).png b/cn/.gitbook/assets/image (43).png new file mode 100644 index 00000000..53140bf6 Binary files /dev/null and b/cn/.gitbook/assets/image (43).png differ diff --git a/cn/.gitbook/assets/image (44).png b/cn/.gitbook/assets/image (44).png new file mode 100644 index 00000000..37b86f5e Binary files /dev/null and b/cn/.gitbook/assets/image (44).png differ diff --git a/cn/.gitbook/assets/image (45).png b/cn/.gitbook/assets/image (45).png new file mode 100644 index 00000000..271be4f5 Binary files /dev/null and b/cn/.gitbook/assets/image (45).png differ diff --git a/cn/.gitbook/assets/image (46).png b/cn/.gitbook/assets/image (46).png new file mode 100644 index 00000000..a817d39d Binary files /dev/null and b/cn/.gitbook/assets/image (46).png differ diff --git a/cn/.gitbook/assets/image (47).png b/cn/.gitbook/assets/image (47).png new file mode 100644 index 00000000..98ee4c12 Binary files /dev/null and b/cn/.gitbook/assets/image (47).png differ diff --git a/cn/.gitbook/assets/image (48).png b/cn/.gitbook/assets/image (48).png new file mode 100644 index 00000000..4f264640 Binary files /dev/null and b/cn/.gitbook/assets/image (48).png differ diff --git a/cn/.gitbook/assets/image (49).png b/cn/.gitbook/assets/image (49).png new file mode 100644 index 00000000..c57ce0db Binary files /dev/null and b/cn/.gitbook/assets/image (49).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..8b3f22d1 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..6798fc57 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png new file mode 100644 index 00000000..e58fad39 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..2e754028 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..f1c0f754 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..ac1b4de9 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..a99621b3 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..35e23324 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..7cb303e7 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..f38c3016 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..31ba94ab Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..9d9da9cb Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..b07c2549 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..ac8d8708 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..dc697fd3 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..ae46289c Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..82a62d3c Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..fc10c2c7 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..63a4b868 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1) (1).png new file mode 100644 index 00000000..9d857bcd Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1) (1).png new file mode 100644 index 00000000..c62ffad2 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (1) (2).png new file mode 100644 index 00000000..ff87b170 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (1).png b/cn/.gitbook/assets/image (5) (1) (1).png new file mode 100644 index 00000000..51329fec Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (1) (2).png b/cn/.gitbook/assets/image (5) (1) (2).png new file mode 100644 index 00000000..5cf127ec Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (1).png b/cn/.gitbook/assets/image (5) (1).png new file mode 100644 index 00000000..8b69ddc3 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (1).png differ diff --git a/cn/.gitbook/assets/image (5) (2).png b/cn/.gitbook/assets/image (5) (2).png new file mode 100644 index 00000000..85a77ebd Binary files /dev/null and b/cn/.gitbook/assets/image (5) (2).png differ diff --git a/cn/.gitbook/assets/image (5) (3).png b/cn/.gitbook/assets/image (5) (3).png new file mode 100644 index 00000000..4b6f3caf Binary files /dev/null and b/cn/.gitbook/assets/image (5) (3).png differ diff --git a/cn/.gitbook/assets/image (5) (4).png b/cn/.gitbook/assets/image (5) (4).png new file mode 100644 index 00000000..c2fe2124 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (4).png differ diff --git a/cn/.gitbook/assets/image (5) (5).png b/cn/.gitbook/assets/image (5) (5).png new file mode 100644 index 00000000..a67be3c7 Binary files /dev/null and b/cn/.gitbook/assets/image (5) (5).png differ diff --git a/cn/.gitbook/assets/image (5) (6).png b/cn/.gitbook/assets/image (5) (6).png new file mode 100644 index 00000000..8cae20db Binary files /dev/null and b/cn/.gitbook/assets/image (5) (6).png differ diff --git a/cn/.gitbook/assets/image (5).png b/cn/.gitbook/assets/image (5).png new file mode 100644 index 00000000..42dfa78e Binary files /dev/null and b/cn/.gitbook/assets/image (5).png differ diff --git a/cn/.gitbook/assets/image (50).png b/cn/.gitbook/assets/image (50).png new file mode 100644 index 00000000..ee42d003 Binary files /dev/null and b/cn/.gitbook/assets/image (50).png differ diff --git a/cn/.gitbook/assets/image (51).png b/cn/.gitbook/assets/image (51).png new file mode 100644 index 00000000..8ab2351e Binary files /dev/null and b/cn/.gitbook/assets/image (51).png differ diff --git a/cn/.gitbook/assets/image (52).png b/cn/.gitbook/assets/image (52).png new file mode 100644 index 00000000..4cb1b4a9 Binary files /dev/null and b/cn/.gitbook/assets/image (52).png differ diff --git a/cn/.gitbook/assets/image (53).png b/cn/.gitbook/assets/image (53).png new file mode 100644 index 00000000..98f95c27 Binary files /dev/null and b/cn/.gitbook/assets/image (53).png differ diff --git a/cn/.gitbook/assets/image (54).png b/cn/.gitbook/assets/image (54).png new file mode 100644 index 00000000..73793197 Binary files /dev/null and b/cn/.gitbook/assets/image (54).png differ diff --git a/cn/.gitbook/assets/image (55).png b/cn/.gitbook/assets/image (55).png new file mode 100644 index 00000000..9633de50 Binary files /dev/null and b/cn/.gitbook/assets/image (55).png differ diff --git a/cn/.gitbook/assets/image (56).png b/cn/.gitbook/assets/image (56).png new file mode 100644 index 00000000..2d47d097 Binary files /dev/null and b/cn/.gitbook/assets/image (56).png differ diff --git a/cn/.gitbook/assets/image (57).png b/cn/.gitbook/assets/image (57).png new file mode 100644 index 00000000..e4b4c3f9 Binary files /dev/null and b/cn/.gitbook/assets/image (57).png differ diff --git a/cn/.gitbook/assets/image (58).png b/cn/.gitbook/assets/image (58).png new file mode 100644 index 00000000..383cb564 Binary files /dev/null and b/cn/.gitbook/assets/image (58).png differ diff --git a/cn/.gitbook/assets/image (59).png b/cn/.gitbook/assets/image (59).png new file mode 100644 index 00000000..4e8dd10a Binary files /dev/null and b/cn/.gitbook/assets/image (59).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..6730b1b9 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..568fbe6b Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c8568fc8 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..ba6f5153 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..ef6d8157 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..52dbd74e Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..9c59d546 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (2).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (2).png new file mode 100644 index 00000000..631f5d69 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2) (2).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..95cd6e1d Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..cdfbe504 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..619f2a15 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..ae521cdd Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..c8b0b3f3 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (3).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (3).png new file mode 100644 index 00000000..e7a404eb Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1) (3).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (1).png new file mode 100644 index 00000000..8688b58c Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (6) (1) (1) (1) (2).png new file mode 100644 index 00000000..d2b2b36b Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1) (1).png new file mode 100644 index 00000000..4a205bdb Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (1).png b/cn/.gitbook/assets/image (6) (1) (1).png new file mode 100644 index 00000000..8650e278 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (1) (2).png b/cn/.gitbook/assets/image (6) (1) (2).png new file mode 100644 index 00000000..a9a62b0c Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (6) (1).png b/cn/.gitbook/assets/image (6) (1).png new file mode 100644 index 00000000..efaeecc8 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (1).png differ diff --git a/cn/.gitbook/assets/image (6) (2).png b/cn/.gitbook/assets/image (6) (2).png new file mode 100644 index 00000000..d7617d21 Binary files /dev/null and b/cn/.gitbook/assets/image (6) (2).png differ diff --git a/cn/.gitbook/assets/image (6) (3).png b/cn/.gitbook/assets/image (6) (3).png new file mode 100644 index 00000000..cb24c93d Binary files /dev/null and b/cn/.gitbook/assets/image (6) (3).png differ diff --git a/cn/.gitbook/assets/image (6).png b/cn/.gitbook/assets/image (6).png new file mode 100644 index 00000000..358b54b1 Binary files /dev/null and b/cn/.gitbook/assets/image (6).png differ diff --git a/cn/.gitbook/assets/image (60).png b/cn/.gitbook/assets/image (60).png new file mode 100644 index 00000000..b099b007 Binary files /dev/null and b/cn/.gitbook/assets/image (60).png differ diff --git a/cn/.gitbook/assets/image (61).png b/cn/.gitbook/assets/image (61).png new file mode 100644 index 00000000..79ffbded Binary files /dev/null and b/cn/.gitbook/assets/image (61).png differ diff --git a/cn/.gitbook/assets/image (62).png b/cn/.gitbook/assets/image (62).png new file mode 100644 index 00000000..97b8fa60 Binary files /dev/null and b/cn/.gitbook/assets/image (62).png differ diff --git a/cn/.gitbook/assets/image (63).png b/cn/.gitbook/assets/image (63).png new file mode 100644 index 00000000..7bb5754a Binary files /dev/null and b/cn/.gitbook/assets/image (63).png differ diff --git a/cn/.gitbook/assets/image (64).png b/cn/.gitbook/assets/image (64).png new file mode 100644 index 00000000..8782e07d Binary files /dev/null and b/cn/.gitbook/assets/image (64).png differ diff --git a/cn/.gitbook/assets/image (65).png b/cn/.gitbook/assets/image (65).png new file mode 100644 index 00000000..6d2342f8 Binary files /dev/null and b/cn/.gitbook/assets/image (65).png differ diff --git a/cn/.gitbook/assets/image (66).png b/cn/.gitbook/assets/image (66).png new file mode 100644 index 00000000..675182ef Binary files /dev/null and b/cn/.gitbook/assets/image (66).png differ diff --git a/cn/.gitbook/assets/image (67).png b/cn/.gitbook/assets/image (67).png new file mode 100644 index 00000000..049b1740 Binary files /dev/null and b/cn/.gitbook/assets/image (67).png differ diff --git a/cn/.gitbook/assets/image (68).png b/cn/.gitbook/assets/image (68).png new file mode 100644 index 00000000..b494b784 Binary files /dev/null and b/cn/.gitbook/assets/image (68).png differ diff --git a/cn/.gitbook/assets/image (69).png b/cn/.gitbook/assets/image (69).png new file mode 100644 index 00000000..cb7a995d Binary files /dev/null and b/cn/.gitbook/assets/image (69).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..5e416f0e Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..a911824f Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..4c374bd1 Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..f3d7516a Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..333726dc Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..cdfbe504 Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..98d15ed2 Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..3af481de Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..ec7c36fe Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (1).png new file mode 100644 index 00000000..2d9376e5 Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (7) (1) (1) (1) (2).png new file mode 100644 index 00000000..730d7732 Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1) (1).png new file mode 100644 index 00000000..040b67cd Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (1).png b/cn/.gitbook/assets/image (7) (1) (1).png new file mode 100644 index 00000000..95f6aa3f Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (1) (2).png b/cn/.gitbook/assets/image (7) (1) (2).png new file mode 100644 index 00000000..c1a9d1ba Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (7) (1).png b/cn/.gitbook/assets/image (7) (1).png new file mode 100644 index 00000000..6b39bacd Binary files /dev/null and b/cn/.gitbook/assets/image (7) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (2) (1).png b/cn/.gitbook/assets/image (7) (2) (1).png new file mode 100644 index 00000000..c0cb1668 Binary files /dev/null and b/cn/.gitbook/assets/image (7) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (7) (2) (2).png b/cn/.gitbook/assets/image (7) (2) (2).png new file mode 100644 index 00000000..750a4dec Binary files /dev/null and b/cn/.gitbook/assets/image (7) (2) (2).png differ diff --git a/cn/.gitbook/assets/image (7) (2).png b/cn/.gitbook/assets/image (7) (2).png new file mode 100644 index 00000000..b2590f89 Binary files /dev/null and b/cn/.gitbook/assets/image (7) (2).png differ diff --git a/cn/.gitbook/assets/image (7).png b/cn/.gitbook/assets/image (7).png new file mode 100644 index 00000000..b9804240 Binary files /dev/null and b/cn/.gitbook/assets/image (7).png differ diff --git a/cn/.gitbook/assets/image (70).png b/cn/.gitbook/assets/image (70).png new file mode 100644 index 00000000..a068612f Binary files /dev/null and b/cn/.gitbook/assets/image (70).png differ diff --git a/cn/.gitbook/assets/image (71).png b/cn/.gitbook/assets/image (71).png new file mode 100644 index 00000000..60465c5a Binary files /dev/null and b/cn/.gitbook/assets/image (71).png differ diff --git a/cn/.gitbook/assets/image (72).png b/cn/.gitbook/assets/image (72).png new file mode 100644 index 00000000..18e0650a Binary files /dev/null and b/cn/.gitbook/assets/image (72).png differ diff --git a/cn/.gitbook/assets/image (73).png b/cn/.gitbook/assets/image (73).png new file mode 100644 index 00000000..eb313caa Binary files /dev/null and b/cn/.gitbook/assets/image (73).png differ diff --git a/cn/.gitbook/assets/image (74).png b/cn/.gitbook/assets/image (74).png new file mode 100644 index 00000000..c4486f67 Binary files /dev/null and b/cn/.gitbook/assets/image (74).png differ diff --git a/cn/.gitbook/assets/image (75).png b/cn/.gitbook/assets/image (75).png new file mode 100644 index 00000000..89738bd0 Binary files /dev/null and b/cn/.gitbook/assets/image (75).png differ diff --git a/cn/.gitbook/assets/image (76).png b/cn/.gitbook/assets/image (76).png new file mode 100644 index 00000000..822b64c6 Binary files /dev/null and b/cn/.gitbook/assets/image (76).png differ diff --git a/cn/.gitbook/assets/image (77).png b/cn/.gitbook/assets/image (77).png new file mode 100644 index 00000000..96a4803b Binary files /dev/null and b/cn/.gitbook/assets/image (77).png differ diff --git a/cn/.gitbook/assets/image (78).png b/cn/.gitbook/assets/image (78).png new file mode 100644 index 00000000..b94f78c1 Binary files /dev/null and b/cn/.gitbook/assets/image (78).png differ diff --git a/cn/.gitbook/assets/image (79).png b/cn/.gitbook/assets/image (79).png new file mode 100644 index 00000000..d5a07c4d Binary files /dev/null and b/cn/.gitbook/assets/image (79).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..b2bf4e1d Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..56ff6078 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..108fccd8 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..c26dd6ec Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..2163a982 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..f4815f46 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..061fa98a Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..9f67744b Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..635f5bff Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..17c51cda Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..da09887a Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..72a2fbfb Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..f1a5558c Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (1).png new file mode 100644 index 00000000..820fa75f Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (8) (1) (1) (1) (2).png new file mode 100644 index 00000000..fc799e6a Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1) (1).png new file mode 100644 index 00000000..b95af4d0 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1) (1).png b/cn/.gitbook/assets/image (8) (1) (1).png new file mode 100644 index 00000000..d71d4bf4 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (1).png b/cn/.gitbook/assets/image (8) (1).png new file mode 100644 index 00000000..cb2296c0 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (2) (1) (1).png b/cn/.gitbook/assets/image (8) (2) (1) (1).png new file mode 100644 index 00000000..9721de0b Binary files /dev/null and b/cn/.gitbook/assets/image (8) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (2) (1).png b/cn/.gitbook/assets/image (8) (2) (1).png new file mode 100644 index 00000000..c715f651 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (8) (2).png b/cn/.gitbook/assets/image (8) (2).png new file mode 100644 index 00000000..d57c0b07 Binary files /dev/null and b/cn/.gitbook/assets/image (8) (2).png differ diff --git a/cn/.gitbook/assets/image (8).png b/cn/.gitbook/assets/image (8).png new file mode 100644 index 00000000..8c466dad Binary files /dev/null and b/cn/.gitbook/assets/image (8).png differ diff --git a/cn/.gitbook/assets/image (80).png b/cn/.gitbook/assets/image (80).png new file mode 100644 index 00000000..b01b0ca3 Binary files /dev/null and b/cn/.gitbook/assets/image (80).png differ diff --git a/cn/.gitbook/assets/image (81).png b/cn/.gitbook/assets/image (81).png new file mode 100644 index 00000000..54665a31 Binary files /dev/null and b/cn/.gitbook/assets/image (81).png differ diff --git a/cn/.gitbook/assets/image (82).png b/cn/.gitbook/assets/image (82).png new file mode 100644 index 00000000..c668dd18 Binary files /dev/null and b/cn/.gitbook/assets/image (82).png differ diff --git a/cn/.gitbook/assets/image (83).png b/cn/.gitbook/assets/image (83).png new file mode 100644 index 00000000..bbb0da47 Binary files /dev/null and b/cn/.gitbook/assets/image (83).png differ diff --git a/cn/.gitbook/assets/image (84).png b/cn/.gitbook/assets/image (84).png new file mode 100644 index 00000000..a7f2b684 Binary files /dev/null and b/cn/.gitbook/assets/image (84).png differ diff --git a/cn/.gitbook/assets/image (85).png b/cn/.gitbook/assets/image (85).png new file mode 100644 index 00000000..1e867fb8 Binary files /dev/null and b/cn/.gitbook/assets/image (85).png differ diff --git a/cn/.gitbook/assets/image (86).png b/cn/.gitbook/assets/image (86).png new file mode 100644 index 00000000..1fa4bdf9 Binary files /dev/null and b/cn/.gitbook/assets/image (86).png differ diff --git a/cn/.gitbook/assets/image (87).png b/cn/.gitbook/assets/image (87).png new file mode 100644 index 00000000..2f020cde Binary files /dev/null and b/cn/.gitbook/assets/image (87).png differ diff --git a/cn/.gitbook/assets/image (88).png b/cn/.gitbook/assets/image (88).png new file mode 100644 index 00000000..b2716d71 Binary files /dev/null and b/cn/.gitbook/assets/image (88).png differ diff --git a/cn/.gitbook/assets/image (89).png b/cn/.gitbook/assets/image (89).png new file mode 100644 index 00000000..dcb2d13e Binary files /dev/null and b/cn/.gitbook/assets/image (89).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..2a56c02c Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..439ae037 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..da16bd74 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..388b22a7 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..bc01445f Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1).png new file mode 100644 index 00000000..e403f932 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2) (1) (1).png new file mode 100644 index 00000000..6cf7ae39 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..1484e2b0 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2).png new file mode 100644 index 00000000..68b63505 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (3).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (3).png new file mode 100644 index 00000000..9b90b2a4 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1) (3).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (1).png new file mode 100644 index 00000000..e12e56ef Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (2) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (2) (1).png new file mode 100644 index 00000000..dc53fe76 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (2).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (2).png new file mode 100644 index 00000000..28393fd4 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (2).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1) (3).png b/cn/.gitbook/assets/image (9) (1) (1) (1) (3).png new file mode 100644 index 00000000..2643724f Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1) (3).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1) (1).png new file mode 100644 index 00000000..f4f59da1 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1) (1).png b/cn/.gitbook/assets/image (9) (1) (1).png new file mode 100644 index 00000000..701b82d1 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (1).png b/cn/.gitbook/assets/image (9) (1).png new file mode 100644 index 00000000..3e08d6f8 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (2) (1).png b/cn/.gitbook/assets/image (9) (2) (1).png new file mode 100644 index 00000000..2bc45dca Binary files /dev/null and b/cn/.gitbook/assets/image (9) (2) (1).png differ diff --git a/cn/.gitbook/assets/image (9) (2).png b/cn/.gitbook/assets/image (9) (2).png new file mode 100644 index 00000000..d660c992 Binary files /dev/null and b/cn/.gitbook/assets/image (9) (2).png differ diff --git a/cn/.gitbook/assets/image (9).png b/cn/.gitbook/assets/image (9).png new file mode 100644 index 00000000..68de06c9 Binary files /dev/null and b/cn/.gitbook/assets/image (9).png differ diff --git a/cn/.gitbook/assets/image (90).png b/cn/.gitbook/assets/image (90).png new file mode 100644 index 00000000..92235f44 Binary files /dev/null and b/cn/.gitbook/assets/image (90).png differ diff --git a/cn/.gitbook/assets/image (91).png b/cn/.gitbook/assets/image (91).png new file mode 100644 index 00000000..7c80698f Binary files /dev/null and b/cn/.gitbook/assets/image (91).png differ diff --git a/cn/.gitbook/assets/image (92).png b/cn/.gitbook/assets/image (92).png new file mode 100644 index 00000000..38b19459 Binary files /dev/null and b/cn/.gitbook/assets/image (92).png differ diff --git a/cn/.gitbook/assets/image (93).png b/cn/.gitbook/assets/image (93).png new file mode 100644 index 00000000..e6d72c4b Binary files /dev/null and b/cn/.gitbook/assets/image (93).png differ diff --git a/cn/.gitbook/assets/image (94).png b/cn/.gitbook/assets/image (94).png new file mode 100644 index 00000000..5c3e1805 Binary files /dev/null and b/cn/.gitbook/assets/image (94).png differ diff --git a/cn/.gitbook/assets/image (95) (1).png b/cn/.gitbook/assets/image (95) (1).png new file mode 100644 index 00000000..cdf7bcfa Binary files /dev/null and b/cn/.gitbook/assets/image (95) (1).png differ diff --git a/cn/.gitbook/assets/image (95).png b/cn/.gitbook/assets/image (95).png new file mode 100644 index 00000000..30c2d25c Binary files /dev/null and b/cn/.gitbook/assets/image (95).png differ diff --git a/cn/.gitbook/assets/image (96).png b/cn/.gitbook/assets/image (96).png new file mode 100644 index 00000000..431b030e Binary files /dev/null and b/cn/.gitbook/assets/image (96).png differ diff --git a/cn/.gitbook/assets/image (97).png b/cn/.gitbook/assets/image (97).png new file mode 100644 index 00000000..131ee883 Binary files /dev/null and b/cn/.gitbook/assets/image (97).png differ diff --git a/cn/.gitbook/assets/image (98).png b/cn/.gitbook/assets/image (98).png new file mode 100644 index 00000000..a7db7aac Binary files /dev/null and b/cn/.gitbook/assets/image (98).png differ diff --git a/cn/.gitbook/assets/image (99).png b/cn/.gitbook/assets/image (99).png new file mode 100644 index 00000000..0460f1bc Binary files /dev/null and b/cn/.gitbook/assets/image (99).png differ diff --git a/cn/.gitbook/assets/image.png b/cn/.gitbook/assets/image.png new file mode 100644 index 00000000..d0653c61 Binary files /dev/null and b/cn/.gitbook/assets/image.png differ diff --git a/cn/.gitbook/assets/image_airtable (1).png b/cn/.gitbook/assets/image_airtable (1).png new file mode 100644 index 00000000..f32ff749 Binary files /dev/null and b/cn/.gitbook/assets/image_airtable (1).png differ diff --git a/cn/.gitbook/assets/image_airtable.png b/cn/.gitbook/assets/image_airtable.png new file mode 100644 index 00000000..f32ff749 Binary files /dev/null and b/cn/.gitbook/assets/image_airtable.png differ diff --git a/cn/.gitbook/assets/image_csv (1).png b/cn/.gitbook/assets/image_csv (1).png new file mode 100644 index 00000000..2815c268 Binary files /dev/null and b/cn/.gitbook/assets/image_csv (1).png differ diff --git a/cn/.gitbook/assets/image_custom-loader (1).png b/cn/.gitbook/assets/image_custom-loader (1).png new file mode 100644 index 00000000..4a2cfcf7 Binary files /dev/null and b/cn/.gitbook/assets/image_custom-loader (1).png differ diff --git a/cn/.gitbook/assets/image_openAI (1).png b/cn/.gitbook/assets/image_openAI (1).png new file mode 100644 index 00000000..9ad11174 Binary files /dev/null and b/cn/.gitbook/assets/image_openAI (1).png differ diff --git a/cn/.gitbook/assets/longGIF.gif b/cn/.gitbook/assets/longGIF.gif new file mode 100644 index 00000000..0e51d24f Binary files /dev/null and b/cn/.gitbook/assets/longGIF.gif differ diff --git a/cn/.gitbook/assets/mas04.png b/cn/.gitbook/assets/mas04.png new file mode 100644 index 00000000..718db44c Binary files /dev/null and b/cn/.gitbook/assets/mas04.png differ diff --git a/cn/.gitbook/assets/mas05.png b/cn/.gitbook/assets/mas05.png new file mode 100644 index 00000000..6094f848 Binary files /dev/null and b/cn/.gitbook/assets/mas05.png differ diff --git a/cn/.gitbook/assets/mas06.png b/cn/.gitbook/assets/mas06.png new file mode 100644 index 00000000..eeb86668 Binary files /dev/null and b/cn/.gitbook/assets/mas06.png differ diff --git a/cn/.gitbook/assets/mas07.png b/cn/.gitbook/assets/mas07.png new file mode 100644 index 00000000..697eb048 Binary files /dev/null and b/cn/.gitbook/assets/mas07.png differ diff --git a/cn/.gitbook/assets/mas08.png b/cn/.gitbook/assets/mas08.png new file mode 100644 index 00000000..1fee1997 Binary files /dev/null and b/cn/.gitbook/assets/mas08.png differ diff --git a/cn/.gitbook/assets/migration-guide/cloud-migration/3.png b/cn/.gitbook/assets/migration-guide/cloud-migration/3.png new file mode 100644 index 00000000..451ad970 Binary files /dev/null and b/cn/.gitbook/assets/migration-guide/cloud-migration/3.png differ diff --git a/cn/.gitbook/assets/mistral_ai/1.png b/cn/.gitbook/assets/mistral_ai/1.png new file mode 100644 index 00000000..0f7052a3 Binary files /dev/null and b/cn/.gitbook/assets/mistral_ai/1.png differ diff --git a/cn/.gitbook/assets/mistral_ai/2.png b/cn/.gitbook/assets/mistral_ai/2.png new file mode 100644 index 00000000..da08971f Binary files /dev/null and b/cn/.gitbook/assets/mistral_ai/2.png differ diff --git a/cn/.gitbook/assets/mistral_ai/3.png b/cn/.gitbook/assets/mistral_ai/3.png new file mode 100644 index 00000000..cab2f1ff Binary files /dev/null and b/cn/.gitbook/assets/mistral_ai/3.png differ diff --git a/cn/.gitbook/assets/mistral_ai/4.png b/cn/.gitbook/assets/mistral_ai/4.png new file mode 100644 index 00000000..64606413 Binary files /dev/null and b/cn/.gitbook/assets/mistral_ai/4.png differ diff --git a/cn/.gitbook/assets/multi-agent-diagram.svg b/cn/.gitbook/assets/multi-agent-diagram.svg new file mode 100644 index 00000000..07de3d51 --- /dev/null +++ b/cn/.gitbook/assets/multi-agent-diagram.svg @@ -0,0 +1,13 @@ + + + + + + + + Worker 1Worker 2Worker 3SupervisorUser \ No newline at end of file diff --git a/cn/.gitbook/assets/multi-docs-apple.png b/cn/.gitbook/assets/multi-docs-apple.png new file mode 100644 index 00000000..16761aa6 Binary files /dev/null and b/cn/.gitbook/assets/multi-docs-apple.png differ diff --git a/cn/.gitbook/assets/multi-docs-console.png b/cn/.gitbook/assets/multi-docs-console.png new file mode 100644 index 00000000..f7182f9e Binary files /dev/null and b/cn/.gitbook/assets/multi-docs-console.png differ diff --git a/cn/.gitbook/assets/multi-docs-tesla.png b/cn/.gitbook/assets/multi-docs-tesla.png new file mode 100644 index 00000000..9a639ff1 Binary files /dev/null and b/cn/.gitbook/assets/multi-docs-tesla.png differ diff --git a/cn/.gitbook/assets/multi-docs-upload.png b/cn/.gitbook/assets/multi-docs-upload.png new file mode 100644 index 00000000..b24c3b67 Binary files /dev/null and b/cn/.gitbook/assets/multi-docs-upload.png differ diff --git a/cn/.gitbook/assets/multi-docs-upsert.png b/cn/.gitbook/assets/multi-docs-upsert.png new file mode 100644 index 00000000..e0b3b679 Binary files /dev/null and b/cn/.gitbook/assets/multi-docs-upsert.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-container-exists.png b/cn/.gitbook/assets/nvidia-nim-container-exists.png new file mode 100644 index 00000000..ac7008cd Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-container-exists.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-1.png b/cn/.gitbook/assets/nvidia-nim-local-1.png new file mode 100644 index 00000000..456a272b Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-1.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-2.png b/cn/.gitbook/assets/nvidia-nim-local-2.png new file mode 100644 index 00000000..9b8b696f Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-2.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-3.png b/cn/.gitbook/assets/nvidia-nim-local-3.png new file mode 100644 index 00000000..941dc67d Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-3.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-4.png b/cn/.gitbook/assets/nvidia-nim-local-4.png new file mode 100644 index 00000000..f1de04d9 Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-4.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-5.png b/cn/.gitbook/assets/nvidia-nim-local-5.png new file mode 100644 index 00000000..be5dd548 Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-5.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-6.png b/cn/.gitbook/assets/nvidia-nim-local-6.png new file mode 100644 index 00000000..1e736e31 Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-6.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-7.png b/cn/.gitbook/assets/nvidia-nim-local-7.png new file mode 100644 index 00000000..b58fa30e Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-7.png differ diff --git a/cn/.gitbook/assets/nvidia-nim-local-8.png b/cn/.gitbook/assets/nvidia-nim-local-8.png new file mode 100644 index 00000000..0d835c5e Binary files /dev/null and b/cn/.gitbook/assets/nvidia-nim-local-8.png differ diff --git a/cn/.gitbook/assets/openai_openapi.yaml b/cn/.gitbook/assets/openai_openapi.yaml new file mode 100644 index 00000000..6d77f43c --- /dev/null +++ b/cn/.gitbook/assets/openai_openapi.yaml @@ -0,0 +1,3196 @@ +openapi: 3.0.0 +info: + title: OpenAI API + description: APIs for sampling from and fine-tuning language models + version: '1.1.0' +servers: + - url: https://api.openai.com/v1 +tags: +- name: OpenAI + description: The OpenAI REST API +paths: + /engines: + get: + operationId: listEngines + deprecated: true + tags: + - OpenAI + summary: Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListEnginesResponse' + x-oaiMeta: + name: List engines + group: engines + path: list + examples: + curl: | + curl https://api.openai.com/v1/engines \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Engine.list() + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.listEngines(); + response: | + { + "data": [ + { + "id": "engine-id-0", + "object": "engine", + "owner": "organization-owner", + "ready": true + }, + { + "id": "engine-id-2", + "object": "engine", + "owner": "organization-owner", + "ready": true + }, + { + "id": "engine-id-3", + "object": "engine", + "owner": "openai", + "ready": false + }, + ], + "object": "list" + } + + /engines/{engine_id}: + get: + operationId: retrieveEngine + deprecated: true + tags: + - OpenAI + summary: Retrieves a model instance, providing basic information about it such as the owner and availability. + parameters: + - in: path + name: engine_id + required: true + schema: + type: string + # ideally this will be an actual ID, so this will always work from browser + example: + davinci + description: &engine_id_description > + The ID of the engine to use for this request + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Engine' + x-oaiMeta: + name: Retrieve engine + group: engines + path: retrieve + examples: + curl: | + curl https://api.openai.com/v1/engines/VAR_model_id \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Engine.retrieve("VAR_model_id") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.retrieveEngine("VAR_model_id"); + response: | + { + "id": "VAR_model_id", + "object": "engine", + "owner": "openai", + "ready": true + } + + /completions: + post: + operationId: createCompletion + tags: + - OpenAI + summary: Creates a completion for the provided prompt and parameters + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCompletionRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCompletionResponse' + x-oaiMeta: + name: Create completion + group: completions + path: create + examples: + curl: | + curl https://api.openai.com/v1/completions \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer YOUR_API_KEY' \ + -d '{ + "model": "VAR_model_id", + "prompt": "Say this is a test", + "max_tokens": 7, + "temperature": 0 + }' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Completion.create( + model="VAR_model_id", + prompt="Say this is a test", + max_tokens=7, + temperature=0 + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createCompletion({ + model: "VAR_model_id", + prompt: "Say this is a test", + max_tokens: 7, + temperature: 0, + }); + parameters: | + { + "model": "VAR_model_id", + "prompt": "Say this is a test", + "max_tokens": 7, + "temperature": 0, + "top_p": 1, + "n": 1, + "stream": false, + "logprobs": null, + "stop": "\n" + } + response: | + { + "id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7", + "object": "text_completion", + "created": 1589478378, + "model": "VAR_model_id", + "choices": [ + { + "text": "\n\nThis is indeed a test", + "index": 0, + "logprobs": null, + "finish_reason": "length" + } + ], + "usage": { + "prompt_tokens": 5, + "completion_tokens": 7, + "total_tokens": 12 + } + } + + /edits: + post: + operationId: createEdit + tags: + - OpenAI + summary: Creates a new edit for the provided input, instruction, and parameters + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEditRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEditResponse' + x-oaiMeta: + name: Create edit + group: edits + path: create + examples: + curl: | + curl https://api.openai.com/v1/edits \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer YOUR_API_KEY' \ + -d '{ + "model": "VAR_model_id", + "input": "What day of the wek is it?", + "instruction": "Fix the spelling mistakes" + }' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Edit.create( + model="VAR_model_id", + input="What day of the wek is it?", + instruction="Fix the spelling mistakes" + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createEdit({ + model: "VAR_model_id", + input: "What day of the wek is it?", + instruction: "Fix the spelling mistakes", + }); + parameters: | + { + "model": "VAR_model_id", + "input": "What day of the wek is it?", + "instruction": "Fix the spelling mistakes", + } + response: | + { + "object": "edit", + "created": 1589478378, + "choices": [ + { + "text": "What day of the week is it?", + "index": 0, + } + ], + "usage": { + "prompt_tokens": 25, + "completion_tokens": 32, + "total_tokens": 57 + } + } + + /images/generations: + post: + operationId: createImage + tags: + - OpenAI + summary: Creates an image given a prompt. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateImageRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImagesResponse' + x-oaiMeta: + name: Create image + group: images + path: create + examples: + curl: | + curl https://api.openai.com/v1/images/generations \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer YOUR_API_KEY' \ + -d '{ + "prompt": "A cute baby sea otter", + "n": 2, + "size": "1024x1024" + }' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Image.create( + prompt="A cute baby sea otter", + n=2, + size="1024x1024" + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createImage({ + prompt: "A cute baby sea otter", + n: 2, + size: "1024x1024", + }); + parameters: | + { + "prompt": "A cute baby sea otter", + "n": 2, + "size": "1024x1024" + } + response: | + { + "created": 1589478378, + "data": [ + { + "url": "https://..." + }, + { + "url": "https://..." + } + ] + } + + /images/edits: + post: + operationId: createImageEdit + tags: + - OpenAI + summary: Creates an edited or extended image given an original image and a prompt. + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/CreateImageEditRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImagesResponse' + x-oaiMeta: + name: Create image edit + group: images + path: create-edit + examples: + curl: | + curl https://api.openai.com/v1/images/edits \ + -H 'Authorization: Bearer YOUR_API_KEY' \ + -F image='@otter.png' \ + -F mask='@mask.png' \ + -F prompt="A cute baby sea otter wearing a beret" \ + -F n=2 \ + -F size="1024x1024" + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Image.create_edit( + image=open("otter.png", "rb"), + mask=open("mask.png", "rb"), + prompt="A cute baby sea otter wearing a beret", + n=2, + size="1024x1024" + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createImageEdit( + fs.createReadStream("otter.png"), + fs.createReadStream("mask.png"), + "A cute baby sea otter wearing a beret", + 2, + "1024x1024" + ); + response: | + { + "created": 1589478378, + "data": [ + { + "url": "https://..." + }, + { + "url": "https://..." + } + ] + } + + /images/variations: + post: + operationId: createImageVariation + tags: + - OpenAI + summary: Creates a variation of a given image. + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/CreateImageVariationRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ImagesResponse' + x-oaiMeta: + name: Create image variation + group: images + path: create-variation + examples: + curl: | + curl https://api.openai.com/v1/images/variations \ + -H 'Authorization: Bearer YOUR_API_KEY' \ + -F image='@otter.png' \ + -F n=2 \ + -F size="1024x1024" + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Image.create_variation( + image=open("otter.png", "rb"), + n=2, + size="1024x1024" + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createImageVariation( + fs.createReadStream("otter.png"), + 2, + "1024x1024" + ); + response: | + { + "created": 1589478378, + "data": [ + { + "url": "https://..." + }, + { + "url": "https://..." + } + ] + } + + /embeddings: + post: + operationId: createEmbedding + tags: + - OpenAI + summary: Creates an embedding vector representing the input text. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEmbeddingRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEmbeddingResponse' + x-oaiMeta: + name: Create embeddings + group: embeddings + path: create + examples: + curl: | + curl https://api.openai.com/v1/embeddings \ + -X POST \ + -H "Authorization: Bearer YOUR_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"input": "The food was delicious and the waiter...", + "model": "text-embedding-ada-002"}' + + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Embedding.create( + model="text-embedding-ada-002", + input="The food was delicious and the waiter..." + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createEmbedding({ + model: "text-embedding-ada-002", + input: "The food was delicious and the waiter...", + }); + parameters: | + { + "model": "text-embedding-ada-002", + "input": "The food was delicious and the waiter..." + } + response: | + { + "object": "list", + "data": [ + { + "object": "embedding", + "embedding": [ + 0.0023064255, + -0.009327292, + .... (1056 floats total for ada) + -0.0028842222, + ], + "index": 0 + } + ], + "model": "text-embedding-ada-002", + "usage": { + "prompt_tokens": 8, + "total_tokens": 8 + } + } + + /engines/{engine_id}/search: + post: + operationId: createSearch + deprecated: true + tags: + - OpenAI + summary: | + The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. + + To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. + + The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query. + parameters: + - in: path + name: engine_id + required: true + schema: + type: string + example: davinci + description: The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSearchRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateSearchResponse' + x-oaiMeta: + name: Create search + group: searches + path: create + examples: + curl: | + curl https://api.openai.com/v1/engines/davinci/search \ + -H "Content-Type: application/json" \ + -H 'Authorization: Bearer YOUR_API_KEY' \ + -d '{ + "documents": ["White House", "hospital", "school"], + "query": "the president" + }' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Engine("davinci").search( + documents=["White House", "hospital", "school"], + query="the president" + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createSearch("davinci", { + documents: ["White House", "hospital", "school"], + query: "the president", + }); + parameters: | + { + "documents": [ + "White House", + "hospital", + "school" + ], + "query": "the president" + } + response: | + { + "data": [ + { + "document": 0, + "object": "search_result", + "score": 215.412 + }, + { + "document": 1, + "object": "search_result", + "score": 40.316 + }, + { + "document": 2, + "object": "search_result", + "score": 55.226 + } + ], + "object": "list" + } + + /files: + get: + operationId: listFiles + tags: + - OpenAI + summary: Returns a list of files that belong to the user's organization. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListFilesResponse' + x-oaiMeta: + name: List files + group: files + path: list + examples: + curl: | + curl https://api.openai.com/v1/files \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.File.list() + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.listFiles(); + response: | + { + "data": [ + { + "id": "file-ccdDZrC3iZVNiQVeEA6Z66wf", + "object": "file", + "bytes": 175, + "created_at": 1613677385, + "filename": "train.jsonl", + "purpose": "search" + }, + { + "id": "file-XjGxS3KTG0uNmNOK362iJua3", + "object": "file", + "bytes": 140, + "created_at": 1613779121, + "filename": "puppy.jsonl", + "purpose": "search" + } + ], + "object": "list" + } + post: + operationId: createFile + tags: + - OpenAI + summary: | + Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit. + + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/CreateFileRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFile' + x-oaiMeta: + name: Upload file + group: files + path: upload + examples: + curl: | + curl https://api.openai.com/v1/files \ + -H "Authorization: Bearer YOUR_API_KEY" \ + -F purpose="fine-tune" \ + -F file='@mydata.jsonl' + + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.File.create( + file=open("mydata.jsonl", "rb"), + purpose='fine-tune' + ) + node.js: | + const fs = require("fs"); + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createFile( + fs.createReadStream("mydata.jsonl"), + "fine-tune" + ); + response: | + { + "id": "file-XjGxS3KTG0uNmNOK362iJua3", + "object": "file", + "bytes": 140, + "created_at": 1613779121, + "filename": "mydata.jsonl", + "purpose": "fine-tune" + } + + /files/{file_id}: + delete: + operationId: deleteFile + tags: + - OpenAI + summary: Delete a file. + parameters: + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file to use for this request + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteFileResponse' + x-oaiMeta: + name: Delete file + group: files + path: delete + examples: + curl: | + curl https://api.openai.com/v1/files/file-XjGxS3KTG0uNmNOK362iJua3 \ + -X DELETE \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.File.delete("file-XjGxS3KTG0uNmNOK362iJua3") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.deleteFile("file-XjGxS3KTG0uNmNOK362iJua3"); + response: | + { + "id": "file-XjGxS3KTG0uNmNOK362iJua3", + "object": "file", + "deleted": true + } + get: + operationId: retrieveFile + tags: + - OpenAI + summary: Returns information about a specific file. + parameters: + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file to use for this request + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFile' + x-oaiMeta: + name: Retrieve file + group: files + path: retrieve + examples: + curl: | + curl https://api.openai.com/v1/files/file-XjGxS3KTG0uNmNOK362iJua3 \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.File.retrieve("file-XjGxS3KTG0uNmNOK362iJua3") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.retrieveFile("file-XjGxS3KTG0uNmNOK362iJua3"); + response: | + { + "id": "file-XjGxS3KTG0uNmNOK362iJua3", + "object": "file", + "bytes": 140, + "created_at": 1613779657, + "filename": "mydata.jsonl", + "purpose": "fine-tune" + } + + /files/{file_id}/content: + get: + operationId: downloadFile + tags: + - OpenAI + summary: Returns the contents of the specified file + parameters: + - in: path + name: file_id + required: true + schema: + type: string + description: The ID of the file to use for this request + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + x-oaiMeta: + name: Retrieve file content + group: files + path: retrieve-content + examples: + curl: | + curl https://api.openai.com/v1/files/file-XjGxS3KTG0uNmNOK362iJua3/content \ + -H 'Authorization: Bearer YOUR_API_KEY' > file.jsonl + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + content = openai.File.download("file-XjGxS3KTG0uNmNOK362iJua3") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.downloadFile("file-XjGxS3KTG0uNmNOK362iJua3"); + + /answers: + post: + operationId: createAnswer + deprecated: true + tags: + - OpenAI + summary: | + Answers the specified question using the provided documents and examples. + + The endpoint first [searches](/docs/api-reference/searches) over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for [completion](/docs/api-reference/completions). + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAnswerRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAnswerResponse' + x-oaiMeta: + name: Create answer + group: answers + path: create + examples: + curl: | + curl https://api.openai.com/v1/answers \ + -X POST \ + -H "Authorization: Bearer YOUR_API_KEY" \ + -H 'Content-Type: application/json' \ + -d '{ + "documents": ["Puppy A is happy.", "Puppy B is sad."], + "question": "which puppy is happy?", + "search_model": "ada", + "model": "curie", + "examples_context": "In 2017, U.S. life expectancy was 78.6 years.", + "examples": [["What is human life expectancy in the United States?","78 years."]], + "max_tokens": 5, + "stop": ["\n", "<|endoftext|>"] + }' + + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Answer.create( + search_model="ada", + model="curie", + question="which puppy is happy?", + documents=["Puppy A is happy.", "Puppy B is sad."], + examples_context="In 2017, U.S. life expectancy was 78.6 years.", + examples=[["What is human life expectancy in the United States?","78 years."]], + max_tokens=5, + stop=["\n", "<|endoftext|>"], + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createAnswer({ + search_model: "ada", + model: "curie", + question: "which puppy is happy?", + documents: ["Puppy A is happy.", "Puppy B is sad."], + examples_context: "In 2017, U.S. life expectancy was 78.6 years.", + examples: [["What is human life expectancy in the United States?","78 years."]], + max_tokens: 5, + stop: ["\n", "<|endoftext|>"], + }); + parameters: | + { + "documents": ["Puppy A is happy.", "Puppy B is sad."], + "question": "which puppy is happy?", + "search_model": "ada", + "model": "curie", + "examples_context": "In 2017, U.S. life expectancy was 78.6 years.", + "examples": [["What is human life expectancy in the United States?","78 years."]], + "max_tokens": 5, + "stop": ["\n", "<|endoftext|>"] + } + response: | + { + "answers": [ + "puppy A." + ], + "completion": "cmpl-2euVa1kmKUuLpSX600M41125Mo9NI", + "model": "curie:2020-05-03", + "object": "answer", + "search_model": "ada", + "selected_documents": [ + { + "document": 0, + "text": "Puppy A is happy. " + }, + { + "document": 1, + "text": "Puppy B is sad. " + } + ] + } + + /classifications: + post: + operationId: createClassification + deprecated: true + tags: + - OpenAI + summary: | + Classifies the specified `query` using provided examples. + + The endpoint first [searches](/docs/api-reference/searches) over the labeled examples + to select the ones most relevant for the particular query. Then, the relevant examples + are combined with the query to construct a prompt to produce the final label via the + [completions](/docs/api-reference/completions) endpoint. + + Labeled examples can be provided via an uploaded `file`, or explicitly listed in the + request using the `examples` parameter for quick tests and small scale use cases. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateClassificationRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateClassificationResponse' + x-oaiMeta: + name: Create classification + group: classifications + path: create + examples: + curl: | + curl https://api.openai.com/v1/classifications \ + -X POST \ + -H "Authorization: Bearer YOUR_API_KEY" \ + -H 'Content-Type: application/json' \ + -d '{ + "examples": [ + ["A happy moment", "Positive"], + ["I am sad.", "Negative"], + ["I am feeling awesome", "Positive"]], + "query": "It is a raining day :(", + "search_model": "ada", + "model": "curie", + "labels":["Positive", "Negative", "Neutral"] + }' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Classification.create( + search_model="ada", + model="curie", + examples=[ + ["A happy moment", "Positive"], + ["I am sad.", "Negative"], + ["I am feeling awesome", "Positive"] + ], + query="It is a raining day :(", + labels=["Positive", "Negative", "Neutral"], + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createClassification({ + search_model: "ada", + model: "curie", + examples: [ + ["A happy moment", "Positive"], + ["I am sad.", "Negative"], + ["I am feeling awesome", "Positive"] + ], + query:"It is a raining day :(", + labels: ["Positive", "Negative", "Neutral"], + }); + parameters: | + { + "examples": [ + ["A happy moment", "Positive"], + ["I am sad.", "Negative"], + ["I am feeling awesome", "Positive"] + ], + "labels": ["Positive", "Negative", "Neutral"], + "query": "It is a raining day :(", + "search_model": "ada", + "model": "curie" + } + response: | + { + "completion": "cmpl-2euN7lUVZ0d4RKbQqRV79IiiE6M1f", + "label": "Negative", + "model": "curie:2020-05-03", + "object": "classification", + "search_model": "ada", + "selected_examples": [ + { + "document": 1, + "label": "Negative", + "text": "I am sad." + }, + { + "document": 0, + "label": "Positive", + "text": "A happy moment" + }, + { + "document": 2, + "label": "Positive", + "text": "I am feeling awesome" + } + ] + } + + /fine-tunes: + post: + operationId: createFineTune + tags: + - OpenAI + summary: | + Creates a job that fine-tunes a specified model from a given dataset. + + Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. + + [Learn more about Fine-tuning](/docs/guides/fine-tuning) + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateFineTuneRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FineTune' + x-oaiMeta: + name: Create fine-tune + group: fine-tunes + path: create + beta: true + examples: + curl: | + curl https://api.openai.com/v1/fine-tunes \ + -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer YOUR_API_KEY" \ + -d '{ + "training_file": "file-XGinujblHPwGLSztz8cPS8XY" + }' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.FineTune.create(training_file="file-XGinujblHPwGLSztz8cPS8XY") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createFineTune({ + training_file: "file-XGinujblHPwGLSztz8cPS8XY", + }); + response: | + { + "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807352, + "events": [ + { + "object": "fine-tune-event", + "created_at": 1614807352, + "level": "info", + "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0." + } + ], + "fine_tuned_model": null, + "hyperparams": { + "batch_size": 4, + "learning_rate_multiplier": 0.1, + "n_epochs": 4, + "prompt_loss_weight": 0.1, + }, + "organization_id": "org-...", + "result_files": [], + "status": "pending", + "validation_files": [], + "training_files": [ + { + "id": "file-XGinujblHPwGLSztz8cPS8XY", + "object": "file", + "bytes": 1547276, + "created_at": 1610062281, + "filename": "my-data-train.jsonl", + "purpose": "fine-tune-train" + } + ], + "updated_at": 1614807352, + } + get: + operationId: listFineTunes + tags: + - OpenAI + summary: | + List your organization's fine-tuning jobs + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListFineTunesResponse' + x-oaiMeta: + name: List fine-tunes + group: fine-tunes + path: list + beta: true + examples: + curl: | + curl https://api.openai.com/v1/fine-tunes \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.FineTune.list() + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.listFineTunes(); + response: | + { + "object": "list", + "data": [ + { + "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807352, + "fine_tuned_model": null, + "hyperparams": { ... }, + "organization_id": "org-...", + "result_files": [], + "status": "pending", + "validation_files": [], + "training_files": [ { ... } ], + "updated_at": 1614807352, + }, + { ... }, + { ... } + ] + } + + /fine-tunes/{fine_tune_id}: + get: + operationId: retrieveFineTune + tags: + - OpenAI + summary: | + Gets info about the fine-tune job. + + [Learn more about Fine-tuning](/docs/guides/fine-tuning) + parameters: + - in: path + name: fine_tune_id + required: true + schema: + type: string + example: + ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tune job + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FineTune' + x-oaiMeta: + name: Retrieve fine-tune + group: fine-tunes + path: retrieve + beta: true + examples: + curl: | + curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F \ + -H "Authorization: Bearer YOUR_API_KEY" + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.FineTune.retrieve(id="ft-AF1WoRqd3aJAHsqc9NY7iL8F") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.retrieveFineTune("ft-AF1WoRqd3aJAHsqc9NY7iL8F"); + response: | + { + "id": "ft-AF1WoRqd3aJAHsqc9NY7iL8F", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807352, + "events": [ + { + "object": "fine-tune-event", + "created_at": 1614807352, + "level": "info", + "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0." + }, + { + "object": "fine-tune-event", + "created_at": 1614807356, + "level": "info", + "message": "Job started." + }, + { + "object": "fine-tune-event", + "created_at": 1614807861, + "level": "info", + "message": "Uploaded snapshot: curie:ft-acmeco-2021-03-03-21-44-20." + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Uploaded result files: file-QQm6ZpqdNwAaVC3aSz5sWwLT." + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Job succeeded." + } + ], + "fine_tuned_model": "curie:ft-acmeco-2021-03-03-21-44-20", + "hyperparams": { + "batch_size": 4, + "learning_rate_multiplier": 0.1, + "n_epochs": 4, + "prompt_loss_weight": 0.1, + }, + "organization_id": "org-...", + "result_files": [ + { + "id": "file-QQm6ZpqdNwAaVC3aSz5sWwLT", + "object": "file", + "bytes": 81509, + "created_at": 1614807863, + "filename": "compiled_results.csv", + "purpose": "fine-tune-results" + } + ], + "status": "succeeded", + "validation_files": [], + "training_files": [ + { + "id": "file-XGinujblHPwGLSztz8cPS8XY", + "object": "file", + "bytes": 1547276, + "created_at": 1610062281, + "filename": "my-data-train.jsonl", + "purpose": "fine-tune-train" + } + ], + "updated_at": 1614807865, + } + + /fine-tunes/{fine_tune_id}/cancel: + post: + operationId: cancelFineTune + tags: + - OpenAI + summary: | + Immediately cancel a fine-tune job. + parameters: + - in: path + name: fine_tune_id + required: true + schema: + type: string + example: + ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tune job to cancel + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/FineTune' + x-oaiMeta: + name: Cancel fine-tune + group: fine-tunes + path: cancel + beta: true + examples: + curl: | + curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F/cancel \ + -X POST \ + -H "Authorization: Bearer YOUR_API_KEY" + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.FineTune.cancel(id="ft-AF1WoRqd3aJAHsqc9NY7iL8F") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.cancelFineTune("ft-AF1WoRqd3aJAHsqc9NY7iL8F"); + response: | + { + "id": "ft-xhrpBbvVUzYGo8oUO1FY4nI7", + "object": "fine-tune", + "model": "curie", + "created_at": 1614807770, + "events": [ { ... } ], + "fine_tuned_model": null, + "hyperparams": { ... }, + "organization_id": "org-...", + "result_files": [], + "status": "cancelled", + "validation_files": [], + "training_files": [ + { + "id": "file-XGinujblHPwGLSztz8cPS8XY", + "object": "file", + "bytes": 1547276, + "created_at": 1610062281, + "filename": "my-data-train.jsonl", + "purpose": "fine-tune-train" + } + ], + "updated_at": 1614807789, + } + + /fine-tunes/{fine_tune_id}/events: + get: + operationId: listFineTuneEvents + tags: + - OpenAI + summary: | + Get fine-grained status updates for a fine-tune job. + parameters: + - in: path + name: fine_tune_id + required: true + schema: + type: string + example: + ft-AF1WoRqd3aJAHsqc9NY7iL8F + description: | + The ID of the fine-tune job to get events for. + - in: query + name: stream + required: false + schema: + type: boolean + default: false + description: | + Whether to stream events for the fine-tune job. If set to true, + events will be sent as data-only + [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available. The stream will terminate with a + `data: [DONE]` message when the job is finished (succeeded, cancelled, + or failed). + + If set to false, only events generated so far will be returned. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListFineTuneEventsResponse' + x-oaiMeta: + name: List fine-tune events + group: fine-tunes + path: events + beta: true + examples: + curl: | + curl https://api.openai.com/v1/fine-tunes/ft-AF1WoRqd3aJAHsqc9NY7iL8F/events \ + -H "Authorization: Bearer YOUR_API_KEY" + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.FineTune.list_events(id="ft-AF1WoRqd3aJAHsqc9NY7iL8F") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.listFineTuneEvents("ft-AF1WoRqd3aJAHsqc9NY7iL8F"); + response: | + { + "object": "list", + "data": [ + { + "object": "fine-tune-event", + "created_at": 1614807352, + "level": "info", + "message": "Job enqueued. Waiting for jobs ahead to complete. Queue number: 0." + }, + { + "object": "fine-tune-event", + "created_at": 1614807356, + "level": "info", + "message": "Job started." + }, + { + "object": "fine-tune-event", + "created_at": 1614807861, + "level": "info", + "message": "Uploaded snapshot: curie:ft-acmeco-2021-03-03-21-44-20." + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Uploaded result files: file-QQm6ZpqdNwAaVC3aSz5sWwLT." + }, + { + "object": "fine-tune-event", + "created_at": 1614807864, + "level": "info", + "message": "Job succeeded." + } + ] + } + + /models: + get: + operationId: listModels + tags: + - OpenAI + summary: Lists the currently available models, and provides basic information about each one such as the owner and availability. + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListModelsResponse' + x-oaiMeta: + name: List models + group: models + path: list + examples: + curl: | + curl https://api.openai.com/v1/models \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Model.list() + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.listModels(); + response: | + { + "data": [ + { + "id": "model-id-0", + "object": "model", + "owned_by": "organization-owner", + "permission": [...] + }, + { + "id": "model-id-1", + "object": "model", + "owned_by": "organization-owner", + "permission": [...] + }, + { + "id": "model-id-2", + "object": "model", + "owned_by": "openai", + "permission": [...] + }, + ], + "object": "list" + } + + /models/{model}: + get: + operationId: retrieveModel + tags: + - OpenAI + summary: Retrieves a model instance, providing basic information about the model such as the owner and permissioning. + parameters: + - in: path + name: model + required: true + schema: + type: string + # ideally this will be an actual ID, so this will always work from browser + example: + text-davinci-001 + description: + The ID of the model to use for this request + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Model' + x-oaiMeta: + name: Retrieve model + group: models + path: retrieve + examples: + curl: | + curl https://api.openai.com/v1/models/VAR_model_id \ + -H 'Authorization: Bearer YOUR_API_KEY' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Model.retrieve("VAR_model_id") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.retrieveModel("VAR_model_id"); + response: | + { + "id": "VAR_model_id", + "object": "model", + "owned_by": "openai", + "permission": [...] + } + delete: + operationId: deleteModel + tags: + - OpenAI + summary: Delete a fine-tuned model. You must have the Owner role in your organization. + parameters: + - in: path + name: model + required: true + schema: + type: string + example: curie:ft-acmeco-2021-03-03-21-44-20 + description: The model to delete + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteModelResponse' + x-oaiMeta: + name: Delete fine-tune model + group: fine-tunes + path: delete-model + beta: true + examples: + curl: | + curl https://api.openai.com/v1/models/curie:ft-acmeco-2021-03-03-21-44-20 \ + -X DELETE \ + -H "Authorization: Bearer YOUR_API_KEY" + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Model.delete("curie:ft-acmeco-2021-03-03-21-44-20") + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.deleteModel('curie:ft-acmeco-2021-03-03-21-44-20'); + response: | + { + "id": "curie:ft-acmeco-2021-03-03-21-44-20", + "object": "model", + "deleted": true + } + + /moderations: + post: + operationId: createModeration + tags: + - OpenAI + summary: Classifies if text violates OpenAI's Content Policy + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateModerationRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateModerationResponse' + x-oaiMeta: + name: Create moderation + group: moderations + path: create + examples: + curl: | + curl https://api.openai.com/v1/moderations \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer YOUR_API_KEY' \ + -d '{ + "input": "I want to kill them." + }' + python: | + import os + import openai + openai.api_key = os.getenv("OPENAI_API_KEY") + openai.Moderation.create( + input="I want to kill them.", + ) + node.js: | + const { Configuration, OpenAIApi } = require("openai"); + const configuration = new Configuration({ + apiKey: process.env.OPENAI_API_KEY, + }); + const openai = new OpenAIApi(configuration); + const response = await openai.createModeration({ + input: "I want to kill them.", + }); + parameters: | + { + "input": "I want to kill them." + } + response: | + { + "id": "modr-5MWoLO", + "model": "text-moderation-001", + "results": [ + { + "categories": { + "hate": false, + "hate/threatening": true, + "self-harm": false, + "sexual": false, + "sexual/minors": false, + "violence": true, + "violence/graphic": false + }, + "category_scores": { + "hate": 0.22714105248451233, + "hate/threatening": 0.4132447838783264, + "self-harm": 0.005232391878962517, + "sexual": 0.01407341007143259, + "sexual/minors": 0.0038522258400917053, + "violence": 0.9223177433013916, + "violence/graphic": 0.036865197122097015 + }, + "flagged": true + } + ] + } + +components: + schemas: + ListEnginesResponse: + type: object + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/Engine' + required: + - object + - data + + ListModelsResponse: + type: object + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/Model' + required: + - object + - data + + DeleteModelResponse: + type: object + properties: + id: + type: string + object: + type: string + deleted: + type: boolean + required: + - id + - object + - deleted + + CreateCompletionRequest: + type: object + properties: + model: &model_configuration + description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them. + type: string + prompt: + description: &completions_prompt_description | + The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. + + Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. + default: '<|endoftext|>' + nullable: true + oneOf: + - type: string + default: '' + example: "This is a test." + - type: array + items: + type: string + default: '' + example: "This is a test." + - type: array + minItems: 1 + items: + type: integer + example: "[1212, 318, 257, 1332, 13]" + - type: array + minItems: 1 + items: + type: array + minItems: 1 + items: + type: integer + example: "[[1212, 318, 257, 1332, 13]]" + suffix: + description: + The suffix that comes after a completion of inserted text. + default: null + nullable: true + type: string + example: "test." + max_tokens: + type: integer + minimum: 0 + default: 16 + example: 16 + nullable: true + description: &completions_max_tokens_description | + The maximum number of [tokens](/tokenizer) to generate in the completion. + + The token count of your prompt plus `max_tokens` cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). + temperature: + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + description: &completions_temperature_description | + What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. + + We generally recommend altering this or `top_p` but not both. + top_p: + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + description: &completions_top_p_description | + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + n: + type: integer + minimum: 1 + maximum: 128 + default: 1 + example: 1 + nullable: true + description: &completions_completions_description | + How many completions to generate for each prompt. + + **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + stream: + description: > + Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) + as they become available, with the stream terminated by a `data: [DONE]` message. + type: boolean + nullable: true + default: false + logprobs: &completions_logprobs_configuration + type: integer + minimum: 0 + maximum: 5 + default: null + nullable: true + description: &completions_logprobs_description | + Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. + + The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case. + echo: + type: boolean + default: false + nullable: true + description: &completions_echo_description > + Echo back the prompt in addition to the completion + stop: + description: &completions_stop_description > + Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + default: null + nullable: true + oneOf: + - type: string + default: <|endoftext|> + example: "\n" + nullable: true + - type: array + minItems: 1 + maxItems: 4 + items: + type: string + example: '["\n"]' + presence_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: &completions_presence_penalty_description | + Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + + [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) + frequency_penalty: + type: number + default: 0 + minimum: -2 + maximum: 2 + nullable: true + description: &completions_frequency_penalty_description | + Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + + [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) + best_of: + type: integer + default: 1 + minimum: 0 + maximum: 20 + nullable: true + description: &completions_best_of_description | + Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. + + When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. + + **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + logit_bias: &completions_logit_bias + type: object + x-oaiTypeLabel: map + default: null + nullable: true + description: &completions_logit_bias_description | + Modify the likelihood of specified tokens appearing in the completion. + + Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + + As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + user: &end_user_param_configuration + type: string + example: user-1234 + description: | + A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + required: + - model + + CreateCompletionResponse: + type: object + properties: + id: + type: string + object: + type: string + created: + type: integer + model: + type: string + choices: + type: array + items: + type: object + properties: + text: + type: string + index: + type: integer + logprobs: + type: object + nullable: true + properties: + tokens: + type: array + items: + type: string + token_logprobs: + type: array + items: + type: number + top_logprobs: + type: array + items: + type: object + text_offset: + type: array + items: + type: integer + finish_reason: + type: string + usage: + type: object + properties: + prompt_tokens: + type: integer + completion_tokens: + type: integer + total_tokens: + type: integer + required: + - prompt_tokens + - completion_tokens + - total_tokens + required: + - id + - object + - created + - model + - choices + + CreateEditRequest: + type: object + properties: + model: *model_configuration + input: + description: + The input text to use as a starting point for the edit. + type: string + default: '' + nullable: true + example: "What day of the wek is it?" + instruction: + description: + The instruction that tells the model how to edit the prompt. + type: string + example: "Fix the spelling mistakes." + n: + type: integer + minimum: 1 + maximum: 20 + default: 1 + example: 1 + nullable: true + description: + How many edits to generate for the input and instruction. + temperature: + type: number + minimum: 0 + maximum: 2 + default: 1 + example: 1 + nullable: true + description: *completions_temperature_description + top_p: + type: number + minimum: 0 + maximum: 1 + default: 1 + example: 1 + nullable: true + description: *completions_top_p_description + required: + - model + - instruction + + CreateEditResponse: + type: object + properties: + object: + type: string + created: + type: integer + choices: + type: array + items: + type: object + properties: + text: + type: string + index: + type: integer + logprobs: + type: object + nullable: true + properties: + tokens: + type: array + items: + type: string + token_logprobs: + type: array + items: + type: number + top_logprobs: + type: array + items: + type: object + text_offset: + type: array + items: + type: integer + finish_reason: + type: string + usage: + type: object + properties: + prompt_tokens: + type: integer + completion_tokens: + type: integer + total_tokens: + type: integer + required: + - prompt_tokens + - completion_tokens + - total_tokens + required: + - object + - created + - choices + - usage + + CreateImageRequest: + type: object + properties: + prompt: + description: A text description of the desired image(s). The maximum length is 1000 characters. + type: string + example: "A cute baby sea otter" + n: &images_n + type: integer + minimum: 1 + maximum: 10 + default: 1 + example: 1 + nullable: true + description: The number of images to generate. Must be between 1 and 10. + size: &images_size + type: string + enum: ["256x256", "512x512", "1024x1024"] + default: "1024x1024" + example: "1024x1024" + nullable: true + description: The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. + response_format: &images_response_format + type: string + enum: ["url", "b64_json"] + default: "url" + example: "url" + nullable: true + description: The format in which the generated images are returned. Must be one of `url` or `b64_json`. + user: *end_user_param_configuration + required: + - prompt + + ImagesResponse: + properties: + created: + type: integer + data: + type: array + items: + type: object + properties: + url: + type: string + b64_json: + type: string + required: + - created + - data + + CreateImageEditRequest: + type: object + properties: + image: + description: The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask. + type: string + format: binary + mask: + description: An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. + type: string + format: binary + prompt: + description: A text description of the desired image(s). The maximum length is 1000 characters. + type: string + example: "A cute baby sea otter wearing a beret" + n: *images_n + size: *images_size + response_format: *images_response_format + user: *end_user_param_configuration + required: + - prompt + - image + + CreateImageVariationRequest: + type: object + properties: + image: + description: The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. + type: string + format: binary + n: *images_n + size: *images_size + response_format: *images_response_format + user: *end_user_param_configuration + required: + - image + + CreateModerationRequest: + type: object + properties: + input: + description: The input text to classify + oneOf: + - type: string + default: '' + example: "I want to kill them." + - type: array + items: + type: string + default: '' + example: "I want to kill them." + model: + description: | + Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`. + + The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`. + type: string + nullable: false + default: "text-moderation-latest" + example: "text-moderation-stable" + required: + - input + + CreateModerationResponse: + type: object + properties: + id: + type: string + model: + type: string + results: + type: array + items: + type: object + properties: + flagged: + type: boolean + categories: + type: object + properties: + hate: + type: boolean + hate/threatening: + type: boolean + self-harm: + type: boolean + sexual: + type: boolean + sexual/minors: + type: boolean + violence: + type: boolean + violence/graphic: + type: boolean + required: + - hate + - hate/threatening + - self-harm + - sexual + - sexual/minors + - violence + - violence/graphic + category_scores: + type: object + properties: + hate: + type: number + hate/threatening: + type: number + self-harm: + type: number + sexual: + type: number + sexual/minors: + type: number + violence: + type: number + violence/graphic: + type: number + required: + - hate + - hate/threatening + - self-harm + - sexual + - sexual/minors + - violence + - violence/graphic + required: + - flagged + - categories + - category_scores + required: + - id + - model + - results + + CreateSearchRequest: + type: object + properties: + query: + description: Query to search against the documents. + type: string + example: "the president" + minLength: 1 + documents: + description: | + Up to 200 documents to search over, provided as a list of strings. + + The maximum document length (in tokens) is 2034 minus the number of tokens in the query. + + You should specify either `documents` or a `file`, but not both. + type: array + minItems: 1 + maxItems: 200 + items: + type: string + nullable: true + example: "['White House', 'hospital', 'school']" + file: + description: | + The ID of an uploaded file that contains documents to search over. + + You should specify either `documents` or a `file`, but not both. + type: string + nullable: true + max_rerank: + description: | + The maximum number of documents to be re-ranked and returned by search. + + This flag only takes effect when `file` is set. + type: integer + minimum: 1 + default: 200 + nullable: true + return_metadata: &return_metadata_configuration + description: | + A special boolean flag for showing metadata. If set to `true`, each document entry in the returned JSON will contain a "metadata" field. + + This flag only takes effect when `file` is set. + type: boolean + default: false + nullable: true + user: *end_user_param_configuration + required: + - query + + CreateSearchResponse: + type: object + properties: + object: + type: string + model: + type: string + data: + type: array + items: + type: object + properties: + object: + type: string + document: + type: integer + score: + type: number + + ListFilesResponse: + type: object + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAIFile' + required: + - object + - data + + CreateFileRequest: + type: object + additionalProperties: false + properties: + file: + description: | + Name of the [JSON Lines](https://jsonlines.readthedocs.io/en/latest/) file to be uploaded. + + If the `purpose` is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your [training examples](/docs/guides/fine-tuning/prepare-training-data). + type: string + format: binary + purpose: + description: | + The intended purpose of the uploaded documents. + + Use "fine-tune" for [Fine-tuning](/docs/api-reference/fine-tunes). This allows us to validate the format of the uploaded file. + + type: string + required: + - file + - purpose + + DeleteFileResponse: + type: object + properties: + id: + type: string + object: + type: string + deleted: + type: boolean + required: + - id + - object + - deleted + + CreateAnswerRequest: + type: object + additionalProperties: false + properties: + model: + description: ID of the model to use for completion. You can select one of `ada`, `babbage`, `curie`, or `davinci`. + type: string + question: + description: Question to get answered. + type: string + minLength: 1 + example: "What is the capital of Japan?" + examples: + description: List of (question, answer) pairs that will help steer the model towards the tone and answer format you'd like. We recommend adding 2 to 3 examples. + type: array + minItems: 1 + maxItems: 200 + items: + type: array + minItems: 2 + maxItems: 2 + items: + type: string + minLength: 1 + example: "[['What is the capital of Canada?', 'Ottawa'], ['Which province is Ottawa in?', 'Ontario']]" + examples_context: + description: A text snippet containing the contextual information used to generate the answers for the `examples` you provide. + type: string + example: "Ottawa, Canada's capital, is located in the east of southern Ontario, near the city of Montréal and the U.S. border." + documents: + description: | + List of documents from which the answer for the input `question` should be derived. If this is an empty list, the question will be answered based on the question-answer examples. + + You should specify either `documents` or a `file`, but not both. + type: array + maxItems: 200 + items: + type: string + example: "['Japan is an island country in East Asia, located in the northwest Pacific Ocean.', 'Tokyo is the capital and most populous prefecture of Japan.']" + nullable: true + file: + description: | + The ID of an uploaded file that contains documents to search over. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose. + + You should specify either `documents` or a `file`, but not both. + type: string + nullable: true + search_model: &search_model_configuration + description: ID of the model to use for [Search](/docs/api-reference/searches/create). You can select one of `ada`, `babbage`, `curie`, or `davinci`. + type: string + default: ada + nullable: true + max_rerank: + description: The maximum number of documents to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost. + type: integer + default: 200 + nullable: true + temperature: + description: What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values mean the model will take more risks and value 0 (argmax sampling) works better for scenarios with a well-defined answer. + type: number + default: 0 + nullable: true + logprobs: &context_completions_logprobs_configuration + type: integer + minimum: 0 + maximum: 5 + default: null + nullable: true + description: | + Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. + + The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case. + + When `logprobs` is set, `completion` will be automatically added into `expand` to get the logprobs. + max_tokens: + description: The maximum number of tokens allowed for the generated answer + type: integer + default: 16 + nullable: true + stop: + description: *completions_stop_description + default: null + oneOf: + - type: string + default: <|endoftext|> + example: "\n" + - type: array + minItems: 1 + maxItems: 4 + items: + type: string + example: '["\n"]' + nullable: true + n: + description: How many answers to generate for each question. + type: integer + minimum: 1 + maximum: 10 + default: 1 + nullable: true + logit_bias: *completions_logit_bias + return_metadata: *return_metadata_configuration + return_prompt: &return_prompt_configuration + description: If set to `true`, the returned JSON will include a "prompt" field containing the final prompt that was used to request a completion. This is mainly useful for debugging purposes. + type: boolean + default: false + nullable: true + expand: &expand_configuration + description: If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID. Currently we support `completion` and `file` objects for expansion. + type: array + items: {} + nullable: true + default: [] + user: *end_user_param_configuration + required: + - model + - question + - examples + - examples_context + + CreateAnswerResponse: + type: object + properties: + object: + type: string + model: + type: string + search_model: + type: string + completion: + type: string + answers: + type: array + items: + type: string + selected_documents: + type: array + items: + type: object + properties: + document: + type: integer + text: + type: string + + CreateClassificationRequest: + type: object + additionalProperties: false + properties: + model: *model_configuration + query: + description: Query to be classified. + type: string + minLength: 1 + example: "The plot is not very attractive." + examples: + description: | + A list of examples with labels, in the following format: + + `[["The movie is so interesting.", "Positive"], ["It is quite boring.", "Negative"], ...]` + + All the label strings will be normalized to be capitalized. + + You should specify either `examples` or `file`, but not both. + type: array + minItems: 2 + maxItems: 200 + items: + type: array + minItems: 2 + maxItems: 2 + items: + type: string + minLength: 1 + example: "[['Do not see this film.', 'Negative'], ['Smart, provocative and blisteringly funny.', 'Positive']]" + nullable: true + file: + description: | + The ID of the uploaded file that contains training examples. See [upload file](/docs/api-reference/files/upload) for how to upload a file of the desired format and purpose. + + You should specify either `examples` or `file`, but not both. + type: string + nullable: true + labels: + description: The set of categories being classified. If not specified, candidate labels will be automatically collected from the examples you provide. All the label strings will be normalized to be capitalized. + type: array + minItems: 2 + maxItems: 200 + default: null + items: + type: string + example: ["Positive", "Negative"] + nullable: true + search_model: *search_model_configuration + temperature: + description: + What sampling `temperature` to use. Higher values mean the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. + type: number + minimum: 0 + maximum: 2 + default: 0 + nullable: true + example: 0 + logprobs: *context_completions_logprobs_configuration + max_examples: + description: The maximum number of examples to be ranked by [Search](/docs/api-reference/searches/create) when using `file`. Setting it to a higher value leads to improved accuracy but with increased latency and cost. + type: integer + default: 200 + nullable: true + logit_bias: *completions_logit_bias + return_prompt: *return_prompt_configuration + return_metadata: *return_metadata_configuration + expand: *expand_configuration + user: *end_user_param_configuration + required: + - model + - query + + CreateClassificationResponse: + type: object + properties: + object: + type: string + model: + type: string + search_model: + type: string + completion: + type: string + label: + type: string + selected_examples: + type: array + items: + type: object + properties: + document: + type: integer + text: + type: string + label: + type: string + + CreateFineTuneRequest: + type: object + properties: + training_file: + description: | + The ID of an uploaded file that contains training data. + + See [upload file](/docs/api-reference/files/upload) for how to upload a file. + + Your dataset must be formatted as a JSONL file, where each training + example is a JSON object with the keys "prompt" and "completion". + Additionally, you must upload your file with the purpose `fine-tune`. + + See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details. + type: string + example: "file-ajSREls59WBbvgSzJSVWxMCB" + validation_file: + description: | + The ID of an uploaded file that contains validation data. + + If you provide this file, the data is used to generate validation + metrics periodically during fine-tuning. These metrics can be viewed in + the [fine-tuning results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model). + Your train and validation data should be mutually exclusive. + + Your dataset must be formatted as a JSONL file, where each validation + example is a JSON object with the keys "prompt" and "completion". + Additionally, you must upload your file with the purpose `fine-tune`. + + See the [fine-tuning guide](/docs/guides/fine-tuning/creating-training-data) for more details. + type: string + nullable: true + example: "file-XjSREls59WBbvgSzJSVWxMCa" + model: + description: | + The name of the base model to fine-tune. You can select one of "ada", + "babbage", "curie", "davinci", or a fine-tuned model created after 2022-04-21. + To learn more about these models, see the + [Models](https://beta.openai.com/docs/models) documentation. + default: "curie" + type: string + nullable: true + n_epochs: + description: | + The number of epochs to train the model for. An epoch refers to one + full cycle through the training dataset. + default: 4 + type: integer + nullable: true + batch_size: + description: | + The batch size to use for training. The batch size is the number of + training examples used to train a single forward and backward pass. + + By default, the batch size will be dynamically configured to be + ~0.2% of the number of examples in the training set, capped at 256 - + in general, we've found that larger batch sizes tend to work better + for larger datasets. + default: null + type: integer + nullable: true + learning_rate_multiplier: + description: | + The learning rate multiplier to use for training. + The fine-tuning learning rate is the original learning rate used for + pretraining multiplied by this value. + + By default, the learning rate multiplier is the 0.05, 0.1, or 0.2 + depending on final `batch_size` (larger learning rates tend to + perform better with larger batch sizes). We recommend experimenting + with values in the range 0.02 to 0.2 to see what produces the best + results. + default: null + type: number + nullable: true + prompt_loss_weight: + description: | + The weight to use for loss on the prompt tokens. This controls how + much the model tries to learn to generate the prompt (as compared + to the completion which always has a weight of 1.0), and can add + a stabilizing effect to training when completions are short. + + If prompts are extremely long (relative to completions), it may make + sense to reduce this weight so as to avoid over-prioritizing + learning the prompt. + default: 0.01 + type: number + nullable: true + compute_classification_metrics: + description: | + If set, we calculate classification-specific metrics such as accuracy + and F-1 score using the validation set at the end of every epoch. + These metrics can be viewed in the [results file](/docs/guides/fine-tuning/analyzing-your-fine-tuned-model). + + In order to compute classification metrics, you must provide a + `validation_file`. Additionally, you must + specify `classification_n_classes` for multiclass classification or + `classification_positive_class` for binary classification. + type: boolean + default: false + nullable: true + classification_n_classes: + description: | + The number of classes in a classification task. + + This parameter is required for multiclass classification. + type: integer + default: null + nullable: true + classification_positive_class: + description: | + The positive class in binary classification. + + This parameter is needed to generate precision, recall, and F1 + metrics when doing binary classification. + type: string + default: null + nullable: true + classification_betas: + description: | + If this is provided, we calculate F-beta scores at the specified + beta values. The F-beta score is a generalization of F-1 score. + This is only used for binary classification. + + With a beta of 1 (i.e. the F-1 score), precision and recall are + given the same weight. A larger beta score puts more weight on + recall and less on precision. A smaller beta score puts more weight + on precision and less on recall. + type: array + items: + type: number + example: [0.6, 1, 1.5, 2] + default: null + nullable: true + suffix: + description: | + A string of up to 40 characters that will be added to your fine-tuned model name. + + For example, a `suffix` of "custom-model-name" would produce a model name like `ada:ft-your-org:custom-model-name-2022-02-15-04-21-04`. + type: string + minLength: 1 + maxLength: 40 + default: null + nullable: true + required: + - training_file + + ListFineTunesResponse: + type: object + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/FineTune' + required: + - object + - data + + ListFineTuneEventsResponse: + type: object + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/FineTuneEvent' + required: + - object + - data + + CreateEmbeddingRequest: + type: object + additionalProperties: false + properties: + model: *model_configuration + input: + description: | + Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 8192 tokens in length. + example: "The quick brown fox jumped over the lazy dog" + oneOf: + - type: string + default: '' + example: "This is a test." + - type: array + items: + type: string + default: '' + example: "This is a test." + - type: array + minItems: 1 + items: + type: integer + example: "[1212, 318, 257, 1332, 13]" + - type: array + minItems: 1 + items: + type: array + minItems: 1 + items: + type: integer + example: "[[1212, 318, 257, 1332, 13]]" + user: *end_user_param_configuration + required: + - model + - input + + CreateEmbeddingResponse: + type: object + properties: + object: + type: string + model: + type: string + data: + type: array + items: + type: object + properties: + index: + type: integer + object: + type: string + embedding: + type: array + items: + type: number + required: + - index + - object + - embedding + usage: + type: object + properties: + prompt_tokens: + type: integer + total_tokens: + type: integer + required: + - prompt_tokens + - total_tokens + required: + - object + - model + - data + - usage + + Engine: + title: Engine + properties: + id: + type: string + object: + type: string + created: + type: integer + nullable: true + ready: + type: boolean + required: + - id + - object + - created + - ready + + Model: + title: Model + properties: + id: + type: string + object: + type: string + created: + type: integer + owned_by: + type: string + required: + - id + - object + - created + - owned_by + + OpenAIFile: + title: OpenAIFile + properties: + id: + type: string + object: + type: string + bytes: + type: integer + created_at: + type: integer + filename: + type: string + purpose: + type: string + status: + type: string + status_details: + type: object + nullable: true + required: + - id + - object + - bytes + - created_at + - filename + - purpose + + FineTune: + title: FineTune + properties: + id: + type: string + object: + type: string + created_at: + type: integer + updated_at: + type: integer + model: + type: string + fine_tuned_model: + type: string + nullable: true + organization_id: + type: string + status: + type: string + hyperparams: + type: object + training_files: + type: array + items: + $ref: '#/components/schemas/OpenAIFile' + validation_files: + type: array + items: + $ref: '#/components/schemas/OpenAIFile' + result_files: + type: array + items: + $ref: '#/components/schemas/OpenAIFile' + events: + type: array + items: + $ref: '#/components/schemas/FineTuneEvent' + required: + - id + - object + - created_at + - updated_at + - model + - fine_tuned_model + - organization_id + - status + - hyperparams + - training_files + - validation_files + - result_files + + FineTuneEvent: + title: FineTuneEvent + properties: + object: + type: string + created_at: + type: integer + level: + type: string + message: + type: string + required: + - object + - created_at + - level + - message + +x-oaiMeta: + groups: + - id: models + title: Models + description: | + List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them. + - id: completions + title: Completions + description: | + Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. + - id: edits + title: Edits + description: | + Given a prompt and an instruction, the model will return an edited version of the prompt. + - id: images + title: Images + description: | + Given a prompt and/or an input image, the model will generate a new image. + + Related guide: [Image generation](/docs/guides/images) + - id: embeddings + title: Embeddings + description: | + Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. + + Related guide: [Embeddings](/docs/guides/embeddings) + - id: files + title: Files + description: | + Files are used to upload documents that can be used with features like [Fine-tuning](/docs/api-reference/fine-tunes). + - id: fine-tunes + title: Fine-tunes + description: | + Manage fine-tuning jobs to tailor a model to your specific training data. + + Related guide: [Fine-tune models](/docs/guides/fine-tuning) + - id: moderations + title: Moderations + description: | + Given a input text, outputs if the model classifies it as violating OpenAI's content policy. + + Related guide: [Moderations](/docs/guides/moderation) + - id: searches + title: Searches + warning: + title: This endpoint is deprecated and will be removed on December 3rd, 2022 + message: We’ve developed new methods with better performance. [Learn more](https://help.openai.com/en/articles/6272952-search-transition-guide). + description: | + Given a query and a set of documents or labels, the model ranks each document based on its semantic similarity to the provided query. + + Related guide: [Search](/docs/guides/search) + - id: classifications + title: Classifications + warning: + title: This endpoint is deprecated and will be removed on December 3rd, 2022 + message: We’ve developed new methods with better performance. [Learn more](https://help.openai.com/en/articles/6272941-classifications-transition-guide). + description: | + Given a query and a set of labeled examples, the model will predict the most likely label for the query. Useful as a drop-in replacement for any ML classification or text-to-label task. + + Related guide: [Classification](/docs/guides/classifications) + - id: answers + title: Answers + warning: + title: This endpoint is deprecated and will be removed on December 3rd, 2022 + message: We’ve developed new methods with better performance. [Learn more](https://help.openai.com/en/articles/6233728-answers-transition-guide). + description: | + Given a question, a set of documents, and some examples, the API generates an answer to the question based on the information in the set of documents. This is useful for question-answering applications on sources of truth, like company documentation or a knowledge base. + + Related guide: [Question answering](/docs/guides/answers) + - id: engines + title: Engines + description: These endpoints describe and provide access to the various engines available in the API. + warning: + title: The Engines endpoints are deprecated. + message: Please use their replacement, [Models](/docs/api-reference/models), instead. [Learn more](https://help.openai.com/TODO). diff --git a/cn/.gitbook/assets/opik-1.png b/cn/.gitbook/assets/opik-1.png new file mode 100644 index 00000000..906b04a3 Binary files /dev/null and b/cn/.gitbook/assets/opik-1.png differ diff --git a/cn/.gitbook/assets/opik-2.png b/cn/.gitbook/assets/opik-2.png new file mode 100644 index 00000000..a561e4c7 Binary files /dev/null and b/cn/.gitbook/assets/opik-2.png differ diff --git a/cn/.gitbook/assets/opik-3.png b/cn/.gitbook/assets/opik-3.png new file mode 100644 index 00000000..88ae6422 Binary files /dev/null and b/cn/.gitbook/assets/opik-3.png differ diff --git a/cn/.gitbook/assets/opik-4.png b/cn/.gitbook/assets/opik-4.png new file mode 100644 index 00000000..69d816d5 Binary files /dev/null and b/cn/.gitbook/assets/opik-4.png differ diff --git a/cn/.gitbook/assets/oxylabs_document_loader.png b/cn/.gitbook/assets/oxylabs_document_loader.png new file mode 100644 index 00000000..9c607067 Binary files /dev/null and b/cn/.gitbook/assets/oxylabs_document_loader.png differ diff --git a/cn/.gitbook/assets/phoenix/phoenix-1.png b/cn/.gitbook/assets/phoenix/phoenix-1.png new file mode 100644 index 00000000..8a466a29 Binary files /dev/null and b/cn/.gitbook/assets/phoenix/phoenix-1.png differ diff --git a/cn/.gitbook/assets/phoenix/phoenix-2.png b/cn/.gitbook/assets/phoenix/phoenix-2.png new file mode 100644 index 00000000..12fa4fdd Binary files /dev/null and b/cn/.gitbook/assets/phoenix/phoenix-2.png differ diff --git a/cn/.gitbook/assets/phoenix/phoenix-3.png b/cn/.gitbook/assets/phoenix/phoenix-3.png new file mode 100644 index 00000000..10548706 Binary files /dev/null and b/cn/.gitbook/assets/phoenix/phoenix-3.png differ diff --git a/cn/.gitbook/assets/pinecone_1.png b/cn/.gitbook/assets/pinecone_1.png new file mode 100644 index 00000000..efd45d48 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_1.png differ diff --git a/cn/.gitbook/assets/pinecone_2.png b/cn/.gitbook/assets/pinecone_2.png new file mode 100644 index 00000000..1cdfa258 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_2.png differ diff --git a/cn/.gitbook/assets/pinecone_3.png b/cn/.gitbook/assets/pinecone_3.png new file mode 100644 index 00000000..495497d3 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_3.png differ diff --git a/cn/.gitbook/assets/pinecone_4.png b/cn/.gitbook/assets/pinecone_4.png new file mode 100644 index 00000000..6674e759 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_4.png differ diff --git a/cn/.gitbook/assets/pinecone_5.png b/cn/.gitbook/assets/pinecone_5.png new file mode 100644 index 00000000..798beb4e Binary files /dev/null and b/cn/.gitbook/assets/pinecone_5.png differ diff --git a/cn/.gitbook/assets/pinecone_6.png b/cn/.gitbook/assets/pinecone_6.png new file mode 100644 index 00000000..41accc77 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_6.png differ diff --git a/cn/.gitbook/assets/pinecone_7.png b/cn/.gitbook/assets/pinecone_7.png new file mode 100644 index 00000000..f902d4c2 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_7.png differ diff --git a/cn/.gitbook/assets/pinecone_8.png b/cn/.gitbook/assets/pinecone_8.png new file mode 100644 index 00000000..d8bf1bc0 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_8.png differ diff --git a/cn/.gitbook/assets/pinecone_llama_chatflow.png b/cn/.gitbook/assets/pinecone_llama_chatflow.png new file mode 100644 index 00000000..563f6565 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_llama_chatflow.png differ diff --git a/cn/.gitbook/assets/pinecone_llama_upsert.png b/cn/.gitbook/assets/pinecone_llama_upsert.png new file mode 100644 index 00000000..7b8e30fc Binary files /dev/null and b/cn/.gitbook/assets/pinecone_llama_upsert.png differ diff --git a/cn/.gitbook/assets/pinecone_llamaindex.png b/cn/.gitbook/assets/pinecone_llamaindex.png new file mode 100644 index 00000000..32977e96 Binary files /dev/null and b/cn/.gitbook/assets/pinecone_llamaindex.png differ diff --git a/cn/.gitbook/assets/pipedream/image1.png b/cn/.gitbook/assets/pipedream/image1.png new file mode 100644 index 00000000..1870fbea Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image1.png differ diff --git a/cn/.gitbook/assets/pipedream/image2.png b/cn/.gitbook/assets/pipedream/image2.png new file mode 100644 index 00000000..cb1df370 Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image2.png differ diff --git a/cn/.gitbook/assets/pipedream/image3.png b/cn/.gitbook/assets/pipedream/image3.png new file mode 100644 index 00000000..560e2f76 Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image3.png differ diff --git a/cn/.gitbook/assets/pipedream/image4.png b/cn/.gitbook/assets/pipedream/image4.png new file mode 100644 index 00000000..db76ecbf Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image4.png differ diff --git a/cn/.gitbook/assets/pipedream/image5.png b/cn/.gitbook/assets/pipedream/image5.png new file mode 100644 index 00000000..19f50407 Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image5.png differ diff --git a/cn/.gitbook/assets/pipedream/image6.png b/cn/.gitbook/assets/pipedream/image6.png new file mode 100644 index 00000000..cd3d310a Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image6.png differ diff --git a/cn/.gitbook/assets/pipedream/image7.png b/cn/.gitbook/assets/pipedream/image7.png new file mode 100644 index 00000000..bb67814b Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image7.png differ diff --git a/cn/.gitbook/assets/pipedream/image8.png b/cn/.gitbook/assets/pipedream/image8.png new file mode 100644 index 00000000..c2b872fe Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image8.png differ diff --git a/cn/.gitbook/assets/pipedream/image9.png b/cn/.gitbook/assets/pipedream/image9.png new file mode 100644 index 00000000..53909dfe Binary files /dev/null and b/cn/.gitbook/assets/pipedream/image9.png differ diff --git a/cn/.gitbook/assets/qdrant/1.png b/cn/.gitbook/assets/qdrant/1.png new file mode 100644 index 00000000..41e3dad8 Binary files /dev/null and b/cn/.gitbook/assets/qdrant/1.png differ diff --git a/cn/.gitbook/assets/qdrant/2.png b/cn/.gitbook/assets/qdrant/2.png new file mode 100644 index 00000000..630b9c27 Binary files /dev/null and b/cn/.gitbook/assets/qdrant/2.png differ diff --git a/cn/.gitbook/assets/qdrant/3.png b/cn/.gitbook/assets/qdrant/3.png new file mode 100644 index 00000000..58dc5cd7 Binary files /dev/null and b/cn/.gitbook/assets/qdrant/3.png differ diff --git a/cn/.gitbook/assets/render/1.png b/cn/.gitbook/assets/render/1.png new file mode 100644 index 00000000..60515e19 Binary files /dev/null and b/cn/.gitbook/assets/render/1.png differ diff --git a/cn/.gitbook/assets/render/11.png b/cn/.gitbook/assets/render/11.png new file mode 100644 index 00000000..39248e0f Binary files /dev/null and b/cn/.gitbook/assets/render/11.png differ diff --git a/cn/.gitbook/assets/render/2.png b/cn/.gitbook/assets/render/2.png new file mode 100644 index 00000000..9105e091 Binary files /dev/null and b/cn/.gitbook/assets/render/2.png differ diff --git a/cn/.gitbook/assets/render/3.png b/cn/.gitbook/assets/render/3.png new file mode 100644 index 00000000..b74c7452 Binary files /dev/null and b/cn/.gitbook/assets/render/3.png differ diff --git a/cn/.gitbook/assets/render/4.png b/cn/.gitbook/assets/render/4.png new file mode 100644 index 00000000..bb7d83e9 Binary files /dev/null and b/cn/.gitbook/assets/render/4.png differ diff --git a/cn/.gitbook/assets/render/5.png b/cn/.gitbook/assets/render/5.png new file mode 100644 index 00000000..8956f03b Binary files /dev/null and b/cn/.gitbook/assets/render/5.png differ diff --git a/cn/.gitbook/assets/render/6.png b/cn/.gitbook/assets/render/6.png new file mode 100644 index 00000000..07fe0e82 Binary files /dev/null and b/cn/.gitbook/assets/render/6.png differ diff --git a/cn/.gitbook/assets/render/7.png b/cn/.gitbook/assets/render/7.png new file mode 100644 index 00000000..efb7b057 Binary files /dev/null and b/cn/.gitbook/assets/render/7.png differ diff --git a/cn/.gitbook/assets/render/8.png b/cn/.gitbook/assets/render/8.png new file mode 100644 index 00000000..c3cc2f55 Binary files /dev/null and b/cn/.gitbook/assets/render/8.png differ diff --git a/cn/.gitbook/assets/render/9.png b/cn/.gitbook/assets/render/9.png new file mode 100644 index 00000000..e0a86f22 Binary files /dev/null and b/cn/.gitbook/assets/render/9.png differ diff --git a/cn/.gitbook/assets/sa-agent.png b/cn/.gitbook/assets/sa-agent.png new file mode 100644 index 00000000..7de9c9ad Binary files /dev/null and b/cn/.gitbook/assets/sa-agent.png differ diff --git a/cn/.gitbook/assets/sa-llm.png b/cn/.gitbook/assets/sa-llm.png new file mode 100644 index 00000000..194e1bf3 Binary files /dev/null and b/cn/.gitbook/assets/sa-llm.png differ diff --git a/cn/.gitbook/assets/sa-loop.png b/cn/.gitbook/assets/sa-loop.png new file mode 100644 index 00000000..57f8e164 Binary files /dev/null and b/cn/.gitbook/assets/sa-loop.png differ diff --git a/cn/.gitbook/assets/savereuse.png b/cn/.gitbook/assets/savereuse.png new file mode 100644 index 00000000..e44dcdab Binary files /dev/null and b/cn/.gitbook/assets/savereuse.png differ diff --git a/cn/.gitbook/assets/screely-1691756705932.png b/cn/.gitbook/assets/screely-1691756705932.png new file mode 100644 index 00000000..8f78243b Binary files /dev/null and b/cn/.gitbook/assets/screely-1691756705932.png differ diff --git a/cn/.gitbook/assets/screely-1691758397783.png b/cn/.gitbook/assets/screely-1691758397783.png new file mode 100644 index 00000000..f86ad79d Binary files /dev/null and b/cn/.gitbook/assets/screely-1691758397783.png differ diff --git a/cn/.gitbook/assets/screely-1691758990676.png b/cn/.gitbook/assets/screely-1691758990676.png new file mode 100644 index 00000000..b1a367fd Binary files /dev/null and b/cn/.gitbook/assets/screely-1691758990676.png differ diff --git a/cn/.gitbook/assets/screely-1698767992182.png b/cn/.gitbook/assets/screely-1698767992182.png new file mode 100644 index 00000000..7a0110c2 Binary files /dev/null and b/cn/.gitbook/assets/screely-1698767992182.png differ diff --git a/cn/.gitbook/assets/screely-1699896158130.png b/cn/.gitbook/assets/screely-1699896158130.png new file mode 100644 index 00000000..fa1ccff7 Binary files /dev/null and b/cn/.gitbook/assets/screely-1699896158130.png differ diff --git a/cn/.gitbook/assets/screely-1700662138252.png b/cn/.gitbook/assets/screely-1700662138252.png new file mode 100644 index 00000000..c228b3fb Binary files /dev/null and b/cn/.gitbook/assets/screely-1700662138252.png differ diff --git a/cn/.gitbook/assets/screely-1749593961545.png b/cn/.gitbook/assets/screely-1749593961545.png new file mode 100644 index 00000000..38423547 Binary files /dev/null and b/cn/.gitbook/assets/screely-1749593961545.png differ diff --git a/cn/.gitbook/assets/screely-1749594035877.png b/cn/.gitbook/assets/screely-1749594035877.png new file mode 100644 index 00000000..bf9cd3a2 Binary files /dev/null and b/cn/.gitbook/assets/screely-1749594035877.png differ diff --git a/cn/.gitbook/assets/screely-1749594614881.png b/cn/.gitbook/assets/screely-1749594614881.png new file mode 100644 index 00000000..feafeb4f Binary files /dev/null and b/cn/.gitbook/assets/screely-1749594614881.png differ diff --git a/cn/.gitbook/assets/screely-1749594631028.png b/cn/.gitbook/assets/screely-1749594631028.png new file mode 100644 index 00000000..6f44fa0e Binary files /dev/null and b/cn/.gitbook/assets/screely-1749594631028.png differ diff --git a/cn/.gitbook/assets/seq-00.png b/cn/.gitbook/assets/seq-00.png new file mode 100644 index 00000000..52c437a8 Binary files /dev/null and b/cn/.gitbook/assets/seq-00.png differ diff --git a/cn/.gitbook/assets/seq-02.png b/cn/.gitbook/assets/seq-02.png new file mode 100644 index 00000000..7d99d317 Binary files /dev/null and b/cn/.gitbook/assets/seq-02.png differ diff --git a/cn/.gitbook/assets/seq-03.png b/cn/.gitbook/assets/seq-03.png new file mode 100644 index 00000000..bcd9409b Binary files /dev/null and b/cn/.gitbook/assets/seq-03.png differ diff --git a/cn/.gitbook/assets/seq-04.png b/cn/.gitbook/assets/seq-04.png new file mode 100644 index 00000000..97868ec4 Binary files /dev/null and b/cn/.gitbook/assets/seq-04.png differ diff --git a/cn/.gitbook/assets/seq-07.png b/cn/.gitbook/assets/seq-07.png new file mode 100644 index 00000000..fffa2e7c Binary files /dev/null and b/cn/.gitbook/assets/seq-07.png differ diff --git a/cn/.gitbook/assets/seq-08.png b/cn/.gitbook/assets/seq-08.png new file mode 100644 index 00000000..12f037bd Binary files /dev/null and b/cn/.gitbook/assets/seq-08.png differ diff --git a/cn/.gitbook/assets/seq-09.png b/cn/.gitbook/assets/seq-09.png new file mode 100644 index 00000000..080d0519 Binary files /dev/null and b/cn/.gitbook/assets/seq-09.png differ diff --git a/cn/.gitbook/assets/seq-12.png b/cn/.gitbook/assets/seq-12.png new file mode 100644 index 00000000..494ea054 Binary files /dev/null and b/cn/.gitbook/assets/seq-12.png differ diff --git a/cn/.gitbook/assets/seq-14.png b/cn/.gitbook/assets/seq-14.png new file mode 100644 index 00000000..fb09eba7 Binary files /dev/null and b/cn/.gitbook/assets/seq-14.png differ diff --git a/cn/.gitbook/assets/seq-16 (1).png b/cn/.gitbook/assets/seq-16 (1).png new file mode 100644 index 00000000..2e317ee4 Binary files /dev/null and b/cn/.gitbook/assets/seq-16 (1).png differ diff --git a/cn/.gitbook/assets/seq-20.png b/cn/.gitbook/assets/seq-20.png new file mode 100644 index 00000000..1e00abb8 Binary files /dev/null and b/cn/.gitbook/assets/seq-20.png differ diff --git a/cn/.gitbook/assets/seq-21.svg b/cn/.gitbook/assets/seq-21.svg new file mode 100644 index 00000000..34db743f --- /dev/null +++ b/cn/.gitbook/assets/seq-21.svg @@ -0,0 +1,13 @@ + + + + + + + + Agent 1Agent 2Conditionalagent_toolLoopStartEnd \ No newline at end of file diff --git a/cn/.gitbook/assets/seq-end-node.png b/cn/.gitbook/assets/seq-end-node.png new file mode 100644 index 00000000..76b1d08e Binary files /dev/null and b/cn/.gitbook/assets/seq-end-node.png differ diff --git a/cn/.gitbook/assets/simplestore.png b/cn/.gitbook/assets/simplestore.png new file mode 100644 index 00000000..24f9b252 Binary files /dev/null and b/cn/.gitbook/assets/simplestore.png differ diff --git a/cn/.gitbook/assets/spider.png b/cn/.gitbook/assets/spider.png new file mode 100644 index 00000000..2cc0bba6 Binary files /dev/null and b/cn/.gitbook/assets/spider.png differ diff --git a/cn/.gitbook/assets/spider_example_usage.png b/cn/.gitbook/assets/spider_example_usage.png new file mode 100644 index 00000000..6e53d3c0 Binary files /dev/null and b/cn/.gitbook/assets/spider_example_usage.png differ diff --git a/cn/.gitbook/assets/subagents.png b/cn/.gitbook/assets/subagents.png new file mode 100644 index 00000000..58c96341 Binary files /dev/null and b/cn/.gitbook/assets/subagents.png differ diff --git a/cn/.gitbook/assets/subagentstool.png b/cn/.gitbook/assets/subagentstool.png new file mode 100644 index 00000000..d21112dc Binary files /dev/null and b/cn/.gitbook/assets/subagentstool.png differ diff --git a/cn/.gitbook/assets/swagger (1) (1) (1).yml b/cn/.gitbook/assets/swagger (1) (1) (1).yml new file mode 100644 index 00000000..9e347ad5 --- /dev/null +++ b/cn/.gitbook/assets/swagger (1) (1) (1).yml @@ -0,0 +1,2467 @@ +tags: + - name: apikey + - name: assistants + - name: chatmessage + - name: chatflows + - name: credentials + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /apikey: + post: + tags: + - apikey + security: + - bearerAuth: [] + operationId: createApiKey + summary: Add new api key + description: Add new api key + requestBody: + content: + application/json: + schema: + type: object + properties: + keyName: + type: string + example: 'someKeyName' + required: true + responses: + '200': + description: Api key created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ApiKey' + application/xml: + schema: + $ref: '#/components/schemas/ApiKey' + '400': + description: Invalid keyName provided + '404': + description: Api Key not found + '422': + description: Validation exception + get: + tags: + - apikey + security: + - bearerAuth: [] + summary: List all API keys + description: List all API keys + operationId: listApiKey + responses: + '200': + description: A list of API keys + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiKey' + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/ApiKey' + '500': + description: Internal error + /apikey/{id}: + put: + tags: + - apikey + security: + - bearerAuth: [] + summary: Update API key name + description: Update API key name + operationId: updateApiKey + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Api Key ID + requestBody: + content: + application/json: + schema: + type: object + properties: + keyName: + type: string + example: 'someKeyName' + responses: + '200': + description: Api key updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ApiKey' + application/xml: + schema: + $ref: '#/components/schemas/ApiKey' + '400': + description: The specified ID is invalid + '404': + description: Api Key with the specified ID was not found + '500': + description: Internal error + delete: + tags: + - apikey + security: + - bearerAuth: [] + summary: Delete API key + description: Delete API key + operationId: deleteApiKey + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Api Key ID + responses: + '200': + description: Api key deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Api Key with the specified ID was not found + '500': + description: Internal error + + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /credentials: + post: + tags: + - credentials + security: + - bearerAuth: [] + operationId: createCredential + summary: Add new credential + description: Add new credential + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + required: true + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '400': + description: Invalid request body + '422': + description: Validation exception + get: + tags: + - credentials + security: + - bearerAuth: [] + summary: List all credentials + description: List all credentials + operationId: listCredentials + parameters: + - in: query + name: credentialName + required: false + schema: + type: string + description: Filter credentials by name + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Credential' + '500': + description: Internal error + + /credentials/{id}: + get: + tags: + - credentials + security: + - bearerAuth: [] + summary: Get a credential by ID + description: Retrieve a specific credential by ID + operationId: getCredentialById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Credential ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '400': + description: The specified ID is invalid + '404': + description: Credential with the specified ID was not found + '500': + description: Internal error + put: + tags: + - credentials + security: + - bearerAuth: [] + summary: Update a credential by ID + description: Update a specific credential by ID + operationId: updateCredential + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Credential ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + required: true + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '400': + description: The specified ID is invalid or request body is invalid + '404': + description: Credential with the specified ID was not found + '500': + description: Internal error + delete: + tags: + - credentials + security: + - bearerAuth: [] + summary: Delete a credential by ID + description: Delete a specific credential by ID + operationId: deleteCredential + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Credential ID + responses: + '200': + description: Successful operation + '400': + description: The specified ID is invalid + '404': + description: Credential with the specified ID was not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/loader/preview: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Preview document chunks + description: Preview document chunks from loader + operationId: previewChunking + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + required: true + responses: + '200': + description: Successfully preview chunks + content: + application/json: + schema: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/Document' + totalChunks: + type: integer + example: 10 + previewChunkCount: + type: integer + example: 5 + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/process: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Process loading & chunking operation + description: Process loading & chunking operation of document from loader + operationId: processChunking + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - id + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + id: + type: string + description: Document loader ID. If your URL is /document-stores/{storeId}/{id}, then id is the last part of the URL + example: 'c427e569-b81a-469a-b14c-fa73dd5bae49' + required: true + responses: + '200': + description: Successfully process chunking operation + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/save: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Save upsert configuration of document store + description: Save upsert configuration of document store + operationId: saveVectorStoreConfig + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + embeddingName: + type: string + description: Name of the embedding + example: 'openAIEmbeddings' + embeddingConfig: + type: object + description: Configuration of the embedding + example: { 'model': 'text-embedding-ada-002', 'credential': '1eba5808-c55b-4817-a285-b0c92846a7ad' } + vectorStoreName: + type: string + description: Name of the vector store + example: 'faiss' + vectorStoreConfig: + type: object + description: Configuration of the embedding + example: { 'basePath': './faiss' } + recordManagerName: + type: string + description: Name of the record manager + example: 'SQLiteRecordManager' + recordManagerConfig: + type: object + description: Configuration of the embedding + example: { 'databaseFilePath': './recordManager.db' } + required: true + responses: + '200': + description: Successfully save upsert configuration of document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/insert: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert chunks from document store + description: Upsert chunks from document store using the saved configuration + operationId: insertIntoVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + required: true + responses: + '200': + description: Successfully save upsert configuration of document store + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + description: The type of file upload (e.g., 'file', 'audio', 'url') + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger (1) (1).yml b/cn/.gitbook/assets/swagger (1) (1).yml new file mode 100644 index 00000000..379b15da --- /dev/null +++ b/cn/.gitbook/assets/swagger (1) (1).yml @@ -0,0 +1,2467 @@ +tags: + - name: apikey + - name: assistants + - name: chatmessage + - name: chatflows + - name: credentials + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /apikey: + post: + tags: + - apikey + security: + - bearerAuth: [] + operationId: createApiKey + summary: Add new api key + description: Add new api key + requestBody: + content: + application/json: + schema: + type: object + properties: + keyName: + type: string + example: 'someKeyName' + required: true + responses: + '200': + description: Api key created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ApiKey' + application/xml: + schema: + $ref: '#/components/schemas/ApiKey' + '400': + description: Invalid keyName provided + '404': + description: Api Key not found + '422': + description: Validation exception + get: + tags: + - apikey + security: + - bearerAuth: [] + summary: List all API keys + description: List all API keys + operationId: listApiKey + responses: + '200': + description: A list of API keys + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiKey' + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/ApiKey' + '500': + description: Internal error + /apikey/{id}: + put: + tags: + - apikey + security: + - bearerAuth: [] + summary: Update API key name + description: Update API key name + operationId: updateApiKey + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Api Key ID + requestBody: + content: + application/json: + schema: + type: object + properties: + keyName: + type: string + example: 'someKeyName' + responses: + '200': + description: Api key updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ApiKey' + application/xml: + schema: + $ref: '#/components/schemas/ApiKey' + '400': + description: The specified ID is invalid + '404': + description: Api Key with the specified ID was not found + '500': + description: Internal error + delete: + tags: + - apikey + security: + - bearerAuth: [] + summary: Delete API key + description: Delete API key + operationId: deleteApiKey + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Api Key ID + responses: + '200': + description: Api key deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Api Key with the specified ID was not found + '500': + description: Internal error + + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /credentials: + post: + tags: + - credentials + security: + - bearerAuth: [] + operationId: createCredential + summary: Add new credential + description: Add new credential + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + required: true + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '400': + description: Invalid request body + '422': + description: Validation exception + get: + tags: + - credentials + security: + - bearerAuth: [] + summary: List all credentials + description: List all credentials + operationId: listCredentials + parameters: + - in: query + name: credentialName + required: false + schema: + type: string + description: Filter credentials by name + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Credential' + '500': + description: Internal error + + /credentials/{id}: + get: + tags: + - credentials + security: + - bearerAuth: [] + summary: Get a credential by ID + description: Retrieve a specific credential by ID + operationId: getCredentialById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Credential ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '400': + description: The specified ID is invalid + '404': + description: Credential with the specified ID was not found + '500': + description: Internal error + put: + tags: + - credentials + security: + - bearerAuth: [] + summary: Update a credential by ID + description: Update a specific credential by ID + operationId: updateCredential + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Credential ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + required: true + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Credential' + '400': + description: The specified ID is invalid or request body is invalid + '404': + description: Credential with the specified ID was not found + '500': + description: Internal error + delete: + tags: + - credentials + security: + - bearerAuth: [] + summary: Delete a credential by ID + description: Delete a specific credential by ID + operationId: deleteCredential + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Credential ID + responses: + '200': + description: Successful operation + '400': + description: The specified ID is invalid + '404': + description: Credential with the specified ID was not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/loader/preview: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Preview document chunks + description: Preview document chunks from loader + operationId: previewChunking + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + required: true + responses: + '200': + description: Successfully preview chunks + content: + application/json: + schema: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/Document' + totalChunks: + type: integer + example: 10 + previewChunkCount: + type: integer + example: 5 + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/process: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Process loading & chunking operation + description: Process loading & chunking operation of document from loader + operationId: processChunking + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - id + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + id: + type: string + description: Document loader ID. If your URL is /document-stores/{storeId}/{id}, then id is the last part of the URL + example: 'c427e569-b81a-469a-b14c-fa73dd5bae49' + required: true + responses: + '200': + description: Successfully process chunking operation + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/save: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Save upsert configuration of document store + description: Save upsert configuration of document store + operationId: saveVectorStoreConfig + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + embeddingName: + type: string + description: Name of the embedding + example: 'openAIEmbeddings' + embeddingConfig: + type: object + description: Configuration of the embedding + example: { 'model': 'text-embedding-ada-002', 'credential': '1eba5808-c55b-4817-a285-b0c92846a7ad' } + vectorStoreName: + type: string + description: Name of the vector store + example: 'faiss' + vectorStoreConfig: + type: object + description: Configuration of the embedding + example: { 'basePath': './faiss' } + recordManagerName: + type: string + description: Name of the record manager + example: 'SQLiteRecordManager' + recordManagerConfig: + type: object + description: Configuration of the embedding + example: { 'databaseFilePath': './recordManager.db' } + required: true + responses: + '200': + description: Successfully save upsert configuration of document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/insert: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert chunks from document store + description: Upsert chunks from document store using the saved configuration + operationId: insertIntoVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + required: true + responses: + '200': + description: Successfully save upsert configuration of document store + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + description: The type of file upload (e.g., 'file', 'audio', 'url') + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger (1).yml b/cn/.gitbook/assets/swagger (1).yml new file mode 100644 index 00000000..da52b2f0 --- /dev/null +++ b/cn/.gitbook/assets/swagger (1).yml @@ -0,0 +1,2273 @@ +tags: + - name: assistants + - name: attachments + - name: chatmessage + - name: chatflows + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /attachments/{chatflowId}/{chatId}: + post: + tags: + - attachments + security: + - bearerAuth: [] + operationId: createAttachment + summary: Create attachments array + description: Return contents of the files in plain string format + parameters: + - in: path + name: chatflowId + required: true + schema: + type: string + description: Chatflow ID + - in: path + name: chatId + required: true + schema: + type: string + description: Chat ID + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + required: + - files + required: true + responses: + '200': + description: Attachments created successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateAttachmentResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow or ChatId not found + '422': + description: Validation error + '500': + description: Internal server error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/loader/preview: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Preview document chunks + description: Preview document chunks from loader + operationId: previewChunking + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + required: true + responses: + '200': + description: Successfully preview chunks + content: + application/json: + schema: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/Document' + totalChunks: + type: integer + example: 10 + previewChunkCount: + type: integer + example: 5 + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/process: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Process loading & chunking operation + description: Process loading & chunking operation of document from loader + operationId: processChunking + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - id + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + id: + type: string + description: Document loader ID. If your URL is /document-stores/{storeId}/{id}, then id is the last part of the URL + example: 'c427e569-b81a-469a-b14c-fa73dd5bae49' + required: true + responses: + '200': + description: Successfully process chunking operation + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/save: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Save upsert configuration of document store + description: Save upsert configuration of document store + operationId: saveVectorStoreConfig + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + embeddingName: + type: string + description: Name of the embedding + example: 'openAIEmbeddings' + embeddingConfig: + type: object + description: Configuration of the embedding + example: { 'model': 'text-embedding-ada-002', 'credential': '1eba5808-c55b-4817-a285-b0c92846a7ad' } + vectorStoreName: + type: string + description: Name of the vector store + example: 'faiss' + vectorStoreConfig: + type: object + description: Configuration of the embedding + example: { 'basePath': './faiss' } + recordManagerName: + type: string + description: Name of the record manager + example: 'SQLiteRecordManager' + recordManagerConfig: + type: object + description: Configuration of the embedding + example: { 'databaseFilePath': './recordManager.db' } + required: true + responses: + '200': + description: Successfully save upsert configuration of document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/insert: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert chunks from document store + description: Upsert chunks from document store using the saved configuration + operationId: insertIntoVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + required: true + responses: + '200': + description: Successfully save upsert configuration of document store + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + enum: [audio, url, file, file:rag, file:full] + description: The type of file upload + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + CreateAttachmentResponse: + type: object + properties: + name: + type: string + description: Name of the file + mimeType: + type: string + description: Mime type of the file + size: + type: string + description: Size of the file + content: + type: string + description: Content of the file in string format + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger (2) (1).yml b/cn/.gitbook/assets/swagger (2) (1).yml new file mode 100644 index 00000000..ad9b5e4b --- /dev/null +++ b/cn/.gitbook/assets/swagger (2) (1).yml @@ -0,0 +1,2281 @@ +tags: + - name: assistants + - name: attachments + - name: chatmessage + - name: chatflows + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /attachments/{chatflowId}/{chatId}: + post: + tags: + - attachments + security: + - bearerAuth: [] + operationId: createAttachment + summary: Create attachments array + description: Return contents of the files in plain string format + parameters: + - in: path + name: chatflowId + required: true + schema: + type: string + description: Chatflow ID + - in: path + name: chatId + required: true + schema: + type: string + description: Chat ID + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + base64: + type: boolean + default: false + description: Return contents of the files in base64 format + required: + - files + required: true + responses: + '200': + description: Attachments created successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateAttachmentResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow or ChatId not found + '422': + description: Validation error + '500': + description: Internal server error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/upsert/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert new document to document store + description: Upsert new document to document store + operationId: upsertDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + loader: + type: string + nullable: true + example: '{"name":"plainText","config":{"text":"why the sky is blue"}}' + description: Loader configurations + splitter: + type: string + nullable: true + example: '{"name":"recursiveCharacterTextSplitter","config":{"chunkSize":2000}}' + description: Splitter configurations + embedding: + type: string + nullable: true + example: '{"name":"openAIEmbeddings","config":{"modelName":"text-embedding-ada-002"}}' + description: Embedding configurations + vectorStore: + type: string + nullable: true + example: '{"name":"faiss"}' + description: Vector Store configurations + recordManager: + type: string + nullable: true + example: '{"name":"postgresRecordManager"}' + description: Record Manager configurations + required: + - files + required: true + responses: + '200': + description: Successfully execute upsert operation + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/refresh/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Re-process and upsert all documents in document store + description: Re-process and upsert all existing documents in document store + operationId: refreshDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForRefresh' + required: true + responses: + '200': + description: Successfully execute refresh operation + content: + application/json: + type: array + items: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + enum: [audio, url, file, file:rag, file:full] + description: The type of file upload + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + DocumentStoreLoaderForUpsert: + type: object + properties: + docId: + type: string + format: uuid + description: Document ID within the store. If provided, existing configuration from the document will be used for the new document + loader: + type: object + properties: + name: + type: string + example: plainText + description: Name of the loader (camelCase) + config: + type: object + description: Configuration for the loader + splitter: + type: object + properties: + name: + type: string + example: recursiveCharacterTextSplitter + description: Name of the text splitter (camelCase) + config: + type: object + description: Configuration for the text splitter + embedding: + type: object + properties: + name: + type: string + example: openAIEmbeddings + description: Name of the embedding generator (camelCase) + config: + type: object + description: Configuration for the embedding generator + vectorStore: + type: object + properties: + name: + type: string + example: faiss + description: Name of the vector store (camelCase) + config: + type: object + description: Configuration for the vector store + recordManager: + type: object + properties: + name: + type: string + example: postgresRecordManager + description: Name of the record manager (camelCase) + config: + type: object + description: Configuration for the record manager + + DocumentStoreLoaderForRefresh: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + CreateAttachmentResponse: + type: object + properties: + name: + type: string + description: Name of the file + mimeType: + type: string + description: Mime type of the file + size: + type: string + description: Size of the file + content: + type: string + description: Content of the file in string format + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger (2).yml b/cn/.gitbook/assets/swagger (2).yml new file mode 100644 index 00000000..5a92d4bf --- /dev/null +++ b/cn/.gitbook/assets/swagger (2).yml @@ -0,0 +1,2438 @@ +tags: + - name: assistants + - name: attachments + - name: chatmessage + - name: chatflows + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /attachments/{chatflowId}/{chatId}: + post: + tags: + - attachments + security: + - bearerAuth: [] + operationId: createAttachment + summary: Create attachments array + description: Return contents of the files in plain string format + parameters: + - in: path + name: chatflowId + required: true + schema: + type: string + description: Chatflow ID + - in: path + name: chatId + required: true + schema: + type: string + description: Chat ID + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + base64: + type: boolean + default: false + description: Return contents of the files in base64 format + required: + - files + required: true + responses: + '200': + description: Attachments created successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateAttachmentResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow or ChatId not found + '422': + description: Validation error + '500': + description: Internal server error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/upsert/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert new document to document store + description: Upsert new document to document store + operationId: upsertDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + loader: + type: string + nullable: true + example: '{"name":"plainText","config":{"text":"why the sky is blue"}}' + description: Loader configurations + splitter: + type: string + nullable: true + example: '{"name":"recursiveCharacterTextSplitter","config":{"chunkSize":2000}}' + description: Splitter configurations + embedding: + type: string + nullable: true + example: '{"name":"openAIEmbeddings","config":{"modelName":"text-embedding-ada-002"}}' + description: Embedding configurations + vectorStore: + type: string + nullable: true + example: '{"name":"faiss"}' + description: Vector Store configurations + recordManager: + type: string + nullable: true + example: '{"name":"postgresRecordManager"}' + description: Record Manager configurations + required: + - files + required: true + responses: + '200': + description: Successfully execute upsert operation + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/refresh/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Re-process and upsert all documents in document store + description: Re-process and upsert all existing documents in document store + operationId: refreshDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForRefresh' + required: true + responses: + '200': + description: Successfully execute refresh operation + content: + application/json: + type: array + items: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document Store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/{storeId}/{loaderId}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete specific document loader and associated chunks from document store + description: Delete specific document loader and associated chunks from document store. This does not delete data from vector store. + operationId: deleteLoaderFromDocumentStore + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + responses: + '200': + description: Successfully deleted loader from document store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{pageNo}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get chunks from a specific document loader + description: Get chunks from a specific document loader within a document store + operationId: getDocumentStoreFileChunks + parameters: + - in: path + name: storeId + required: true + schema: + type: string + format: uuid + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + format: uuid + description: Document loader ID + - in: path + name: pageNo + required: true + schema: + type: string + description: Pagination number + responses: + '200': + description: Successfully retrieved chunks from document loader + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{chunkId}: + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific chunk + description: Updates a specific chunk from a document loader + operationId: editDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + '200': + description: Successfully updated chunk + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific chunk from a document loader + description: Delete a specific chunk from a document loader + operationId: deleteDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + responses: + '200': + description: Successfully deleted chunk + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + enum: [audio, url, file, file:rag, file:full] + description: The type of file upload + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document Store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + DocumentStoreLoaderForUpsert: + type: object + properties: + docId: + type: string + format: uuid + description: Document ID within the store. If provided, existing configuration from the document will be used for the new document + loader: + type: object + properties: + name: + type: string + example: plainText + description: Name of the loader (camelCase) + config: + type: object + description: Configuration for the loader + splitter: + type: object + properties: + name: + type: string + example: recursiveCharacterTextSplitter + description: Name of the text splitter (camelCase) + config: + type: object + description: Configuration for the text splitter + embedding: + type: object + properties: + name: + type: string + example: openAIEmbeddings + description: Name of the embedding generator (camelCase) + config: + type: object + description: Configuration for the embedding generator + vectorStore: + type: object + properties: + name: + type: string + example: faiss + description: Name of the vector store (camelCase) + config: + type: object + description: Configuration for the vector store + recordManager: + type: object + properties: + name: + type: string + example: postgresRecordManager + description: Name of the record manager (camelCase) + config: + type: object + description: Configuration for the record manager + + DocumentStoreLoaderForRefresh: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + CreateAttachmentResponse: + type: object + properties: + name: + type: string + description: Name of the file + mimeType: + type: string + description: Mime type of the file + size: + type: string + description: Size of the file + content: + type: string + description: Content of the file in string format + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger (3).yml b/cn/.gitbook/assets/swagger (3).yml new file mode 100644 index 00000000..0ea487b4 --- /dev/null +++ b/cn/.gitbook/assets/swagger (3).yml @@ -0,0 +1,2465 @@ +tags: + - name: assistants + - name: attachments + - name: chatmessage + - name: chatflows + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type. Only applicable if feedback is true + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + description: Filter by end date + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /attachments/{chatflowId}/{chatId}: + post: + tags: + - attachments + security: + - bearerAuth: [] + operationId: createAttachment + summary: Create attachments array + description: Return contents of the files in plain string format + parameters: + - in: path + name: chatflowId + required: true + schema: + type: string + description: Chatflow ID + - in: path + name: chatId + required: true + schema: + type: string + description: Chat ID + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + base64: + type: boolean + default: false + description: Return contents of the files in base64 format + required: + - files + required: true + responses: + '200': + description: Attachments created successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateAttachmentResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow or ChatId not found + '422': + description: Validation error + '500': + description: Internal server error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/upsert/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert document to document store + description: Upsert document to document store + operationId: upsertDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + loader: + type: string + nullable: true + example: '{"name":"plainText","config":{"text":"why the sky is blue"}}' + description: Loader configurations + splitter: + type: string + nullable: true + example: '{"name":"recursiveCharacterTextSplitter","config":{"chunkSize":2000}}' + description: Splitter configurations + embedding: + type: string + nullable: true + example: '{"name":"openAIEmbeddings","config":{"modelName":"text-embedding-ada-002"}}' + description: Embedding configurations + vectorStore: + type: string + nullable: true + example: '{"name":"faiss"}' + description: Vector Store configurations + recordManager: + type: string + nullable: true + example: '{"name":"postgresRecordManager"}' + description: Record Manager configurations + required: + - files + required: true + responses: + '200': + description: Successfully execute upsert operation + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/refresh/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Re-process and upsert all documents in document store + description: Re-process and upsert all existing documents in document store + operationId: refreshDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForRefresh' + required: true + responses: + '200': + description: Successfully execute refresh operation + content: + application/json: + type: array + items: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document Store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/{storeId}/{loaderId}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete specific document loader and associated chunks from document store + description: Delete specific document loader and associated chunks from document store. This does not delete data from vector store. + operationId: deleteLoaderFromDocumentStore + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + responses: + '200': + description: Successfully deleted loader from document store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{pageNo}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get chunks from a specific document loader + description: Get chunks from a specific document loader within a document store + operationId: getDocumentStoreFileChunks + parameters: + - in: path + name: storeId + required: true + schema: + type: string + format: uuid + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + format: uuid + description: Document loader ID + - in: path + name: pageNo + required: true + schema: + type: string + description: Pagination number + responses: + '200': + description: Successfully retrieved chunks from document loader + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{chunkId}: + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific chunk + description: Updates a specific chunk from a document loader + operationId: editDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + '200': + description: Successfully updated chunk + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific chunk from a document loader + description: Delete a specific chunk from a document loader + operationId: deleteDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + responses: + '200': + description: Successfully deleted chunk + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + enum: [audio, url, file, file:rag, file:full] + description: The type of file upload + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document Store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + DocumentStoreLoaderForUpsert: + type: object + properties: + docId: + type: string + format: uuid + description: Document ID within the store. If provided, existing configuration from the document will be used for the new document + metadata: + type: object + description: Metadata associated with the document + example: { 'foo': 'bar' } + replaceExisting: + type: boolean + description: Whether to replace existing document loader with the new upserted chunks. However this does not delete the existing embeddings in the vector store + loader: + type: object + properties: + name: + type: string + example: plainText + description: Name of the loader (camelCase) + config: + type: object + description: Configuration for the loader + splitter: + type: object + properties: + name: + type: string + example: recursiveCharacterTextSplitter + description: Name of the text splitter (camelCase) + config: + type: object + description: Configuration for the text splitter + embedding: + type: object + properties: + name: + type: string + example: openAIEmbeddings + description: Name of the embedding generator (camelCase) + config: + type: object + description: Configuration for the embedding generator + vectorStore: + type: object + properties: + name: + type: string + example: faiss + description: Name of the vector store (camelCase) + config: + type: object + description: Configuration for the vector store + recordManager: + type: object + properties: + name: + type: string + example: postgresRecordManager + description: Name of the record manager (camelCase) + config: + type: object + description: Configuration for the record manager + + DocumentStoreLoaderForRefresh: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + CreateAttachmentResponse: + type: object + properties: + name: + type: string + description: Name of the file + mimeType: + type: string + description: Mime type of the file + size: + type: string + description: Size of the file + content: + type: string + description: Content of the file in string format + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger (4).yml b/cn/.gitbook/assets/swagger (4).yml new file mode 100644 index 00000000..3b37cc52 --- /dev/null +++ b/cn/.gitbook/assets/swagger (4).yml @@ -0,0 +1,2470 @@ +tags: + - name: assistants + - name: attachments + - name: chatmessage + - name: chatflows + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type. Only applicable if feedback is true + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + description: Filter by end date + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + - in: query + name: hardDelete + schema: + type: boolean + description: If hardDelete is true, messages will be deleted from the third party service as well + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /attachments/{chatflowId}/{chatId}: + post: + tags: + - attachments + security: + - bearerAuth: [] + operationId: createAttachment + summary: Create attachments array + description: Return contents of the files in plain string format + parameters: + - in: path + name: chatflowId + required: true + schema: + type: string + description: Chatflow ID + - in: path + name: chatId + required: true + schema: + type: string + description: Chat ID + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + base64: + type: boolean + default: false + description: Return contents of the files in base64 format + required: + - files + required: true + responses: + '200': + description: Attachments created successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateAttachmentResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow or ChatId not found + '422': + description: Validation error + '500': + description: Internal server error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/upsert/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert document to document store + description: Upsert document to document store + operationId: upsertDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + loader: + type: string + nullable: true + example: '{"name":"plainText","config":{"text":"why the sky is blue"}}' + description: Loader configurations + splitter: + type: string + nullable: true + example: '{"name":"recursiveCharacterTextSplitter","config":{"chunkSize":2000}}' + description: Splitter configurations + embedding: + type: string + nullable: true + example: '{"name":"openAIEmbeddings","config":{"modelName":"text-embedding-ada-002"}}' + description: Embedding configurations + vectorStore: + type: string + nullable: true + example: '{"name":"faiss"}' + description: Vector Store configurations + recordManager: + type: string + nullable: true + example: '{"name":"postgresRecordManager"}' + description: Record Manager configurations + required: + - files + required: true + responses: + '200': + description: Successfully execute upsert operation + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/refresh/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Re-process and upsert all documents in document store + description: Re-process and upsert all existing documents in document store + operationId: refreshDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForRefresh' + required: true + responses: + '200': + description: Successfully execute refresh operation + content: + application/json: + type: array + items: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document Store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/{storeId}/{loaderId}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete specific document loader and associated chunks from document store + description: Delete specific document loader and associated chunks from document store. This does not delete data from vector store. + operationId: deleteLoaderFromDocumentStore + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + responses: + '200': + description: Successfully deleted loader from document store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{pageNo}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get chunks from a specific document loader + description: Get chunks from a specific document loader within a document store + operationId: getDocumentStoreFileChunks + parameters: + - in: path + name: storeId + required: true + schema: + type: string + format: uuid + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + format: uuid + description: Document loader ID + - in: path + name: pageNo + required: true + schema: + type: string + description: Pagination number + responses: + '200': + description: Successfully retrieved chunks from document loader + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{chunkId}: + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific chunk + description: Updates a specific chunk from a document loader + operationId: editDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + '200': + description: Successfully updated chunk + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific chunk from a document loader + description: Delete a specific chunk from a document loader + operationId: deleteDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + responses: + '200': + description: Successfully deleted chunk + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + enum: [audio, url, file, file:rag, file:full] + description: The type of file upload + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document Store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + DocumentStoreLoaderForUpsert: + type: object + properties: + docId: + type: string + format: uuid + description: Document ID within the store. If provided, existing configuration from the document will be used for the new document + metadata: + type: object + description: Metadata associated with the document + example: { 'foo': 'bar' } + replaceExisting: + type: boolean + description: Whether to replace existing document loader with the new upserted chunks. However this does not delete the existing embeddings in the vector store + loader: + type: object + properties: + name: + type: string + example: plainText + description: Name of the loader (camelCase) + config: + type: object + description: Configuration for the loader + splitter: + type: object + properties: + name: + type: string + example: recursiveCharacterTextSplitter + description: Name of the text splitter (camelCase) + config: + type: object + description: Configuration for the text splitter + embedding: + type: object + properties: + name: + type: string + example: openAIEmbeddings + description: Name of the embedding generator (camelCase) + config: + type: object + description: Configuration for the embedding generator + vectorStore: + type: object + properties: + name: + type: string + example: faiss + description: Name of the vector store (camelCase) + config: + type: object + description: Configuration for the vector store + recordManager: + type: object + properties: + name: + type: string + example: postgresRecordManager + description: Name of the record manager (camelCase) + config: + type: object + description: Configuration for the record manager + + DocumentStoreLoaderForRefresh: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + CreateAttachmentResponse: + type: object + properties: + name: + type: string + description: Name of the file + mimeType: + type: string + description: Mime type of the file + size: + type: string + description: Size of the file + content: + type: string + description: Content of the file in string format + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger (5).yml b/cn/.gitbook/assets/swagger (5).yml new file mode 100644 index 00000000..9cca7597 --- /dev/null +++ b/cn/.gitbook/assets/swagger (5).yml @@ -0,0 +1,2526 @@ +tags: + - name: assistants + - name: attachments + - name: chatmessage + - name: chatflows + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type. Only applicable if feedback is true + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + description: Filter by end date + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + - in: query + name: hardDelete + schema: + type: boolean + description: If hardDelete is true, messages will be deleted from the third party service as well + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /attachments/{chatflowId}/{chatId}: + post: + tags: + - attachments + security: + - bearerAuth: [] + operationId: createAttachment + summary: Create attachments array + description: Return contents of the files in plain string format + parameters: + - in: path + name: chatflowId + required: true + schema: + type: string + description: Chatflow ID + - in: path + name: chatId + required: true + schema: + type: string + description: Chat ID + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + base64: + type: boolean + default: false + description: Return contents of the files in base64 format + required: + - files + required: true + responses: + '200': + description: Attachments created successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateAttachmentResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow or ChatId not found + '422': + description: Validation error + '500': + description: Internal server error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/upsert/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert document to document store + description: Upsert document to document store + operationId: upsertDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + docId: + type: string + nullable: true + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + description: Document ID to use existing configuration + loader: + type: string + nullable: true + example: '{"name":"plainText","config":{"text":"why the sky is blue"}}' + description: Loader configurations + splitter: + type: string + nullable: true + example: '{"name":"recursiveCharacterTextSplitter","config":{"chunkSize":2000}}' + description: Splitter configurations + embedding: + type: string + nullable: true + example: '{"name":"openAIEmbeddings","config":{"modelName":"text-embedding-ada-002"}}' + description: Embedding configurations + vectorStore: + type: string + nullable: true + example: '{"name":"faiss"}' + description: Vector Store configurations + recordManager: + type: string + nullable: true + example: '{"name":"postgresRecordManager"}' + description: Record Manager configurations + metadata: + type: object + nullable: true + description: Metadata associated with the document + example: { 'foo': 'bar' } + replaceExisting: + type: boolean + nullable: true + description: Whether to replace existing document loader with the new upserted chunks. However this does not delete the existing embeddings in the vector store + createNewDocStore: + type: boolean + nullable: true + description: Whether to create a new document store + docStore: + type: object + nullable: true + description: Only when createNewDocStore is true, pass in the new document store configuration + properties: + name: + type: string + example: plainText + description: Name of the new document store to be created + description: + type: string + example: plainText + description: Description of the new document store to be created + required: + - files + required: true + responses: + '200': + description: Successfully execute upsert operation + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/refresh/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Re-process and upsert all documents in document store + description: Re-process and upsert all existing documents in document store + operationId: refreshDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForRefresh' + required: true + responses: + '200': + description: Successfully execute refresh operation + content: + application/json: + type: array + items: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document Store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/{storeId}/{loaderId}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete specific document loader and associated chunks from document store + description: Delete specific document loader and associated chunks from document store. This does not delete data from vector store. + operationId: deleteLoaderFromDocumentStore + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + responses: + '200': + description: Successfully deleted loader from document store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{pageNo}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get chunks from a specific document loader + description: Get chunks from a specific document loader within a document store + operationId: getDocumentStoreFileChunks + parameters: + - in: path + name: storeId + required: true + schema: + type: string + format: uuid + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + format: uuid + description: Document loader ID + - in: path + name: pageNo + required: true + schema: + type: string + description: Pagination number + responses: + '200': + description: Successfully retrieved chunks from document loader + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{chunkId}: + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific chunk + description: Updates a specific chunk from a document loader + operationId: editDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + '200': + description: Successfully updated chunk + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific chunk from a document loader + description: Delete a specific chunk from a document loader + operationId: deleteDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + responses: + '200': + description: Successfully deleted chunk + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + enum: [audio, url, file, file:rag, file:full] + description: The type of file upload + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document Store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + DocumentStoreLoaderForUpsert: + type: object + properties: + docId: + type: string + format: uuid + nullable: true + description: Document ID within the store. If provided, existing configuration from the document will be used for the new document + metadata: + type: object + nullable: true + description: Metadata associated with the document + example: { 'foo': 'bar' } + replaceExisting: + type: boolean + nullable: true + description: Whether to replace existing document loader with the new upserted chunks. However this does not delete the existing embeddings in the vector store + createNewDocStore: + type: boolean + nullable: true + description: Whether to create a new document store + docStore: + type: object + nullable: true + description: Only when createNewDocStore is true, pass in the new document store configuration + properties: + name: + type: string + example: plainText + description: Name of the new document store to be created + description: + type: string + example: plainText + description: Description of the new document store to be created + loader: + type: object + nullable: true + properties: + name: + type: string + example: plainText + description: Name of the loader (camelCase) + config: + type: object + description: Configuration for the loader + splitter: + type: object + nullable: true + properties: + name: + type: string + example: recursiveCharacterTextSplitter + description: Name of the text splitter (camelCase) + config: + type: object + description: Configuration for the text splitter + embedding: + type: object + nullable: true + properties: + name: + type: string + example: openAIEmbeddings + description: Name of the embedding generator (camelCase) + config: + type: object + description: Configuration for the embedding generator + vectorStore: + type: object + nullable: true + properties: + name: + type: string + example: faiss + description: Name of the vector store (camelCase) + config: + type: object + description: Configuration for the vector store + recordManager: + type: object + nullable: true + properties: + name: + type: string + example: postgresRecordManager + description: Name of the record manager (camelCase) + config: + type: object + description: Configuration for the record manager + + DocumentStoreLoaderForRefresh: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + CreateAttachmentResponse: + type: object + properties: + name: + type: string + description: Name of the file + mimeType: + type: string + description: Mime type of the file + size: + type: string + description: Size of the file + content: + type: string + description: Content of the file in string format + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/swagger.yml b/cn/.gitbook/assets/swagger.yml new file mode 100644 index 00000000..9cca7597 --- /dev/null +++ b/cn/.gitbook/assets/swagger.yml @@ -0,0 +1,2526 @@ +tags: + - name: assistants + - name: attachments + - name: chatmessage + - name: chatflows + - name: document-store + - name: feedback + - name: leads + - name: ping + - name: prediction + - name: tools + - name: upsert-history + - name: variables + - name: vector + +paths: + /chatmessage/{id}: + get: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: getAllChatMessages + summary: List all chat messages + description: Retrieve all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: order + schema: + type: string + enum: [ASC, DESC] + description: Sort order + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + format: date-time + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + format: date-time + description: Filter by end date + - in: query + name: feedback + schema: + type: boolean + description: Filter by feedback + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type. Only applicable if feedback is true + responses: + '200': + description: A list of chat messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessage' + '500': + description: Internal error + + delete: + tags: + - chatmessage + security: + - bearerAuth: [] + operationId: removeAllChatMessages + summary: Delete all chat messages + description: Delete all chat messages for a specific chatflow. + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Filter by chat ID + - in: query + name: memoryType + schema: + type: string + example: Buffer Memory + description: Filter by memory type + - in: query + name: sessionId + schema: + type: string + description: Filter by session ID + - in: query + name: chatType + schema: + type: string + enum: [INTERNAL, EXTERNAL] + description: Filter by chat type + - in: query + name: startDate + schema: + type: string + example: 2025-01-01T11:28:36.000Z + description: Filter by start date + - in: query + name: endDate + schema: + type: string + example: 2025-01-13T11:28:36.000Z + description: Filter by end date + - in: query + name: feedbackType + schema: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Filter by feedback type + - in: query + name: hardDelete + schema: + type: boolean + description: If hardDelete is true, messages will be deleted from the third party service as well + responses: + '200': + description: Chat messages deleted successfully + '400': + description: Invalid parameters + '404': + description: Chat messages not found + '500': + description: Internal error + /assistants: + post: + tags: + - assistants + security: + - bearerAuth: [] + operationId: createAssistant + summary: Create a new assistant + description: Create a new assistant with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + required: true + responses: + '200': + description: Assistant created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: List all assistants + description: Retrieve a list of all assistants + operationId: listAssistants + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Assistant' + '500': + description: Internal error + /assistants/{id}: + get: + tags: + - assistants + security: + - bearerAuth: [] + summary: Get assistant by ID + description: Retrieve a specific assistant by ID + operationId: getAssistantById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + put: + tags: + - assistants + security: + - bearerAuth: [] + summary: Update assistant details + description: Update the details of an existing assistant + operationId: updateAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + responses: + '200': + description: Assistant updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/assistant' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Assistant not found + '500': + description: Internal error + delete: + tags: + - assistants + security: + - bearerAuth: [] + summary: Delete an assistant + description: Delete an assistant by ID + operationId: deleteAssistant + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Assistant ID + responses: + '200': + description: Assistant deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Assistant not found + '500': + description: Internal error + + /attachments/{chatflowId}/{chatId}: + post: + tags: + - attachments + security: + - bearerAuth: [] + operationId: createAttachment + summary: Create attachments array + description: Return contents of the files in plain string format + parameters: + - in: path + name: chatflowId + required: true + schema: + type: string + description: Chatflow ID + - in: path + name: chatId + required: true + schema: + type: string + description: Chat ID + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + base64: + type: boolean + default: false + description: Return contents of the files in base64 format + required: + - files + required: true + responses: + '200': + description: Attachments created successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateAttachmentResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow or ChatId not found + '422': + description: Validation error + '500': + description: Internal server error + + /chatflows: + post: + tags: + - chatflows + security: + - bearerAuth: [] + operationId: createChatflow + summary: Create a new chatflow + description: Create a new chatflow with the provided details + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + required: true + responses: + '200': + description: Chatflow created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: Invalid input provided + '422': + description: Validation exception + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: List all chatflows + description: Retrieve a list of all chatflows + operationId: listChatflows + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Chatflow' + '500': + description: Internal error + /chatflows/{id}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by ID + description: Retrieve a specific chatflow by ID + operationId: getChatflowById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + put: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Update chatflow details + description: Update the details of an existing chatflow + operationId: updateChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + responses: + '200': + description: Chatflow updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified ID is invalid or body is missing + '404': + description: Chatflow not found + '500': + description: Internal error + delete: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Delete a chatflow + description: Delete a chatflow by ID + operationId: deleteChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Chatflow deleted successfully + '400': + description: The specified ID is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + /chatflows/apikey/{apikey}: + get: + tags: + - chatflows + security: + - bearerAuth: [] + summary: Get chatflow by API key + description: Retrieve a chatflow using an API key + operationId: getChatflowByApiKey + parameters: + - in: path + name: apikey + required: true + schema: + type: string + description: API key associated with the chatflow + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Chatflow' + '400': + description: The specified API key is invalid + '404': + description: Chatflow not found + '500': + description: Internal error + + /document-store/store: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Create a new document store + description: Creates a new document store with the provided details + operationId: createDocumentStore + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully created document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '400': + description: Invalid request body + '500': + description: Internal server error + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: List all document stores + description: Retrieves a list of all document stores + operationId: getAllDocumentStores + responses: + '200': + description: A list of document stores + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DocumentStore' + '500': + description: Internal server error + + /document-store/store/{id}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get a specific document store + description: Retrieves details of a specific document store by its ID + operationId: getDocumentStoreById + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully retrieved document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific document store + description: Updates the details of a specific document store by its ID + operationId: updateDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + required: true + responses: + '200': + description: Successfully updated document store + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStore' + '404': + description: Document store not found + '500': + description: Internal server error + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific document store + description: Deletes a document store by its ID + operationId: deleteDocumentStore + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + responses: + '200': + description: Successfully deleted document store + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/upsert/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Upsert document to document store + description: Upsert document to document store + operationId: upsertDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + docId: + type: string + nullable: true + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + description: Document ID to use existing configuration + loader: + type: string + nullable: true + example: '{"name":"plainText","config":{"text":"why the sky is blue"}}' + description: Loader configurations + splitter: + type: string + nullable: true + example: '{"name":"recursiveCharacterTextSplitter","config":{"chunkSize":2000}}' + description: Splitter configurations + embedding: + type: string + nullable: true + example: '{"name":"openAIEmbeddings","config":{"modelName":"text-embedding-ada-002"}}' + description: Embedding configurations + vectorStore: + type: string + nullable: true + example: '{"name":"faiss"}' + description: Vector Store configurations + recordManager: + type: string + nullable: true + example: '{"name":"postgresRecordManager"}' + description: Record Manager configurations + metadata: + type: object + nullable: true + description: Metadata associated with the document + example: { 'foo': 'bar' } + replaceExisting: + type: boolean + nullable: true + description: Whether to replace existing document loader with the new upserted chunks. However this does not delete the existing embeddings in the vector store + createNewDocStore: + type: boolean + nullable: true + description: Whether to create a new document store + docStore: + type: object + nullable: true + description: Only when createNewDocStore is true, pass in the new document store configuration + properties: + name: + type: string + example: plainText + description: Name of the new document store to be created + description: + type: string + example: plainText + description: Description of the new document store to be created + required: + - files + required: true + responses: + '200': + description: Successfully execute upsert operation + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/refresh/{id}: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Re-process and upsert all documents in document store + description: Re-process and upsert all existing documents in document store + operationId: refreshDocument + parameters: + - in: path + name: id + required: true + schema: + type: string + format: uuid + description: Document Store ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreLoaderForRefresh' + required: true + responses: + '200': + description: Successfully execute refresh operation + content: + application/json: + type: array + items: + $ref: '#/components/schemas/VectorUpsertResponse' + + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/vectorstore/query: + post: + tags: + - document-store + security: + - bearerAuth: [] + summary: Retrieval query + description: Retrieval query for the upserted chunks + operationId: queryVectorStore + requestBody: + content: + application/json: + schema: + type: object + required: + - storeId + - query + properties: + storeId: + type: string + description: Document Store ID + example: '603a7b51-ae7c-4b0a-8865-e454ed2f6766' + query: + type: string + description: Query to search for + example: 'What is the capital of France?' + required: true + responses: + '200': + description: Successfully executed query on vector store + content: + application/json: + schema: + type: object + properties: + timeTaken: + type: number + description: Time taken to execute the query (in milliseconds) + docs: + type: array + items: + $ref: '#/components/schemas/Document' + '400': + description: Invalid request body + '500': + description: Internal server error + + /document-store/loader/{storeId}/{loaderId}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete specific document loader and associated chunks from document store + description: Delete specific document loader and associated chunks from document store. This does not delete data from vector store. + operationId: deleteLoaderFromDocumentStore + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + responses: + '200': + description: Successfully deleted loader from document store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/vectorstore/{id}: + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete data from vector store + description: Only data that were upserted with Record Manager will be deleted from vector store + operationId: deleteVectorStoreFromStore + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Document Store ID + responses: + '200': + description: Successfully deleted data from vector store + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{pageNo}: + get: + tags: + - document-store + security: + - bearerAuth: [] + summary: Get chunks from a specific document loader + description: Get chunks from a specific document loader within a document store + operationId: getDocumentStoreFileChunks + parameters: + - in: path + name: storeId + required: true + schema: + type: string + format: uuid + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + format: uuid + description: Document loader ID + - in: path + name: pageNo + required: true + schema: + type: string + description: Pagination number + responses: + '200': + description: Successfully retrieved chunks from document loader + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + /document-store/chunks/{storeId}/{loaderId}/{chunkId}: + put: + tags: + - document-store + security: + - bearerAuth: [] + summary: Update a specific chunk + description: Updates a specific chunk from a document loader + operationId: editDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + '200': + description: Successfully updated chunk + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentStoreFileChunkPagedResponse' + '404': + description: Document store not found + '500': + description: Internal server error + + delete: + tags: + - document-store + security: + - bearerAuth: [] + summary: Delete a specific chunk from a document loader + description: Delete a specific chunk from a document loader + operationId: deleteDocumentStoreFileChunk + parameters: + - in: path + name: storeId + required: true + schema: + type: string + description: Document Store ID + - in: path + name: loaderId + required: true + schema: + type: string + description: Document Loader ID + - in: path + name: chunkId + required: true + schema: + type: string + description: Document Chunk ID + responses: + '200': + description: Successfully deleted chunk + '400': + description: Invalid ID provided + '404': + description: Document Store not found + '500': + description: Internal server error + + /feedback: + post: + tags: + - feedback + security: + - bearerAuth: [] + operationId: createChatMessageFeedbackForChatflow + summary: Create new chat message feedback + description: Create new feedback for a specific chat flow. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + required: true + responses: + '200': + description: Feedback successfully created + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '500': + description: Internal server error + /feedback/{id}: + get: + tags: + - feedback + security: + - bearerAuth: [] + summary: List all chat message feedbacks for a chatflow + description: Retrieve all feedbacks for a chatflow + operationId: getAllChatMessageFeedback + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + - in: query + name: chatId + schema: + type: string + description: Chat ID to filter feedbacks (optional) + - in: query + name: sortOrder + schema: + type: string + enum: [asc, desc] + default: asc + description: Sort order of feedbacks (optional) + - in: query + name: startDate + schema: + type: string + format: date-time + description: Filter feedbacks starting from this date (optional) + - in: query + name: endDate + schema: + type: string + format: date-time + description: Filter feedbacks up to this date (optional) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ChatMessageFeedback' + '500': + description: Internal server error + put: + tags: + - feedback + security: + - bearerAuth: [] + summary: Update chat message feedback + description: Update a specific feedback + operationId: updateChatMessageFeedbackForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chat Message Feedback ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + responses: + '200': + description: Feedback successfully updated + content: + application/json: + schema: + $ref: '#/components/schemas/ChatMessageFeedback' + '400': + description: Invalid input provided + '404': + description: Feedback with the specified ID was not found + '500': + description: Internal server error + + /leads: + post: + tags: + - leads + security: + - bearerAuth: [] + operationId: createLead + summary: Create a new lead in a chatflow + description: Create a new lead associated with a specific chatflow + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + required: true + responses: + '200': + description: Lead created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + + /leads/{id}: + get: + tags: + - leads + security: + - bearerAuth: [] + summary: Get all leads for a specific chatflow + description: Retrieve all leads associated with a specific chatflow + operationId: getAllLeadsForChatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Lead' + '400': + description: Invalid ID provided + '404': + description: Leads not found + '500': + description: Internal server error + + /ping: + get: + tags: + - ping + summary: Ping the server + description: Ping the server to check if it is running + operationId: pingServer + responses: + '200': + description: Server is running + content: + text/plain: + schema: + type: string + example: pong + '500': + description: Internal server error + + /prediction/{id}: + post: + tags: + - prediction + security: + - bearerAuth: [] + operationId: createPrediction + summary: Create a new prediction + description: Create a new prediction + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Prediction' + multipart/form-data: + schema: + type: object + properties: + question: + type: string + description: Question to ask during the prediction process + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - question + required: true + responses: + '200': + description: Prediction created successfully + content: + application/json: + schema: + type: object + properties: + text: + type: string + description: The result of the prediction + json: + type: object + description: The result of the prediction in JSON format if available + question: + type: string + description: The question asked during the prediction process + chatId: + type: string + description: The chat ID associated with the prediction + chatMessageId: + type: string + description: The chat message ID associated with the prediction + sessionId: + type: string + description: The session ID associated with the prediction + memoryType: + type: string + description: The memory type associated with the prediction + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + items: + $ref: '#/components/schemas/FileAnnotation' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + /tools: + post: + tags: + - tools + security: + - bearerAuth: [] + operationId: createTool + summary: Create a new tool + description: Create a new tool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - tools + security: + - bearerAuth: [] + summary: List all tools + description: Retrieve a list of all tools + operationId: getAllTools + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Tool' + '500': + description: Internal server error + + /tools/{id}: + get: + tags: + - tools + security: + - bearerAuth: [] + summary: Get a tool by ID + description: Retrieve a specific tool by ID + operationId: getToolById + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + put: + tags: + - tools + security: + - bearerAuth: [] + summary: Update a tool by ID + description: Update a specific tool by ID + operationId: updateTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + required: true + responses: + '200': + description: Tool updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Tool' + '400': + description: Invalid ID or request body provided + '404': + description: Tool not found + '500': + description: Internal server error + delete: + tags: + - tools + security: + - bearerAuth: [] + summary: Delete a tool by ID + description: Delete a specific tool by ID + operationId: deleteTool + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Tool ID + responses: + '200': + description: Tool deleted successfully + '400': + description: Invalid ID provided + '404': + description: Tool not found + '500': + description: Internal server error + + /upsert-history/{id}: + get: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Get all upsert history records + description: Retrieve all upsert history records with optional filters + operationId: getAllUpsertHistory + parameters: + - in: path + name: id + required: false + schema: + type: string + description: Chatflow ID to filter records by + - in: query + name: order + required: false + schema: + type: string + enum: [ASC, DESC] + default: ASC + description: Sort order of the results (ascending or descending) + - in: query + name: startDate + required: false + schema: + type: string + format: date-time + description: Filter records from this start date (inclusive) + - in: query + name: endDate + required: false + schema: + type: string + format: date-time + description: Filter records until this end date (inclusive) + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UpsertHistoryResponse' + '500': + description: Internal server error + patch: + tags: + - upsert-history + security: + - bearerAuth: [] + summary: Delete upsert history records + description: Soft delete upsert history records by IDs + operationId: patchDeleteUpsertHistory + requestBody: + content: + application/json: + schema: + type: object + properties: + ids: + type: array + items: + type: string + format: uuid + description: List of upsert history record IDs to delete + responses: + '200': + description: Successfully deleted records + '400': + description: Invalid request body + '500': + description: Internal server error + /variables: + post: + tags: + - variables + security: + - bearerAuth: [] + operationId: createVariable + summary: Create a new variable + description: Create a new variable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid request body + '422': + description: Validation error + '500': + description: Internal server error + get: + tags: + - variables + security: + - bearerAuth: [] + summary: List all variables + description: Retrieve a list of all variables + operationId: getAllVariables + responses: + '200': + description: Successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Variable' + '500': + description: Internal server error + + /variables/{id}: + put: + tags: + - variables + security: + - bearerAuth: [] + summary: Update a variable by ID + description: Update a specific variable by ID + operationId: updateVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + '200': + description: Variable updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + '400': + description: Invalid ID or request body provided + '404': + description: Variable not found + '500': + description: Internal server error + delete: + tags: + - variables + security: + - bearerAuth: [] + summary: Delete a variable by ID + description: Delete a specific variable by ID + operationId: deleteVariable + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Variable ID + responses: + '200': + description: Variable deleted successfully + '400': + description: Invalid ID provided + '404': + description: Variable not found + '500': + description: Internal server error + /vector/upsert/{id}: + post: + tags: + - vector + security: + - bearerAuth: [] + operationId: vectorUpsert + summary: Upsert vector embeddings + description: Upsert vector embeddings of documents in a chatflow + parameters: + - in: path + name: id + required: true + schema: + type: string + description: Chatflow ID + requestBody: + content: + application/json: + schema: + type: object + properties: + stopNodeId: + type: string + description: In cases when you have multiple vector store nodes, you can specify the node ID to store the vectors + example: 'node_1' + overrideConfig: + type: object + description: The configuration to override the default vector upsert settings (optional) + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary + description: Files to be uploaded + modelName: + type: string + nullable: true + example: '' + description: Other override configurations + required: + - files + required: true + responses: + '200': + description: Vector embeddings upserted successfully + content: + application/json: + schema: + $ref: '#/components/schemas/VectorUpsertResponse' + '400': + description: Invalid input provided + '404': + description: Chatflow not found + '422': + description: Validation error + '500': + description: Internal server error + +components: + responses: + UnauthorizedError: + description: Access token is missing or invalid + schemas: + ApiKey: + type: object + properties: + apiKey: + type: string + example: 'vYV8OdUMRzRQbzpp2JzY5DvriBnuVHo3pYpPQ7IJWyw=' + apiSecret: + type: string + example: '50e19a35ee1df775c09628dade1c00f0f680c6e15256e34a6eab350b38b31352df35c4db7925a3e5dd41cc773a0e2529e6c6da18408a8bbeeb0ae4b0f0ab9486.a96478a9225ed6ab' + chatFlows: + type: array + example: [] + createdAt: + type: string + example: '10-Mar-24' + id: + type: string + example: '525e4daa2104f06ffdea5c1af37009be' + keyName: + type: string + example: 'someKeyName' + + ChatMessage: + type: object + properties: + id: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + role: + type: string + enum: [apiMessage, userMessage] + example: 'apiMessage' + chatflowid: + type: string + format: uuid + example: 'd290f1ee-6c54-4b01-90e6-d701748f0852' + content: + type: string + example: 'Hello, how can I help you today?' + sourceDocuments: + type: array + nullable: true + items: + $ref: '#/components/schemas/Document' + usedTools: + type: array + nullable: true + items: + $ref: '#/components/schemas/UsedTool' + fileAnnotations: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileAnnotation' + agentReasoning: + type: array + nullable: true + items: + $ref: '#/components/schemas/AgentReasoning' + fileUploads: + type: array + nullable: true + items: + $ref: '#/components/schemas/FileUpload' + action: + type: array + nullable: true + items: + $ref: '#/components/schemas/Action' + chatType: + type: string + enum: [INTERNAL, EXTERNAL] + example: 'INTERNAL' + chatId: + type: string + example: 'chat12345' + memoryType: + type: string + nullable: true + sessionId: + type: string + nullable: true + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + leadEmail: + type: string + nullable: true + example: 'user@example.com' + + Chatflow: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + name: + type: string + example: 'MyChatFlow' + flowData: + type: string + example: '{}' + deployed: + type: boolean + isPublic: + type: boolean + apikeyid: + type: string + chatbotConfig: + type: string + example: '{}' + apiConfig: + type: string + example: '{}' + analytic: + type: string + example: '{}' + speechToText: + type: string + example: '{}' + category: + type: string + example: 'category1;category2' + type: + type: string + enum: [CHATFLOW, MULTIAGENT] + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Document: + type: object + properties: + pageContent: + type: string + example: 'This is the content of the page.' + metadata: + type: object + additionalProperties: + type: string + example: + author: 'John Doe' + date: '2024-08-24' + + UsedTool: + type: object + properties: + tool: + type: string + example: 'Name of the tool' + toolInput: + type: object + additionalProperties: + type: string + example: + input: 'search query' + toolOutput: + type: string + + FileAnnotation: + type: object + properties: + filePath: + type: string + example: 'path/to/file' + fileName: + type: string + example: 'file.txt' + + FileUpload: + type: object + properties: + data: + type: string + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + type: + type: string + example: 'image' + name: + type: string + example: 'image.png' + mime: + type: string + example: 'image/png' + Action: + type: object + properties: + id: + type: string + format: uuid + example: '61beeb58-6ebe-4d51-aa0b-41d4c546ff08' + mapping: + type: object + properties: + approve: + type: string + example: 'Yes' + reject: + type: string + example: 'No' + toolCalls: + type: array + example: [] + elements: + type: array + + AgentReasoning: + type: object + properties: + agentName: + type: string + example: 'agent' + messages: + type: array + items: + type: string + example: ['hello'] + nodeName: + type: string + example: 'seqAgent' + nodeId: + type: string + example: 'seqAgent_0' + usedTools: + type: array + items: + $ref: '#/components/schemas/UsedTool' + sourceDocuments: + type: array + items: + $ref: '#/components/schemas/Document' + state: + type: object + additionalProperties: + type: string + + Assistant: + type: object + properties: + id: + type: string + example: 'd290f1ee-6c54-4b01-90e6-d701748f0851' + details: + type: object + properties: + id: + type: string + example: 'asst_zbNeYIuXIUSKVHjJkfRo6ilv' + name: + type: string + example: 'assistant' + description: + type: string + model: + type: string + example: 'gpt-4' + instructions: + type: string + example: 'You are a helpful assistant, do your best to answer question and query' + temperature: + type: number + example: 1 + top_p: + type: number + example: 1 + tools: + type: array + items: + type: string + example: ['function', 'code_interpreter', 'file_search'] + tool_resources: + type: object + additionalProperties: + type: object + credential: + type: string + example: '7db93c02-8d5a-4117-a8f1-3dfb6721b339' + iconSrc: + type: string + example: '/images/assistant.png' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + + Credential: + type: object + properties: + id: + type: string + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + example: 'My Credential' + credentialName: + type: string + example: 'openAIAPI' + encryptedData: + type: string + example: 'U2FsdGVkX1/3T2gnnsEtX6FJi1DbnYx0VVdS3XWZ5ro=' + createdDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + example: '2024-08-24T14:15:22Z' + Prediction: + type: object + properties: + question: + type: string + description: The question being asked + overrideConfig: + type: object + description: The configuration to override the default prediction settings (optional) + history: + type: array + description: The history messages to be prepended (optional) + items: + type: object + properties: + role: + type: string + enum: [apiMessage, userMessage] + description: The role of the message + example: apiMessage + content: + type: string + description: The content of the message + example: 'Hello, how can I help you?' + uploads: + type: array + items: + type: object + properties: + type: + type: string + enum: [audio, url, file, file:rag, file:full] + description: The type of file upload + example: file + name: + type: string + description: The name of the file or resource + example: 'image.png' + data: + type: string + description: The base64-encoded data or URL for the resource + example: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABjElEQVRIS+2Vv0oDQRDG' + mime: + type: string + description: The MIME type of the file or resource + example: 'image/png' + + Tool: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the tool + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the tool + example: 'date_time_tool' + description: + type: string + description: Description of the tool + example: 'A tool used for date and time operations' + color: + type: string + description: Color associated with the tool + example: '#FF5733' + iconSrc: + type: string + nullable: true + description: Source URL for the tool's icon + example: 'https://example.com/icons/date.png' + schema: + type: string + nullable: true + description: JSON schema associated with the tool + func: + type: string + nullable: true + description: Functionality description or code associated with the tool + createdDate: + type: string + format: date-time + description: Date and time when the tool was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the tool was last updated + example: '2024-08-24T14:15:22Z' + Variable: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the variable + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the variable + example: 'API_KEY' + value: + type: string + description: Value of the variable + nullable: true + example: 'my-secret-key' + type: + type: string + description: Type of the variable (e.g., string, number) + example: 'string' + createdDate: + type: string + format: date-time + description: Date and time when the variable was created + example: '2024-08-24T14:15:22Z' + updatedDate: + type: string + format: date-time + description: Date and time when the variable was last updated + example: '2024-08-24T14:15:22Z' + VectorUpsertResponse: + type: object + properties: + numAdded: + type: number + description: Number of vectors added + example: 1 + numDeleted: + type: number + description: Number of vectors deleted + example: 1 + numUpdated: + type: number + description: Number of vectors updated + example: 1 + numSkipped: + type: number + description: Number of vectors skipped (not added, deleted, or updated) + example: 1 + addedDocs: + type: array + items: + $ref: '#/components/schemas/Document' + Lead: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the lead + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + name: + type: string + description: Name of the lead + example: 'John Doe' + email: + type: string + description: Email address of the lead + example: 'john.doe@example.com' + phone: + type: string + description: Phone number of the lead + example: '+1234567890' + chatflowid: + type: string + description: ID of the chatflow the lead is associated with + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + chatId: + type: string + description: ID of the chat session the lead is associated with + example: 'd7b0b5d8-85e6-4f2a-9c1f-9d9a0e2ebf6b' + createdDate: + type: string + format: date-time + description: Date and time when the lead was created + example: '2024-08-24T14:15:22Z' + UpsertHistoryResponse: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the upsert history record + example: 'cfd531e0-82fc-11e9-bc42-526af7764f64' + chatflowid: + type: string + description: ID of the chatflow associated with the upsert history + example: '7c4e8b7a-7b9a-4b4d-9f3e-2d28f1ebea02' + result: + type: string + description: Result of the upsert operation, stored as a JSON string + example: '{"status":"success","data":{"key":"value"}}' + flowData: + type: string + description: Flow data associated with the upsert operation, stored as a JSON string + example: '{"nodes":[],"edges":[]}' + date: + type: string + format: date-time + description: Date and time when the upsert operation was performed + example: '2024-08-24T14:15:22Z' + DocumentStore: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store + name: + type: string + description: Name of the document store + description: + type: string + description: Description of the document store + loaders: + type: string + description: Loaders associated with the document store, stored as JSON string + whereUsed: + type: string + description: Places where the document store is used, stored as JSON string + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store + vectorStoreConfig: + type: string + description: Configuration for the vector store, stored as JSON string + embeddingConfig: + type: string + description: Configuration for the embedding, stored as JSON string + recordManagerConfig: + type: string + description: Configuration for the record manager, stored as JSON string + createdDate: + type: string + format: date-time + description: Date and time when the document store was created + updatedDate: + type: string + format: date-time + description: Date and time when the document store was last updated + + DocumentStoreFileChunk: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file chunk + docId: + type: string + format: uuid + description: Document ID within the store + storeId: + type: string + format: uuid + description: Document Store ID + chunkNo: + type: integer + description: Chunk number within the document + pageContent: + type: string + description: Content of the chunk + metadata: + type: string + description: Metadata associated with the chunk + + DocumentStoreLoaderForPreview: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the document store loader + loaderId: + type: string + description: ID of the loader + loaderName: + type: string + description: Name of the loader + loaderConfig: + type: object + description: Configuration for the loader + splitterId: + type: string + description: ID of the text splitter + splitterName: + type: string + description: Name of the text splitter + splitterConfig: + type: object + description: Configuration for the text splitter + totalChunks: + type: number + description: Total number of chunks + totalChars: + type: number + description: Total number of characters + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the document store loader + storeId: + type: string + description: ID of the document store + files: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderFile' + source: + type: string + description: Source of the document store loader + credential: + type: string + description: Credential associated with the document store loader + rehydrated: + type: boolean + description: Whether the loader has been rehydrated + preview: + type: boolean + description: Whether the loader is in preview mode + previewChunkCount: + type: number + description: Number of chunks in preview mode + + DocumentStoreLoaderFile: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the file + name: + type: string + description: Name of the file + mimePrefix: + type: string + description: MIME prefix of the file + size: + type: number + description: Size of the file + status: + type: string + enum: [EMPTY, SYNC, SYNCING, STALE, NEW, UPSERTING, UPSERTED] + description: Status of the file + uploaded: + type: string + format: date-time + description: Date and time when the file was uploaded + + DocumentStoreFileChunkPagedResponse: + type: object + properties: + chunks: + type: array + items: + $ref: '#/components/schemas/DocumentStoreFileChunk' + count: + type: number + example: 1 + file: + $ref: '#/components/schemas/DocumentStoreLoaderForPreview' + currentPage: + type: number + storeName: + type: string + description: + type: string + + DocumentStoreLoaderForUpsert: + type: object + properties: + docId: + type: string + format: uuid + nullable: true + description: Document ID within the store. If provided, existing configuration from the document will be used for the new document + metadata: + type: object + nullable: true + description: Metadata associated with the document + example: { 'foo': 'bar' } + replaceExisting: + type: boolean + nullable: true + description: Whether to replace existing document loader with the new upserted chunks. However this does not delete the existing embeddings in the vector store + createNewDocStore: + type: boolean + nullable: true + description: Whether to create a new document store + docStore: + type: object + nullable: true + description: Only when createNewDocStore is true, pass in the new document store configuration + properties: + name: + type: string + example: plainText + description: Name of the new document store to be created + description: + type: string + example: plainText + description: Description of the new document store to be created + loader: + type: object + nullable: true + properties: + name: + type: string + example: plainText + description: Name of the loader (camelCase) + config: + type: object + description: Configuration for the loader + splitter: + type: object + nullable: true + properties: + name: + type: string + example: recursiveCharacterTextSplitter + description: Name of the text splitter (camelCase) + config: + type: object + description: Configuration for the text splitter + embedding: + type: object + nullable: true + properties: + name: + type: string + example: openAIEmbeddings + description: Name of the embedding generator (camelCase) + config: + type: object + description: Configuration for the embedding generator + vectorStore: + type: object + nullable: true + properties: + name: + type: string + example: faiss + description: Name of the vector store (camelCase) + config: + type: object + description: Configuration for the vector store + recordManager: + type: object + nullable: true + properties: + name: + type: string + example: postgresRecordManager + description: Name of the record manager (camelCase) + config: + type: object + description: Configuration for the record manager + + DocumentStoreLoaderForRefresh: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/DocumentStoreLoaderForUpsert' + + ChatMessageFeedback: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the feedback + chatflowid: + type: string + format: uuid + description: Identifier for the chat flow + chatId: + type: string + description: Identifier for the chat + messageId: + type: string + format: uuid + description: Identifier for the message + rating: + type: string + enum: [THUMBS_UP, THUMBS_DOWN] + description: Rating for the message + content: + type: string + description: Feedback content + createdDate: + type: string + format: date-time + description: Date and time when the feedback was created + + CreateAttachmentResponse: + type: object + properties: + name: + type: string + description: Name of the file + mimeType: + type: string + description: Mime type of the file + size: + type: string + description: Size of the file + content: + type: string + description: Content of the file in string format + + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT # optional, for documentation purposes only diff --git a/cn/.gitbook/assets/tavily.png b/cn/.gitbook/assets/tavily.png new file mode 100644 index 00000000..8313e561 Binary files /dev/null and b/cn/.gitbook/assets/tavily.png differ diff --git a/cn/.gitbook/assets/tavily/tavily-1.png b/cn/.gitbook/assets/tavily/tavily-1.png new file mode 100644 index 00000000..4605fe2f Binary files /dev/null and b/cn/.gitbook/assets/tavily/tavily-1.png differ diff --git a/cn/.gitbook/assets/tavily/tavily-2.png b/cn/.gitbook/assets/tavily/tavily-2.png new file mode 100644 index 00000000..8ca8d1c5 Binary files /dev/null and b/cn/.gitbook/assets/tavily/tavily-2.png differ diff --git a/cn/.gitbook/assets/ud_01.png b/cn/.gitbook/assets/ud_01.png new file mode 100644 index 00000000..9163207f Binary files /dev/null and b/cn/.gitbook/assets/ud_01.png differ diff --git a/cn/.gitbook/assets/up-001.png b/cn/.gitbook/assets/up-001.png new file mode 100644 index 00000000..2a1c18ac Binary files /dev/null and b/cn/.gitbook/assets/up-001.png differ diff --git a/cn/.gitbook/assets/up-003.png b/cn/.gitbook/assets/up-003.png new file mode 100644 index 00000000..dc6ac0c2 Binary files /dev/null and b/cn/.gitbook/assets/up-003.png differ diff --git a/cn/.gitbook/assets/up-004.png b/cn/.gitbook/assets/up-004.png new file mode 100644 index 00000000..0ba04fee Binary files /dev/null and b/cn/.gitbook/assets/up-004.png differ diff --git a/cn/.gitbook/assets/up-006.png b/cn/.gitbook/assets/up-006.png new file mode 100644 index 00000000..39de29bf Binary files /dev/null and b/cn/.gitbook/assets/up-006.png differ diff --git a/cn/.gitbook/assets/up-007.png b/cn/.gitbook/assets/up-007.png new file mode 100644 index 00000000..964accb7 Binary files /dev/null and b/cn/.gitbook/assets/up-007.png differ diff --git a/cn/.gitbook/assets/up-009.png b/cn/.gitbook/assets/up-009.png new file mode 100644 index 00000000..96473c30 Binary files /dev/null and b/cn/.gitbook/assets/up-009.png differ diff --git a/cn/.gitbook/assets/up-010.png b/cn/.gitbook/assets/up-010.png new file mode 100644 index 00000000..3cba7065 Binary files /dev/null and b/cn/.gitbook/assets/up-010.png differ diff --git a/cn/.gitbook/assets/up-011.png b/cn/.gitbook/assets/up-011.png new file mode 100644 index 00000000..acafb033 Binary files /dev/null and b/cn/.gitbook/assets/up-011.png differ diff --git a/cn/.gitbook/assets/up-012.png b/cn/.gitbook/assets/up-012.png new file mode 100644 index 00000000..d9a44c88 Binary files /dev/null and b/cn/.gitbook/assets/up-012.png differ diff --git a/cn/.gitbook/assets/up-013.png b/cn/.gitbook/assets/up-013.png new file mode 100644 index 00000000..6ba61861 Binary files /dev/null and b/cn/.gitbook/assets/up-013.png differ diff --git a/cn/.gitbook/assets/up-014.png b/cn/.gitbook/assets/up-014.png new file mode 100644 index 00000000..e43fe443 Binary files /dev/null and b/cn/.gitbook/assets/up-014.png differ diff --git a/cn/.gitbook/assets/up-015.png b/cn/.gitbook/assets/up-015.png new file mode 100644 index 00000000..751d6921 Binary files /dev/null and b/cn/.gitbook/assets/up-015.png differ diff --git a/cn/.gitbook/assets/up-018.png b/cn/.gitbook/assets/up-018.png new file mode 100644 index 00000000..a079d708 Binary files /dev/null and b/cn/.gitbook/assets/up-018.png differ diff --git a/cn/.gitbook/assets/upstash/create-index.jpeg b/cn/.gitbook/assets/upstash/create-index.jpeg new file mode 100644 index 00000000..92743fd8 Binary files /dev/null and b/cn/.gitbook/assets/upstash/create-index.jpeg differ diff --git a/cn/.gitbook/assets/upstash/credentials.jpeg b/cn/.gitbook/assets/upstash/credentials.jpeg new file mode 100644 index 00000000..a4c8bfbf Binary files /dev/null and b/cn/.gitbook/assets/upstash/credentials.jpeg differ diff --git a/cn/.gitbook/assets/upstash/databrowser.jpeg b/cn/.gitbook/assets/upstash/databrowser.jpeg new file mode 100644 index 00000000..d91f5f63 Binary files /dev/null and b/cn/.gitbook/assets/upstash/databrowser.jpeg differ diff --git a/cn/.gitbook/assets/upstash/env-variables.jpeg b/cn/.gitbook/assets/upstash/env-variables.jpeg new file mode 100644 index 00000000..92743fd8 Binary files /dev/null and b/cn/.gitbook/assets/upstash/env-variables.jpeg differ diff --git a/cn/.gitbook/assets/upstash/flowise-design.jpeg b/cn/.gitbook/assets/upstash/flowise-design.jpeg new file mode 100644 index 00000000..5519d6b4 Binary files /dev/null and b/cn/.gitbook/assets/upstash/flowise-design.jpeg differ diff --git a/cn/.gitbook/assets/upstash/list-index.jpeg b/cn/.gitbook/assets/upstash/list-index.jpeg new file mode 100644 index 00000000..db5d7d91 Binary files /dev/null and b/cn/.gitbook/assets/upstash/list-index.jpeg differ diff --git a/cn/.gitbook/assets/upstash/upstash-node.jpeg b/cn/.gitbook/assets/upstash/upstash-node.jpeg new file mode 100644 index 00000000..3fa6df21 Binary files /dev/null and b/cn/.gitbook/assets/upstash/upstash-node.jpeg differ diff --git a/cn/.gitbook/assets/vectara/1.png b/cn/.gitbook/assets/vectara/1.png new file mode 100644 index 00000000..575a5236 Binary files /dev/null and b/cn/.gitbook/assets/vectara/1.png differ diff --git a/cn/.gitbook/assets/vectara/2.png b/cn/.gitbook/assets/vectara/2.png new file mode 100644 index 00000000..95c6a532 Binary files /dev/null and b/cn/.gitbook/assets/vectara/2.png differ diff --git a/cn/.gitbook/assets/vectara/3.png b/cn/.gitbook/assets/vectara/3.png new file mode 100644 index 00000000..d8236eb3 Binary files /dev/null and b/cn/.gitbook/assets/vectara/3.png differ diff --git a/cn/.gitbook/assets/vectara/4.png b/cn/.gitbook/assets/vectara/4.png new file mode 100644 index 00000000..4170964b Binary files /dev/null and b/cn/.gitbook/assets/vectara/4.png differ diff --git a/cn/.gitbook/assets/vectara/5.png b/cn/.gitbook/assets/vectara/5.png new file mode 100644 index 00000000..808bbdff Binary files /dev/null and b/cn/.gitbook/assets/vectara/5.png differ diff --git a/cn/.gitbook/assets/vectara/6.png b/cn/.gitbook/assets/vectara/6.png new file mode 100644 index 00000000..f0d16e32 Binary files /dev/null and b/cn/.gitbook/assets/vectara/6.png differ diff --git a/cn/.gitbook/assets/web-scrape-pinecone.png b/cn/.gitbook/assets/web-scrape-pinecone.png new file mode 100644 index 00000000..0d587dd9 Binary files /dev/null and b/cn/.gitbook/assets/web-scrape-pinecone.png differ diff --git a/cn/.gitbook/assets/white.png b/cn/.gitbook/assets/white.png new file mode 100644 index 00000000..7b7b9ea3 Binary files /dev/null and b/cn/.gitbook/assets/white.png differ diff --git a/cn/.gitbook/assets/writer.png b/cn/.gitbook/assets/writer.png new file mode 100644 index 00000000..5ccd0f83 Binary files /dev/null and b/cn/.gitbook/assets/writer.png differ diff --git a/cn/.gitbook/assets/zapier/zap/1.png b/cn/.gitbook/assets/zapier/zap/1.png new file mode 100644 index 00000000..cdd1e6a9 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/1.png differ diff --git a/cn/.gitbook/assets/zapier/zap/10.png b/cn/.gitbook/assets/zapier/zap/10.png new file mode 100644 index 00000000..770ce515 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/10.png differ diff --git a/cn/.gitbook/assets/zapier/zap/11.png b/cn/.gitbook/assets/zapier/zap/11.png new file mode 100644 index 00000000..0e1f5d3b Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/11.png differ diff --git a/cn/.gitbook/assets/zapier/zap/12.png b/cn/.gitbook/assets/zapier/zap/12.png new file mode 100644 index 00000000..667c65be Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/12.png differ diff --git a/cn/.gitbook/assets/zapier/zap/13.png b/cn/.gitbook/assets/zapier/zap/13.png new file mode 100644 index 00000000..8aee1edb Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/13.png differ diff --git a/cn/.gitbook/assets/zapier/zap/14.png b/cn/.gitbook/assets/zapier/zap/14.png new file mode 100644 index 00000000..4bef9d6d Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/14.png differ diff --git a/cn/.gitbook/assets/zapier/zap/15.png b/cn/.gitbook/assets/zapier/zap/15.png new file mode 100644 index 00000000..bd07b861 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/15.png differ diff --git a/cn/.gitbook/assets/zapier/zap/16.png b/cn/.gitbook/assets/zapier/zap/16.png new file mode 100644 index 00000000..87e1c401 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/16.png differ diff --git a/cn/.gitbook/assets/zapier/zap/17.png b/cn/.gitbook/assets/zapier/zap/17.png new file mode 100644 index 00000000..20fd2eff Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/17.png differ diff --git a/cn/.gitbook/assets/zapier/zap/18.png b/cn/.gitbook/assets/zapier/zap/18.png new file mode 100644 index 00000000..652ec4cd Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/18.png differ diff --git a/cn/.gitbook/assets/zapier/zap/19.png b/cn/.gitbook/assets/zapier/zap/19.png new file mode 100644 index 00000000..5d0e5ebf Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/19.png differ diff --git a/cn/.gitbook/assets/zapier/zap/2.png b/cn/.gitbook/assets/zapier/zap/2.png new file mode 100644 index 00000000..69b43621 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/2.png differ diff --git a/cn/.gitbook/assets/zapier/zap/20.png b/cn/.gitbook/assets/zapier/zap/20.png new file mode 100644 index 00000000..47667132 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/20.png differ diff --git a/cn/.gitbook/assets/zapier/zap/21.png b/cn/.gitbook/assets/zapier/zap/21.png new file mode 100644 index 00000000..b0a1c0d9 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/21.png differ diff --git a/cn/.gitbook/assets/zapier/zap/22.png b/cn/.gitbook/assets/zapier/zap/22.png new file mode 100644 index 00000000..bd8e8e34 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/22.png differ diff --git a/cn/.gitbook/assets/zapier/zap/23.png b/cn/.gitbook/assets/zapier/zap/23.png new file mode 100644 index 00000000..a3467930 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/23.png differ diff --git a/cn/.gitbook/assets/zapier/zap/24.png b/cn/.gitbook/assets/zapier/zap/24.png new file mode 100644 index 00000000..c356925c Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/24.png differ diff --git a/cn/.gitbook/assets/zapier/zap/25.png b/cn/.gitbook/assets/zapier/zap/25.png new file mode 100644 index 00000000..76527a91 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/25.png differ diff --git a/cn/.gitbook/assets/zapier/zap/26.png b/cn/.gitbook/assets/zapier/zap/26.png new file mode 100644 index 00000000..74a4c55b Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/26.png differ diff --git a/cn/.gitbook/assets/zapier/zap/3.png b/cn/.gitbook/assets/zapier/zap/3.png new file mode 100644 index 00000000..46eb81b8 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/3.png differ diff --git a/cn/.gitbook/assets/zapier/zap/4.png b/cn/.gitbook/assets/zapier/zap/4.png new file mode 100644 index 00000000..6ba39b85 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/4.png differ diff --git a/cn/.gitbook/assets/zapier/zap/5.png b/cn/.gitbook/assets/zapier/zap/5.png new file mode 100644 index 00000000..804367de Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/5.png differ diff --git a/cn/.gitbook/assets/zapier/zap/6.png b/cn/.gitbook/assets/zapier/zap/6.png new file mode 100644 index 00000000..d42ddeac Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/6.png differ diff --git a/cn/.gitbook/assets/zapier/zap/7.png b/cn/.gitbook/assets/zapier/zap/7.png new file mode 100644 index 00000000..ce2ca2e8 Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/7.png differ diff --git a/cn/.gitbook/assets/zapier/zap/8.png b/cn/.gitbook/assets/zapier/zap/8.png new file mode 100644 index 00000000..851e4f5f Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/8.png differ diff --git a/cn/.gitbook/assets/zapier/zap/9.png b/cn/.gitbook/assets/zapier/zap/9.png new file mode 100644 index 00000000..fcaa125a Binary files /dev/null and b/cn/.gitbook/assets/zapier/zap/9.png differ diff --git a/cn/.gitbook/assets/zeabur/1.png b/cn/.gitbook/assets/zeabur/1.png new file mode 100644 index 00000000..2b4186e5 Binary files /dev/null and b/cn/.gitbook/assets/zeabur/1.png differ diff --git a/cn/.gitbook/assets/zeabur/2.png b/cn/.gitbook/assets/zeabur/2.png new file mode 100644 index 00000000..8d8063fb Binary files /dev/null and b/cn/.gitbook/assets/zeabur/2.png differ diff --git a/cn/.gitbook/assets/zeabur/3.png b/cn/.gitbook/assets/zeabur/3.png new file mode 100644 index 00000000..af9e1687 Binary files /dev/null and b/cn/.gitbook/assets/zeabur/3.png differ diff --git a/cn/.gitbook/assets/zeabur/4.png b/cn/.gitbook/assets/zeabur/4.png new file mode 100644 index 00000000..ab41bc8a Binary files /dev/null and b/cn/.gitbook/assets/zeabur/4.png differ diff --git a/cn/README.md b/cn/README.md new file mode 100644 index 00000000..d4c38331 --- /dev/null +++ b/cn/README.md @@ -0,0 +1,71 @@ +--- +description: 欢迎使用 Flowise 官方文档 +--- + +# 简介 + +
+ +Flowise 是一个开源生成式 AI 开发平台,用于构建 AI 智能体和 LLM 工作流程。 + +它提供了完整的解决方案,包括: + +* [x] 可视化生成器 +* [x] 追踪与分析 +* [x] 评价 +* [x] 人工介入 +* [x] API、CLI、SDK、嵌入式聊天机器人 +* [x] 团队与工作区 + +有 3 个主要的可视化构建器,即: + +* 助理 +* 聊天流 +* 智能体流程 + +## 助理 + +助手 是创建 AI 智能体最适合初学者的方式。用户可以创建能够遵循说明、在必要时使用工具以及从上传的文件 ([RAG](https://en.wikipedia.org/wiki/Retrieval-augmented_generation)) 中检索知识库以响应用户查询的聊天助手。 + +
+ +## 聊天流 + +聊天流 旨在构建单智能体系统、聊天机器人和简单的 LLM 流程。它比助手更灵活。用户可以使用先进的技术,如 Graph RAG、Reranker、检索器 等。 + +
+ +## 智能体流程 + +智能体流程 是 聊天流 和 助手 的超集。它可用于创建聊天助手、单智能体系统、多智能体系统以及复杂的工作流程编排。了解详情 [智能体流程 V2](using-flowise/agentflowv2.md) + +
+ +## Flowise 能力 + +|特色专区 | Flowise 能力 | +| ---------------------------- | ------------------------------------------------------------------------------------------------------------------- | +|编排|可视化编辑器,支持开源和专有模型、表达式、自定义代码、分支/循环/路由逻辑 | +|数据摄取和集成|连接到 100 多个来源、工具、矢量数据库、存储器 | +|监控|执行日志、可视化调试、外部日志流 | +|部署|自托管选项,气隙部署 | +|数据处理|数据转换、过滤器、聚合、自定义代码、RAG 索引管道 | +|记忆与规划|各种内存优化技术和集成| +| MCP 集成 | MCP 客户端/服务器节点、工具列表、SSE、身份验证支持 | +|安全与控制|输入调节和输出后处理 | +| API、SDK、CLI | API 访问,JS/Python SDK,命令行接口 | +|嵌入式和共享聊天机器人 |可定制的嵌入式聊天小部件和组件 | +|模板和组件|模板市场,可重用组件| +|安全控制| RBAC、SSO、加密信用、秘密管理器、速率限制、受限域 | +|可扩展性|垂直/水平规模,高吞吐量/工作流程负载 | +|评价|数据集、评估者和评估 | +|社区支持 |活跃的社区论坛 | +|供应商支持 | SLA 支持、咨询、固定/确定性定价 | + +## 贡献 + +如果您想帮助该项目,请考虑查看[贡献指南](https://github.com/FlowiseAI/Flowise/blob/main/CONTRIBUTING.md)。 + +## 需要帮助吗? + +如需支持和进一步讨论,请访问我们的[Discord](https://discord.gg/jbaHfsRVBW)服务器。 diff --git a/cn/SUMMARY.md b/cn/SUMMARY.md new file mode 100644 index 00000000..9169fd65 --- /dev/null +++ b/cn/SUMMARY.md @@ -0,0 +1,346 @@ +# 目录 + +* [简介](README.md) +* [开始](getting-started/README.md) +* [贡献指南](contributing/README.md) + * [构建节点](contributing/building-node.md) +* [API 参考](api-reference/README.md) + * [助理](api-reference/assistants.md) + * [附件](api-reference/attachments.md) + * [聊天消息](api-reference/chat-message.md) + * [聊天流](api-reference/chatflows.md) + * [文档存储](api-reference/document-store.md) + * [反馈](api-reference/feedback.md) + * [潜在客户](api-reference/leads.md) + * [Ping](api-reference/ping.md) + * [预测](api-reference/prediction.md) + * [工具](api-reference/tools.md) + * [写入更新历史](api-reference/upsert-history.md) + * [变量](api-reference/variables.md) + * [矢量写入更新](api-reference/vector-upsert.md) +* [CLI 参考](cli-reference/README.md) + * [用户](cli-reference/user.md) +* [使用 Flowise](using-flowise/README.md) + * [智能体流程 V2](using-flowise/agentflowv2.md) + * [智能体流程 V1(弃用)](using-flowise/agentflowv1/README.md) + * [多智能体](using-flowise/agentflowv1/multi-agents.md) + * [顺序智能体](using-flowise/agentflowv1/sequential-agents/README.md) + * [视频教程](using-flowise/agentflowv1/sequential-agents/video-tutorials.md) + * [预测](using-flowise/prediction.md) + * [流式传输](using-flowise/streaming.md) + * [文档存储](using-flowise/document-stores.md) + * [写入更新](using-flowise/upsertion.md) + * [分析](using-flowise/analytics/README.md) + * [Arize](using-flowise/analytics/arize.md) + * [LangWatch](using-flowise/analytics/langwatch.md) + * [Langfuse](using-flowise/analytics/langfuse.md) + * [农历](using-flowise/analytics/lunary.md) + * [Opik](using-flowise/analytics/opik.md) + * [菲尼克斯](using-flowise/analytics/phoenix.md) + * [监控](using-flowise/monitoring.md) + * [嵌入](using-flowise/embed.md) + * [上传](using-flowise/uploads.md) + * [变量](using-flowise/variables.md) + * [工作区](using-flowise/workspaces.md) + * [评估](using-flowise/evaluations.md) +* [配置](configuration/README.md) + * [授权](configuration/authorization/README.md) + * [应用](configuration/authorization/app-level.md) + * [流](configuration/authorization/chatflow-level.md) + * [数据库](configuration/databases.md) + * [部署](configuration/deployment/README.md) + * [AWS](configuration/deployment/aws.md) + * [Azure](configuration/deployment/azure.md) + * [阿里云](https://aliyun-computenest.github.io/quickstart-flowise/) + * [数字海洋](configuration/deployment/digital-ocean.md) + * [Elesio](https://elest.io/open-source/flowiseai) + * [GCP](configuration/deployment/gcp.md) + * [拥抱脸](configuration/deployment/hugging-face.md) + * [使用 Helm 的 Kubernetes](https://artifacthub.io/packages/helm/cowboysysop/flowise) + * [北翼](https://northflank.com/stacks/deploy-flowiseai) +* [铁路](configuration/deployment/railway.md) + * [渲染](configuration/deployment/render.md) + * [复制](configuration/deployment/replit.md) + * [RepoCloud](https://repocloud.io/details/?app_id=29) + * [Sealos](configuration/deployment/sealos.md) + * [Zeabur](configuration/deployment/zeabur.md) + * [环境变量](configuration/environment-variables.md) + * [速率限制](configuration/rate-limit.md) + * [在公司代理后面运行 Flowise](configuration/running-flowise-behind-company-proxy.md) + * [SSO](configuration/sso.md) + * [使用队列运行 Flowise](configuration/running-flowise-using-queue.md) + * [在生产环境中运行](configuration/running-in-production.md) +* [集成](integrations/README.md) + * [LangChain](integrations/langchain/README.md) + * [代理](integrations/langchain/agents/README.md) + * [Airtable 代理](integrations/langchain/agents/airtable-agent.md) + * [AutoGPT](integrations/langchain/agents/autogpt.md) + * [BabyAGI](integrations/langchain/agents/babyagi.md) + * [CSV 代理](integrations/langchain/agents/csv-agent.md) + * [会话代理](integrations/langchain/agents/conversational-agent.md) + * [会话检索代理](integrations/langchain/agents/conversational-retrieval-agent.md) + * [MistralAI 工具代理](integrations/langchain/agents/mistralai-tool-agent.md) + * [OpenAI 助手](integrations/langchain/agents/openai-assistant/README.md) + * [线程](integrations/langchain/agents/openai-assistant/threads.md) + * [OpenAI 函数代理](integrations/langchain/agents/openai-function-agent.md) + * [OpenAI 工具代理](integrations/langchain/agents/openai-tool-agent.md) + * [ReAct 代理聊天](integrations/langchain/agents/react-agent-chat.md) + * [ReAct 代理 LLM](integrations/langchain/agents/react-agent-llm.md) + * [工具代理](integrations/langchain/agents/tool-agent.md) + * [XML 代理](integrations/langchain/agents/xml-agent.md) + * [缓存](integrations/langchain/cache/README.md) + * [内存中缓存](integrations/langchain/cache/in-memory-cache.md) + * [内存中嵌入缓存](integrations/langchain/cache/inmemory-embedding-cache.md) + * [Momento 缓存](integrations/langchain/cache/momento-cache.md) + * [Redis 缓存](integrations/langchain/cache/redis-cache.md) + * [Redis 嵌入缓存](integrations/langchain/cache/redis-embeddings-cache.md) + * [Upstash Redis 缓存](integrations/langchain/cache/upstash-redis-cache.md) + * [链](integrations/langchain/chains/README.md) + * [获取API链](integrations/langchain/chains/get-api-chain.md) + * [OpenAPI 链](integrations/langchain/chains/openapi-chain.md) + * [POST API 链](integrations/langchain/chains/post-api-chain.md) + * [对话链](integrations/langchain/chains/conversation-chain.md) + * [对话式检索 QA 链](integrations/langchain/chains/conversational-retrieval-qa-chain.md) + * [法学硕士链](integrations/langchain/chains/llm-chain.md) + * [多提示词链](integrations/langchain/chains/multi-prompt-chain.md) + * [多重检索 QA 链](integrations/langchain/chains/multi-retrieval-qa-chain.md) + * [检索 QA 链](integrations/langchain/chains/retrieval-qa-chain.md) + * [Sql 数据库链](integrations/langchain/chains/sql-database-chain.md) + * [Vectara QA 链](integrations/langchain/chains/vectara-chain.md) + * [VectorDB QA 链](integrations/langchain/chains/vectordb-qa-chain.md) + * [聊天模型](integrations/langchain/chat-models/README.md) + * [AWS ChatBedrock](integrations/langchain/chat-models/aws-chatbedrock.md) +* [Azure ChatOpenAI](integrations/langchain/chat-models/azure-chatopenai-1.md) + * [NVIDIA NIM](integrations/langchain/chat-models/nvidia-nim.md) + * [ChatCometAPI](integrations/langchain/chat-models/chatcometapi.md) + * [ChatAnthropic](integrations/langchain/chat-models/chatanthropic.md) + * [ChatCohere](integrations/langchain/chat-models/chatcohere.md) + * [聊天烟花](integrations/langchain/chat-models/chat-fireworks.md) + * [ChatGoogleGenerativeAI](integrations/langchain/chat-models/google-ai.md) + * [Google VertexAI](integrations/langchain/chat-models/google-vertexai.md) + * [ChatHuggingFace](integrations/langchain/chat-models/chathuggingface.md) + * [ChatLocalAI](integrations/langchain/chat-models/chatlocalai.md) + * [ChatMistralAI](integrations/langchain/chat-models/mistral-ai.md) + * [IBM Watsonx](integrations/langchain/chat-models/ibm-watsonx.md) + * [ChatOllama](integrations/langchain/chat-models/chatollama.md) + * [ChatOpenAI](integrations/langchain/chat-models/azure-chatopenai.md) + * [ChatTogetherAI](integrations/langchain/chat-models/chattogetherai.md) + * [GroqChat](integrations/langchain/chat-models/groqchat.md) + * [文档加载器](integrations/langchain/document-loaders/README.md) + * [Airtable](integrations/langchain/document-loaders/airtable.md) + * [API 加载程序](integrations/langchain/document-loaders/api-loader.md) + * [Apify 网站内容爬网程序](integrations/langchain/document-loaders/apify-website-content-crawler.md) + * [BraveSearch 加载程序](integrations/langchain/document-loaders/bravesearch-api.md) + * [Cheerio 网络抓取工具](integrations/langchain/document-loaders/cheerio-web-scraper.md) + * [Confluence](integrations/langchain/document-loaders/confluence.md) + * [Csv 文件](integrations/langchain/document-loaders/csv-file.md) + * [自定义文档加载器](integrations/langchain/document-loaders/custom-document-loader.md) + * [文档存储](integrations/langchain/document-loaders/document-store.md) + * [Docx 文件](integrations/langchain/document-loaders/docx-file.md) + * [Epub 文件](integrations/langchain/document-loaders/epub-file.md) + * [Figma](integrations/langchain/document-loaders/figma.md) + * [文件](integrations/langchain/document-loaders/file-loader.md) + * [FireCrawl](integrations/langchain/document-loaders/firecrawl.md) + * [文件夹](integrations/langchain/document-loaders/folder.md) + * [GitBook](integrations/langchain/document-loaders/gitbook.md) + * [Github](integrations/langchain/document-loaders/github.md) + * [Google 云端硬盘](integrations/langchain/document-loaders/google-drive.md) + * [Google 表格](integrations/langchain/document-loaders/google-sheets.md) + * [Jira](integrations/langchain/document-loaders/jira.md) + * [Json 文件](integrations/langchain/document-loaders/json-file.md) + * [Json 行文件](integrations/langchain/document-loaders/jsonlines.md) + * [Microsoft Excel](integrations/langchain/document-loaders/microsoft-excel.md) + * [Microsoft Powerpoint](integrations/langchain/document-loaders/microsoft-powerpoint.md) + * [Microsoft Word](integrations/langchain/document-loaders/microsoft-word.md) + * [概念](integrations/langchain/document-loaders/notion.md) + * [Oxylabs](integrations/langchain/document-loaders/oxylabs.md) + * [PDF 文件](integrations/langchain/document-loaders/pdf-file.md) + * [纯文本](integrations/langchain/document-loaders/plain-text.md) + * [剧作家网络爬虫](integrations/langchain/document-loaders/playwright-web-scraper.md) + * [Puppeteer 网络抓取工具](integrations/langchain/document-loaders/puppeteer-web-scraper.md) + * [S3 文件加载器](integrations/langchain/document-loaders/s3-file-loader.md) + * [用于网页搜索的SearchApi](integrations/langchain/document-loaders/searchapi-for-web-search.md) + * [用于网页搜索的 SerpApi](integrations/langchain/document-loaders/serpapi-for-web-search.md) + * [Spider - 网络搜索和抓取工具](integrations/langchain/document-loaders/spider-web-scraper-crawler.md) + * [文本文件](integrations/langchain/document-loaders/text-file.md) +* [非结构化文件加载器](integrations/langchain/document-loaders/unstructured-file-loader.md) + * [非结构化文件夹加载器](integrations/langchain/document-loaders/unstructured-folder-loader.md) + * [嵌入](integrations/langchain/embeddings/README.md) + * [AWS 基岩嵌入](integrations/langchain/embeddings/aws-bedrock-embeddings.md) + * [Azure OpenAI 嵌入](integrations/langchain/embeddings/azure-openai-embeddings.md) + * [Cohere 嵌入](integrations/langchain/embeddings/cohere-embeddings.md) + * [Google GenerativeAI 嵌入](integrations/langchain/embeddings/googlegenerativeai-embeddings.md) + * [Google VertexAI 嵌入](integrations/langchain/embeddings/googlevertexai-embeddings.md) + * [HuggingFace 推理嵌入](integrations/langchain/embeddings/huggingface-inference-embeddings.md) + * [本地AI嵌入](integrations/langchain/embeddings/localai-embeddings.md) + * [MistralAI 嵌入](integrations/langchain/embeddings/mistralai-embeddings.md) + * [Ollama 嵌入](integrations/langchain/embeddings/ollama-embeddings.md) + * [OpenAI 嵌入](integrations/langchain/embeddings/openai-embeddings.md) + * [OpenAI 嵌入自定义](integrations/langchain/embeddings/openai-embeddings-custom.md) + * [TogetherAI 嵌入](integrations/langchain/embeddings/togetherai-embedding.md) + * [VoyageAI 嵌入](integrations/langchain/embeddings/voyageai-embeddings.md) + * [法学硕士](integrations/langchain/llms/README.md) + * [AWS Bedrock](integrations/langchain/llms/aws-bedrock.md) + * [Azure OpenAI](integrations/langchain/llms/azure-openai.md) + * [一致](integrations/langchain/llms/cohere.md) + * [GoogleVertex AI](integrations/langchain/llms/googlevertex-ai.md) + * [HuggingFace 推理](integrations/langchain/llms/huggingface-inference.md) + * [Ollama](integrations/langchain/llms/ollama.md) + * [OpenAI](integrations/langchain/llms/openai.md) + * [复制](integrations/langchain/llms/replicate.md) + * [内存](integrations/langchain/memory/README.md) + * [缓冲内存](integrations/langchain/memory/buffer-memory.md) + * [缓冲窗口内存](integrations/langchain/memory/buffer-window-memory.md) + * [对话摘要记忆](integrations/langchain/memory/conversation-summary-memory.md) + * [对话摘要缓冲区内存](integrations/langchain/memory/conversation-summary-buffer-memory.md) + * [DynamoDB 聊天内存](integrations/langchain/memory/dynamodb-chat-memory.md) + * [MongoDB Atlas 聊天内存](integrations/langchain/memory/mongodb-atlas-chat-memory.md) + * [Redis 支持的聊天内存](integrations/langchain/memory/redis-backed-chat-memory.md) + * [Upstash Redis 支持的聊天内存](integrations/langchain/memory/upstash-redis-backed-chat-memory.md) + * [Zep 内存](integrations/langchain/memory/zep-memory.md) + * [审核](integrations/langchain/moderation/README.md) + * [OpenAI 审核](integrations/langchain/moderation/openai-moderation.md) + * [简单提示词审核](integrations/langchain/moderation/simple-prompt-moderation.md) + * [输出解析器](integrations/langchain/output-parsers/README.md) + * [CSV 输出解析器](integrations/langchain/output-parsers/csv-output-parser.md) + * [自定义列表输出解析器](integrations/langchain/output-parsers/custom-list-output-parser.md) + * [结构化输出解析器](integrations/langchain/output-parsers/structured-output-parser.md) + * [高级结构化输出解析器](integrations/langchain/output-parsers/advanced-structured-output-parser.md) + * [提示词](integrations/langchain/prompts/README.md) + * [聊天提示词模板](integrations/langchain/prompts/chat-prompt-template.md) + * [少量拍摄提示词模板](integrations/langchain/prompts/few-shot-prompt-template.md) + * [提示词模板](integrations/langchain/prompts/prompt-template.md) + * [记录管理器](integrations/langchain/record-managers.md) + * [猎犬](integrations/langchain/retrievers/README.md) +* [提取元数据检索器](integrations/langchain/retrievers/extract-metadata-retriever.md) + * [自定义检索器](integrations/langchain/retrievers/custom-retriever.md) + * [Cohere 重新排序检索器](integrations/langchain/retrievers/cohere-rerank-retriever.md) + * [嵌入过滤器检索器](integrations/langchain/retrievers/embeddings-filter-retriever.md) + * [HyDE 猎犬](integrations/langchain/retrievers/hyde-retriever.md) + * [LLM 过滤器检索器](integrations/langchain/retrievers/llm-filter-retriever.md) + * [多查询检索器](integrations/langchain/retrievers/multi-query-retriever.md) + * [提示词检索器](integrations/langchain/retrievers/prompt-retriever.md) + * [倒数排名融合检索器](integrations/langchain/retrievers/reciprocal-rank-fusion-retriever.md) + * [相似度分数阈值检索器](integrations/langchain/retrievers/similarity-score-threshold-retriever.md) + * [矢量存储检索器](integrations/langchain/retrievers/vector-store-retriever.md) + * [Voyage AI 重新排序检索器](integrations/langchain/retrievers/page.md) + * [文本分割器](integrations/langchain/text-splitters/README.md) + * [字符文本分割器](integrations/langchain/text-splitters/character-text-splitter.md) + * [代码文本分割器](integrations/langchain/text-splitters/code-text-splitter.md) + * [Html-To-Markdown 文本分割器](integrations/langchain/text-splitters/html-to-markdown-text-splitter.md) + * [Markdown 文本分割器](integrations/langchain/text-splitters/markdown-text-splitter.md) + * [递归字符文本分割器](integrations/langchain/text-splitters/recursive-character-text-splitter.md) + * [令牌文本分割器](integrations/langchain/text-splitters/token-text-splitter.md) + * [工具](integrations/langchain/tools/README.md) + * [BraveSearch API](integrations/langchain/tools/bravesearch-api.md) + * [无浏览器 MCP](integrations/langchain/tools/browserless-mcp.md) + * [计算器](integrations/langchain/tools/calculator.md) + * [链条工具](integrations/langchain/tools/chain-tool.md) + * [聊天流工具](integrations/langchain/tools/chatflow-tool.md) + * [代码解释器,作者:E2B](integrations/langchain/tools/python-interpreter.md) + * [自定义工具](integrations/langchain/tools/custom-tool.md) + * [Exa 搜索](integrations/langchain/tools/exa-search.md) + * [Gmail](integrations/langchain/tools/gmail.md) + * [Google 日历](integrations/langchain/tools/google-calendar.md) + * [Google 自定义搜索](integrations/langchain/tools/google-custom-search.md) + * [Google 云端硬盘](integrations/langchain/tools/google-drive.md) + * [Google 表格](integrations/langchain/tools/google-sheets.md) + * [Microsoft Outlook](integrations/langchain/tools/microsoft-outlook.md) + * [Microsoft Teams](integrations/langchain/tools/microsoft-teams.md) + * [OpenAPI 工具包](integrations/langchain/tools/openapi-toolkit.md) + * [白日梦 MCP](integrations/langchain/tools/pipedream-mcp-user-guide.md) + * [读取文件](integrations/langchain/tools/read-file.md) + * [请求获取](integrations/langchain/tools/request-get.md) + * [请求帖子](integrations/langchain/tools/request-post.md) + * [检索工具](integrations/langchain/tools/retriever-tool.md) + * [SearchApi](integrations/langchain/tools/searchapi.md) + * [SearXNG](integrations/langchain/tools/searxng.md) + * [Serp API](integrations/langchain/tools/serp-api.md) + * [Serper](integrations/langchain/tools/serper.md) + * [Slack MCP](integrations/langchain/tools/pipedream-mcp-user-guide-1.md) + * [塔维利](integrations/langchain/tools/tavily-ai.md) + * [网络浏览器](integrations/langchain/tools/web-browser.md) + * [写入文件](integrations/langchain/tools/write-file.md) + * [向量存储](integrations/langchain/vector-stores/README.md) + * [AstraDB](integrations/langchain/vector-stores/astradb.md) +* [色度](integrations/langchain/vector-stores/chroma.md) + * [沙发底座](integrations/langchain/vector-stores/couchbase.md) + * [弹性](integrations/langchain/vector-stores/elastic.md) + * [费斯](integrations/langchain/vector-stores/faiss.md) + * [内存中矢量存储](integrations/langchain/vector-stores/in-memory-vector-store.md) + * [Milvus](integrations/langchain/vector-stores/milvus.md) + * [MongoDB Atlas](integrations/langchain/vector-stores/mongodb-atlas.md) + * [打开搜索](integrations/langchain/vector-stores/opensearch.md) + * [松果](integrations/langchain/vector-stores/pinecone.md) + * [Postgres](integrations/langchain/vector-stores/postgres.md) + * [Qdrant](integrations/langchain/vector-stores/qdrant.md) + * [Redis](integrations/langchain/vector-stores/redis.md) + * [SingleStore](integrations/langchain/vector-stores/singlestore.md) + * [Supabase](integrations/langchain/vector-stores/supabase.md) + * [Upstash 矢量](integrations/langchain/vector-stores/upstash-vector.md) + * [Vectara](integrations/langchain/vector-stores/vectara.md) + * [取消](integrations/langchain/vector-stores/weaviate.md) + * [Zep 集合 - 开源](integrations/langchain/vector-stores/zep-collection-open-source.md) + * [Zep 集合 - 云](integrations/langchain/vector-stores/zep-collection-cloud.md) + * [LiteLLM 代理](integrations/litellm/README.md) + * [LlamaIndex](integrations/llamaindex/README.md) + * [代理](integrations/llamaindex/agents/README.md) + * [OpenAI 工具代理](integrations/llamaindex/agents/openai-tool-agent.md) + * [人类工具代理](integrations/llamaindex/agents/openai-tool-agent-1.md) + * [聊天模型](integrations/llamaindex/chat-models/README.md) + * [AzureChatOpenAI](integrations/llamaindex/chat-models/azurechatopenai.md) + * [ChatAnthropic](integrations/llamaindex/chat-models/chatanthropic.md) + * [ChatMistral](integrations/llamaindex/chat-models/chatmistral.md) + * [ChatOllama](integrations/llamaindex/chat-models/chatollama.md) + * [ChatOpenAI](integrations/llamaindex/chat-models/chatopenai.md) + * [ChatTogetherAI](integrations/llamaindex/chat-models/chattogetherai.md) + * [ChatGroq](integrations/llamaindex/chat-models/chatgroq.md) + * [嵌入](integrations/llamaindex/embeddings/README.md) + * [Azure OpenAI 嵌入](integrations/llamaindex/embeddings/azure-openai-embeddings.md) + * [OpenAI 嵌入](integrations/llamaindex/embeddings/openai-embedding.md) + * [引擎](integrations/llamaindex/engine/README.md) + * [查询引擎](integrations/llamaindex/engine/query-engine.md) + * [简单聊天引擎](integrations/llamaindex/engine/simple-chat-engine.md) + * [上下文聊天引擎](integrations/llamaindex/engine/context-chat-engine.md) + * [子问题查询引擎](integrations/llamaindex/engine/sub-question-query-engine.md) + * [响应合成器](integrations/llamaindex/response-synthesizer/README.md) + * [优化](integrations/llamaindex/response-synthesizer/refine.md) + * [紧凑和精炼](integrations/llamaindex/response-synthesizer/compact-and-refine.md) + * [简单响应生成器](integrations/llamaindex/response-synthesizer/simple-response-builder.md) + * [树摘要](integrations/llamaindex/response-synthesizer/tree-summarize.md) + * [工具](integrations/llamaindex/tools/README.md) + * [查询引擎工具](integrations/llamaindex/tools/query-engine-tool.md) + * [向量存储](integrations/llamaindex/vector-stores/README.md) + * [松果](integrations/llamaindex/vector-stores/pinecone.md) + * [SimpleStore](integrations/llamaindex/vector-stores/queryengine-tool.md) + * [实用程序](integrations/utilities/README.md) + * [自定义 JS 函数](integrations/utilities/custom-js-function.md) + * [设置/获取变量](integrations/utilities/set-get-variable.md) +* [如果否则](integrations/utilities/if-else.md) + * [便签](integrations/utilities/sticky-note.md) + * [外部集成](integrations/3rd-party-platform-integration/README.md) + * [扎皮尔扎普斯](integrations/3rd-party-platform-integration/zapier-zaps.md) + * [打开 WebUI](integrations/3rd-party-platform-integration/open-webui.md) + * [Streamlit](integrations/3rd-party-platform-integration/streamlit.md) +* [迁移指南](migration-guide/README.md) + * [云迁移](migration-guide/cloud-migration.md) + * [v1.3.0 迁移指南](migration-guide/v1.3.0-migration-guide.md) + * [v1.4.3 迁移指南](migration-guide/v1.4.3-migration-guide.md) + * [v2.1.4 迁移指南](migration-guide/v2.1.4-migration-guide.md) +* [教程](tutorials/README.md) + * [RAG](tutorials/rag.md) + * [代理 RAG](tutorials/agentic-rag.md) + * [SQL 代理](tutorials/sql-agent.md) + * [代理作为工具](tutorials/agent-as-tool.md) + * [与 API](tutorials/interacting-with-api.md) 互动 + * [工具和 MCP](tutorials/tools-and-mcp.md) + * [结构化输出](tutorials/structured-output.md) + * [人工介入](tutorials/human-in-the-loop.md) + * [深入研究](tutorials/deep-research.md) + * [客户支持](tutorials/customer-support.md) + * [主管和工人](tutorials/supervisor-and-workers.md) + +## 流畅 + +* [Flowise GitHub](https://github.com/FlowiseAI) +* [Flowise 云](https://cloud.flowiseai.com/) diff --git a/cn/api-reference/README.md b/cn/api-reference/README.md new file mode 100644 index 00000000..e8b15270 --- /dev/null +++ b/cn/api-reference/README.md @@ -0,0 +1,17 @@ +# API 参考 + +使用 Flowise public API,您可以通过编程方式执行许多与 GUI 中相同的任务。本节介绍 Flowise REST API。 + +* [助理](assistants.md) +* [附件](attachments.md) +* [聊天消息](chat-message.md) +* [聊天流](chatflows.md) +* [文档存储](document-store.md) +* [反馈](feedback.md) +* [潜在客户](leads.md) +* [Ping](ping.md) +* [预测](prediction.md) +* [工具](tools.md) +* [写入更新历史](upsert-history.md) +* [变量](variables.md) +* [矢量写入更新](vector-upsert.md) diff --git a/cn/api-reference/assistants.md b/cn/api-reference/assistants.md new file mode 100644 index 00000000..87736223 --- /dev/null +++ b/cn/api-reference/assistants.md @@ -0,0 +1,17 @@ +# 助理 + +{% openapi-operation spec="flowiseai-api" path="/assistants" method="post" %} +[链接失效](broken-reference) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/assistants/{id}" method="get" %} +[链接失效](broken-reference) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/assistants/{id}" method="put" %} +[链接失效](broken-reference) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/assistants/{id}" method="delete" %} +[链接失效](broken-reference) +{% endopenapi-operation %} diff --git a/cn/api-reference/attachments.md b/cn/api-reference/attachments.md new file mode 100644 index 00000000..7257614a --- /dev/null +++ b/cn/api-reference/attachments.md @@ -0,0 +1,5 @@ +# 附件 + +{% openapi-operation spec="flowiseai-api" path="/attachments/{chatflowId}/{chatId}" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250622%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250622T114123Z&X-Amz-Expires=172800&X-Amz-Signature=5dd4b3343a1c2a841e205191e3862f26b17fd1af871cb148ed64f6c7ad8048f1&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/chat-message.md b/cn/api-reference/chat-message.md new file mode 100644 index 00000000..c85bb32e --- /dev/null +++ b/cn/api-reference/chat-message.md @@ -0,0 +1,9 @@ +# 聊天消息 + +{% openapi-operation spec="flowiseai-api" path="/chatmessage/{id}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/chatmessage/{id}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/chatflows.md b/cn/api-reference/chatflows.md new file mode 100644 index 00000000..f4868256 --- /dev/null +++ b/cn/api-reference/chatflows.md @@ -0,0 +1,25 @@ +# 聊天流 + +{% openapi-operation spec="flowiseai-api" path="/chatflows" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/chatflows/{id}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/chatflows/apikey/{apikey}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/chatflows/{id}" method="put" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/chatflows/{id}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/chatflows" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/document-store.md b/cn/api-reference/document-store.md new file mode 100644 index 00000000..ef3f59c3 --- /dev/null +++ b/cn/api-reference/document-store.md @@ -0,0 +1,53 @@ +# 文档存储 + +{% openapi-operation spec="flowiseai-api" path="/document-store/store/{id}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/chunks/{storeId}/{loaderId}/{pageNo}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/store" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/upsert/{id}" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/refresh/{id}" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/vectorstore/query" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/store" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/chunks/{storeId}/{loaderId}/{chunkId}" method="put" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/store/{id}" method="put" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/store/{id}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/chunks/{storeId}/{loaderId}/{chunkId}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/loader/{storeId}/{loaderId}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/document-store/vectorstore/{id}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/feedback.md b/cn/api-reference/feedback.md new file mode 100644 index 00000000..6ee2c991 --- /dev/null +++ b/cn/api-reference/feedback.md @@ -0,0 +1,13 @@ +# 反馈 + +{% openapi-operation spec="flowiseai-api" path="/feedback/{id}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/feedback" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/feedback/{id}" method="put" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/leads.md b/cn/api-reference/leads.md new file mode 100644 index 00000000..6360b7af --- /dev/null +++ b/cn/api-reference/leads.md @@ -0,0 +1,9 @@ +# 潜在客户 + +{% openapi-operation spec="flowiseai-api" path="/leads/{id}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/leads" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/ping.md b/cn/api-reference/ping.md new file mode 100644 index 00000000..0db88212 --- /dev/null +++ b/cn/api-reference/ping.md @@ -0,0 +1,5 @@ +# 平 + +{% openapi-operation spec="flowiseai-api" path="/ping" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250622%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250622T114123Z&X-Amz-Expires=172800&X-Amz-Signature=5dd4b3343a1c2a841e205191e3862f26b17fd1af871cb148ed64f6c7ad8048f1&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/prediction.md b/cn/api-reference/prediction.md new file mode 100644 index 00000000..899980ed --- /dev/null +++ b/cn/api-reference/prediction.md @@ -0,0 +1,5 @@ +# 预言 + +{% openapi-operation spec="flowiseai-api" path="/prediction/{id}" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250622%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250622T113955Z&X-Amz-Expires=172800&X-Amz-Signature=ebc051053087decf7af1fc246ba6a1cffc92d068f8cb5f3a2f0deef9b8b229c4&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/tools.md b/cn/api-reference/tools.md new file mode 100644 index 00000000..d12dc5d9 --- /dev/null +++ b/cn/api-reference/tools.md @@ -0,0 +1,21 @@ +# 工具 + +{% openapi-operation spec="flowiseai-api" path="/tools" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/tools" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/tools/{id}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/tools/{id}" method="put" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/tools/{id}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/upsert-history.md b/cn/api-reference/upsert-history.md new file mode 100644 index 00000000..8e4d62ef --- /dev/null +++ b/cn/api-reference/upsert-history.md @@ -0,0 +1,9 @@ +# 写入更新历史 + +{% openapi-operation spec="flowiseai-api" path="/upsert-history/{id}" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/upsert-history/{id}" method="patch" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/variables.md b/cn/api-reference/variables.md new file mode 100644 index 00000000..6b0b76c1 --- /dev/null +++ b/cn/api-reference/variables.md @@ -0,0 +1,17 @@ +# 变量 + +{% openapi-operation spec="flowiseai-api" path="/variables" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/variables" method="get" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/variables/{id}" method="put" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} + +{% openapi-operation spec="flowiseai-api" path="/variables/{id}" method="delete" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250717%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250717T144327Z&X-Amz-Expires=172800&X-Amz-Signature=b4e9a97d35bf5ed41bad9cb6ac39ae59371100f618dc64f1d01f6adf1f6419a3&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/api-reference/vector-upsert.md b/cn/api-reference/vector-upsert.md new file mode 100644 index 00000000..9bc83998 --- /dev/null +++ b/cn/api-reference/vector-upsert.md @@ -0,0 +1,5 @@ +# 矢量写入更新 + +{% openapi-operation spec="flowiseai-api" path="/vector/upsert/{id}" method="post" %} +[OpenAPI flowiseai-api](https://gitbook-x-prod-openapi.4401d86825a13bf607936cc3a9f3897a.r2.cloudflarestorage.com/raw/238edaa326f0ca4057047699b251f09b359ab0c2a5d5201f7095b100792cf411.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=dce48141f43c0191a2ad043a6888781c%2F20250622%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250622T114123Z&X-Amz-Expires=172800&X-Amz-Signature=5dd4b3343a1c2a841e205191e3862f26b17fd1af871cb148ed64f6c7ad8048f1&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject) +{% endopenapi-operation %} diff --git a/cn/cli-reference/README.md b/cn/cli-reference/README.md new file mode 100644 index 00000000..8090a058 --- /dev/null +++ b/cn/cli-reference/README.md @@ -0,0 +1,5 @@ +# CLI 参考 + +使用 Flowise CLI,您可以通过编程方式执行许多与 GUI 中相同的任务。本节介绍 Flowise 命令行接口。 + +- [用户](user.md) diff --git a/cn/cli-reference/user.md b/cn/cli-reference/user.md new file mode 100644 index 00000000..5a7b1289 --- /dev/null +++ b/cn/cli-reference/user.md @@ -0,0 +1,58 @@ +# 用户 + +## 列出用户电子邮件 + +此命令允许您列出系统中注册的所有用户电子邮件。 + +### 本地使用 + +```bash +pnpm user +``` + +或者如果使用 npm + +```bash +npx flowise user +``` + +### Docker 使用 + +如果您在 Docker 容器中运行 Flowise,请使用以下命令: + +```bash +docker exec -it FLOWISE_CONTAINER_NAME pnpm user +``` + +将 `FLOWISE_CONTAINER_NAME` 替换为您的实际 Flowise 容器名称。 + +## 重置用户密码 + +该命令允许您重置用户的密码。 + +### 本地使用 + +```bash +pnpm user --email "admin@admin.com" --password "myPassword1!" +``` + +或者如果使用 npm + +``` +npx flowise user --email "admin@admin.com" --password "myPassword1!" +``` + +### Docker 使用 + +如果您在 Docker 容器中运行 Flowise,请使用以下命令: + +```bash +docker exec -it FLOWISE_CONTAINER_NAME pnpm user --email "admin@admin.com" --password "myPassword1!" +``` + +将 `FLOWISE_CONTAINER_NAME` 替换为您的实际 Flowise 容器名称。 + +### 参数 + +* `--email`:您要重置其密码的用户的电子邮件地址 +* `--password`:为用户设置的新密码 diff --git a/cn/configuration/README.md b/cn/configuration/README.md new file mode 100644 index 00000000..863825ef --- /dev/null +++ b/cn/configuration/README.md @@ -0,0 +1,23 @@ +--- +description: 了解如何设置和运行 Flowise 实例 +--- + +# 配置 + +*** + +本部分将指导您完成各种配置选项,以针对开发、测试和生产环境自定义 Flowise 实例。 + +我们还将提供在不同平台即服务 (PaaS) 选项上部署 Flowise 的深入指南,确保部署顺利、成功。 + +## 指南 + +* [授权](authorization/) +* [数据库](databases.md) +* [部署](deployment/) +* [环境变量](environment-variables.md) +* [速率限制](rate-limit.md) +* [代理](running-flowise-behind-company-proxy.md) +* [SSO](sso.md) +* [队列模式](running-flowise-using-queue.md) +* [生产就绪](running-in-production.md) diff --git a/cn/configuration/authorization/README.md b/cn/configuration/authorization/README.md new file mode 100644 index 00000000..1ad62132 --- /dev/null +++ b/cn/configuration/authorization/README.md @@ -0,0 +1,16 @@ +--- +description: 了解如何保护您的 Flowise 实例 +--- + +# 验证 + +*** + +本部分将指导您使用 Flowise 配置安全性,重点关注应用程序和聊天流级别的身份验证机制。 + +通过实施强大的身份验证,您可以保护您的 Flowise 实例,并确保只有授权用户才能访问您的聊天流并与之交互。 + +## 支持的方法 + +* [应用级别](app-level.md) +* [聊天流级别](chatflow-level.md) diff --git a/cn/configuration/authorization/app-level.md b/cn/configuration/authorization/app-level.md new file mode 100644 index 00000000..9f004d0d --- /dev/null +++ b/cn/configuration/authorization/app-level.md @@ -0,0 +1,127 @@ +--- +description: 了解如何为 Flowise 实例设置应用程序级访问控制 +--- + +# 应用 + +*** + +## 电子邮件和密码 + +从v3.0.1开始,引入了新的身份验证方法。 Flowise 使用 [**Passport.js**](https://www.passportjs.org/)** 基于身份验证系统**,并将 JWT 令牌存储在安全的 HTTP-only cookie 中。当用户登录时,系统使用 bcrypt 哈希比较来根据数据库验证其电子邮件/密码,然后生成两个 JWT 令牌:一个短期访问令牌(默认 60 分钟)和一个长期刷新令牌(默认 90 天)。这些令牌存储为安全 cookie。对于后续请求,系统从 cookie 中提取 JWT,使用 Passport 的 JWT 策略验证签名和声明,并检查用户会话是否仍然存在。系统还支持访问令牌过期时自动令牌刷新,根据配置使用 Redis 或数据库存储来维护会话。 + +对于一直使用[用户名和密码(已弃用)](app-level.md#username-and-password-deprecated)的现有用户,您需要设置一个新的管理员帐户。为了防止未经授权的所有权声明,您必须首先使用配置为 `FLOWISE_USERNAME` 和 `FLOWISE_PASSWORD` 的现有用户名和密码进行身份验证。 + +
+ +可以更改以下环境变量: + +### 应用程序 URL + +* `APP_URL` - 您托管的 Flowise 应用程序 URL。默认为 `http://localhost:3000` + +### JWT 环境变量配置 + +要配置 Flowise 的 JWT 身份验证参数,用户可以更改以下环境变量: + +* `JWT_AUTH_TOKEN_SECRET` - 用于签署访问令牌的密钥 +* `JWT_REFRESH_TOKEN_SECRET` - 刷新令牌的秘密(如果未设置,则默认为身份验证令牌秘密) +* `JWT_TOKEN_EXPIRY_IN_MINUTES` - 访问令牌生命周期(默认值:60 分钟) +* `JWT_REFRESH_TOKEN_EXPIRY_IN_MINUTES` - 刷新令牌生命周期(默认值:129,600 分钟或 90 天) +* `JWT_AUDIENCE` - 令牌验证受众声明(默认值:'AUDIENCE') +* `JWT_ISSUER` - 令牌验证发行者声明(默认值:'ISSUER') +* `EXPRESS_SESSION_SECRET` - 会话加密密钥(默认值:'flowise') +* `EXPIRE_AUTH_TOKENS_ON_RESTART` - 设置为“true”以使服务器重新启动时的所有令牌无效(对开发有用) + +### SMTP 电子邮件配置 + +配置这些变量以启用密码重置和通知的电子邮件功能: + +* `SMTP_HOST` - SMTP 服务器的主机名(例如 `smtp.gmail.com`、`smtp.host.com`) +* `SMTP_PORT` - SMTP 连接的端口号(常用值:`587` 表示 TLS、`465` 表示 SSL、`25` 表示未加密) +* `SMTP_USER` - SMTP 身份验证的用户名(通常是您的电子邮件地址) +* `SMTP_PASSWORD` - 用于 SMTP 身份验证的密码或应用程序专用密码 +* `SMTP_SECURE` - 对于 SSL/TLS 加密设置为 `true`,对于未加密连接设置为 `false` +* `ALLOW_UNAUTHORIZED_CERTS` - 设置为 `true` 以允许自签名证书(不建议用于生产) +* `SENDER_EMAIL` - 将显示在外发电子邮件上的“发件人”电子邮件地址 + +### 安全和令牌配置 + +这些变量控制身份验证安全性、令牌过期和密码散列: + +* `PASSWORD_RESET_TOKEN_EXPIRY_IN_MINS` - 密码重置令牌的到期时间(默认值:15 分钟) +* `PASSWORD_SALT_HASH_ROUNDS` - 用于密码散列的 bcrypt salt 轮数(默认值:10,更高=更安全但更慢) +* `TOKEN_HASH_SECRET` - 用于哈希令牌和敏感数据的密钥(使用强随机字符串) + +### 安全最佳实践 + +{% hint style="warning" %} +我们建议配置您自己的 JWT 和 Secret 令牌环境变量;否则,将使用默认值,这可能会增加攻击者伪造有效令牌并冒充用户的机会。 +{% endhint %} + +* 对 `TOKEN_HASH_SECRET` 使用强而独特的值并安全地存储它们 +* 对于生产,请使用 `SMTP_SECURE=true` 和 `ALLOW_UNAUTHORIZED_CERTS=false` +* 根据您的安全要求设置适当的令牌到期时间 +* 使用更高的 `PASSWORD_SALT_HASH_ROUNDS` 值 (12-15) 以提高生产安全性 + +## 用户名和密码(已弃用) + +应用程序级授权通过用户名和密码保护您的 Flowise 实例。这可以防止您的应用程序在在线部署时被任何人访问。 + +
+ +### 如何设置用户名和密码 + +#### Npm + +1.安装Flowise + +```bash +npm install -g flowise +``` + +2. 使用用户名和密码启动 Flowise + +```bash +npx flowise start --FLOWISE_USERNAME=user --FLOWISE_PASSWORD=1234 +``` + +3. 打开[http://localhost:3000](http://localhost:3000) + +#### 码头工人 + +1. 导航至 `docker` 文件夹 + +``` +cd docker +``` + +2. 创建 `.env` 文件并指定 `PORT`、`FLOWISE_USERNAME` 和 `FLOWISE_PASSWORD` + +```sh +PORT=3000 +FLOWISE_USERNAME=user +FLOWISE_PASSWORD=1234 +``` + +3. 将 `FLOWISE_USERNAME` 和 `FLOWISE_PASSWORD` 传递到 `docker-compose.yml` 文件: + +``` +environment: + - PORT=${PORT} + - FLOWISE_USERNAME=${FLOWISE_USERNAME} + - FLOWISE_PASSWORD=${FLOWISE_PASSWORD} +``` + +4.`docker compose up -d` +5. 打开[http://localhost:3000](http://localhost:3000) +6. 您可以通过 `docker compose stop` 将容器放下 + +#### Git 克隆 + +要启用应用程序级身份验证,请将 `FLOWISE_USERNAME` 和 `FLOWISE_PASSWORD` 添加到 `packages/server` 中的 `.env` 文件: + +``` +FLOWISE_USERNAME=user +FLOWISE_PASSWORD=1234 +``` diff --git a/cn/configuration/authorization/chatflow-level.md b/cn/configuration/authorization/chatflow-level.md new file mode 100644 index 00000000..01c72111 --- /dev/null +++ b/cn/configuration/authorization/chatflow-level.md @@ -0,0 +1,33 @@ +--- +description: 了解如何为 Flowise 实例设置聊天流级访问控制 +--- + +# 流量 + +*** + +构建聊天流/智能体流程后,默认情况下,您的流可供公众使用。有权访问 聊天流 ID 的任何人都可以通过 嵌入 或 API 运行预测。 + +如果您可能希望允许某些人能够访问它并与之交互,您可以通过为该特定聊天流分配 API 键来实现。 + +## API 键 + +在仪表板中,导航到 API 密钥 部分,您应该能够看到创建的 DefaultKey。您还可以添加或删除任何键。 + +
+ +## 聊天流 + +导航到聊天流,现在您可以选择要用于保护聊天流的 API 密钥。 + +
+ +分配 API 密钥后,只有在授权标头提供了在 HTTP 调用期间指定的正确 API 密钥时,才能访问聊天流 API。 + +```json +"Authorization": "Bearer " +``` + +使用 POSTMAN 调用 API 的示例 + +
diff --git a/cn/configuration/databases.md b/cn/configuration/databases.md new file mode 100644 index 00000000..ed1acc3f --- /dev/null +++ b/cn/configuration/databases.md @@ -0,0 +1,136 @@ +--- +description: 了解如何将 Flowise 实例连接到数据库 +--- + +# 数据库 + +--- + +## 设置 + +Flowise 支持 4 种数据库类型: + +- SQLite +- MySQL +- PostgreSQL +- 玛丽亚数据库 + +### SQLite(默认) + +SQLite 将是默认数据库。这些数据库可以使用以下环境变量进行配置: + +```sh +DATABASE_TYPE=sqlite +DATABASE_PATH=/root/.flowise #your preferred location +``` + +将创建 `database.sqlite` 文件并将其保存在 `DATABASE_PATH` 指定的路径中。如果未指定,默认存储路径将位于您的主目录 -> .flowise + +**注意:** 如果未指定任何环境变量,SQLite 将作为后备数据库选择。 + +### MySQL + +```sh +DATABASE_TYPE=mysql +DATABASE_PORT=3306 +DATABASE_HOST=localhost +DATABASE_NAME=flowise +DATABASE_USER=user +DATABASE_PASSWORD=123 +``` + +### PostgreSQL + +```sh +DATABASE_TYPE=postgres +DATABASE_PORT=5432 +DATABASE_HOST=localhost +DATABASE_NAME=flowise +DATABASE_USER=user +DATABASE_PASSWORD=123 +PGSSLMODE=require +``` + +### 玛丽亚数据库 + +```bash +DATABASE_TYPE="mariadb" +DATABASE_PORT="3306" +DATABASE_HOST="localhost" +DATABASE_NAME="flowise" +DATABASE_USER="flowise" +DATABASE_PASSWORD="mypassword" +``` + +### 如何使用 Flowise 数据库 SQLite 和 MySQL/MariaDB + +{% embed url="https://youtu.be/R-6uV1Cb8I8" %} + +## 备份 + +1. 关闭 FlowiseAI 应用程序。 +2. 确保与其他应用程序的数据库连接已关闭。 +3. 备份数据库。 +4. 测试备份数据库。 + +### SQLite + +1. 重命名文件名。 + + 窗户: + + ```bash + rename "DATABASE_PATH\database.sqlite" "DATABASE_PATH\BACKUP_FILE_NAME.sqlite" + ``` + + Linux: + + ```bash + mv DATABASE_PATH/database.sqlite DATABASE_PATH/BACKUP_FILE_NAME.sqlite + ``` + +2.备份数据库。 + + 窗户: + + ```bash + copy DATABASE_PATH\BACKUP_FILE_NAME.sqlite DATABASE_PATH\database.sqlite + ``` + + Linux: + + ```bash + cp DATABASE_PATH/BACKUP_FILE_NAME.sqlite DATABASE_PATH/database.sqlite + ``` + +3. 通过运行 Flowise 测试备份数据库。 + +### PostgreSQL + +1.备份数据库。 + + ```bash + pg_dump -U USERNAME -h HOST -p PORT -d DATABASE_NAME -f /PATH/TO/BACKUP_FILE_NAME.sql + ``` + +2. 输入数据库密码。 +3. 创建测试数据库。 + ```bash + psql -U USERNAME -h HOST -p PORT -d TEST_DATABASE_NAME -f /PATH/TO/BACKUP_FILE_NAME.sql + ``` +4. 通过运行 Flowise 来测试备份数据库,并将 `.env` 文件修改为指向备份数据库。 + +### MySQL 和 MariaDB + +1.备份数据库。 + + ```bash + mysqldump -u USERNAME -p DATABASE_NAME > BACKUP_FILE_NAME.sql + ``` + +2. 输入数据库密码。 +3. 创建测试数据库。 + ```bash + mysql -u USERNAME -p TEST_DATABASE_NAME < BACKUP_FILE_NAME.sql + ``` +4. 通过运行 Flowise 来测试备份数据库,并将 `.env` 文件修改为指向备份数据库。 diff --git a/cn/configuration/deployment/README.md b/cn/configuration/deployment/README.md new file mode 100644 index 00000000..639751b3 --- /dev/null +++ b/cn/configuration/deployment/README.md @@ -0,0 +1,41 @@ +--- +description: 了解如何将 Flowise 部署到云端 +--- + +# 部署 + +*** + +Flowise 采用与平台无关的架构设计,确保与各种部署环境兼容,以满足您的基础设施需求。 + +## 本地机器 + +要在本地部署 Flowise,请按照我们的[开始](../../getting-started/)指南进行操作。 + +## 现代云提供商 + +现代云平台优先考虑自动化并专注于开发人员工作流程,简化云管理和持续维护。 + +这减少了所需的技术专业知识,但可能会限制您对底层基础设施的定制级别。 + +* [Elesio](https://elest.io/open-source/flowiseai) +* [拥抱脸](hugging-face.md) +* [北翼](https://northflank.com/stacks/deploy-flowiseai) +* [铁路](railway.md) +* [渲染](render.md) +* [复制](replit.md) +* [RepoCloud](https://repocloud.io/details/?app\_id=29) +* [Sealos](sealos.md) +* [Zeabur](zeabur.md) + +## 成熟的云提供商 + +另一方面,成熟的云提供商需要更高水平的技术专业知识来管理和优化您的特定需求。 + +然而,这种复杂性也为您的云环境提供了更大的灵活性和控制力。 + +* [AWS](aws.md) +* [Azure](azure.md) +* [DigitalOcean](digital-ocean.md) +* [GCP](gcp.md) +* [使用 Helm 的 Kubernetes](https://artifacthub.io/packages/helm/cowboysysop/flowise) diff --git a/cn/configuration/deployment/aws.md b/cn/configuration/deployment/aws.md new file mode 100644 index 00000000..43d2cc3e --- /dev/null +++ b/cn/configuration/deployment/aws.md @@ -0,0 +1,336 @@ +--- +description: 了解如何在 AWS 上部署 Flowise +--- + +# AWS + +*** + +## 先决条件 + +这需要对 AWS 的工作原理有一些基本的了解。 + +有两个选项可用于在 AWS 上部署 Flowise: + +* [使用 CloudFormation 在 ECS 上部署](aws.md#deploy-on-ecs-using-cloudformation) +* [手动配置 EC2 实例](aws.md#launch-ec2-instance) + +## 使用 CloudFormation 在 ECS 上部署 + +CloudFormation 模板可在此处获取:[https://gist.github.com/MrHertal/549b31a18e350b69c7200ae8d26ed691](https://gist.github.com/MrHertal/549b31a18e350b69c7200ae8d26ed691) + +它将 Flowise 部署在通过 ELB 公开的 ECS 集群上。 + +它的灵感来自于这个参考架构:[https://github.com/aws-samples/ecs-refarch-cloudformation](https://github.com/aws-samples/ecs-refarch-cloudformation) + +请随意编辑此模板以适应 Flowise 图像版本、环境变量等内容。 + +使用 [AWS CLI](https://aws.amazon.com/fr/cli/) 部署 Flowise 的命令示例: + +```bash +aws cloudformation create-stack --stack-name flowise --template-body file://flowise-cloudformation.yml --capabilities CAPABILITY_IAM +``` + +部署后,您的 Flowise 应用程序的 URL 将在 CloudFormation 堆栈输出中可用。 + +## 使用 Terraform 在 ECS 上部署 + +Terraform 文件(`variables.tf`、`main.tf`)可在此 GitHub 存储库中获取:[terraform-flowise-setup](https://github.com/huiseo/terraform-flowise-setup/tree/main)。 + +此设置将 Flowise 部署在通过应用程序负载均衡器 (ALB) 公开的 ECS 集群上。它基于 ECS 部署的 AWS 最佳实践。 + +您可以修改 Terraform 模板进行调整: + +* Flowise图像版本 +* 环境变量 +* 资源配置(CPU、内存等) + +### 部署命令示例: + +1. **初始化Terraform:** + +```bash +terraform init +terraform apply +terraform destroy +``` + +## 启动 EC2 实例 + +1. 在 EC2 仪表板中,单击 **启动实例** + +
+ +2. 向下滚动并**创建新的密钥对**(如果您没有) + +
+ +3. 填写您首选的密钥对名称。对于 Windows,我们将使用 `.ppk` 和 PuTTY 连接到实例。对于 Mac 和 Linux,我们将使用 `.pem` 和 OpenSSH + +
+ +4、点击**创建密钥对**,选择保存`.ppk`文件的位置路径 +5. 打开左侧栏,然后从 **安全组** 打开一个新选项卡。然后**创建安全组** + +
+ +6. 填写您首选的安全组名称和描述。接下来,将以下内容添加到入站规则并**创建安全组** + +
+ +7. 返回第一个选项卡(EC2 启动实例)并向下滚动到 **网络设置**。选择刚刚创建的安全组 + +
+ +8. 单击**启动实例**。导航回 EC2 仪表板,几分钟后我们应该能够看到一个新实例已启动并正在运行 [🎉](https://emojipedia.org/party-popper/) + +
+ +## 如何连接到您的实例 (Windows) + +1. 对于 Windows,我们将使用 PuTTY。您可以从[此处](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)下载一个。 +2. 打开 PuTTY 并使用实例的公共 IPv4 DNS 名称填写 **HostName** + +
+ +3. 在 PuTTY 配置的左侧栏中,展开 **SSH** 并单击 **Auth**。单击浏览并选择您之前下载的 `.ppk` 文件。 + +
+ +4. 单击“**打开**”和“**接受**”弹出消息 + +
+ +5. 然后以 `ec2-user` 身份登录 + +
+ +6. 现在您已连接到 EC2 实例 + +## 如何连接到您的实例(Mac 和 Linux) + +1. 在 Mac/Linux 上打开终端应用程序。 +2._(可选)_ 设置私钥文件的权限以限制对其的访问: + +```bash +chmod 400 /path/to/mykey.pem +``` + +3. 使用 `ssh` 命令连接到 EC2 实例,指定用户名 (`ec2-user`)、公共 IPv4 DNS 以及 `.pem` 文件的路径。 + +```bash +ssh -i /Users/username/Documents/mykey.pem ec2-user@ec2-123-45-678-910.compute-1.amazonaws.com +``` + +4. 按 Enter,如果所有配置均正确,您应该成功建立与 EC2 实例的 SSH 连接 + +## 安装 Docker + +1. 使用 yum 命令应用挂起的更新: + +```bash +sudo yum update +``` + +2.搜索Docker包: + +```bash +sudo yum search docker +``` + +3.获取版本信息: + +```bash +sudo yum info docker +``` + +4.安装docker,运行: + +```bash +sudo yum install docker +``` + +5. 为默认 ec2-user 添加组成员身份,以便您无需使用 sudo 命令即可运行所有 docker 命令: + +```bash +sudo usermod -a -G docker ec2-user +id ec2-user +newgrp docker +``` + +6.安装docker-compose: + +```bash +sudo yum install docker-compose-plugin +``` + +7. 在 AMI 启动时启用 docker 服务: + +```bash +sudo systemctl enable docker.service +``` + +8.启动Docker服务: + +```bash +sudo systemctl start docker.service +``` + +## 安装 Git + +```bash +sudo yum install git -y +``` + +## 设置 + +1. 克隆仓库 + +```bash +git clone https://github.com/FlowiseAI/Flowise.git +``` + +2. cd 进入 docker 文件夹 + +```bash +cd Flowise && cd docker +``` + +3. 创建 `.env` 文件。您可以使用您最喜欢的编辑器。我将使用 `nano` + +```bash +nano .env +``` + +
+ +4. 指定环境变量: + +```sh +PORT=3000 +DATABASE_PATH=/root/.flowise +SECRETKEY_PATH=/root/.flowise +LOG_PATH=/root/.flowise/logs +BLOB_STORAGE_PATH=/root/.flowise/storage +``` + +5. 然后按 `Ctrl + X` 退出,按 `Y` 保存文件 +6.运行docker compose + +```bash +docker compose up -d +``` + +7. 您的应用程序现已在端口 3000 上的公共 IPv4 DNS 上准备就绪: + +``` +http://ec2-123-456-789.compute-1.amazonaws.com:3000 +``` + +8. 您可以通过以下方式关闭该应用程序: + +```bash +docker compose stop +``` + +9. 您可以通过以下方式提取最新图像: + +```bash +docker pull flowiseai/flowise +``` + +或者: + +```bash +docker-compose pull +docker-compose up --build -d +``` + +## 使用 NGINX + +如果您想摆脱网址上的 :3000 并拥有自定义域,您可以使用 NGINX 将代理端口 80 反向到 3000,这样用户将能够使用您的域打开应用程序。示例:`http://yourdomain.com`。 + +1. ```bash + sudo yum 安装 nginx + ``` +2. ```bash + nginx -v + ``` +3.
sudo systemctl start nginx
+   
+4.
sudo nano /etc/nginx/conf.d/flowise.conf
+   
+5. 复制粘贴以下内容并更改为您的域: + +```shell +server { + listen 80; + listen [::]:80; + server_name yourdomain.com; #Example: demo.flowiseai.com + location / { + proxy_pass http://localhost:3000; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_cache_bypass $http_upgrade; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} +``` + +按 `Ctrl + X` 退出,按 `Y` 保存文件 + +6.```bash + sudo systemctl 重新启动 nginx + ``` +7. Go to your DNS provider, and add a new A record. Name will be your domain name, and value will be the Public IPv4 address from EC2 instance + +
+ +6. You should now be able to open the app: `http://yourdomain.com`. + +### Install Certbot to have HTTPS + +If you like your app to have `https://yourdomain.com`. Here is how: + +1. For installing Certbot and enabling HTTPS on NGINX, we will rely on Python. So, first of all, let's set up a virtual environment: + +```bash +sudo python3 -m venv /opt/certbot/ +sudo /opt/certbot/bin/pip install --升级 pip +``` + +2. Afterwards, run this command to install Certbot: + +```bash +sudo /opt/certbot/bin/pip 安装 certbot certbot-nginx +``` + +3. Now, execute the following command to ensure that the `certbot` command can be run: + +```bash +sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot +``` + +4. Finally, run the following command to obtain a certificate and let Certbot automatically modify the NGINX configuration, enabling HTTPS: + +```bash +sudo certbot --nginx +``` + +5. After following the certificate generation wizard, we will be able to access our EC2 instance via HTTPS using the address `https://yourdomain.com` + +## Set up automatic renewal + +To enable Certbot to automatically renew the certificates, it is sufficient to add a cron job by running the following command: + +```bash +echo "0 0,12 * * * root /opt/certbot/bin/python -c '导入随机;导入时间;time.sleep(random.random() * 3600)' && sudo certbot renew -q" | sudo tee -a /etc/crontab > /dev/null +``` + +## Congratulations! + +You have successfully setup Flowise apps on EC2 instance with SSL certificate on your domain[🥳](https://emojipedia.org/partying-face/) diff --git a/cn/configuration/deployment/azure.md b/cn/configuration/deployment/azure.md new file mode 100644 index 00000000..8f2c0797 --- /dev/null +++ b/cn/configuration/deployment/azure.md @@ -0,0 +1,602 @@ +--- +description: 了解如何在 Azure 上部署 Flowise +--- + +# 天蓝色 + +*** + +## Flowise 作为 Azure 应用服务与 Postgres:使用 Terraform + +### 先决条件 + +1. **Azure 帐户**:确保您拥有具有有效订阅的 Azure 帐户。如果您没有,请在 [Azure 门户](https://portal.azure.com/) 上注册。 +2. **Terraform**:在您的计算机上安装 Terraform CLI。从[Terraform 的网站](https://www.terraform.io/downloads.html) 下载它。 +3. **Azure CLI**:安装 Azure CLI。可以在 [Azure CLI 文档页面](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) 上找到相关说明。 + +### 设置您的环境 + +1. **登录 Azure**:打开终端或命令提示词符并使用以下命令登录 Azure CLI: + +```bash +az login --tenant --use-device-code +``` + +按照提示词完成登录过程。 + +2. **设置订阅**:登录后,使用以下命令设置 Azure 订阅: + +```bash +az account set --subscription +``` + +3. **初始化 Terraform**: + +在 Terraform 项目目录中创建一个 `terraform.tfvars` 文件(如果尚不存在),并添加以下内容: + +```hcl +subscription_name = "subscrpiton_name" +subscription_id = "subscription id" +project_name = "webapp_name" +db_username = "PostgresUserName" +db_password = "strongPostgresPassword" +flowise_secretkey_overwrite = "longandStrongSecretKey" +webapp_ip_rules = [ + { + name = "AllowedIP" + ip_address = "X.X.X.X/32" + headers = null + virtual_network_subnet_id = null + subnet_id = null + service_tag = null + priority = 300 + action = "Allow" + } +] +postgres_ip_rules = { + "ValbyOfficeIP" = "X.X.X.X" + // Add more key-value pairs as needed +} +source_image = "flowiseai/flowise:latest" +tagged_image = "flow:v1" +``` + +将占位符替换为您的设置的实际值。 + +文件树结构如下: + +``` +flow +├── database.tf +├── main.tf +├── network.tf +├── output.tf +├── providers.tf +├── terraform.tfvars +├── terraform.tfvars.example +├── variables.tf +├── webapp.tf +├── .gitignore // ignore your .tfvars and .lock.hcf, .terraform + +``` + +Terraform 配置中的每个 `.tf` 文件可能包含基础设施作为代码的不同方面: + +
+ +`database.tf` 将定义 Postgres 数据库的配置。 + +```yaml + +// database.tf + +// Database instance +resource "azurerm_postgresql_flexible_server" "postgres" { + name = "postgresql-${var.project_name}" + location = azurerm_resource_group.rg.location + resource_group_name = azurerm_resource_group.rg.name + sku_name = "GP_Standard_D2s_v3" + storage_mb = 32768 + version = "11" + delegated_subnet_id = azurerm_subnet.dbsubnet.id + private_dns_zone_id = azurerm_private_dns_zone.postgres.id + backup_retention_days = 7 + geo_redundant_backup_enabled = false + auto_grow_enabled = false + administrator_login = var.db_username + administrator_password = var.db_password + zone = "2" + + lifecycle { + prevent_destroy = false + } +} + +// Firewall +resource "azurerm_postgresql_flexible_server_firewall_rule" "pg_firewall" { + for_each = var.postgres_ip_rules + name = each.key + server_id = azurerm_postgresql_flexible_server.postgres.id + start_ip_address = each.value + end_ip_address = each.value +} + +// Database +resource "azurerm_postgresql_flexible_server_database" "production" { + name = "production" + server_id = azurerm_postgresql_flexible_server.postgres.id + charset = "UTF8" + collation = "en_US.utf8" + + # prevent the possibility of accidental data loss + lifecycle { + prevent_destroy = false + } +} + +// Transport off +resource "azurerm_postgresql_flexible_server_configuration" "postgres_config" { + name = "require_secure_transport" + server_id = azurerm_postgresql_flexible_server.postgres.id + value = "off" +} +``` + +
+ +
+ +`main.tf` 可能是主配置文件,其中可能包括 Azure 提供程序配置并定义 Azure 资源组。 + +```yaml +// main.tf +resource "random_string" "resource_code" { + length = 5 + special = false + upper = false +} + +// resource group +resource "azurerm_resource_group" "rg" { + location = var.resource_group_location + name = "rg-${var.project_name}" +} + +// Storage Account +resource "azurerm_storage_account" "sa" { + name = "${var.subscription_name}${random_string.resource_code.result}" + resource_group_name = azurerm_resource_group.rg.name + location = azurerm_resource_group.rg.location + account_tier = "Standard" + account_replication_type = "LRS" + + blob_properties { + versioning_enabled = true + } + +} + +// File share +resource "azurerm_storage_share" "flowise-share" { + name = "flowise" + storage_account_name = azurerm_storage_account.sa.name + quota = 50 +} + +``` + +
+ +
+ +`network.tf` 将包括网络资源,例如虚拟网络、子网和网络安全组。 + +```yaml +// network.tf + +// Vnet +resource "azurerm_virtual_network" "vnet" { + name = "vn-${var.project_name}" + location = azurerm_resource_group.rg.location + resource_group_name = azurerm_resource_group.rg.name + address_space = ["10.3.0.0/16"] +} + +resource "azurerm_subnet" "dbsubnet" { + name = "db-subnet-${var.project_name}" + resource_group_name = azurerm_resource_group.rg.name + virtual_network_name = azurerm_virtual_network.vnet.name + address_prefixes = ["10.3.1.0/24"] + private_endpoint_network_policies_enabled = true + delegation { + name = "delegation" + service_delegation { + name = "Microsoft.DBforPostgreSQL/flexibleServers" + } + } + lifecycle { + ignore_changes = [ + service_endpoints, + delegation + ] + } +} + +resource "azurerm_subnet" "webappsubnet" { + + name = "web-app-subnet-${var.project_name}" + resource_group_name = azurerm_resource_group.rg.name + virtual_network_name = azurerm_virtual_network.vnet.name + address_prefixes = ["10.3.8.0/24"] + + delegation { + name = "delegation" + service_delegation { + name = "Microsoft.Web/serverFarms" + } + } + lifecycle { + ignore_changes = [ + delegation + ] + } +} + +resource "azurerm_private_dns_zone" "postgres" { + name = "private.postgres.database.azure.com" + resource_group_name = azurerm_resource_group.rg.name +} + +resource "azurerm_private_dns_zone_virtual_network_link" "postgres" { + name = "private-postgres-vnet-link" + resource_group_name = azurerm_resource_group.rg.name + private_dns_zone_name = azurerm_private_dns_zone.postgres.name + virtual_network_id = azurerm_virtual_network.vnet.id +} + +``` + +
+ +
+ +`providers.tf` 将定义 Terraform 提供程序,例如 Azure。 + +```yaml +// providers.tf +terraform { + required_version = ">=0.12" + + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "=3.87.0" + } + random = { + source = "hashicorp/random" + version = "~>3.0" + } + } +} + +provider "azurerm" { + subscription_id = var.subscription_id + features {} +} +``` + +
+ +
+ +`variables.tf` 将声明在所有 `.tf` 文件中使用的变量。 + +```yaml +// variables.tf +variable "resource_group_location" { + default = "westeurope" + description = "Location of the resource group." +} + +variable "container_rg_name" { + default = "acrllm" + description = "Name of container regrestry." +} + +variable "subscription_id" { + type = string + sensitive = true + description = "Service Subscription ID" +} + +variable "subscription_name" { + type = string + description = "Service Subscription Name" +} + + +variable "project_name" { + type = string + description = "Project Name" +} + +variable "db_username" { + type = string + description = "DB User Name" +} + +variable "db_password" { + type = string + sensitive = true + description = "DB Password" +} + +variable "flowise_secretkey_overwrite" { + type = string + sensitive = true + description = "Flowise secret key" +} + +variable "webapp_ip_rules" { + type = list(object({ + name = string + ip_address = string + headers = string + virtual_network_subnet_id = string + subnet_id = string + service_tag = string + priority = number + action = string + })) +} + +variable "postgres_ip_rules" { + description = "A map of IP addresses and their corresponding names for firewall rules" + type = map(string) + default = {} +} + +variable "flowise_image" { + type = string + description = "Flowise image from Docker Hub" +} + +variable "tagged_image" { + type = string + description = "Tag for flowise image version" +} +``` + +
+ +
+ +`webapp.tf` Azure 应用服务,包括服务计划和 Linux Web 应用 + +```yaml +// webapp.tf +#Create the Linux App Service Plan +resource "azurerm_service_plan" "webappsp" { + name = "asp${var.project_name}" + resource_group_name = azurerm_resource_group.rg.name + location = azurerm_resource_group.rg.location + os_type = "Linux" + sku_name = "P3v3" +} + +resource "azurerm_linux_web_app" "webapp" { + name = var.project_name + resource_group_name = azurerm_resource_group.rg.name + location = azurerm_resource_group.rg.location + service_plan_id = azurerm_service_plan.webappsp.id + + app_settings = { + DOCKER_ENABLE_CI = true + WEBSITES_CONTAINER_START_TIME_LIMIT = 1800 + WEBSITES_ENABLE_APP_SERVICE_STORAGE = false + DATABASE_TYPE = "postgres" + DATABASE_HOST = azurerm_postgresql_flexible_server.postgres.fqdn + DATABASE_NAME = azurerm_postgresql_flexible_server_database.production.name + DATABASE_USER = azurerm_postgresql_flexible_server.postgres.administrator_login + DATABASE_PASSWORD = azurerm_postgresql_flexible_server.postgres.administrator_password + DATABASE_PORT = 5432 + FLOWISE_SECRETKEY_OVERWRITE = var.flowise_secretkey_overwrite + PORT = 3000 + SECRETKEY_PATH = "/root" + DOCKER_IMAGE_TAG = var.tagged_image + } + + storage_account { + name = "${var.project_name}_mount" + access_key = azurerm_storage_account.sa.primary_access_key + account_name = azurerm_storage_account.sa.name + share_name = azurerm_storage_share.flowise-share.name + type = "AzureFiles" + mount_path = "/root" + } + + + https_only = true + + site_config { + always_on = true + vnet_route_all_enabled = true + dynamic "ip_restriction" { + for_each = var.webapp_ip_rules + content { + name = ip_restriction.value.name + ip_address = ip_restriction.value.ip_address + } + } + application_stack { + docker_image_name = var.flowise_image + docker_registry_url = "https://${azurerm_container_registry.acr.login_server}" + docker_registry_username = azurerm_container_registry.acr.admin_username + docker_registry_password = azurerm_container_registry.acr.admin_password + } + } + + logs { + http_logs { + file_system { + retention_in_days = 7 + retention_in_mb = 35 + } + + } + } + + identity { + type = "SystemAssigned" + } + + lifecycle { + create_before_destroy = false + + ignore_changes = [ + virtual_network_subnet_id + ] + } + +} + +resource "azurerm_app_service_virtual_network_swift_connection" "webappvnetintegrationconnection" { + app_service_id = azurerm_linux_web_app.webapp.id + subnet_id = azurerm_subnet.webappsubnet.id + + depends_on = [azurerm_linux_web_app.webapp, azurerm_subnet.webappsubnet] +} + +``` + +
+ +注意: `.terraform` 目录是 Terraform 在初始化项目 (`terraform init`) 时创建的,它包含 Terraform 运行所需的插件和二进制文件。 `.terraform.lock.hcl` 文件用于记录确切的提供程序版本,这些版本用于确保不同计算机上的安装一致。 + +导航到您的 Terraform 项目目录并运行: + +```bash +terraform init +``` + +这将初始化 Terraform 并下载所需的提供程序。 + +### 配置 Terraform 变量 + +### 使用 Terraform 进行部署 + +1. **规划部署**:运行 Terraform plan 命令以查看将创建哪些资源: + + ```bash + terraform plan + ``` +2. **应用部署**:如果您对计划感到满意,请应用更改: + + ```bash + terraform apply + ``` + + 出现提示词时确认操作,Terraform 将开始创建资源。 +3. **验证部署**:Terraform 完成后,它将输出任何定义的输出,例如 IP 地址或域名。验证资源是否已正确部署在 Azure 门户中。 + +*** + +## Azure Continer 实例:使用 Azure 门户 UI 或 Azure CLI + +### 先决条件 + +1. _(可选)_ [如果您想遵循基于 cli 的命令,请安装 Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) + +## 创建一个没有持久存储的容器实例 + +如果没有持久存储,您的数据将保存在内存中。这意味着容器重新启动后,您存储的所有数据都将消失。 + +### 在门户中 + +1、在Marketplace中搜索容器实例,点击创建: + +

Azure 市场中的容器实例条目

+ +2. 选择或创建资源组、容器名称、区域、镜像源`Other registry`、镜像类型、镜像`flowiseai/flowise`、操作系统类型和大小。然后点击“下一步:网络”配置 Flowise 端口: + +

容器实例创建向导中的第一页

+ +3. 在默认端口 `80 (TCP)` 旁边添加新端口 `3000 (TCP)`。然后选择“下一步:高级”: + +

容器实例创建向导中的第二页。它要求网络类型和端口。

+ +4. 将重新启动策略设置为 `On failure`。添加命令覆盖 `["/bin/sh", "-c", "flowise start"]`。最后点击“审核+创建”: + +

容器实例创建向导中的第三页。它要求重新启动策略、环境变量和在容器启动时运行的命令。

+ +5. 检查最终设置并单击“创建”: + +

容器实例的最终审核和创建页面。

+ +6.创建完成后,点击“转到资源” + +

Azure 中的资源创建结果页面。

+ +7. 通过复制 IP 地址并添加 :3000 作为端口来访问您的 Flowise 实例: + +

容器实例概览页面

+ +

Flowise 应用程序部署为容器实例

+ +### 使用 Azure CLI 创建 + +1. 创建一个资源组(如果您还没有) + +```bash +az group create --name flowise-rg --location "West US" +``` + +2. 创建容器实例 + +```bash +az container create -g flowise-rg \ + --name flowise \ + --image flowiseai/flowise \ + --command-line "/bin/sh -c 'flowise start'" \ + --ip-address public \ + --ports 80 3000 \ + --restart-policy OnFailure +``` + +3. 访问上述命令输出中打印的 IP 地址(包括端口:3000)。 + +## 创建具有持久存储的容器实例 + +只能使用 CLI 创建具有持久存储的容器实例: + +1. 创建一个资源组(如果您还没有) + +```bash +az group create --name flowise-rg --location "West US" +``` + +2. 在上述资源组内创建存储帐户资源(或使用现有资源)。您可以在[此处](https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-portal?tabs=azure-portal)查看操作方法。 +3. 在 Azure 存储中创建新的文件共享。您可以在[此处](https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-portal?tabs=azure-portal)查看操作方法。 +4. 创建容器实例 + +```bash +az container create -g flowise-rg \ + --name flowise \ + --image flowiseai/flowise \ + --command-line "/bin/sh -c 'flowise start'" \ + --environment-variables DATABASE_PATH=/opt/flowise/.flowise SECRETKEY_PATH=/opt/flowise/.flowise LOG_PATH=/opt/flowise/.flowise/logs BLOB_STORAGE_PATH=/opt/flowise/.flowise/storage \ + --ip-address public \ + --ports 80 3000 \ + --restart-policy OnFailure \ + --azure-file-volume-share-name here goes the name of your File share \ + --azure-file-volume-account-name here goes the name of your Storage Account \ + --azure-file-volume-account-key here goes the access key to your Storage Account \ + --azure-file-volume-mount-path /opt/flowise/.flowise +``` + +5. 访问上述命令输出中打印的 IP 地址(包括端口:3000)。 +6. 从现在开始,您的数据将存储在 SQLite 数据库中,您可以在文件共享中找到该数据库。 + +观看有关部署到 Azure 容器实例的视频教程: + +{% embed url="https://www.youtube.com/watch?v=yDebxDfn2yk" %} diff --git a/cn/configuration/deployment/digital-ocean.md b/cn/configuration/deployment/digital-ocean.md new file mode 100644 index 00000000..456dd83d --- /dev/null +++ b/cn/configuration/deployment/digital-ocean.md @@ -0,0 +1,280 @@ +--- +description: 了解如何在 Digital Ocean 上部署 Flowise +--- + +# 数字海洋 + +*** + +## 创建水滴 + +在本节中,我们将创建一个 Droplet。如需了解更多信息,请参阅[官方指南](https://docs.digitalocean.com/products/droplets/quickstart/)。 + +1. 首先,从下拉列表中单击 **Droplets** + +
+ +2. 选择数据区域和基本 $6/月 Droplet 类型 + +
+ +3. 选择身份验证方法。在此示例中,我们将使用密码 + +
+ +4. 一段时间后,您应该能够看到 Droplet 创建成功 + +
+ +## 如何连接到您的 Droplet + +对于 Windows,请遵循此[指南](https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/putty/)。 + +对于 Mac/Linux,请遵循此[指南](https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/openssh/)。 + +## 安装 Docker + +1.``` + 卷曲-fsSL https://get.docker.com -o get-docker.sh + ``` +2. ``` + sudo sh get-docker.sh + ``` +3.安装docker-compose: + +``` +sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +``` + +4.设置权限: + +``` +sudo chmod +x /usr/local/bin/docker-compose +``` + +## 设置 + +1. 克隆仓库 + +``` +git clone https://github.com/FlowiseAI/Flowise.git +``` + +2. cd 进入 docker 文件夹 + +```bash +cd Flowise && cd docker +``` + +3. 创建 `.env` 文件。您可以使用您最喜欢的编辑器。我将使用 `nano` + +```bash +nano .env +``` + +
+ +4. 指定环境变量: + +```sh +PORT=3000 +DATABASE_PATH=/root/.flowise +SECRETKEY_PATH=/root/.flowise +LOG_PATH=/root/.flowise/logs +BLOB_STORAGE_PATH=/root/.flowise/storage +``` + +5. 然后按 `Ctrl + X` 退出,按 `Y` 保存文件 +6.运行docker compose + +```bash +docker compose up -d +``` + +7. 然后您可以查看应用程序:“您的公共 IPv4 DNS”:3000。示例:`176.63.19.226:3000` +8. 您可以通过以下方式关闭该应用程序: + +```bash +docker compose stop +``` + +9. 您可以通过以下方式提取最新图像: + +```bash +docker pull flowiseai/flowise +``` + +## 添加反向代理 & SSL + +反向代理是将应用程序服务器公开到互联网的推荐方法。它将让我们单独使用 URL 而不是服务器 IP 和端口号连接到 Droplet。这提供了安全优势,将应用程序服务器与直接互联网访问隔离、集中防火墙保护的能力、针对常见威胁(例如拒绝服务攻击)的最小化攻击平面,以及对于我们的目的来说最重要的是,能够在单个位置终止 SSL/TLS 加密。 + +> Droplet 上缺少 SSL 将导致嵌入式小部件和 API 端点在现代浏览器中无法访问。这是因为浏览器已开始弃用 HTTP,转而使用 HTTPS,并阻止来自通过 HTTPS 加载的页面的 HTTP 请求。 + +### 步骤 1 — 安装 Nginx + +1. Nginx 可以通过默认存储库使用 apt 安装。更新您的存储库索引,然后安装 Nginx: + +```bash +sudo apt update +sudo apt install nginx +``` + +> 按 Y 确认安装。如果系统要求您重新启动服务,请按 ENTER 接受默认值。 + +2. 您需要允许通过防火墙访问Nginx。根据初始服务器先决条件设置服务器后,使用 ufw 添加以下规则: + +```bash +sudo ufw allow 'Nginx HTTP' +``` + +3. 现在您可以验证 Nginx 是否正在运行: + +```bash +systemctl status nginx +``` + +输出: + +```bash +● nginx.service - A high performance web server and a reverse proxy server + Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) + Active: active (running) since Mon 2022-08-29 06:52:46 UTC; 39min ago + Docs: man:nginx(8) + Main PID: 9919 (nginx) + Tasks: 2 (limit: 2327) + Memory: 2.9M + CPU: 50ms + CGroup: /system.slice/nginx.service + ├─9919 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;" + └─9920 "nginx: worker process +``` + +接下来,您将使用您的域和应用程序服务器代理添加自定义服务器块。 + +### 步骤 2 — 配置您的服务器块 + DNS 记录 + +建议为新添加的服务器块创建自定义配置文件,而不是直接编辑默认配置。 + +1. 使用 nano 或您喜欢的文本编辑器创建并打开新的 Nginx 配置文件: + +```bash +sudo nano /etc/nginx/sites-available/your_domain +``` + +2. 将以下内容插入到新文件中,确保将 `your_domain` 替换为您自己的域名: + +``` +server { + listen 80; + listen [::]:80; + server_name your_domain; #Example: demo.flowiseai.com + location / { + proxy_pass http://localhost:3000; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_cache_bypass $http_upgrade; + } +} +``` + +3.保存并退出,使用`nano`,您可以通过点击`CTRL+O`然后点击`CTRL+X`来完成此操作。 +4. 接下来,通过创建一个链接来启用此配置文件,该链接指向 Nginx 在启动时读取的启用站点的目录,并再次确保将 `your_domain` 替换为您自己的域名: + +```bash +sudo ln -s /etc/nginx/sites-available/your_domain /etc/nginx/sites-enabled/ +``` + +5. 现在您可以测试配置文件是否存在语法错误: + +```bash +sudo nginx -t +``` + +6. 如果没有报告任何问题,请重新启动 Nginx 以应用更改: + +```bash +sudo systemctl restart nginx +``` + +7. 转到您的 DNS 提供商,然后添加新的 A 记录。名称将是您的域名,值将是您 Droplet 中的公共 IPv4 地址 + +
+ +Nginx 现在已配置为应用程序服务器的反向代理。您现在应该可以打开应用程序:http://yourdomain.com. + +### 步骤 3 — 为 HTTPS (SSL) 安装 Certbot + +如果您想向 Droplet 添加安全的 `https` 连接(例如 https://yourdomain.com,),您需要执行以下操作: + +1. 为了安装 Certbot 并在 NGINX 上启用 HTTPS,我们将依赖 Python。那么,首先我们来设置一个虚拟环境: + +```bash +apt install python3.10-venv +sudo python3 -m venv /opt/certbot/ +sudo /opt/certbot/bin/pip install --upgrade pip +``` + +2. 然后,运行以下命令安装 Certbot: + +```bash +sudo /opt/certbot/bin/pip install certbot certbot-nginx +``` + +3. 现在,执行以下命令以确保可以运行 `certbot` 命令: + +```bash +sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot +``` + +4. 最后,运行以下命令获取证书,并让Certbot自动修改NGINX配置,启用HTTPS: + +```bash +sudo certbot --nginx +``` + +5. 按照证书生成向导操作后,我们将能够使用地址 https://yourdomain.com 通过 HTTPS 访问我们的 Droplet + +### 设置自动续订 + +要使 Certbot 自动续订证书,只需运行以下命令来添加 cron 作业即可: + +```bash +echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo certbot renew -q" | sudo tee -a /etc/crontab > /dev/null +``` + +## 恭喜! + +您已在 Droplet 上成功设置 Flowise,并在您的域 [🥳](https://emojipedia.org/partying-face/) 上使用 SSL 证书 + +## 在 Digital Ocean 上更新 Flowise 的步骤 + +1. 导航到您安装 flowise 的目录 + +```bash +cd Flowise/docker +``` + +2.停止并删除docker镜像 + +注意:这不会删除您的流,因为数据库存储在单独的文件夹中 + +```bash +sudo docker compose stop +sudo docker compose rm +``` + +3.拉取最新的Flowise镜像 + +您可以在[此处](https://github.com/FlowiseAI/Flowise/releases)查看最新版本 + +```bash +docker pull flowiseai/flowise +``` + +4.启动docker + +```bash +docker compose up -d +``` diff --git a/cn/configuration/deployment/gcp.md b/cn/configuration/deployment/gcp.md new file mode 100644 index 00000000..abd7fe41 --- /dev/null +++ b/cn/configuration/deployment/gcp.md @@ -0,0 +1,194 @@ +--- +description: 了解如何在 GCP 上部署 Flowise +--- + +# GCP + +*** + +## 先决条件 + +1. 记下您的 Google Cloud \[ProjectId] +2. 安装 [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +3. 安装 [Google Cloud CLI](https://cloud.google.com/sdk/docs/install-sdk) +4. 安装[Docker 桌面](https://docs.docker.com/desktop/) + +## 设置 Kubernetes 集群 + +1. 如果没有 Kubernetes 集群,请创建一个。 + +

单击 `Clusters` 创建一个。

+ +2. 命名集群,选择正确的资源位置,使用 `Autopilot` 模式并保留所有其他默认配置。 +3. 创建集群后,单击操作菜单中的“连接”菜单 + +
+ +4. 复制命令并粘贴到终端中,然后按 Enter 键连接集群。 +5. 运行以下命令并选择正确的上下文名称,例如 `gke_[ProjectId]_[DataCenter]_[ClusterName]` + +``` +kubectl config get-contexts +``` + +6. 设置当前上下文 + +``` +kubectl config use-context gke_[ProjectId]_[DataCenter]_[ClusterName] +``` + +## 构建并推送 Docker 镜像 + +运行以下命令来构建 Docker 映像并将其推送到 GCP 容器注册表。 + +1. 克隆 Flowise + +``` +git clone https://github.com/FlowiseAI/Flowise.git +``` + +2. 构建 Flowise + +``` +cd Flowise +pnpm install +pnpm build +``` + +3. 稍微更新 `Dockerfile` 文件。 + +> 指定nodejs的平台 +> +> ``` +> FROM --platform=linux/amd64 节点:18-alpine +> ``` +> +> 添加python3、make和g++安装 +> +> ``` +> RUN apk add --no-cache python3 make g++ +> ``` + +3. 构建为 Docker 镜像,确保 Docker 桌面应用程序正在运行 + +``` +docker build -t gcr.io/[ProjectId]/flowise:dev . +``` + +4. 将 Docker 映像推送到 GCP 容器注册表。 + +``` +docker push gcr.io/[ProjectId]/flowise:dev +``` + +## 部署到 GCP + +1. 在项目中创建`yamls`根文件夹。 +2. 将 `deployment.yaml` 文件添加到该文件夹​​中。 + +``` +# deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: flowise + labels: + app: flowise +spec: + selector: + matchLabels: + app: flowise + replicas: 1 + template: + metadata: + labels: + app: flowise + spec: + containers: + - name: flowise + image: gcr.io/[ProjectID]/flowise:dev + imagePullPolicy: Always + resources: + requests: + cpu: "1" + memory: "1Gi" +``` + +3. 将 `service.yaml` 文件添加到该文件夹​​中。 + +``` +# service.yaml +apiVersion: "v1" +kind: "Service" +metadata: + name: "flowise-service" + namespace: "default" + labels: + app: "flowise" +spec: + ports: + - protocol: "TCP" + port: 80 + targetPort: 3000 + selector: + app: "flowise" + type: "LoadBalancer" + +``` + +它将如下所示。 + +
+ +4. 通过运行以下命令部署 yaml 文件。 + +``` +kubectl apply -f yamls/deployment.yaml +kubectl apply -f yamls/service.yaml +``` + +5. 进入GCP中的`Workloads`,可以看到你的pod正在运行。 + +
+ +6. 转到`Services & Ingress`,您可以单击Flowise 所在的`Endpoint`。 + +
+ +## 恭喜! + +您已成功在 GCP [🥳](https://emojipedia.org/partying-face/) 上托管 Flowise 应用 + +## 超时 + +默认情况下,GCP 为代理分配了 30 秒的超时。当响应返回时间超过 30 秒阈值时,这会导致问题。为了解决此问题,请对 YAML 文件进行以下更改: + +注意:要将超时设置为 10 分钟(例如)——我们在下面指定 600 秒。 + +1. 创建一个 `backendconfig.yaml` 文件,内容如下: + +```yaml +apiVersion: cloud.google.com/v1 +kind: BackendConfig +metadata: + name: flowise-backendconfig + namespace: your-namespace +spec: + timeoutSec: 600 +``` + +2.问题:`kubectl apply -f backendconfig.yaml` +3. 使用以下对 `BackendConfig` 的引用更新您的 `service.yaml` 文件: + +```yaml +apiVersion: v1 +kind: Service +metadata: + annotations: + cloud.google.com/backend-config: '{"default": "flowise-backendconfig"}' + name: flowise-service + namespace: your-namespace +... +``` + +4.问题:`kubectl apply -f service.yaml` diff --git a/cn/configuration/deployment/hugging-face.md b/cn/configuration/deployment/hugging-face.md new file mode 100644 index 00000000..e3bbed51 --- /dev/null +++ b/cn/configuration/deployment/hugging-face.md @@ -0,0 +1,63 @@ +--- +description: 了解如何在 Hugging Face 上部署 Flowise +--- + +# 拥抱脸 + +*** + +### 创建一个新空间 + +1. 登录[抱脸](https://huggingface.co/login) +2. 开始使用您喜欢的名称创建[新空间](https://huggingface.co/new-space)。 +3. 选择 **Docker** 作为 **Space SDK** 并选择 **Blank** 作为 Docker 模板。 +4. 选择 **CPU basic ∙ 2 vCPU ∙ 16GB ∙ FREE** 作为 **Space 硬件**。 +5. 单击“**创建空间**”。 + +### 设置环境变量 + +1. 转到新空间的 **设置** 并找到 **变量和秘密** 部分 +2. 单击 **新变量** 并将名称添加为 `PORT`,值为 `7860` +3. 单击“**保存**” +4._(可选)_单击**新秘密** +5._(可选)_填写您的环境变量,例如数据库凭据、文件路径等。您可以检查 `.env.example` [此处](https://github.com/FlowiseAI/Flowise/blob/main/docker/.env.example) 中的有效字段 + +### 创建一个 Dockerfile + +1. 在文件选项卡中,单击按钮 _**+ 添加文件**_ 并单击 **创建新文件**(如果您愿意,也可以上传文件) +2. 创建一个名为 **Dockerfile** 的文件并粘贴以下内容: + +```Dockerfile +FROM node:20-alpine +USER root + +# Arguments that can be passed at build time +ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise +ARG BASE_PATH=/root/.flowise +ARG DATABASE_PATH=$BASE_PATH +ARG SECRETKEY_PATH=$BASE_PATH +ARG LOG_PATH=$BASE_PATH/logs +ARG BLOB_STORAGE_PATH=$BASE_PATH/storage + +# Install dependencies +RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium + +ENV PUPPETEER_SKIP_DOWNLOAD=true +ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser + +# Install Flowise globally +RUN npm install -g flowise + +# Configure Flowise directories using the ARG +RUN mkdir -p $LOG_PATH $FLOWISE_PATH/uploads && chmod -R 777 $LOG_PATH $FLOWISE_PATH + +WORKDIR /data + +CMD ["npx", "flowise", "start"] +``` + +3. 单击 **Commit file to `main`**,它将开始构建您的应用程序。 + +### 完成🎉 + +构建完成后,您可以单击 **App** 选项卡来查看您的应用程序正在运行。 diff --git a/cn/configuration/deployment/railway.md b/cn/configuration/deployment/railway.md new file mode 100644 index 00000000..2ac17332 --- /dev/null +++ b/cn/configuration/deployment/railway.md @@ -0,0 +1,49 @@ +--- +description: 了解如何在铁路上部署 Flowise +--- + +# 铁路 + +*** + +1. 单击以下预建的[模板](https://railway.app/template/pn4G8S?referralCode=WVNPD9) +2. 单击“立即部署” + +
+ +3. 更改为您的首选存储库名称并单击部署 + +
+ +4. 如果成功,您应该能够看到已部署的 URL + +
+ +5. 要添加授权,请导航到“变量”选项卡并添加: + +* FLOWISE\_用户名 +* FLOWISE\_PASSWORD + +
+ +6. 您可以配置环境变量列表。请参阅[environment-variables.md](../environment-variables.md "mention") + +就是这样!您现在已在 Railway 上部署了 Flowise [🎉](https://emojipedia.org/party-popper/)[🎉](https://emojipedia.org/party-popper/) + +## 持久卷 + +在 Railway 上运行的服务的默认文件系统是短暂的。 Flowise 数据不会在部署和重新启动时保留。要解决此问题,我们可以使用[Railway Volume](https://docs.railway.app/reference/volumes)。 + +为了简化步骤,我们有一个安装了卷的铁路模板:[https://railway.app/template/nEGbjR](https://railway.app/template/nEGbjR) + +只需单击“部署”并填写环境变量,如下所示: + +* DATABASE\_PATH - `/opt/railway/.flowise` +* APIKEY\_PATH - `/opt/railway/.flowise` +* LOG\_PATH - `/opt/railway/.flowise/logs` +* SECRETKEY\_PATH - `/opt/railway/.flowise` +* BLOB\_STORAGE\_PATH - `/opt/railway/.flowise/storage` + +
+ +现在尝试创建一个流程并将其保存在 Flowise 中。然后尝试重新启动服务或重新部署,您应该仍然能够看到之前保存的流程。 diff --git a/cn/configuration/deployment/render.md b/cn/configuration/deployment/render.md new file mode 100644 index 00000000..de1d789d --- /dev/null +++ b/cn/configuration/deployment/render.md @@ -0,0 +1,83 @@ +--- +description: 了解如何在渲染上部署 Flowise +--- + +# 渲染 + +*** + +1. 分叉 [Flowise 官方存储库](https://github.com/FlowiseAI/Flowise) +2.访问您的github个人资料以确保您已成功创建分叉 +3. 登录[渲染](https://dashboard.render.com) +4. 单击“**新建+**” + +
+ +5. 选择**网络服务** + +
+ +6. 连接您的 GitHub 帐户 +7. 选择您分叉的 Flowise 存储库并单击 **连接** + +
+ +8. 填写您首选的**名称**和**区域。** +9. 选择 `Docker` 作为您的 **运行时** + +
+ +9. 选择一个**实例** + +
+ +10._(可选)_添加应用程序级别授权,单击**高级**并添加`Environment Variable` + +* FLOWISE\_用户名 +* FLOWISE\_PASSWORD + +
+ +添加值为 `18.18.1` 的 `NODE_VERSION` 作为运行实例的节点版本。 + +您可以配置环境变量列表。请参阅[environment-variables.md](../environment-variables.md "mention") + +11. 单击“**创建 Web 服务**” + +
+ +12. 导航到已部署的 URL,就是这样 [🚀](https://emojipedia.org/rocket/)[🚀](https://emojipedia.org/rocket/) + +
+ +## 永久磁盘 + +在 Render 上运行的服务的默认文件系统是短暂的。 Flowise 数据不会在部署和重新启动时保留。为了解决这个问题,我们可以使用[渲染磁盘](https://render.com/docs/disks)。 + +1. 在左侧栏上,单击“**磁盘**” +2. 命名您的磁盘,并将 **安装路径** 指定为 `/opt/render/.flowise` + +
+ +3. 单击 **Environment** 部分,然后添加以下新环境变量: + +* HOST - `0.0.0.0` +* DATABASE\_PATH - `/opt/render/.flowise` +* APIKEY\_PATH - `/opt/render/.flowise` +* LOG\_PATH - `/opt/render/.flowise/logs` +* SECRETKEY\_PATH - `/opt/render/.flowise` +* BLOB\_STORAGE\_PATH - `/opt/render/.flowise/storage` + +
+ +4. 单击 **手动部署**,然后选择 **清除构建缓存并部署** + +
+ +5. 现在尝试创建一个流程并将其保存在 Flowise 中。然后尝试重新启动服务或重新部署,您应该仍然能够看到之前保存的流程。 + +观看如何部署到渲染 + +{% embed url="https://youtu.be/Fxyc6-frgrI" %} + +{% embed url="https://youtu.be/l-0NzOMeCco" %} diff --git a/cn/configuration/deployment/replit.md b/cn/configuration/deployment/replit.md new file mode 100644 index 00000000..d41d55e4 --- /dev/null +++ b/cn/configuration/deployment/replit.md @@ -0,0 +1,42 @@ +--- +description: 了解如何在 Replit 上部署 Flowise +--- + +# 重复 + +*** + +1. 登录[Replit](https://replit.com/~) +2. 创建一个新的 **Repl**。选择 **Node.js** 作为模板并填写您喜欢的 **标题**。 + +
+ +3. 创建新的 Repl 后,在左侧栏上单击 Secret: + +
+ +4. 创建 3 个秘密以跳过 Puppeteer 和 Playwright 库的 Chromium 下载。 + +
秘密价值
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD1
PUPPETEER_SKIP_DOWNLOAD真实
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD真实
+ +
+ +5. 现在可以切换到 Shell 选项卡 + +
+ +6. 在 Shell 终端窗口中输入 `npm install -g flowise`。如果您遇到有关节点版本不兼容的错误,请使用以下命令 `yarn global add flowise --ignore-engines` + +
+ +7. 然后是 `npx flowise start` + +
+ +8. 您现在应该能够在 Replit 上看到 Flowise! + +
+ +9. 您现在将看到登录页面。只需使用您设置的用户名和密码登录即可。 + +
diff --git a/cn/configuration/deployment/sealos.md b/cn/configuration/deployment/sealos.md new file mode 100644 index 00000000..4ac67823 --- /dev/null +++ b/cn/configuration/deployment/sealos.md @@ -0,0 +1,36 @@ +--- +description: 了解如何在 Sealos 上部署 Flowise +--- + +# 西洛斯 + +*** + +1. 单击以下预建的[模板](https://template.sealos.io/deploy?templateName=flowise)或下面的按钮。 + +[![部署在 Sealos](https://sealos.io/Deploy-on-Sealos.svg)](https://template.sealos.io/deploy?templateName=flowise) + +2.添加授权 + * FLOWISE\_用户名 + * FLOWISE\_PASSWORD + +
+ +3. 在模板页面点击“部署应用”开始部署。 +4. 部署结束后,单击“详细信息”导航至应用程序的详细信息。 + +
+ +5. 等待应用程序的状态切换为正在运行。随后,单击外部链接可直接通过外部域打开应用程序的 Web 界面。 + +
+ +## 持久卷 + +点击应用详情页面右上角的“更新”,然后点击“高级”->“添加卷”,填写“挂载路径”的值:`/root/.flowise`。 + +
+ +最后,单击“部署”按钮。 + +现在尝试创建一个流程并将其保存在 Flowise 中。然后尝试重新启动服务或重新部署,您应该仍然能够看到之前保存的流程。 diff --git a/cn/configuration/deployment/zeabur.md b/cn/configuration/deployment/zeabur.md new file mode 100644 index 00000000..6b0da7dd --- /dev/null +++ b/cn/configuration/deployment/zeabur.md @@ -0,0 +1,42 @@ +--- +description: 了解如何在 Zeabur 上部署 Flowise +--- + +# 玉米 + +*** + +{% hint style="warning" %} +请注意,Zeabur 制作的以下模板已过时(自 2024 年 1 月 24 日起)。 +{% endhint %} + +1. 单击以下预建的[模板](https://zeabur.com/templates/2JYZTR)或下面的按钮。 + +[![部署在 Zeabur](https://zeabur.com/button.svg)](https://zeabur.com/templates/2JYZTR) + +2. 单击“部署” + +
zeabur template
+ +3. 选择您喜欢的地区并继续 + +
select region
+ +4.您将被重定向到Zeabur的仪表板,您将看到部署过程 + +
deployment process
+ +5. 要添加授权,请导航到“变量”选项卡并添加: + +* FLOWISE\_用户名 +* FLOWISE\_PASSWORD + +
authorization
+ +6. 您可以配置环境变量列表。请参阅[environment-variables.md](../environment-variables.md "mention") + +就是这样!您现在已在 Zeabur 上部署了 Flowise [🎉](https://emojipedia.org/party-popper/)[🎉](https://emojipedia.org/party-popper/) + +## 持久卷 + +Zeabur 会自动为您创建持久卷,因此您无需担心。 diff --git a/cn/configuration/environment-variables.md b/cn/configuration/environment-variables.md new file mode 100644 index 00000000..15f330e1 --- /dev/null +++ b/cn/configuration/environment-variables.md @@ -0,0 +1,221 @@ +--- +description: 了解如何为 Flowise 配置环境变量 +--- + +# 环境变量 + +Flowise 支持不同的环境变量来配置您的实例。您可以在 `packages/server` 文件夹内的 `.env` 文件中指定以下变量。请参阅 [.env.example](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/.env.example) 文件。 + +
变量描述类型默认
PORTFlowise 运行于 HTTP 端口数量3000
FLOWISE_FILE_SIZE_LIMIT上传时最大文件大小字符串50mb
NUMBER_OF_PROXIES速率限制代理数量
CORS_ORIGINS所有跨域 HTTP 调用的允许来源字符串
IFRAME_ORIGINSiframe src 嵌入允许的来源字符串
SHOW_COMMUNITY_NODES显示社区创建的节点布尔值: truefalse
DISABLED_NODES要禁用的节点名称的逗号分隔列表字符串
+ +## 对于数据库 + +|变量|描述 |类型 |默认| +| ------------------ | ---------------------------------------------------------------- | ------------------------------------------ | ------------------------ | +| DATABASE\_类型 |存储流程数据的数据库类型 |枚举字符串:`sqlite`、`mysql`、`postgres` | `sqlite` | +| DATABASE\_PATH |数据库保存位置(当DATABASE\_TYPE为sqlite时) |字符串| `your-home-dir/.flowise` | +| DATABASE\_HOST | DATABASE\_HOST |主机 URL 或 IP 地址(当 DATABASE\_TYPE 不是 sqlite 时)|字符串| | +| DATABASE\_端口 |数据库端口(当 DATABASE\_TYPE 不是 sqlite 时)|字符串| | +| DATABASE\_USER |数据库用户名(当 DATABASE\_TYPE 不是 sqlite 时)|字符串| | +| DATABASE\_密码 |数据库密码(当 DATABASE\_TYPE 不是 sqlite 时)|字符串| | +| DATABASE\_NAME |数据库名称(当 DATABASE\_TYPE 不是 sqlite 时)|字符串| | +| DATABASE\_SSL |需要数据库 SSL (当 DATABASE\_TYPE 不是 sqlite 时)|布尔值:`true` 或 `false` | `false` | + +## 用于存储 + +Flowise 默认将以下文件存储在本地路径文件夹下。 + +* 文件上传到[文档加载器](../integrations/langchain/document-loaders/)/文档存储 +* 从聊天上传图像/音频 +* 来自助手的图像/文件 +* 来自 [Vector 写入更新 API](/broken/pages/F2AfRpI7qYixNiBWpmIe#vector-upsert-api) 的文件 + +用户可以指定 `STORAGE_TYPE` 以使用 AWS S3、Google Cloud Storage 或本地路径 + +|变量|描述 |类型 |默认| +| -------------------------------------- | -------------------------------------------------------------------------------- | --------------------------------- | -------------------------------- | +| STORAGE\_类型 |上传文件的存储类型。默认为 `local` |枚举字符串:`s3`、`gcs`、`local` | `local` | +| BLOB\_STORAGE\_PATH | `STORAGE_TYPE` 为 `local` 时存储上传文件的本地文件夹路径 |字符串| `your-home-dir/.flowise/storage` | +| S3\_STORAGE\_BUCKET\_NAME |当 `STORAGE_TYPE` 为 `s3` 时保存上传文件的存储桶名称 |字符串| | +| S3\_STORAGE\_ACCESS\_KEY\_ID | AWS 访问密钥 |字符串| | +| S3\_存储\_秘密\_访问\_密钥 | AWS 密钥 |字符串| | +| S3\_存储区域 | S3 存储桶的区域 |字符串| | +| S3\_ENDPOINT\_URL |自定义 S3 端点(可选)|字符串| | +| S3\_FORCE\_PATH\_STYLE |强制 S3 路径样式(可选)|布尔 |假 | +| GOOGLE\_CLOUD\_STORAGE\_CREDENTIAL |谷歌云服务帐户密钥 |字符串| | +| GOOGLE\_CLOUD\_STORAGE\_PROJ\_ID |谷歌云项目ID |字符串| | +| GOOGLE\_CLOUD\_STORAGE\_BUCKET\_NAME | Google 云存储桶名称 |字符串| | +| GOOGLE\_云\_统一\_桶\_访问|访问类型 |布尔 |真实 | + +## 用于调试和日志 + +|变量|描述 |类型 | | +| ---------- | ----------------------------------- | ------------------------------------------------ | ------------------------------ | +| DEBUG |从组件打印日志 |布尔 | | +| LOG\_PATH |日志文件存储位置 |字符串| `Flowise/packages/server/logs` | +| LOG\_LEVEL |不同级别的日志 |枚举字符串:`error`、`info`、`verbose`、`debug` | `info` | + +`DEBUG`:如果设置为 true,会将日志打印到终端/控制台: + +
+ +`LOG_LEVEL`:要保存的记录器的不同日志级别。可以是 `error`、`info`、`verbose` 或 `debug.` 默认情况下,它设置为 `info,`,仅将 `logger.info` 保存到日志文件中。如果您想获得完整的详细信息,请设置为 `debug`。 + +

server-requests.log.jsonl - 记录发送到 Flowise 的每个请求

+ +

server.log - 记录 Flowise 上的一般操作

+ +

server-error.log - 使用堆栈跟踪记录错误

+ +### 日志流 S3 + +当 `STORAGE_TYPE` 环境变量设置为 `s3` 时,日志将自动流式传输并存储到 S3。新的日志文件将每小时创建一次,以便更轻松地进行调试。 + +### 日志流 GCS + +当 `STORAGE_TYPE` 环境变量设置为 `gcs` 时,日志将自动传输到 Google [Cloud Logging](https://cloud.google.com/logging?hl=en)。 + +## 凭据 + +Flowise 使用加密密钥将您的第三方 API 密钥存储为加密凭据。 + +默认情况下,启动应用程序时将生成随机加密密钥并存储在文件路径下。然后每次都会检索该加密密钥以解密聊天流中使用的凭据。例如,您的 OpenAI API 密钥、Pinecone API 密钥等。 + +您可以配置为使用 AWS Secret Manager 来存储加密密钥。 + +|变量|描述 |类型 |默认 | +| ----------------------------- | ----------------------------------------------------- | --------------------------- | ------------------------- | +| SECRETKEY\_存储\_类型 |如何存储加密密钥 |枚举字符串:`local`、`aws` | `local` | +| SECRETKEY\_PATH |保存加密密钥的本地文件路径 |字符串| `Flowise/packages/server` | +| FLOWISE\_SECRETKEY\_OVERWRITE |使用加密密钥代替现有密钥 |字符串| | +| SECRETKEY\_AWS\_ACCESS\_KEY | |字符串| | +| SECRETKEY\_AWS\_SECRET\_KEY | |字符串| | +| SECRETKEY\_AWS\_REGION | |字符串| | + +由于某些原因,有时可能会重新生成加密密钥或更改存储路径,这会导致错误,例如 - 凭据无法解密。 + +为了避免这种情况,您可以将自己的加密密钥设置为 `FLOWISE_SECRETKEY_OVERWRITE`,这样每次都会使用相同的加密密钥。格式没有限制,您可以将其设置为任何您想要的文本,或者与您的 `FLOWISE_PASSWORD` 相同。 + +
+ +{% hint style="info" %} +从 UI 返回的凭据 API 密钥与您设置的原始 Api 密钥长度不同。这是一个伪造的前缀字符串,可以防止网络欺骗,这就是我们不将 Api 密钥返回给 UI 的原因。但是,在您与聊天流交互期间,将检索并使用正确的 Api 密钥。 +{% endhint %} + +## 对于模型 + +在某些情况下,您可能希望在现有聊天模型和 LLM 节点上使用自定义模型,或限制仅访问某些模型。 + +默认情况下,Flowise 从[此处](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/models.json) 提取模型列表。但是,用户可以创建自己的 `models.json` 文件并指定文件路径: + +
变量描述类型默认
MODEL_LIST_CONFIG_JSON从您的加载模型列表的链接 models.json 配置文件字符串https://raw.githubusercontent.com/FlowiseAI/Flowise/main/packages/components/models.json
+ +## 对于内置和外部依赖项 + +Flowise 中的某些节点/功能允许用户运行 Javascript 代码。出于安全原因,默认情况下它只允许某些依赖项。通过设置以下环境变量可以解除内置和外部模块的限制: + +
变量描述
TOOL_FUNCTION_BUILTIN_DEPNodeJS 内置模块的使用字符串
TOOL_FUNCTION_EXTERNAL_DEP使用的外部模块 字符串
ALLOW_BUILTIN_DEP允许使用项目依赖项,例如 cheerio, typeorm布尔值
+ +{% code title=".env" %} +```bash +# Allows usage of all builtin modules +TOOL_FUNCTION_BUILTIN_DEP=* + +# Allows usage of only fs +TOOL_FUNCTION_BUILTIN_DEP=fs + +# Allows usage of only crypto and fs +TOOL_FUNCTION_BUILTIN_DEP=crypto,fs + +# Allow usage of external npm modules. +TOOL_FUNCTION_EXTERNAL_DEP=cheerio,typeorm + +ALLOW_BUILTIN_DEP=true +``` +{% endcode %} + +### 使用内置依赖项 + +{% hint style="warning" %} +某些内置依赖项(例如 Puppeteer)可能会引入潜在的安全漏洞。建议在使用前仔细分析和评估这些风险。 +{% endhint %} + +### NodeVM 执行错误:VMError:找不到模块 + +如果您使用默认情况下不允许的库,您可以: + +1. 允许所有项目的 [库/依赖项](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/src/utils.ts#L52):`ALLOW_BUILTIN_DEP=true` +2.(推荐)特别允许某些库/依赖项:`TOOL_FUNCTION_EXTERNAL_DEP=cheerio,typeorm` + +## 安全配置 + +
变量描述选项默认
HTTP_DENY_LIST阻止对 MCP 服务器中指定 URL 或域的 HTTP 请求以逗号分隔的 URL/域(空)
CUSTOM_MCP_SECURITY_CHECK为自定义 MCP 配置启用全面的安全验证true | falsetrue
CUSTOM_MCP_PROTOCOL设置自定义 MCP 通信的默认协议stdio |ssestdio
+ +#### `CUSTOM_MCP_SECURITY_CHECK=true` + +默认情况下,此功能已启用。启用后,应用以下安全验证: + +* **命令白名单**:仅允许安全命令(`node`、`npx`、`python`、`python3`、`docker`) +* **参数验证**:阻止危险的文件路径、目录遍历和可执行文件 +* **注入预防**:防止 shell 元字符和命令链 +* **环境保护**:阻止修改关键环境变量(PATH、LD\_LIBRARY\_PATH) + +#### `CUSTOM_MCP_PROTOCOL` + +* **`stdio`**:直接进程通信(默认,需要命令执行) +* **`sse`**:服务器通过 HTTP 发送的事件(推荐用于生产,更安全) + +### 推荐的生产设置 + +```bash +# Enable security validation (default) +CUSTOM_MCP_SECURITY_CHECK=true + +# Use SSE protocol for better security +CUSTOM_MCP_PROTOCOL=sse + +# Block dangerous domains (example) +HTTP_DENY_LIST=localhost,127.0.0.1,internal.company.com + +# Blocks a hardcoded list of dangerous domains by default, but can be set to false to disable +HTTP_SECURITY_CHECK=true + +# Enables checks on provided file and folder paths to prevent path traversal attacks +PATH_TRAVERSAL_SAFETY=true +``` + +{% hint style="warning" %} +**警告**:禁用 `CUSTOM_MCP_SECURITY_CHECK` 会导致任意命令执行,并在生产环境中带来重大安全风险。 + +`HTTP_SECURITY_CHECK` 启用内置安全功能,阻止硬编码的危险域列表。默认情况下为 `true`,可以通过将其设置为 `false` 来禁用。 + +`HTTP_DENY_LIST` 允许您指定要阻止的附加自定义域列表。默认情况下,此列表为空。 + +`PATH_TRAVERSAL_SAFETY` 启用内置安全功能来防止对文件和文件夹路径的路径遍历攻击。默认情况下为 `true`,可以通过将其设置为 `false` 来禁用。 +{% endhint %} + +## 如何设置环境变量的示例 + +### NPM + +您可以在使用 npx 运行 Flowise 时设置所有这些变量。例如: + +``` +npx flowise start --PORT=3000 --DEBUG=true +``` + +### 码头工人 + +``` +docker run -d -p 5678:5678 flowise \ + -e DATABASE_TYPE=postgresdb \ + -e DATABASE_PORT= \ + -e DATABASE_HOST= \ + -e DATABASE_NAME= \ + -e DATABASE_USER= \ + -e DATABASE_PASSWORD= \ +``` + +### Docker 组合 + +您可以在 `docker` 文件夹内的 `.env` 文件中设置所有这些变量。请参阅 [.env.example](https://github.com/FlowiseAI/Flowise/blob/main/docker/.env.example) 文件。 diff --git a/cn/configuration/rate-limit.md b/cn/configuration/rate-limit.md new file mode 100644 index 00000000..9cc74c50 --- /dev/null +++ b/cn/configuration/rate-limit.md @@ -0,0 +1,31 @@ +--- +description: 了解如何在 Flowise 中管理 API 请求 +--- + +# 速率限制 + +*** + +当您在没有 API 授权的情况下通过 API 或嵌入式聊天向公众共享聊天流时,任何人都可以访问该流。为了防止垃圾邮件,您可以对聊天流设置速率限制。 + +
+ +* **每个持续时间的消息限制**:在特定持续时间内可以接收多少条消息。例如:20 +* **持续时间(以秒为单位)**:指定的持续时间。例如:60 +* **限制消息**:超过限制时返回什么消息。例如:超出配额 + +使用上面的示例,这意味着 60 秒内只允许接收 20 条消息。速率限制由 IP 地址跟踪。如果您已在云服务上部署 Flowise,则必须设置 `NUMBER_OF_PROXIES` 环境变量。 + +## 速率限制设置 + +当您在云上托管 Flowise(例如 AWS、GCP、Azure 等)时,您很可能位于代理/负载均衡器后面。因此,速率限制可能无法发挥作用。如需了解更多信息,请访问[此处](https://github.com/express-rate-limit/express-rate-limit/wiki/Troubleshooting-Proxy-Issues)。 + +要解决该问题: + +1. **设置环境变量:** 在您的托管环境中创建名为 `NUMBER_OF_PROXIES` 的环境变量并将其值设置为 `0`。 +2. **重新启动托管的 Flowise 实例:** 这使 Flowise 能够应用环境变量的更改。 +3. **检查 IP 地址:** 要验证 IP 地址,请访问以下 URL:`{{hosted_url}}/api/v1/ip`。您可以通过在网络浏览器中输入 URL 或发出 API 请求来执行此操作。 +4. **比较IP地址** 发出请求后,将返回的IP地址与您当前的IP地址进行比较。您可以通过访问以下任一网站找到您当前的 IP 地址: + * [http://ip.nfriedly.com/](http://ip.nfriedly.com/) + * [https://api.ipify.org/](https://api.ipify.org/) +5. **IP 地址不正确:** 如果返回的 IP 地址与您当前的 IP 地址不匹配,请将 `NUMBER_OF_PROXIES` 加 1 并重新启动 Flowise 实例。重复此过程,直到 IP 地址与您的 IP 地址匹配。 diff --git a/cn/configuration/running-flowise-behind-company-proxy.md b/cn/configuration/running-flowise-behind-company-proxy.md new file mode 100644 index 00000000..5e2a1251 --- /dev/null +++ b/cn/configuration/running-flowise-behind-company-proxy.md @@ -0,0 +1,19 @@ +# 在公司代理后面运行 Flowise + +如果您在需要代理的环境中运行 Flowise,例如在组织网络内,您可以将 Flowise 配置为通过您选择的代理路由其所有后端请求。此功能由 `global-agent` 包提供支持。 + +[https://github.com/gajus/global-agent](https://github.com/gajus/global-agent) + +## 配置 + +在公司代理后面运行 Flowise 需要 2 个环境变量: + +|变量|目的|必填| +| -------------------------- | -------------------------------------------------------------------------------- | -------- | +| `GLOBAL_AGENT_HTTP_PROXY` |通过哪里代理所有服务器 HTTP 请求 |是的 | +| `GLOBAL_AGENT_HTTPS_PROXY` |通过哪里代理所有服务器 HTTPS 请求 |没有 | +| `GLOBAL_AGENT_NO_PROXY` |应从代理中排除的 URL 模式。例如。 `*.foo.com,baz.com` |没有 | + +## 出站允许列表 + +对于企业计划,您必须允许多个出站连接以进行许可证检查。请联系 support@flowiseai.com 了解更多信息。 diff --git a/cn/configuration/running-flowise-using-queue.md b/cn/configuration/running-flowise-using-queue.md new file mode 100644 index 00000000..4cd4781d --- /dev/null +++ b/cn/configuration/running-flowise-using-queue.md @@ -0,0 +1,201 @@ +# 使用队列运行 Flowise + +默认情况下,Flowise 在 NodeJS 主线程中运行。然而,对于大量的预测,这不能很好地扩展。因此,您可以配置 2 种模式:`main`(默认)和 `queue`。 + +## 队列模式 + +使用以下环境变量,您可以在 `queue` 模式下运行 Flowise。 + +
变量描述类型默认
MODE运行 Flowise 的模式枚举字符串: main, queuemain
WORKER_CONCURRENCY一个worker允许并行处理多少个作业。如果你有 1 个工作线程,这意味着它可以处理多少个并发预测任务。更多 信息数量10000
QUEUE_NAME消息队列的名称字符串流动队列
QUEUE_REDIS_EVENT_STREAM_MAX_LEN事件流会自动修剪,使其大小不会增长太多。更多 信息数量10000
REDIS_URLRedis URL字符串
REDIS_HOSTRedis主机字符串本地主机
REDIS_PORTRedis端口数量6379
REDIS_USERNAMERedis 用户名(可选)字符串
REDIS_PASSWORDRedis密码(可选)字符串
REDIS_TLSRedis TLS 连接(可选)更多 信息布尔值假的
REDIS_CERTRedis自签名证书字符串
REDIS_KEYRedis自签名证书密钥文件字符串
REDIS_CARedis自签名证书CA文件字符串
+ +在 `queue` 模式下,主服务器将负责处理请求,将作业发送到消息队列。主服务器不会执行该作业。一名或多名工作人员从队列中接收作业,执行它们并将结果发回。 + +这允许动态扩展:您可以添加工作人员来处理增加的工作负载或在较轻的时期删除它们。 + +它的工作原理如下: + +1. 主服务器接收来自网络的预测或其他请求,将它们作为作业添加到队列中。 +2. 这些作业队列是等待处理的任务的基本列表。工作人员本质上是独立的进程或线程,负责接收并执行这些作业。 +3. 工作完成后,工人: + * 将结果写入数据库。 + * 发送一个事件来指示作业完成。 +4. 主服务器接收事件,并将结果发送回UI。 +5. Redis pub/sub 还用于将数据流式传输回 UI。 + +
+ +## 流程图 + +
+ +#### 1.请求入口点 + +预测请求到达 Express 服务器并立即检查是否 `MODE=QUEUE`。如果为 true,则会从直接执行切换到异步队列处理。 + +#### 2. 创造就业机会和双渠道 + +系统创建两条并行路径: + +* **作业通道**:请求数据通过BullMQ成为Redis作业,HTTP线程等待完成 +* **流通道**:为通过 Redis pub/sub 进行实时更新而建立的 SSE 连接 + +#### 3. Worker 处理 + +独立的工作进程轮询 Redis 来查找作业。分配时: + +* 重建完整的执行上下文(数据库、组件、中止控制器) +* 通过逐个节点处理执行工作流程 +* 发布实时事件(代币、工具、进度)到Redis通道 + +#### 4. 实时通讯 + +执行期间: + +* [**RedisEventPublisher**](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/queue/RedisEventPublisher.ts) 将事件从工作线程广播到 Redis +* [**RedisEventSubscriber**](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/queue/RedisEventSubscriber.ts) 将事件从 Redis 转发到 SSE 客户端 +* [**SSEStreamer**](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/utils/SSEStreamer.ts) 将事件实时传送到浏览器 + +#### 5. 完成和响应 + +作业完成,结果存储在Redis中: + +* HTTP 线程解除阻塞,接收结果 +* SSE 连接正常关闭 +* 资源清理(中止控制器、连接) + +## 本地设置 + +### 启动Redis + +在启动主服务器和工作人员之前,需要先运行Redis。您可以在单独的计算机上运行 Redis,但请确保服务器和工作实例可以访问它。 + +例如,您可以按照此[指南](https://www.docker.com/blog/how-to-use-the-redis-docker-official-image/)在 Docker 上运行 Redis。 + +### 启动主服务器 + +这与默认运行 Flowise 相同,但配置上述环境变量除外。 + +```bash +pnpm start +``` + +### 启动工人 + +和主服务器一样,必须配置上面的环境变量。我们建议为主实例和工作实例使用相同的 `.env` 文件。唯一的区别是如何运行工人。打开另一个终端并运行: + +```bash +pnpm run start-worker +``` + +{% hint style="warning" %} +主服务器和worker需要共享相同的密钥。请参阅[#for-credentials](environment-variables.md#for-credentials "mention")。对于生产,我们建议使用 Postgres 作为性能数据库。 +{% endhint %} + +## Docker 设置 + +### 方法 1:预构建镜像(推荐) + +此方法使用 Docker Hub 中预先构建的 Docker 映像,使其成为最快、最可靠的部署选项。 + +**第1步:设置环境** + +在 `docker` 目录中创建 `.env` 文件: + +```bash +# Basic Configuration +PORT=3000 +WORKER_PORT=5566 + +# Queue Configuration (Required) +MODE=queue +QUEUE_NAME=flowise-queue +REDIS_URL=redis://redis:6379 + +# Optional Queue Settings +WORKER_CONCURRENCY=5 +REMOVE_ON_AGE=24 +REMOVE_ON_COUNT=1000 +QUEUE_REDIS_EVENT_STREAM_MAX_LEN=1000 +ENABLE_BULLMQ_DASHBOARD=false + +# Database (Optional - defaults to SQLite) +DATABASE_PATH=/root/.flowise + +# Storage +BLOB_STORAGE_PATH=/root/.flowise/storage + +# Secret Keys +SECRETKEY_PATH=/root/.flowise + +# Logging +LOG_PATH=/root/.flowise/logs +``` + +**第 2 步:部署** + +```bash +cd docker +docker compose -f docker-compose-queue-prebuilt.yml up -d +``` + +**步骤 3:验证部署** + +```bash +# Check container status +docker compose -f docker-compose-queue-prebuilt.yml ps + +# View logs +docker compose -f docker-compose-queue-prebuilt.yml logs -f flowise +docker compose -f docker-compose-queue-prebuilt.yml logs -f flowise-worker +``` + +### 方法 2:从源代码构建 + +此方法从源代码构建 Flowise,对于开发或自定义修改很有用。 + +**第1步:设置环境** + +创建与 [方法 1](running-flowise-using-queue.md#method-1-pre-built-images-recommended) 中相同的 `.env` 文件。 + +**第 2 步:部署** + +```bash +cd docker +docker compose -f docker-compose-queue-source.yml up -d +``` + +**步骤 3:构建过程** + +源构建将: + +* 从源代码构建主要 Flowise 应用程序 +* 从源代码构建工人图像 +* 设置Redis和网络 + +**第 4 步:监控构建** + +```bash +# Watch build progress +docker compose -f docker-compose-queue-source.yml logs -f + +# Check final status +docker compose -f docker-compose-queue-source.yml ps +``` + +### 健康检查 + +所有撰写文件都包含健康检查: + +```bash +# Check main instance health +curl http://localhost:3000/api/v1/ping + +# Check worker health +curl http://localhost:5566/healthz +``` + +## 队列仪表板 + +将 `ENABLE_BULLMQ_DASHBOARD` 设置为 true 将允许用户通过导航到“查看所有作业、状态、结果、数据”/管理/队列` + +
diff --git a/cn/configuration/running-in-production.md b/cn/configuration/running-in-production.md new file mode 100644 index 00000000..59a9ffe3 --- /dev/null +++ b/cn/configuration/running-in-production.md @@ -0,0 +1,34 @@ +# 在生产环境中运行 + +## 模式 + +在生产环境中运行时,我们强烈建议使用 [Queue](running-flowise-using-queue.md) 模式并进行以下设置: + +* 2 个带负载均衡的主服务器,每台从 4vCPU 8GB RAM 起 +* 4个worker,每个从4vCPU 8GB RAM开始 + +您可以根据流量和容量配置自动缩放。 + +## 数据库 + +默认情况下,Flowise 将使用 SQLite 作为数据库。但是,当大规模运行时,建议使用 PostgresQL。 + +## 存储 + +目前 Flowise 仅支持 [AWS S3](https://aws.amazon.com/s3/),并计划支持更多 Blob 存储提供商。这将允许文件和日志存储在 S3 上,而不是本地文件路径上。请参阅[#for-storage](environment-variables.md#for-storage "mention") + +## 加密 + +Flowise 使用加密密钥来加密/解密您使用的凭据,例如 OpenAI API 密钥。建议在生产中使用 [AWS Secret Manager](https://aws.amazon.com/secrets-manager/),以实现更好的安全控制和密钥轮换。请参阅[#for-credentials](environment-variables.md#for-credentials "mention") + +## 速率限制 + +当部署到云/本地时,实例很可能位于代理/负载均衡器后面。请求的 IP 地址可能是负载均衡器/反向代理的 IP,使速率限制器实际上成为全局速率限制器,并在达到限制或 `undefined` 时阻止所有请求。设置正确的 `NUMBER_OF_PROXIES` 可以解决该问题。请参阅[#rate-limit-setup](rate-limit.md#rate-limit-setup "mention") + +## 负载测试 + +Artillery 可用于对您部署的 Flowise 应用程序进行负载测试。示例脚本可在[此处](https://github.com/FlowiseAI/Flowise/blob/main/artillery-load-test.yml)找到。 + +## 安全 + +请参阅[#安全配置](environment-variables.md#security-configuration "mention") diff --git a/cn/configuration/sso.md b/cn/configuration/sso.md new file mode 100644 index 00000000..fef8c76f --- /dev/null +++ b/cn/configuration/sso.md @@ -0,0 +1,126 @@ +# SSO + +{% hint style="info" %} +SSO 仅适用于企业计划 +{% endhint %} + +Flowise 支持 [OIDC](https://openid.net/),允许用户使用_单点登录 (_SSO_) 访问应用程序。目前,只有 [组织管理员](../using-flowise/workspaces.md#setting-up-admin-account) 可以配置 SSO 配置。 + +## 微软 + +1. 在 Azure 门户中,搜索 Microsoft Entra ID: + +
+ +2. 在左侧栏中,单击“应用程序注册”,然后单击“新注册”: + +
+ +3. 输入应用程序名称,然后选择单租户: + +
+ +4. 创建应用程序后,记下应用程序(客户端)ID 和目录(租户)ID: + +
+ +5. 在左侧栏上,单击证书和机密 -> 新客户端机密 -> 添加: + +
+ +6. 创建密钥后,复制值, 秘密ID: + +
+ +7. 在左侧栏,单击身份验证 -> 添加平台 -> Web: + +
+ +8. 填写重定向 URI。这需要根据您的托管方式进行更改:`http[s]://[your-flowise-instance.com]/api/v1/azure/callback`: + +
+ +9. 您应该能够看到创建的新重定向 URI: + +
+ +10. 返回 Flowise 应用程序,以组织管理员身份登录。从左侧栏导航至 SSO Config。填写步骤 4 中的 Azure 租户 ID 和客户端 ID,以及步骤 6 中的客户端密钥。单击测试配置以查看是否可以成功建立连接: + +
+ +11.最后,启用并保存: + +
+ +12. 用户必须先获得邀请,然后才能使用 SSO 登录。请参阅[邀请用户SSO登录](sso.md#inviting-users-for-sso-sign-in)了解分步指南。受邀请的用户还必须是 Azure 中的目录用户的一部分。 + +
+ +## 谷歌 + +要在您的网站上启用“使用 Google 登录”,您首先需要设置您的 Google API 客户端 ID。为此,请完成以下步骤: + +1. 打开 [Google API 控制台](https://console.developers.google.com/apis) 的 **凭据** 页面。 +2. 单击 **创建凭据** > **OAuth 客户端 ID** + +
+ +3\.选择 **Web 应用程序**: + +
+ +4\.填写重定向 URI。这需要根据您的托管方式进行更改:`http[s]://[your-flowise-instance.com]/api/v1/google/callback`: + +
+ +5\.创建后,获取客户端 ID 和密钥: + +
+ +6\.返回 Flowise 应用程序,添加客户端 ID 和密码。测试连接并保存。 + +
+ +## 授权0 + +1. 在 [Auth0](https://auth0.com/) 上注册帐户,然后创建一个新应用程序 + +
+ +2. 选择 **常规 Web 应用程序**: + +
+ +3. 配置名称、描述等字段。记下 **域**、**客户端 ID** 和 **客户端密钥**。 + +
+ +4\.填写应用程序 URI。这需要根据您的托管方式进行更改:`http[s]://[your-flowise-instance.com]/api/v1/auth0/callback`: + +
+ +5. 在 API 选项卡中,确保启用了 Auth0 管理 API 并具有以下权限 + * 读取:用户 + * 读取:客户端\_grants + +
+ +6\.返回 Flowise App,填写 Domain、Client ID 和 Secret。测试并保存配置。 + +
+ +## 邀请用户 SSO 登录 + +为了让新用户能够登录,您必须邀请新用户进入 Flowise 应用程序。这对于记录受邀用户的角色/工作区至关重要。有关环境变量配置,请参阅[邀请用户](../using-flowise/workspaces.md#invite-user)部分。 + +受邀用户将收到登录邀请链接: + +
+ +单击该按钮会将受邀请的用户直接带到 Flowise SSO 登录屏幕: + +
+ +或者导航到 Flowise 应用程序并使用 SSO 登录: + +
diff --git a/cn/contributing/README.md b/cn/contributing/README.md new file mode 100644 index 00000000..e4f91528 --- /dev/null +++ b/cn/contributing/README.md @@ -0,0 +1,59 @@ +--- +description: 了解如何为此项目做出贡献 +--- + +# 贡献指南 + +*** + +我们感谢所有的贡献!无论您的技能水平或技术背景如何,您都可以帮助该项目发展。以下是一些贡献方式: + +## ⭐ 星星 + +加注星标并分享[Github 存储库](https://github.com/FlowiseAI/Flowise)。 + +## 🙌 分享聊天流 + +是的!分享您如何使用 Flowise 是一种贡献方式。将您的聊天流导出为 JSON,附上屏幕截图并在 [显示和讲述部分](https://github.com/FlowiseAI/Flowise/discussions/categories/show-and-tell) 中分享。 + +## 💡 想法 + +我们欢迎有关新功能、应用程序集成的想法。将您的建议提交到[想法部分](https://github.com/FlowiseAI/Flowise/discussions/categories/ideas)。 + +## 🙋 问答 + +想了解更多吗?在[问答部分](https://github.com/FlowiseAI/Flowise/discussions/categories/q-a)中搜索任何问题的答案。如果您找不到问题,请随时创建一个新问题。它可能会帮助其他有类似问题的人。 + +## 🐞 报告错误 + +发现问题? [报告](https://github.com/FlowiseAI/Flowise/issues/new/choose)。 + +## 📖 贡献文档 + +1. 分叉官方 [Flowise Docs Repo](https://github.com/FlowiseAI/FlowiseDocs) +2. 克隆您的分叉存储库 +3. 创建新分支 +4.切换到刚刚创建的分支 +5.进入存储库文件夹 + + ```bash + cd FlowiseDocs + ``` +6. 做出改变 +7. 提交更改并从指向 [FlowiseDocs main](https://github.com/FlowiseAI/FlowiseDocs) 的分叉分支提交拉取请求 + +## 👨‍💻 贡献代码 + +要了解如何贡献代码,请转到[对于开发人员](../getting-started/#setup-2)部分并按照说明进行操作。 + +如果您正在为新的节点集成做出贡献,请阅读[构建节点](building-node.md)指南。 + +## 🏷️ 拉取请求流程 + +当您打开拉取请求时,FlowiseAI 团队的成员将自动收到通知/分配。您还可以通过 [Discord](https://discord.gg/jbaHfsRVBW) 与我们联系。 + +## 📜 行为准则 + +该项目以及参与该项目的每个人均受行为准则的约束,该行为准则可在[文件](https://github.com/FlowiseAI/Flowise/blob/main/CODE\_OF\_CONDUCT.md)中找到。通过参与,您应该遵守此准则。 + +请向 hello@flowiseai.com 报告不可接受的行为。 diff --git a/cn/contributing/building-node.md b/cn/contributing/building-node.md new file mode 100644 index 00000000..74ae5679 --- /dev/null +++ b/cn/contributing/building-node.md @@ -0,0 +1,125 @@ +# 构建节点 + +### 安装 Git + +首先,安装 Git 并克隆 Flowise 存储库。您可以按照[开始](/broken/pages/nuiTj70UthEELOvhLrSb#for-developers)指南中的步骤操作。 + +### 结构 + +Flowise 将每个节点集成分离到文件夹 `packages/components/nodes` 下。让我们尝试创建一个简单的工具! + +### 创建计算器工具 + +在 `packages/components/nodes/tools` 文件夹下创建一个名为 `Calculator` 的新文件夹。然后创建一个名为 `Calculator.ts` 的新文件。在文件中,我们首先编写基类。 + +```javascript +import { INode } from '../../../src/Interface' +import { getBaseClasses } from '../../../src/utils' + +class Calculator_Tools implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + author: string + baseClasses: string[] + + constructor() { + this.label = 'Calculator' + this.name = 'calculator' + this.version = 1.0 + this.type = 'Calculator' + this.icon = 'calculator.svg' + this.category = 'Tools' + this.author = 'Your Name' + this.description = 'Perform calculations on response' + this.baseClasses = [this.type, ...getBaseClasses(Calculator)] + } +} + +module.exports = { nodeClass: Calculator_Tools } +``` + +每个节点都将实现 `INode` 基类。每个属性含义的细分: + +
财产描述
标签UI 上显示的节点名称
姓名代码使用的名称。必须是 驼色箱
版本节点版本
类型通常与标签相同。定义哪个节点可以连接到 UI 上的该特定类型
图标节点图标
类别节点类别
作者节点创建者
描述节点说明
基类来自节点的基类,因为节点可以从基组件扩展。用于定义UI上哪个节点可以连接到该节点
+ +### 定义类 + +现在组件类已部分完成,我们可以继续定义实际的工具类,在本例中为 `Calculator`。 + +在同一个 `Calculator` 文件夹下创建一个新文件,并命名为 `core.ts` + +```javascript +import { Parser } from "expr-eval" +import { Tool } from "@langchain/core/tools" + +export class Calculator extends Tool { + name = "calculator" + description = `Useful for getting the result of a math expression. The input to this tool should be a valid mathematical expression that could be executed by a simple calculator.` + + async _call(input: string) { + try { + return Parser.evaluate(input).toString() + } catch (error) { + return "I don't know how to do that." + } + } +} +``` + +### 整理 + +回到 `Calculator.ts` 文件,我们可以通过 `async init` 函数来完成此操作。在此函数中,我们将初始化上面创建的 Calculator 类。当流正在执行时,每个节点中的`init`函数将被调用,并且当LLM决定调用该工具时,将执行`_call`函数。 + +```javascript +import { INode } from '../../../src/Interface' +import { getBaseClasses } from '../../../src/utils' +import { Calculator } from './core' + +class Calculator_Tools implements INode { + label: string + name: string + version: number + description: string + type: string + icon: string + category: string + author: string + baseClasses: string[] + + constructor() { + this.label = 'Calculator' + this.name = 'calculator' + this.version = 1.0 + this.type = 'Calculator' + this.icon = 'calculator.svg' + this.category = 'Tools' + this.author = 'Your Name' + this.description = 'Perform calculations on response' + this.baseClasses = [this.type, ...getBaseClasses(Calculator)] + } + + + async init() { + return new Calculator() + } +} + +module.exports = { nodeClass: Calculator_Tools } +``` + +### 构建并运行 + +在 `packages/server` 内的 `.env` 文件中,创建一个新的环境变量: + +```javascript +SHOW_COMMUNITY_NODES=true +``` + +现在我们可以使用 `pnpm build` 和 `pnpm start` 让组件活跃起来! + +
diff --git a/cn/getting-started/README.md b/cn/getting-started/README.md new file mode 100644 index 00000000..bc2d8b93 --- /dev/null +++ b/cn/getting-started/README.md @@ -0,0 +1,216 @@ +# 开始吧 + +*** + +## 云 + +自托管需要更多的技术技能来设置实例、备份数据库和维护更新。如果您没有管理服务器的经验,而只想使用网络应用程序,我们建议使用[Flowise Cloud](https://cloud.flowiseai.com)。 + +## 快速入门 + +{% hint style="info" %} +先决条件:确保计算机上已安装 [NodeJS](https://nodejs.org/en/download)。支持节点 `v18.15.0` 或 `v20` 及以上。 +{% endhint %} + +使用 NPM 在本地安装 Flowise。 + +1.安装Flowise: + +```bash +npm install -g flowise +``` + +您还可以安装特定版本。请参阅可用的[版本](https://www.npmjs.com/package/flowise?activeTab=versions)。 + +``` +npm install -g flowise@x.x.x +``` + +2.启动Flowise: + +```bash +npx flowise start +``` + +3. 打开:[http://localhost:3000](http://localhost:3000) + +*** + +## 码头工人 + +使用 Docker 部署 Flowise 有两种方法。首先,git克隆项目:[https://github.com/FlowiseAI/Flowise](https://github.com/FlowiseAI/Flowise) + +### Docker 组合 + +1. 转到项目根目录下的 `docker folder` +2. 复制 `.env.example` 文件并将其粘贴为另一个名为 `.env` 的文件 +3. 运行: + +```bash +docker compose up -d +``` + +4. 打开:[http://localhost:3000](http://localhost:3000) +5. 您可以通过运行以下命令来关闭容器: + +```bash +docker compose stop +``` + +### Docker 镜像 + +1. 构建镜像: + +```bash +docker build --no-cache -t flowise . +``` + +2.运行镜像: + +```bash +docker run -d --name flowise -p 3000:3000 flowise +``` + +3. 停止图像: + +```bash +docker stop flowise +``` + +*** + +## 对于开发者 + +Flowise 在一个单一存储库中有 4 个不同的模块: + +* **服务器**:服务 API 逻辑的节点后端 +* **UI**:反应前端 +* **组件**:集成组件 +* **Api 文档**:Flowise API 的 Swagger 规范 + +### 先决条件 + +安装[PNPM](https://pnpm.io/installation)。 + +```bash +npm i -g pnpm +``` + +### 设置 1 + +使用 PNPM 进行简单设置: + +1. 克隆存储库 + +```bash +git clone https://github.com/FlowiseAI/Flowise.git +``` + +2.进入存储库文件夹 + +```bash +cd Flowise +``` + +3.安装所有模块的所有依赖项: + +```bash +pnpm install +``` + +4. 构建代码: + +```bash +pnpm build +``` + +在 [http://localhost:3000](http://localhost:3000) 启动应用 + +```bash +pnpm start +``` + +### 设置 2 + +项目贡献者的逐步设置: + +1. 分叉官方 [Flowise Github 存储库](https://github.com/FlowiseAI/Flowise) +2. 克隆您的分叉存储库 +3. 创建新分支,请参阅[guide](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository)。命名约定: +* 对于功能分支:`feature/` +* 对于错误修复分支:`bugfix/`。 +4.切换到刚刚创建的分支 +5.进入存储库文件夹: + +```bash +cd Flowise +``` + +6.安装所有模块的所有依赖项: + +```bash +pnpm install +``` + +7. 构建代码: + +```bash +pnpm build +``` + +8. 通过 [http://localhost:3000](http://localhost:3000) 启动应用程序 + +```bash +pnpm start +``` + +9. 对于开发构建: + +* 创建`.env`文件并在`packages/ui`中指定`PORT`(参考`.env.example`) +* 创建`.env`文件并在`packages/server`中指定`PORT`(参考`.env.example`) + +```bash +pnpm dev +``` + +* 在 `packages/ui` 或 `packages/server` 中所做的任何更改都将反映在 [http://localhost:8080](http://localhost:8080/) 中 +* 对于 `packages/components` 中所做的更改,您需要再次构建才能获取更改 +* 完成所有更改后,运行: + + ```bash + pnpm build + ``` + + 和 + + ```bash + pnpm start + ``` + + 确保生产中一切正常。 + +*** + +## 对于企业 + +在启动应用程序之前,企业用户需要填写 `.env` 文件中的企业参数值。请参阅 `.env.example` 了解所需的更改。 + +请联系 support@flowiseai.com 以获取以下环境变量的值: + +``` +LICENSE_URL +FLOWISE_EE_LICENSE_KEY +``` + +*** + +## 了解更多 + +在本视频教程中,Leon 介绍了 Flowise,并解释了如何在本地计算机上进行设置。 + +{% embed url="https://youtu.be/nqAK_L66sIQ" %} + +## 社区指南 + +* [介绍\[实用\]使用Flowise / LangChain构建LLM应用程序](https://volcano-ice-cd6.notion.site/Introduction-to-Practical-Building-LLM-Applications-with-Flowise-LangChain-03d6d75bfd20495d96dfdae964bea5a5) +* [Flowise / LangChainによるLLMアプurikeーション构筑\[実践\]入门](https://volcano-ice-cd6.notion.site/Flowise-LangChain-LLM-e106bb0f7e2241379aad8fa428ee064a) diff --git a/cn/integrations/3rd-party-platform-integration/README.md b/cn/integrations/3rd-party-platform-integration/README.md new file mode 100644 index 00000000..2db2e53b --- /dev/null +++ b/cn/integrations/3rd-party-platform-integration/README.md @@ -0,0 +1,11 @@ +--- +description: 了解如何将 Flowise 与第三方平台集成 +--- + +# 外部集成 + +*** + +Flowise 也可以在第三方平台中使用。以下是一些使用示例: + +* [扎皮尔扎普斯](zapier-zaps.md) diff --git a/cn/integrations/3rd-party-platform-integration/open-webui.md b/cn/integrations/3rd-party-platform-integration/open-webui.md new file mode 100644 index 00000000..18ee0a79 --- /dev/null +++ b/cn/integrations/3rd-party-platform-integration/open-webui.md @@ -0,0 +1,212 @@ +# 打开网页界面 + +[开放 WebUI](https://github.com/open-webui/open-webui) 是一个可扩展、功能丰富且用户友好的_自托管 AI 平台_,旨在完全离线运行。 + +[函数](https://docs.openwebui.com/features/plugin/functions/) 就像 Open WebUI 的插件。我们可以创建一个自定义 [Pipe Function](https://docs.openwebui.com/features/plugin/functions/pipe),在将结果返回给用户之前,通过调用 Flowise 预测 API 来处理输入并生成响应。通过此,Flowise 可以在 Open WebUI 中使用。 + +## 设置 + +1. 首先,启动并运行 Open WebUI,您可以参考[快速入门](https://docs.openwebui.com/getting-started/quick-start/) 指南。从左下角,单击您的个人资料和**管理面板** + +
+ +2. 打开 **函数** 选项卡,然后添加一个新函数。 + +
+ +3. 命名该函数,并添加以下代码: + +```python +""" +title: Flowise Integration for OpenWebUI +Requirements: + - Flowise API URL (set via FLOWISE_API_URL) + - Flowise API Key (set via FLOWISE_API_KEY) +""" + +from pydantic import BaseModel, Field +from typing import Optional, Dict, Any, List, Union, Generator, Iterator +import requests +import json +import os + + +class Pipe: + class Valves(BaseModel): + flowise_url: str = Field( + default=os.getenv("FLOWISE_API_URL", ""), + description="Flowise URL", + ) + flowise_api_key: str = Field( + default=os.getenv("FLOWISE_API_KEY", ""), + description="Flowise API key for authentication", + ) + + def __init__(self): + self.type = "manifold" + self.id = "flowise_chat" + self.valves = self.Valves() + + # Validate required settings + if not self.valves.flowise_url: + print( + "⚠️ Please set your Flowise URL using the FLOWISE_API_URL environment variable" + ) + if not self.valves.flowise_api_key: + print( + "⚠️ Please set your Flowise API key using the FLOWISE_API_KEY environment variable" + ) + + def pipes(self): + if self.valves.flowise_api_key and self.valves.flowise_url: + try: + headers = { + "Authorization": f"Bearer {self.valves.flowise_api_key}", + "Content-Type": "application/json", + } + + r = requests.get( + f"{self.valves.flowise_url}/api/v1/chatflows?type=AGENTFLOW", + headers=headers, + ) + models = r.json() + return [ + { + "id": model["id"], + "name": model["name"], + } + for model in models + ] + + except Exception as e: + return [ + { + "id": "error", + "name": str(e), + }, + ] + else: + return [ + { + "id": "error", + "name": "API Key not provided.", + }, + ] + + def _process_message_content(self, message: dict) -> str: + """Process message content, handling text for now""" + if isinstance(message.get("content"), list): + processed_content = [] + for item in message["content"]: + if item["type"] == "text": + processed_content.append(item["text"]) + return " ".join(processed_content) + return message.get("content", "") + + def pipe( + self, body: dict, __user__: Optional[dict] = None, __metadata__: dict = None + ): + try: + stream_enabled = body.get("stream", True) + session_id = (__metadata__ or {}).get("chat_id") or "owui-session" + # model can be "flowise." or just "" + model_name = body.get("model", "") + dot = model_name.find(".") + model_id = model_name[dot + 1 :] if dot != -1 else model_name + + messages = body.get("messages") or [] + if not messages: + raise Exception("No messages found in request body") + question = self._process_message_content(messages[-1]) + + data = { + "question": question, + "overrideConfig": {"sessionId": session_id}, + "streaming": stream_enabled, + } + + headers = { + "Authorization": f"Bearer {self.valves.flowise_api_key}", + "Content-Type": "application/json", + "Accept": "text/event-stream" if stream_enabled else "application/json", + } + + url = f"{self.valves.flowise_url}/api/v1/prediction/{model_id}" + with requests.post( + url, json=data, headers=headers, stream=stream_enabled, timeout=60 + ) as r: + r.raise_for_status() + + if stream_enabled: + # Ensure correct decoding for SSE (prevents ’ etc.) + r.encoding = "utf-8" + + for raw_line in r.iter_lines(decode_unicode=True): + if not raw_line: + continue + line = raw_line.strip() + + # Skip keep-alives or non-data fields + if not line.startswith("data:"): + continue + + payload = line[5:].strip() + if payload in ("[DONE]", '"[DONE]"'): + break + + # Flowise usually sends {"event":"token","data":"..."} + try: + obj = json.loads(payload) + except json.JSONDecodeError: + # Occasionally plain text arrives—stream it anyway + if payload: + yield payload + continue + + if isinstance(obj, dict): + if obj.get("event") == "token": + token = obj.get("data") or "" + if token: + yield token + else: + # Some versions send {"data":{"text":"..."}} + data_field = obj.get("data") + if isinstance(data_field, dict): + text = data_field.get("text") + if text: + yield text + return # end streaming + + # Non-streaming fallback + resp = r.json() + return ( + resp.get("text") or (resp.get("data") or {}).get("text", "") or "" + ) + + except requests.HTTPError as http_err: + try: + detail = http_err.response.text[:500] + except Exception: + detail = "" + return f"HTTP error from Flowise: {http_err.response.status_code} {detail}" + except Exception as e: + return f"Error in Flowise pipe: {e}" +``` + +4. 保存功能后,启用它,然后单击设置按钮,输入您的 Flowise URL 和 Flowise API 密钥: + +
+ +
+ +5. 现在,当您刷新并单击“新建聊天”时,您将能够看到流程列表。您可以修改代码以显示: + +* 仅 智能体流程 V2:`f"{self.valves.flowise_url}/api/v1/chatflows?type=AGENTFLOW"` +* 仅聊天流:`f"{self.valves.flowise_url}/api/v1/chatflows?type=CHATFLOW"` +* 仅助理:`f"{self.valves.flowise_url}/api/v1/chatflows?type=ASSISTANT"` + +
+ +6、测试: + +
diff --git a/cn/integrations/3rd-party-platform-integration/streamlit.md b/cn/integrations/3rd-party-platform-integration/streamlit.md new file mode 100644 index 00000000..1a1db42d --- /dev/null +++ b/cn/integrations/3rd-party-platform-integration/streamlit.md @@ -0,0 +1,71 @@ +# 流光 + +[Python SDK](https://github.com/FlowiseAI/FlowisePy) 可用于创建 [Streamlit](https://streamlit.io/) 应用: + +```python +import streamlit as st +from flowise import Flowise, PredictionData +import json + +# Flowise app base url +base_url = st.secrets["APP_URL"] or "https://your-flowise-url.com" + +# Chatflow/Agentflow ID +flow_id = st.secrets["FLOW_ID"] or "abc" + +# Show title and description. +st.title("💬 Flowise Streamlit Chat") +st.write( + "This is a simple chatbot that uses Flowise Python SDK" +) + +# Create a Flowise client. +client = Flowise(base_url=base_url) + +# Create a session state variable to store the chat messages. This ensures that the +# messages persist across reruns. +if "messages" not in st.session_state: + st.session_state.messages = [] + +# Display the existing chat messages via `st.chat_message`. +for message in st.session_state.messages: + with st.chat_message(message["role"]): + st.markdown(message["content"]) + +def generate_response(prompt: str): + print('generating response') + completion = client.create_prediction( + PredictionData( + chatflowId=flow_id, + question=prompt, + overrideConfig={ + "sessionId": "session1234" + }, + streaming=True + ) + ) + + for chunk in completion: + print(chunk) + parsed_chunk = json.loads(chunk) + if (parsed_chunk['event'] == 'token' and parsed_chunk['data'] != ''): + yield str(parsed_chunk['data']) + +# Create a chat input field to allow the user to enter a message. This will display +# automatically at the bottom of the page. +if prompt := st.chat_input("What is up?"): + + # Store and display the current prompt. + st.session_state.messages.append({"role": "user", "content": prompt}) + with st.chat_message("user"): + st.markdown(prompt) + + # Stream the response to the chat using `st.write_stream`, then store it in + # session state. + with st.chat_message("assistant"): + response = generate_response(prompt) + full_response = st.write_stream(response) + st.session_state.messages.append({"role": "assistant", "content": full_response}) +``` + +完整的 Github 存储库:[https://github.com/HenryHengZJ/flowise-streamlit](https://github.com/HenryHengZJ/flowise-streamlit) diff --git a/cn/integrations/3rd-party-platform-integration/zapier-zaps.md b/cn/integrations/3rd-party-platform-integration/zapier-zaps.md new file mode 100644 index 00000000..97c7055a --- /dev/null +++ b/cn/integrations/3rd-party-platform-integration/zapier-zaps.md @@ -0,0 +1,104 @@ +--- +description: 了解如何集成 Flowise 和 Zapier +--- + +#扎皮尔扎普斯 + +*** + +## 先决条件 + +1. [登录](https://zapier.com/app/login)或[注册](https://zapier.com/sign-up)到 Zapier +2. 请参阅[deployment](../../configuration/deployment/) 创建 Flowise 的云托管版本。 + +## 设置 + +1. 前往[Zapier Zaps](https://zapier.com/app/zaps) +2. 单击“**创建**” + +
+ +### 接收触发消息 + +1. 单击或搜索 **Discord** + +
+2. 选择“**新消息发布到频道**”作为“事件”,然后单击“**继续**” + +
+3. **登录**您的 Discord 帐户 + +
+4. 将 **Zapier Bot** 添加到您的首选服务器 + +
+5. 授予适当的权限并单击“**授权**”,然后单击“**继续**” + +
+ +
+6. 选择您与 Zapier Bot 交互的**首选渠道**,然后单击 **继续** + +
+7. **发送消息**到您在步骤 8 中选择的频道 + +
+8. 单击**测试触发器** + +
+9. 选择您的消息,然后单击 **继续选择的记录** + +
+ +### 过滤掉 Zapier 机器人的消息 + +1. 点击或搜索**过滤器** + +
+2. 将 **过滤器** 配置为如果收到来自 **Zapier Bot** 的消息则不继续,然后单击 **继续** + +
+ +### FlowiseAI 生成结果消息 + +1.点击**+**,点击或搜索**FlowiseAI** + +
+2. 选择 **进行预测** 作为事件,然后单击 **继续** + +
+3. 单击 **登录** 并插入您的详细信息,然后单击 **是,继续使用 FlowiseAI** + +
+ +
+4. 从 Discord 中选择 **内容** 和您的 Flow ID,然后单击 **继续** + +
+5. 单击“**测试操作**”并等待结果 + +
+ +### 发送结果消息 + +1.点击**+**,点击或搜索**Discord** + +
+2. 选择 **发送频道消息** 作为事件,然后单击 **继续** + +
+3. 选择您登录的 Discord 帐户,然后单击 **继续** + +
+4. 为通道选择您喜欢的通道,并从 FlowiseAI 中为消息文本选择 **文本** 和 **字符串源**(如果有),然后单击 **继续** + +
+5. 单击**测试操作** + +
+6. 瞧[🎉](https://emojipedia.org/party-popper/),您应该会看到消息已到达您的 Discord 频道 + +
+7. 最后,重命名您的 Zap 并发布它 + +
diff --git a/cn/integrations/README.md b/cn/integrations/README.md new file mode 100644 index 00000000..626d11d6 --- /dev/null +++ b/cn/integrations/README.md @@ -0,0 +1,50 @@ +--- +description: 了解 Flowise 中所有可用的集成/节点 +--- + +# 集成 + +*** + +在 Flowise 中,节点称为集成。与 LEGO 类似,您可以构建自定义的 LLM ochestration 流程、聊天机器人、具有 Flowise 中可用的所有集成的代理。 + +###浪链 + +* [代理](langchain/agents/) +* [缓存](langchain/cache/) +* [链](langchain/chains/) +* [聊天模型](langchain/chat-models/) +* [文档加载器](langchain/document-loaders/) +* [嵌入](langchain/embeddings/) +* [法学硕士](langchain/llms/) +* [内存](langchain/memory/) +* [审核](langchain/moderation/) +* [输出解析器](langchain/output-parsers/) +* [提示词](langchain/prompts/) +* [记录管理器](langchain/record-managers.md) +* [猎犬](langchain/retrievers/) +* [文本分割器](langchain/text-splitters/) +* [工具](langchain/tools/) +* [向量存储](langchain/vector-stores/) + +### 骆驼索引 + +* [代理](llamaindex/agents/) +* [聊天模型](llamaindex/chat-models/) +* [嵌入](llamaindex/embeddings/) +* [引擎](llamaindex/engine/) +* [响应合成器](llamaindex/response-synthesizer/) +* [工具](llamaindex/tools/) +* [向量存储](llamaindex/vector-stores/) + +### 实用程序 + +* [自定义 JS 函数](utilities/custom-js-function.md) +* [设置/获取变量](utilities/set-get-variable.md) +* [如果否则](utilities/if-else.md) +* [设置变量](broken-reference) +* [便签](utilities/sticky-note.md) + +### 外部集成 + +* [扎皮尔扎普斯](3rd-party-platform-integration/zapier-zaps.md) diff --git a/cn/integrations/langchain/README.md b/cn/integrations/langchain/README.md new file mode 100644 index 00000000..df5586bd --- /dev/null +++ b/cn/integrations/langchain/README.md @@ -0,0 +1,30 @@ +--- +description: 了解 Flowise 如何与 LangChain 框架集成 +--- + +#浪链 + +*** + +[**LangChain**](https://www.langchain.com/) 是一个用于开发由语言模型支持的应用程序的框架。它简化了创建生成式人工智能应用程序、将数据源、向量、内存与法学硕士连接起来的过程。 + +Flowise 通过提供可视化界面来补充 LangChain。在这里,节点被组织成不同的部分,从而更容易构建工作流程。 + +### LangChain 部分: + +* [代理](agents/) +* [缓存](cache/) +* [链](chains/) +* [聊天模型](chat-models/) +* [文档加载器](document-loaders/) +* [嵌入](embeddings/) +* [法学硕士](llms/) +* [内存](memory/) +* [审核](moderation/) +* [输出解析器](output-parsers/) +* [提示词](prompts/) +* [记录管理器](record-managers.md) +* [猎犬](retrievers/) +* [文本分割器](text-splitters/) +* [工具](tools/) +* [向量存储](vector-stores/) diff --git a/cn/integrations/langchain/agents/README.md b/cn/integrations/langchain/agents/README.md new file mode 100644 index 00000000..8ad21e9e --- /dev/null +++ b/cn/integrations/langchain/agents/README.md @@ -0,0 +1,28 @@ +--- +description: LangChain代理节点 +--- + +# 代理 + +*** + +语言模型本身无法采取行动——它们只是输出文本。 + +代理是使用 LLM 作为推理引擎来确定要采取哪些操作以及这些操作的输入应该是什么的系统。然后,这些操作的结果可以反馈给代理,并确定是否需要更多操作,或者是否可以完成。 + +### 代理节点: + +* [Airtable 代理](airtable-agent.md) +* [AutoGPT](autogpt.md) +* [BabyAGI](babyagi.md) +* [CSV 代理](csv-agent.md) +* [会话代理](conversational-agent.md) +* [会话检索代理](conversational-retrieval-agent.md) +* [MistralAI 工具代理](mistralai-tool-agent.md) +* [OpenAI 助手](openai-assistant/) +* [OpenAI 函数代理](openai-function-agent.md) +* [OpenAI 工具代理](../../llamaindex/agents/openai-tool-agent.md) +* [ReAct 代理聊天](react-agent-chat.md) +* [ReAct 代理 LLM](react-agent-llm.md) +* [工具代理](tool-agent.md) +* [XML 代理](xml-agent.md) diff --git a/cn/integrations/langchain/agents/airtable-agent.md b/cn/integrations/langchain/agents/airtable-agent.md new file mode 100644 index 00000000..bea82226 --- /dev/null +++ b/cn/integrations/langchain/agents/airtable-agent.md @@ -0,0 +1,34 @@ +--- +description: 代理用于回答 Airtable 表上的查询。 +--- + +# 空中桌代理 + +

Airtable代理节点

+ +## Airtable 代理功能 + +Airtable Agent 旨在促进 Flowise AI 和 Airtable 表之间的交互,使用户能够以对话方式查询 Airtable 数据。通过使用该代理,用户可以询问有关 Airtable 库内容的问题,并根据存储的数据接收相关响应。这对于快速提取特定信息、自动化工作流程或从 Airtable 中存储的数据生成摘要特别有用。 + +例如,Airtable Agent 可用于回答以下问题: + +*“我的项目跟踪表中还有多少任务未完成?” +*“CRM 中列出的客户的联系方式是什么?” +*“给我一份过去一周添加的所有记录的摘要。” + +此功能可帮助用户从 Airtable 库中获取见解,而无需浏览 Airtable 界面,从而更轻松地以无缝、交互式的方式管理和分析数据。 + +## 输入 + +Airtable Agent 需要以下输入才能有效运行: + +* **语言模型**:用于处理查询的语言模型。此输入是必需的,有助于确定代理提供的响应的质量和准确性。 +* **输入审核**:启用内容审核的可选输入。这有助于确保查询适当且不包含攻击性或有害内容。 +* **连接凭据**:连接到 Airtable 所需的输入。用户必须选择有权访问其 Airtable 数据的适当凭据。 +* **底座 ID**:要连接的 Airtable 底座的 ID。这是必填字段,可以在 Airtable API 文档或基本设置中找到。如果您的表 URL 类似于 `https://airtable.com/app11RobdGoX0YNsC/tblJdmvbrgizbYlCO/viw9UrP77idOCE4ee`,则 `app11RobdGoX0YNsC` 是基本 ID。用于指定哪个Airtable库包含要查询的数据。 +* **桌子 ID**:Airtable 底座内特定桌子的 ID。这也是必填字段,可帮助代理针对正确的表进行数据检索。在示例 URL `https://airtable.com/app11RobdGoX0YNsC/tblJdmvbrgizbYlCO/viw9UrP77idOCE4ee` 中,`tblJdmvbrgizbYlCO` 是表 ID。 +* **附加参数**:可用于自定义代理行为的可选参数。可以根据具体用例配置这些参数。 + * **返回全部**:此选项允许用户返回指定表中的所有记录。如果启用,将检索所有记录,否则,仅返回有限数量的记录。 + * **限制**:指定在未启用**全部返回**时要返回的最大记录数。默认值为 `100`。 + +**注意**:本节是一项正在进行的工作。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 diff --git a/cn/integrations/langchain/agents/autogpt.md b/cn/integrations/langchain/agents/autogpt.md new file mode 100644 index 00000000..ef60ff54 --- /dev/null +++ b/cn/integrations/langchain/agents/autogpt.md @@ -0,0 +1,11 @@ +--- +description: 具有自主完成任务思想链的自主代理。 +--- + +# 自动GPT + +

AutoGPT 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/agents/babyagi.md b/cn/integrations/langchain/agents/babyagi.md new file mode 100644 index 00000000..7ad5b1b4 --- /dev/null +++ b/cn/integrations/langchain/agents/babyagi.md @@ -0,0 +1,13 @@ +--- +description: >- + 任务驱动的自治代理创建新任务并重新确定任务的优先级 + 根据目标列出 +--- + +# 宝贝AGI + +

BabyAGI节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/agents/conversational-agent.md b/cn/integrations/langchain/agents/conversational-agent.md new file mode 100644 index 00000000..01d54814 --- /dev/null +++ b/cn/integrations/langchain/agents/conversational-agent.md @@ -0,0 +1,75 @@ +--- +description: 聊天模型的会话代理。它将利用聊天特定提示词。 +--- + +# 对话代理 + +

会话代理节点

+ +## 设置对话代理 + +## 先决条件: +* 设置 Flowise。 +* 下载并安装 Docker。 +* 在您的计算机上本地下载并安装 Ollama 语言模型。 + * https://ollama.com/ +* 下载并安装 Redis for AI。 + * https://redis.io/redis-for-ai/ + +## 上下文: +与标准大语言模型 (LLM) 不同,标准大语言模型 (LLM) 提供用于执行基于语言的任务的通用模型,而对话代理更加复杂,因为它们是专门为有效管理对话而设计的。 + +您可以使用 Flowise 对话代理来创建全面的交互式对话体验。 + +## 步骤: +1. 访问聊天流菜单。 + 1. 打开浏览器并转到http://localhost:3000. + 2. 在 Flowise 中,单击 **聊天流**。 + +2. 创建一个新的聊天流: + 1. 单击“**添加新**”。 + 2. 输入聊天流的名称,然后单击“**保存**”。 + +3.添加会话代理节点: + 1. 单击“**添加节点**”。 + 2. 搜索会话座席。 + 3. 将对话代理节点拖放到聊天流工作区中。 + +4. 添加SearchAPI节点。该节点使代理能够从 Google 搜索结果中获取数据: + 1. 单击“**添加节点**”。 + 2. 搜索SearchAPI 节点。它显示在搜索结果的 **工具** 部分。 + 3. 将 SearchAPI 节点拖放到聊天流工作区中。 + 4. 创建一个免费的 SearchAPI 帐户并检索您的 SearchAPI API 密钥。 SearchAPI 节点需要此密钥来进行身份验证和执行搜索查询。 + 5. 在 SearchAPI 节点上,单击 **连接凭据 > 新建**。 + 6. 输入您的凭据的名称,例如SearchAPI 凭据,将您的 SearchAPI API 密钥复制并粘贴到 SearchAPI API 密钥字段中,然后单击 **添加**。 + 7. 通过从 SearchAPI 节点的输出部分到对话代理节点的允许工具输入部分绘制一条线,将 SearchAPI 节点连接到对话代理节点。 + 8. 单击“**保存聊天流**”以保存进度。 + +5.添加ChatOllama聊天模型节点。该节点使代理能够使用 Ollama 语言模型来生成响应: + 1. 单击“**添加节点**”。 + 2. 搜索ChatOllama 节点。它显示在搜索结果的 **聊天模型** 部分。 + 3. 将 ChatOllama 节点拖放到聊天流工作区中。 + 4. 在 **型号名称** 字段中,输入您要使用的型号。我们推荐llama3.2。 + 5. 在 **Temperature** 字段中,设置 0 到 1 之间的温度值。温度参数控制模型响应的随机性。低温会产生确定性和集中的响应。高温会产生创造性和多样化的反应。我们建议温度值为 0.5。 + 6. 通过从 ChatOllama 节点的输出部分到对话代理节点的聊天模型输入部分绘制一条线,将 ChatOllama 节点连接到对话代理节点。 + 7. 单击“**保存聊天流**”以保存进度。 + +6.添加Redis聊天内存节点。该节点使代理能够记住之前的交互并将其存储在聊天历史记录中,从而增强整体用户体验: + 1. 单击“**添加节点**”。 + 2. 搜索 Redis-Backed Chat Memory 节点。它显示在搜索结果的 **内存** 部分。 +3. 将 Redis 支持的聊天内存节点拖放到聊天流工作区中。 + 4. 在 Redis 支持的聊天内存节点上,单击 **连接凭据 > 新建**。 + 5. 输入您的 Redis API 用户名和密码或您的 Redis 凭据名称和 URL,然后单击 **添加**。 + 6. 通过从 Redis 节点的输出部分到对话代理节点的内存输入部分绘制一条线,将 Redis 支持的聊天内存节点连接到对话代理节点。 + 7. 单击“**保存聊天流**”以保存进度。 + +## 结果: +通过执行这些步骤,您将成功创建一个可以与之聊天和提问的对话代理。 + +## 后续步骤: +单击聊天图标即可与新创建的对话代理进行交互。如果您在本地运行 Redis,请确保在开始聊天之前您的 Redis Docker 容器正在运行。 + +## 相关链接和故障排除: +有关其他信息和故障排除,请参阅 https://redis.io/tutorials/howtos/solutions/flowise/conversational-agent/. + + diff --git a/cn/integrations/langchain/agents/conversational-retrieval-agent.md b/cn/integrations/langchain/agents/conversational-retrieval-agent.md new file mode 100644 index 00000000..037fd6f4 --- /dev/null +++ b/cn/integrations/langchain/agents/conversational-retrieval-agent.md @@ -0,0 +1,7 @@ +--- +description: 弃用节点。 +--- + +# 会话检索代理 + +
diff --git a/cn/integrations/langchain/agents/csv-agent.md b/cn/integrations/langchain/agents/csv-agent.md new file mode 100644 index 00000000..12ffb10c --- /dev/null +++ b/cn/integrations/langchain/agents/csv-agent.md @@ -0,0 +1,11 @@ +--- +description: 代理用于回答对 CSV 数据的查询。 +--- + +# CSV 代理 + +

CSV 代理节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/agents/mistralai-tool-agent.md b/cn/integrations/langchain/agents/mistralai-tool-agent.md new file mode 100644 index 00000000..6745e96e --- /dev/null +++ b/cn/integrations/langchain/agents/mistralai-tool-agent.md @@ -0,0 +1,7 @@ +--- +description: 弃用节点。 +--- + +# MistralAI 工具代理 + +
diff --git a/cn/integrations/langchain/agents/openai-assistant/README.md b/cn/integrations/langchain/agents/openai-assistant/README.md new file mode 100644 index 00000000..ebe0117e --- /dev/null +++ b/cn/integrations/langchain/agents/openai-assistant/README.md @@ -0,0 +1,11 @@ +--- +description: 使用 OpenAI 助手 API 来选择要调用的工具和参数的代理。 +--- + +# OpenAI 助手 + +

开放人工智能助手

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](../../../../contributing/)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/agents/openai-assistant/threads.md b/cn/integrations/langchain/agents/openai-assistant/threads.md new file mode 100644 index 00000000..9bd6328a --- /dev/null +++ b/cn/integrations/langchain/agents/openai-assistant/threads.md @@ -0,0 +1,33 @@ +# 线程数 + +[Threads](https://platform.openai.com/docs/assistants/how-it-works/managing-threads-and-messages) 仅在使用 OpenAI 助手 时使用。这是助理和用户之间的对话会话。线程存储消息并自动处理截断以使内容适合模型的上下文。 + +
+ +## 多个用户的单独对话 + +### UI 和嵌入式聊天 + +默认情况下,UI 和嵌入式聊天将自动分隔多个用户对话的线程。这是通过为每个新交互生成唯一的 **`chatId`** 来完成的。该逻辑由 Flowise 在幕后处理。 + +### 预测 API + +POST /`api/v1/prediction/{your-chatflowid}`,指定 **`chatId`** 。相同的chatId将使用相同的线程。 + +```json +{ + "question": "hello!", + "chatId": "user1" +} +``` + +### 消息 API + +* GET `/api/v1/chatmessage/{your-chatflowid}` +* DELETE `/api/v1/chatmessage/{your-chatflowid}` + +您还可以通过 **`chatId` -** `/api/v1/chatmessage/{your-chatflowid}?chatId={your-chatid}` 进行过滤 + +所有对话也可以通过 UI 进行可视化和管理: + +
diff --git a/cn/integrations/langchain/agents/openai-function-agent.md b/cn/integrations/langchain/agents/openai-function-agent.md new file mode 100644 index 00000000..0f270ca1 --- /dev/null +++ b/cn/integrations/langchain/agents/openai-function-agent.md @@ -0,0 +1,7 @@ +--- +description: 弃用节点。 +--- + +# OpenAI 功能代理 + +
diff --git a/cn/integrations/langchain/agents/openai-tool-agent.md b/cn/integrations/langchain/agents/openai-tool-agent.md new file mode 100644 index 00000000..210be648 --- /dev/null +++ b/cn/integrations/langchain/agents/openai-tool-agent.md @@ -0,0 +1,7 @@ +--- +description: 弃用节点。 +--- + +# OpenAI 工具代理 + +
diff --git a/cn/integrations/langchain/agents/react-agent-chat.md b/cn/integrations/langchain/agents/react-agent-chat.md new file mode 100644 index 00000000..028841f5 --- /dev/null +++ b/cn/integrations/langchain/agents/react-agent-chat.md @@ -0,0 +1,11 @@ +# ReAct 代理聊天 + +使用 [ReAct](https://react-lm.github.io/)(推理和行动)逻辑来决定采取什么操作的代理,并经过优化以与聊天模型一起使用。 + +
+ +

ReAct 代理聊天节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/agents/react-agent-llm.md b/cn/integrations/langchain/agents/react-agent-llm.md new file mode 100644 index 00000000..c5655a00 --- /dev/null +++ b/cn/integrations/langchain/agents/react-agent-llm.md @@ -0,0 +1,11 @@ +# ReAct 代理 LLM + +使用 [ReAct](https://react-lm.github.io/)(推理和行动)逻辑来决定采取什么操作的代理,并经过优化以与非聊天模型一起使用。 + +
+ +

ReAct 代理 LLM 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/agents/tool-agent.md b/cn/integrations/langchain/agents/tool-agent.md new file mode 100644 index 00000000..dee374be --- /dev/null +++ b/cn/integrations/langchain/agents/tool-agent.md @@ -0,0 +1,11 @@ +--- +description: 使用函数调用来选择要调用的工具和参数的代理。 +--- + +# 工具代理 + +

工具代理节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/agents/xml-agent.md b/cn/integrations/langchain/agents/xml-agent.md new file mode 100644 index 00000000..e6786c04 --- /dev/null +++ b/cn/integrations/langchain/agents/xml-agent.md @@ -0,0 +1,13 @@ +--- +description: >- + 专为法学硕士设计的代理,有利于推理/写作 XML (例如: + 人类克劳德)。 +--- + +# XML 代理 + +

XML 代理节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/cache/README.md b/cn/integrations/langchain/cache/README.md new file mode 100644 index 00000000..de6f0254 --- /dev/null +++ b/cn/integrations/langchain/cache/README.md @@ -0,0 +1,18 @@ +--- +description: LangChain缓存节点 +--- + +# 缓存 + +*** + +如果您经常多次请求相同的完成,则缓存可以通过减少您对 LLM 提供程序进行 API 调用的次数来节省资金。它可以通过减少您对 LLM 提供商进行 API 调用的次数来加速您的应用程序。 + +### 缓存节点: + +* [内存中缓存](in-memory-cache.md) +* [内存中嵌入缓存](inmemory-embedding-cache.md) +* [Momento 缓存](momento-cache.md) +* [Redis 缓存](redis-cache.md) +* [Redis 嵌入缓存](redis-embeddings-cache.md) +* [Upstash Redis 缓存](upstash-redis-cache.md) diff --git a/cn/integrations/langchain/cache/in-memory-cache.md b/cn/integrations/langchain/cache/in-memory-cache.md new file mode 100644 index 00000000..99b31290 --- /dev/null +++ b/cn/integrations/langchain/cache/in-memory-cache.md @@ -0,0 +1,11 @@ +--- +description: 在本地内存中缓存 LLM 响应,应用程序重新启动时将被清除。 +--- + +# 内存缓存 + +

内存缓存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/cache/inmemory-embedding-cache.md b/cn/integrations/langchain/cache/inmemory-embedding-cache.md new file mode 100644 index 00000000..b9e2a07b --- /dev/null +++ b/cn/integrations/langchain/cache/inmemory-embedding-cache.md @@ -0,0 +1,11 @@ +--- +description: 将生成的嵌入缓存在内存中以避免需要重新计算它们。 +--- + +# InMemory 嵌入缓存 + +

InMemory嵌入缓存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/cache/momento-cache.md b/cn/integrations/langchain/cache/momento-cache.md new file mode 100644 index 00000000..3073e7b7 --- /dev/null +++ b/cn/integrations/langchain/cache/momento-cache.md @@ -0,0 +1,11 @@ +--- +description: 使用 Momento(分布式无服务器缓存)缓存 _​​_FLOWISE_PH_0__ 响应。 +--- + +# 时刻缓存 + +

Momento 缓存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/cache/redis-cache.md b/cn/integrations/langchain/cache/redis-cache.md new file mode 100644 index 00000000..2fafc8a7 --- /dev/null +++ b/cn/integrations/langchain/cache/redis-cache.md @@ -0,0 +1,13 @@ +--- +description: >- + 在 Redis 中缓存 LLM 响应,对于跨多个共享缓存很有用 + 进程或服务器。 +--- + +# Redis 缓存 + +

Redis缓存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/cache/redis-embeddings-cache.md b/cn/integrations/langchain/cache/redis-embeddings-cache.md new file mode 100644 index 00000000..036be3c2 --- /dev/null +++ b/cn/integrations/langchain/cache/redis-embeddings-cache.md @@ -0,0 +1,13 @@ +--- +description: >- + 在 Redis 中缓存 LLM 响应,对于跨多个共享缓存很有用 + 进程或服务器。 +--- + +# Redis 嵌入缓存 + +

Redis 嵌入缓存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/cache/upstash-redis-cache.md b/cn/integrations/langchain/cache/upstash-redis-cache.md new file mode 100644 index 00000000..6be99113 --- /dev/null +++ b/cn/integrations/langchain/cache/upstash-redis-cache.md @@ -0,0 +1,11 @@ +--- +description: 在 Upstash Redis 中缓存 LLM 响应,Redis 和 Kafka 的无服务器数据。 +--- + +# Upstash Redis 缓存 + +

Upstash Redis 缓存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/README.md b/cn/integrations/langchain/chains/README.md new file mode 100644 index 00000000..b81a5cce --- /dev/null +++ b/cn/integrations/langchain/chains/README.md @@ -0,0 +1,34 @@ +--- +description: LangChain链节点 +--- + +# 链条 + +*** + +在聊天机器人和大型语言模型的背景下,“链”通常指的是文本序列或对话轮流。这些链用于存储和管理聊天机器人或语言模型的对话历史记录和上下文。链帮助模型理解正在进行的对话,并提供连贯且与上下文相关的响应。 + +以下是链条的工作原理: + +1. **对话历史记录**:当用户与聊天机器人或语言模型交互时,对话通常表示为一系列文本消息或对话轮次。来自用户和模型的每条消息都按时间顺序存储,以维护对话的上下文。 +2. **输入和输出**:每条链都由用户输入和模型输出组成。用户的输入通常称为“输入链”,而模型的响应存储在“输出链”中。这使得模型可以参考对话中之前的消息。 +3. **上下文理解**:通过保留这些链中的整个对话历史记录,模型可以理解上下文并参考早期消息以提供连贯且上下文相关的响应。这对于与用户保持自然且有意义的对话至关重要。 +4. **最大长度**:链具有​​最大长度来管理内存使用和计算资源。当链变得太长时,旧消息可能会被删除或截断,以便为新消息腾出空间。如果删除重要的对话细节,这可能会导致上下文丢失。 +5. **对话的继续**:在实时聊天机器人或语言模型交互中,输入链不断更新为用户的新消息,输出链不断更新为模型的响应。这使得模型能够跟踪正在进行的对话并做出适当的响应。 + +链是构建和维护聊天机器人和语言模型对话的基本概念。它们确保模型能够访问生成有意义且上下文感知的响应所需的上下文,从而使交互对用户更具吸引力和有用性。 + +### 链节点: + +* [获取API链](get-api-chain.md) +* [OpenAPI 链](openapi-chain.md) +* [POST API 链](post-api-chain.md) +* [对话链](conversation-chain.md) +* [对话式检索 QA 链](conversational-retrieval-qa-chain.md) +* [法学硕士链](llm-chain.md) +* [多提示词链](multi-prompt-chain.md) +* [多重检索 QA 链](multi-retrieval-qa-chain.md) +* [检索 QA 链](retrieval-qa-chain.md) +* [Sql 数据库链](sql-database-chain.md) +* [Vectara QA 链](vectara-chain.md) +* [VectorDB QA 链](vectordb-qa-chain.md) diff --git a/cn/integrations/langchain/chains/conversation-chain.md b/cn/integrations/langchain/chains/conversation-chain.md new file mode 100644 index 00000000..bea8eca0 --- /dev/null +++ b/cn/integrations/langchain/chains/conversation-chain.md @@ -0,0 +1,11 @@ +--- +description: 聊天通过记忆对特定的对话链进行建模。 +--- + +# 对话链 + +

对话链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/conversational-retrieval-qa-chain.md b/cn/integrations/langchain/chains/conversational-retrieval-qa-chain.md new file mode 100644 index 00000000..d43a0b96 --- /dev/null +++ b/cn/integrations/langchain/chains/conversational-retrieval-qa-chain.md @@ -0,0 +1,31 @@ +# 对话式检索 QA 链 + +使用检索组件执行问答任务的链。 + +
+ +## 定义 + +**基于检索的问答链**,它与检索组件集成,允许您配置输入参数并执行问答任务。\ +**基于检索的聊天机器人:** 基于检索的聊天机器人是通过从数据库中选择预定义响应或一组可能响应来生成响应的聊天机器人。他们根据用户的输入“检索”最合适的响应。\ +**QA(问答):** QA 系统旨在回答以自然语言提出的问题。它们通常涉及理解问题并寻找或生成适当的答案。 + +## 输入 + +* [语言模型](../chat-models/) +* [矢量存储检索器](../vector-stores/) +* [内存(可选)](../memory/) + +## 参数 + +|名称 |描述 | +| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +|返回源文件 |返回用于构建响应的引文/来源 | +|系统消息 | LLM 关于如何回答查询的说明 | +|链条选项 |关于如何总结、回答问题以及从文档中提取信息的方法。阅读[更多](https://js.langchain.com/docs/modules/chains/document/) | + +## 输出 + +|名称 |描述 | +| ------------------------------ | ----------------------------- | +|会话检索QAChain |返回响应的最终节点 | diff --git a/cn/integrations/langchain/chains/get-api-chain.md b/cn/integrations/langchain/chains/get-api-chain.md new file mode 100644 index 00000000..6eca199b --- /dev/null +++ b/cn/integrations/langchain/chains/get-api-chain.md @@ -0,0 +1,11 @@ +--- +description: 针对 GET API 运行查询的链。 +--- + +# GET API 链 + +

GET API 链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/llm-chain.md b/cn/integrations/langchain/chains/llm-chain.md new file mode 100644 index 00000000..12934e73 --- /dev/null +++ b/cn/integrations/langchain/chains/llm-chain.md @@ -0,0 +1,11 @@ +--- +description: 针对 LLM 运行查询的链。 +--- + +# LLM 链 + +

LLM 链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/multi-prompt-chain.md b/cn/integrations/langchain/chains/multi-prompt-chain.md new file mode 100644 index 00000000..5bb1721c --- /dev/null +++ b/cn/integrations/langchain/chains/multi-prompt-chain.md @@ -0,0 +1,13 @@ +--- +description: >- + Chain自动从多个提示词中选择合适的提示词 + 模板。 +--- + +# 多提示词链 + +

多提示词链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/multi-retrieval-qa-chain.md b/cn/integrations/langchain/chains/multi-retrieval-qa-chain.md new file mode 100644 index 00000000..a4cc1ae9 --- /dev/null +++ b/cn/integrations/langchain/chains/multi-retrieval-qa-chain.md @@ -0,0 +1,13 @@ +--- +description: >- + QA Chain 自动从多个矢量存储中选择合适的矢量存储 + 猎犬。 +--- + +# 多检索QA链 + +

多检索QA链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/openapi-chain.md b/cn/integrations/langchain/chains/openapi-chain.md new file mode 100644 index 00000000..b1f440bc --- /dev/null +++ b/cn/integrations/langchain/chains/openapi-chain.md @@ -0,0 +1,11 @@ +--- +description: 仅根据 OpenAPI 规范自动选择和调用 API 的链。 +--- + +# OpenAPI 链 + +

OpenAPI链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/post-api-chain.md b/cn/integrations/langchain/chains/post-api-chain.md new file mode 100644 index 00000000..2658a2e5 --- /dev/null +++ b/cn/integrations/langchain/chains/post-api-chain.md @@ -0,0 +1,11 @@ +--- +description: 针对 POST API 运行查询的链。 +--- + +# POST API 链 + +

POST API 链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/retrieval-qa-chain.md b/cn/integrations/langchain/chains/retrieval-qa-chain.md new file mode 100644 index 00000000..6d88b18f --- /dev/null +++ b/cn/integrations/langchain/chains/retrieval-qa-chain.md @@ -0,0 +1,11 @@ +--- +description: QA 链根据检索到的文档回答问题。 +--- + +# 检索QA链 + +

检索QA链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/sql-database-chain.md b/cn/integrations/langchain/chains/sql-database-chain.md new file mode 100644 index 00000000..200a3c39 --- /dev/null +++ b/cn/integrations/langchain/chains/sql-database-chain.md @@ -0,0 +1,11 @@ +--- +description: 通过 SQL 数据库回答问题。 +--- + +# Sql数据库链 + +

Sql数据库链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chains/vectara-chain.md b/cn/integrations/langchain/chains/vectara-chain.md new file mode 100644 index 00000000..c272e8c3 --- /dev/null +++ b/cn/integrations/langchain/chains/vectara-chain.md @@ -0,0 +1,27 @@ +# Vectara QA 链 + +用于使用 Vectara 执行问答任务的链。 + +
+ +## 定义 + +**基于检索的问答链**,它与Vectara检索组件集成,允许您配置输入参数并执行问答任务。 + +## 输入 + +* [Vectara 商店](../vector-stores/vectara.md) + +## 参数 + +|名称 |描述 | +| ---------------------- | ------------------------------------------------------------- | +|摘要器提示词名称 |用于生成摘要的模型 | +|回复语言 |所需的回应语言 | +|最大汇总结果 |用于汇总的顶部结果的数量(默认为 7) | + +## 输出 + +|名称 |描述 | +| -------------- | ----------------------------- | +| VectaraQAChain |返回响应的最终节点 | diff --git a/cn/integrations/langchain/chains/vectordb-qa-chain.md b/cn/integrations/langchain/chains/vectordb-qa-chain.md new file mode 100644 index 00000000..e7abdf71 --- /dev/null +++ b/cn/integrations/langchain/chains/vectordb-qa-chain.md @@ -0,0 +1,11 @@ +--- +description: 矢量数据库的 QA 链。 +--- + +# VectorDB QA 链 + +

VectorDB QA链节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chat-models/README.md b/cn/integrations/langchain/chat-models/README.md new file mode 100644 index 00000000..151ab4c0 --- /dev/null +++ b/cn/integrations/langchain/chat-models/README.md @@ -0,0 +1,31 @@ +--- +description: LangChain聊天模型节点 +--- + +# 聊天模型 + +*** + +聊天模型将消息列表作为输入,并返回模型生成的消息作为输出。这些模型(例如 **gpt-3.5-turbo** 或 **gpt4**)比其前身 Completions 模型(例如 **text-davincii-003**)功能强大且便宜。 + +### 聊天模型节点: + +* [AWS ChatBedrock](aws-chatbedrock.md) +* [Azure ChatOpenAI](../../llamaindex/chat-models/azurechatopenai.md) +* [NIBittensorChat](broken-reference) +* [ChatAnthropic](chatanthropic.md) +* [ChatCohere](chatcohere.md) +* [聊天烟花](chat-fireworks.md) +* [ChatGoogleGenerativeAI](google-ai.md) +* [ChatGooglePaLM](broken-reference) +* [Google VertexAI](google-vertexai.md) +* [ChatHuggingFace](chathuggingface.md) +* [ChatLocalAI](chatlocalai.md) +* [ChatMistralAI](mistral-ai.md) +* [ChatOllama](chatollama.md) +* [ChatOllama 功能](broken-reference) +* [ChatOpenAI](azure-chatopenai.md) +* [ChatOpenAI 自定义](broken-reference) +* [ChatTogetherAI](chattogetherai.md) +* [GroqChat](groqchat.md) +* [ChatSambanova](chat-sambanova.md) diff --git a/cn/integrations/langchain/chat-models/aws-chatbedrock.md b/cn/integrations/langchain/chat-models/aws-chatbedrock.md new file mode 100644 index 00000000..fbe93e42 --- /dev/null +++ b/cn/integrations/langchain/chat-models/aws-chatbedrock.md @@ -0,0 +1,11 @@ +--- +description: 围绕使用聊天端点的 AWS 基岩大型语言模型的包装。 +--- + +# AWS ChatBedrock + +

AWS ChatBedrock

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chat-models/azure-chatopenai-1.md b/cn/integrations/langchain/chat-models/azure-chatopenai-1.md new file mode 100644 index 00000000..63f93f93 --- /dev/null +++ b/cn/integrations/langchain/chat-models/azure-chatopenai-1.md @@ -0,0 +1,61 @@ +# Azure ChatOpenAI + +## 先决条件 + +1. [登录](https://portal.azure.com/)或[注册](https://azure.microsoft.com/en-us/free/)到 Azure +2. [创建](https://portal.azure.com/#create/Microsoft.CognitiveServicesOpenAI)您的 Azure OpenAI 并等待大约 10 个工作日的批准 +3. 您的 API 密钥将在 **Azure OpenAI** 中提供 > 单击 **名称\_azure\_openai** > 单击 **单击此处管理密钥** + +
+ +## 设置 + +### Azure 聊天OpenAI + +1. 单击“**转到 Azure OpenaAI Studio**” + +
+ +2. 单击**部署** + +
+ +3. 单击“**创建新部署**” + +
+ +4.如下图选择,点击**创建** + +
+ +5.成功创建**Azure ChatOpenAI** + +* 部署名称:`gpt-35-turbo` +* 实例名称:`top right conner` + +
+ +
+ +### 流动 + +1. **聊天模型** > 拖动 **Azure ChatOpenAI** 节点 + +
+ +2. **连接凭据** > 单击 **新建** + +
+ +3. 将每个详细信息(API 密钥、实例和部署名称、[API 版本](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions))复制并粘贴到 **Azure ChatOpenAI** 凭据中 + +
+ +4.瞧[🎉](https://emojipedia.org/party-popper/),您已在 Flowise 中创建了 **Azure ChatOpenAI 节点** + +
+ +## 资源 + +* [LangChain JS Azure ChatOpenAI](https://js.langchain.com/docs/modules/model\_io/models/chat/integrations/azure) +* [Azure OpenAI 服务 REST API 参考](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference) diff --git a/cn/integrations/langchain/chat-models/azure-chatopenai.md b/cn/integrations/langchain/chat-models/azure-chatopenai.md new file mode 100644 index 00000000..4609111f --- /dev/null +++ b/cn/integrations/langchain/chat-models/azure-chatopenai.md @@ -0,0 +1,64 @@ +# 聊天OpenAI + +## 先决条件 + +1. [OpenAI](https://openai.com/) 帐户 +2. 创建 [API 密钥](https://platform.openai.com/api-keys) + +## 设置 + +1. **聊天模型** > 拖动 **ChatOpenAI** 节点 + +
+ +2. **连接凭据** > 单击 **新建** + +
+ +2.填写**ChatOpenAI**凭据 + +
+ +4.瞧[🎉](https://emojipedia.org/party-popper/),您现在可以在 Flowise 中使用 **ChatOpenAI 节点** + +
+ +## 自定义基础 URL 和标头 + +Flowise 支持使用自定义基础 URL 和 Chat OpenAI 标头。用户可以轻松使用 OpenRouter、TogetherAI 等集成,以及其他支持 OpenAI API 兼容性的集成。 + +### 一起AI + +1. 参考TogetherAI官方[docs](https://docs.together.ai/docs/openai-api-compatibility#nodejs) +2.使用TogetherAI API密钥创建新凭据 +3. 单击 ChatOpenAI 节点上的“**其他参数**”。 +4. 更改基本路径: + +
+ +### 打开路由器 + +1. 参考OpenRouter官方[docs](https://openrouter.ai/docs#quick-start) +2. 使用 OpenRouter API key 创建新凭据 +3. 点击ChatOpenAI节点上的附加参数 +4. 更改基本路径和基本选项: + +
+ +## 定制模型 + +对于 ChatOpenAI 节点不支持的模型,您可以使用 ChatOpenAI Custom。这允许用户填写模型名称,例如 `mistralai/Mixtral-8x7B-Instruct-v0.1` + +
+ +## 图片上传 + +您还可以允许 LLM 上传和分析图像。在底层,Flowise 将使用 [OpenAI Vison](https://platform.openai.com/docs/guides/vision) 模型来处理图像。仅适用于 LLMChain、Conversation Chain、ReAct Agent 和 Conversational Agent。 + +
+ +在聊天界面中,您现在将看到一个新的图像上传按钮: + +
+ +
diff --git a/cn/integrations/langchain/chat-models/chat-fireworks.md b/cn/integrations/langchain/chat-models/chat-fireworks.md new file mode 100644 index 00000000..49d41f09 --- /dev/null +++ b/cn/integrations/langchain/chat-models/chat-fireworks.md @@ -0,0 +1,11 @@ +--- +description: Fireworks 聊天端点的包装。 +--- + +# 聊天烟花 + +

聊天烟花节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chat-models/chat-sambanova.md b/cn/integrations/langchain/chat-models/chat-sambanova.md new file mode 100644 index 00000000..6cc963e1 --- /dev/null +++ b/cn/integrations/langchain/chat-models/chat-sambanova.md @@ -0,0 +1,18 @@ +--- +description: 使用 RDU 推理引擎对 SambaNova API 进行包装。 +--- + +# 聊天桑巴诺瓦 + +## **先决条件** +在开始之前,请确保您拥有: + +1. [SambaNova Cloud](https://cloud.sambanova.ai/apis) 帐户 +2. 您的[SambaNova API 键](https://cloud.sambanova.ai/apis) +3. 保存您的 API 密钥 + +## 分步指南 +

聊天Sambanova节点

+ +1. **聊天模型** > 拖动 **ChatSambanova** 节点。 +2. 使用 SambaNova API 密钥创建新凭据。 \ No newline at end of file diff --git a/cn/integrations/langchain/chat-models/chatanthropic.md b/cn/integrations/langchain/chat-models/chatanthropic.md new file mode 100644 index 00000000..95267453 --- /dev/null +++ b/cn/integrations/langchain/chat-models/chatanthropic.md @@ -0,0 +1,11 @@ +--- +description: ChatAnthropic 大语言模型的包装,使用 Chat 端点。 +--- + +# 聊天人类 + +

聊天人择节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chat-models/chatcohere.md b/cn/integrations/langchain/chat-models/chatcohere.md new file mode 100644 index 00000000..5798ded2 --- /dev/null +++ b/cn/integrations/langchain/chat-models/chatcohere.md @@ -0,0 +1,11 @@ +--- +description: Cohere 聊天端点的包装。 +--- + +# 聊天Cohere + +

ChatCohere节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chat-models/chatcometapi.md b/cn/integrations/langchain/chat-models/chatcometapi.md new file mode 100644 index 00000000..a26597b0 --- /dev/null +++ b/cn/integrations/langchain/chat-models/chatcometapi.md @@ -0,0 +1,16 @@ +# 聊天彗星 API + +## 说明 +CometAPI 是一个统一的 API 平台,通过一次集成即可访问 500 多个 AI 模型,包括 GPT、Claude、Gemini、Qwen、DeepSeek、Midjourney 等。它通过不同模型提供商之间一致的 API 格式提供简化的访问。 + +## 先决条件 +1. 请参阅 CometAPI 的官方[docs](https://api.cometapi.com/doc)。 +2. 从 [CometAPI 控制台](https://api.cometapi.com/console/token) 获取您的 API 密钥。 + +## 分步指南 +

ChatCometAPI 节点

+ +1. **聊天模型** > 拖动 **ChatCometAPI** 节点。 +2. 使用 CometAPI API 密钥创建新凭据。 +3. 单击 ChatCometAPI 节点上的“**其他参数**”。 +4. 将基本路径更改为:`https://api.cometapi.com/v1/`。 \ No newline at end of file diff --git a/cn/integrations/langchain/chat-models/chathuggingface.md b/cn/integrations/langchain/chat-models/chathuggingface.md new file mode 100644 index 00000000..262a0c97 --- /dev/null +++ b/cn/integrations/langchain/chat-models/chathuggingface.md @@ -0,0 +1,63 @@ +--- +description: 使用 Hugging Face 聊天模型创建聊天流的说明。 +--- + +# 聊天拥抱脸 + +## 先决条件 + +1. [登录](https://huggingface.co/login)或[注册](https://huggingface.co/join)到[拥抱表情](https://huggingface.co)。 +2. 创建 API 密钥(如果您尚未这样做): + 1. 从您的 Hugging Face 个人资料中,选择 **访问令牌** > **创建新令牌**。 + 2. 创建_细粒度_令牌。选择您需要的所有读写权限。确保您还选择: + + * _调用推理提供商_ - 通过 Hugging Face 与 Hugging Face 或其他第三方提供商(例如 Together AI、Sambanova 或 Replicate)的无服务器推理 API(以前称为“推理 API”)进行交互。 + * _调用您的推理端点_ - 与您部署在自己的服务器上的专用独立 Hugging Face 实例进行交互。 + +
Screenshot of a Fine-Grained Hugging Face token creation page.

拥抱脸部令牌创建

+ 3. 单击 **复制** 并将 API 令牌保存在其他位置以供以后检索。 +3. 从 **模型** 选项卡中,选择您要使用的 LLM 模型。 + +
Page listing Hugging Face LLM models.

拥抱脸部模型

+4. 在打开的 LLM 模型页面上: + 1. 单击模型名称旁边的图标,将模型名称复制到剪贴板或保存到其他位置以供以后检索。 + 2. 注意模型的默认推理提供程序。 + +
Screenshot of a Hugging Face LLM model page.

拥抱脸 LLM 模型页面

+ 3. 如果您的提供商是需要自定义 API 密钥的第三方提供商,请首先在提供商网站上创建 API 密钥,然后在 Hugging Face 配置文件设置中复制并设置 API 密钥: + 1. 单击 Hugging Face 个人资料下的 **设置**。 + 2. 选择左侧面板上的 **推理提供程序**。 + 3. 选择**设置**选项卡。 + 4. 选择 **为提供商设置自定义 API 密钥**,然后粘贴 API 密钥。 + +## 设置 + +### 流动 + +首先,您需要部署 Flowise。在本地或云端安装并运行 Flowise。您可以按照 Flowise 官方文档或教程进行部署。 + +要使用 ChatHuggingFace 聊天模型在 Flowise 中创建聊天流: + +1. 在 **聊天流** 中,单击 **+ 添加新** 以创建新的聊天流。 +2. 单击**+** 并拖动**链** > **LLM 链**。 +3. 单击 **+** 并拖动 **聊天模型** > **ChatHuggingFace**: + + * **连接凭据**:单击 **新建** 创建新凭据,并在 **HuggingFace API 密钥** 字段中输入 Hugging Face 访问令牌。 + +
Screenshot of a Hugging Face Connect credential.

拥抱面部连接凭据

+ * **模型**:粘贴剪贴板中的模型名称(从 Hugging Face 上的模型页面保存)。 + +
Screenshot of a Hugging Face Chatmodel node

ChatHuggingFace 节点

+4. 单击 **+** 并拖动 **提示词** > **提示词模板**: + * 展开模板并输入说明。示例:“用户问题:{问题}”。 +5. 将 **ChatHuggingFace** 输出连接到 LLM 链的 **语言模型** 输入。 +6. 将 **PromptTemplate** 输出连接到 LLM 链的 **Prompt** 输入。 +7. 在运行聊天流之前保存您的配置。 +8. 瞧[🎉](https://emojipedia.org/party-popper/),您已在 Flowise 中创建了带有 **ChatHuggingFace 节点** 的聊天流。 + +
Screenshot of an LLM Chain with ChatHuggingFace chat model.

拥抱脸聊天流

+ +## 资源 + +* [HuggingFace 文档](https://huggingface.co/docs) +* [HuggingFace 论坛](https://discuss.huggingface.co/) diff --git a/cn/integrations/langchain/chat-models/chatlocalai.md b/cn/integrations/langchain/chat-models/chatlocalai.md new file mode 100644 index 00000000..1ed1d47e --- /dev/null +++ b/cn/integrations/langchain/chat-models/chatlocalai.md @@ -0,0 +1,64 @@ +# 聊天本地人工智能 + +## LocalAI 设置 + +[**LocalAI**](https://github.com/go-skynet/LocalAI) 是 REST API 的直接替代品,与 OpenAI API 本地推理规范兼容。它允许您使用消费级硬件在本地或本地运行 LLM(不仅如此),支持与 ggml 格式兼容的多个模型系列。 + +要在 Flowise 中使用 ChatLocalAI,请按照以下步骤操作: + +1. ```bash + git 克隆 https://github.com/go-skynet/LocalAI + ``` +2.
cd LocalAI
+   
+3. ```bash + # copy your models to models/ + cp your-model.bin models/ + ``` + +例如: + +从 [gpt4all.io](https://gpt4all.io/index.html) 下载模型之一 + +```bash +# Download gpt4all-j to models/ +wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j +``` + +在 `/models` 文件夹中,您应该能够在其中看到下载的模型: + +
+ +请参阅[此处](https://localai.io/model-compatibility/index.html),了解支持的型号列表。 + +4. ```bash + docker compose up -d --pull 始终 + ``` +5. Now API is accessible at localhost:8080 + +```bash +# 测试 API +卷曲 http://localhost:8080/v1/models +# {"object":"list","data":[{"id":"ggml-gpt4all-j.bin","object":"model"}]} +``` + +## Flowise Setup + +Drag and drop a new ChatLocalAI component to canvas: + +
+ +Fill in the fields: + +* **Base Path**: The base url from LocalAI such as [http://localhost:8080/v1](http://localhost:8080/v1) +* **Model Name**: The model you want to use. Note that it must be inside `/models` folder of LocalAI directory. For instance: `ggml-gpt4all-j.bin` + +{% hint style="info" %} +If you are running both Flowise and LocalAI on Docker, you might need to change the base path to [http://host.docker.internal:8080/v1](http://host.docker.internal:8080/v1). For Linux based systems the default docker gateway should be used since host.docker.internal is not available: [http://172.17.0.1:8080/v1](http://172.17.0.1:8080/v1) +{% endhint %} + +That's it! For more information, refer to LocalAI [docs](https://localai.io/basics/getting_started/index.html). + +Watch how you can use LocalAI on Flowise + +{% embed url="https://youtu.be/0B0oIs8NS9k" %} diff --git a/cn/integrations/langchain/chat-models/chatollama.md b/cn/integrations/langchain/chat-models/chatollama.md new file mode 100644 index 00000000..8b40c83d --- /dev/null +++ b/cn/integrations/langchain/chat-models/chatollama.md @@ -0,0 +1,50 @@ +# 聊天奥拉马 + +## 先决条件 + +1. 下载 [Ollama](https://github.com/ollama/ollama) 或在 [Docker.](https://hub.docker.com/r/ollama/ollama) 上运行它 +2. 例如,您可以使用以下命令使用 llama3 启动 Docker 实例 + + ```bash + docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama + docker exec -it ollama ollama run llama3 + ``` + +## 设置 + +1. **聊天模型** > 拖动 **ChatOllama** 节点 + +
+ +2.填写Ollama上运行的模型。例如:`llama2`。您还可以使用附加参数: + +
+ +3.瞧[🎉](https://emojipedia.org/party-popper/),您现在可以在 Flowise 中使用 **ChatOllama 节点** + +
+ +### 在 Docker 上运行 + +如果您在 docker 上同时运行 Flowise 和 Ollama。您必须更改 ChatOllama 的基础 URL。 + +对于 Windows 和 MacOS 操作系统,指定 [http://host.docker.internal:8000](http://host.docker.internal:8000/). 对于基于 Linux 的系统,应使用默认 docker 网关,因为 host.docker.internal 不可用: [http://172.17.0.1:8000](http://172.17.0.1:8000/) + +
+ +## 奥拉玛云 + +1. 在 **ollama.com** 上创建 [API 密钥](https://ollama.com/settings/keys)。 +2. 在 Flowise 中,单击 **创建凭据** 并选择 **Ollama API**,然后输入您的 API 密钥。 + +
+ +3. 然后,将 **基础 URL** 设置为 `https://ollama.com` +4. 输入 Ollama Cloud 上可用的模型。 + +
+ +## 资源 + +* [LangchainJS ChatOllama](https://js.langchain.com/docs/integrations/chat/ollama) +* [Ollama](https://github.com/ollama/ollama) diff --git a/cn/integrations/langchain/chat-models/chattogetherai.md b/cn/integrations/langchain/chat-models/chattogetherai.md new file mode 100644 index 00000000..727e580d --- /dev/null +++ b/cn/integrations/langchain/chat-models/chattogetherai.md @@ -0,0 +1,11 @@ +--- +description: TogetherAI 大语言模型的包装 +--- + +#ChatTogetherAI + +

ChatTogetherAI节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chat-models/google-ai.md b/cn/integrations/langchain/chat-models/google-ai.md new file mode 100644 index 00000000..a488a661 --- /dev/null +++ b/cn/integrations/langchain/chat-models/google-ai.md @@ -0,0 +1,42 @@ +# 聊天谷歌生成人工智能 + +## 先决条件 + +1. 注册 [Google](https://accounts.google.com/InteractiveLogin) 帐户 +2. 创建 [API 密钥](https://aistudio.google.com/app/apikey) + +## 设置 + +1. **聊天模型** > 拖动 **ChatGoogleGenerativeAI** 节点 + +
+ +2. **连接凭据** > 单击 **新建** + +
+ +3.填写**Google AI**凭据 + +
+ +4.瞧[🎉](https://emojipedia.org/party-popper/),您现在可以在 Flowise 中使用 **ChatGoogleGenerativeAI 节点** + +
+ +## 安全属性配置 + +1. 单击**附加参数** + +
+ +* 配置**安全属性**时,**危害类别**和**危害块阈值**中的选择数量应相同。如果不是,它将抛出错误 `Harm Category & Harm Block Threshold are not the same length` + +* 下面**安全属性**的组合将导致 `Dangerous` 设置为 `Low and Above` 且 `Harassment` 设置为 `Medium and Above` + +
+ +## 资源 + +* [LangChain JS ChatGoogleGenerativeAI](https://js.langchain.com/docs/integrations/chat/google_generativeai) +* [Google AI for Developers](https://ai.google.dev/) +* [Gemini API 文档](https://ai.google.dev/docs) \ No newline at end of file diff --git a/cn/integrations/langchain/chat-models/google-vertexai.md b/cn/integrations/langchain/chat-models/google-vertexai.md new file mode 100644 index 00000000..10055b7f --- /dev/null +++ b/cn/integrations/langchain/chat-models/google-vertexai.md @@ -0,0 +1,85 @@ +# 谷歌 VertexAI + +## 先决条件 + +1. [启动您的 GCP](https://cloud.google.com/docs/get-started) +2. 安装 [Google Cloud CLI](https://cloud.google.com/sdk/docs/install-sdk) + +## 设置 + +### 启用顶点AI API + +1. 转到 GCP 上的 Vertex AI,然后单击 **"ENABLE ALL RECOMMENDED API"** + +
+ +## 创建凭据文件_(可选)_ + +有两种方法创建凭据文件 + +### 第 1 条:使用 GCP CLI + +1.打开终端并运行以下命令 + +```bash +gcloud auth application-default login +``` + +2. 登录您的 GCP 帐户 +3. 检查您的凭据文件。您可以在 `~/.config/gcloud/application_default_credentials.json` 中找到您的凭据文件 + +### No. 2 : 使用 GCP 控制台 + +1. 进入GCP控制台并点击**“CREATE CREDENTIALS”** + +
+ +2. 创建服务帐号 + +
+ +3. 填写服务帐户详细信息表格,然后单击 **"CREATE AND CONTINUE"** +4. 选择适当的角色(例如 Vertex AI User)并单击 **“DONE”** + +
+ +5. 单击您创建的服务帐户,然后单击 **"ADD KEY" -> "创建新密钥"** + +
+ +6. 选择 JSON 并点击 **"CREATE"** 然后您可以下载您的凭据文件 + +
+ +## 流畅 + +
+ +### 没有凭据文件 + +如果您使用的是 Cloud Run 等 GCP 服务,或者您已在本地计算机上安装了默认凭据,则无需设置此凭据。 + +### 使用凭据文件 + +1. 转到 Flowise 上的凭据页面,然后单击 **“添加凭据”** +2. 单击 Google Vertex 身份验证 + +
+ +3. 注册您的凭据文件。有两种方法可以注册您的凭据文件。 + +
+ +* **选项 1:输入凭据文件的路径** + * 如果您的计算机上有凭据文件,您可以将凭据文件的路径输入到 `Google Application Credential File Path` 中 +* **选项 2:粘贴凭据文件的文本** + * 或者您可以复制凭据文件中的所有文本并将其粘贴到 `Google Credential JSON Object` 中 + +4. 最后,单击“添加”按钮。 +5. **🎉**您现在可以通过 Flowise 中的凭据使用 ChatGoogleVertexAI! + +### 资源 + +* [LangChain JS GoogleVertexAI](https://js.langchain.com/docs/api/llms_googlevertexai/classes/GoogleVertexAI) +* [Google 服务帐户概述](https://cloud.google.com/iam/docs/service-account-overview?) +* [尝试使用 Flowise 的 Google Vertex AI Palm 2:无需编码即可利用直觉](https://tech.beatrust.com/entry/2023/08/22/Try_Google_Vertex_AI_Palm_2_with_Flowise%3A_Without_Coding_to_Leverage_Intuition) diff --git a/cn/integrations/langchain/chat-models/groqchat.md b/cn/integrations/langchain/chat-models/groqchat.md new file mode 100644 index 00000000..e8d3482d --- /dev/null +++ b/cn/integrations/langchain/chat-models/groqchat.md @@ -0,0 +1,11 @@ +--- +description: 使用 LPU 推理引擎包装 Groq API。 +--- + +# 格罗克聊天 + +

GroqChat 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/chat-models/ibm-watsonx.md b/cn/integrations/langchain/chat-models/ibm-watsonx.md new file mode 100644 index 00000000..bfcf28f0 --- /dev/null +++ b/cn/integrations/langchain/chat-models/ibm-watsonx.md @@ -0,0 +1,49 @@ +# IBM Watsonx + +## 先决条件 + +1. 在 [IBM Watsonx](https://www.ibm.com/watsonx) 上注册帐户 +2.创建一个新项目: + +
+ +
+ +3. 创建项目后,返回主仪表板,然后单击 **探索基础模型**: + +
+ +4. 选择您要使用的模型并在 Prompt Lab 中打开: + +
+ +5. 单击右上角的“查看代码”: + +
+ +6. 记下 `model_id` 和 `version` 参数。在本例中,它是 `ibm/granite-3-8b-instruct,`,版本是 `2023-05-29`。 +7.点击左侧导航栏,点击开发者接入 + +
+ +8. 记下 `watsonx.ai URL`、`Project ID` 并从 IBM Cloud Console 创建新的 API 密钥。 +9. 到目前为止,您应该拥有以下信息: + * Watsonx.ai URL + * 项目编号 + * API 键 + * 型号版本 + * 型号 ID + +## 设置 + +1. **聊天模型** > 拖动 **ChatIBMWatsonx** 节点 + +
+ +2. 将之前的型号 ID 填写到型号中。创建新凭据并填写所有详细信息。 + +
+ +2.瞧[🎉](https://emojipedia.org/party-popper/),您现在可以在 Flowise 中使用 **ChatIBMWatsonx 节点**! + +
diff --git a/cn/integrations/langchain/chat-models/mistral-ai.md b/cn/integrations/langchain/chat-models/mistral-ai.md new file mode 100644 index 00000000..bcedf33f --- /dev/null +++ b/cn/integrations/langchain/chat-models/mistral-ai.md @@ -0,0 +1,30 @@ +# 聊天MistralAI + +## 先决条件 + +1. 注册 [Mistral AI](https://mistral.ai/) 帐户 +2. 创建 [API 密钥](https://console.mistral.ai/user/api-keys/) + +## 设置 + +1. **聊天模型** > 拖动 **ChatMistralAI** 节点 + +
+ +2. **连接凭据** > 单击 **新建** + +
+ +3.填写**Mistral AI**凭据 + +
+ +4.瞧[🎉](https://emojipedia.org/party-popper/),您现在可以在 Flowise 中使用 **ChatMistralAI 节点** + +
+ +## 资源 + +* [LangChain JS ChatMistralAI](https://js.langchain.com/docs/integrations/chat/mistral) +* [米斯特拉尔 AI](https://mistral.ai/) +* [Mistral AI 文档](https://docs.mistral.ai/) \ No newline at end of file diff --git a/cn/integrations/langchain/chat-models/nvidia-nim.md b/cn/integrations/langchain/chat-models/nvidia-nim.md new file mode 100644 index 00000000..1fc7d9a5 --- /dev/null +++ b/cn/integrations/langchain/chat-models/nvidia-nim.md @@ -0,0 +1,93 @@ +# NVIDIA NIM + +## 本地 + +### 关于使用 Flowise 运行 NIM 的重要说明 + +如果现有的 NIM 实例已经在运行(例如,通过 NVIDIA 的 ChatRTX),通过 Flowise **不检查现有端点**启动另一个实例可能会导致冲突。当在同一个 NIM 上执行多个 `podman run` 命令时,会出现此问题,从而导致失败。 + +如需支持,请参阅: + +- **[NVIDIA 开发者论坛](https://forums.developer.nvidia.com/)** – 有关技术问题和疑问。 +- **[NVIDIA Developer Discord](https://discord.gg/nvidiadeveloper)** – 用于社区参与和[公告](https://discord.com/channels/1019361803752456192/1340013505834647572)。 + +### 先决条件 + +1. 使用 [通过 WSL2 在本地设置 NVIDIA NIM](https://docs.nvidia.com/nim/wsl2/1.0.0/getting-started.html)。 + +### 流动 + +1. **聊天模型** > 拖动 **聊天 NVIDIA NIM** 节点 > 单击 **本地设置 NIM**。 + +
+ +2. 如果已安装 NIM,请单击 **下一步**。否则,单击“**下载**”启动安装程序。 + +
+ +3. 选择要下载的模型图像。 + +
+ +4. 选择后,单击**下一步**继续下载。 + +
+ +5. **下载图像** – 持续时间取决于互联网速度。 + +
+ +6. 了解有关[放宽内存限制](https://docs.nvidia.com/nim/large-language-models/1.7.0/configuration.html#environment-variables)的详细信息。 + **主机端口**是容器映射到本地计算机的端口。 + +
+ +7. **启动容器...** + +
+ +_注意:如果您已经有一个使用所选模型运行的容器,Flowise 会询问您是否要重用正在运行的容器。您可以选择重用正在运行的容器或使用不同端口启动一个新容器。_ + +
+ +8. **保存聊天流** + +9. [🎉](https://emojipedia.org/party-popper/) **瞧!** 您的 **聊天 NVIDIA NIM** 节点现在可以在 Flowise 中使用! + +
+ +## 云 + +### 先决条件 + +1. 登录或注册 [NVIDIA](https://build.nvidia.com/)。 +2. 从顶部导航栏中,单击 NIM: + +
+ +3. 搜索您想要使用的型号。要在本地下载它,我们将使用 Docker: + +
+ +4. 按照 Docker 设置中的说明进行操作。您必须首先获得 API 密钥才能拉取 Docker 映像: + +
+ +### 流动 + +1. **聊天模型** > 拖动**聊天 NVIDIA NIM** 节点 + +
+ +2. 如果您使用 NVIDIA 托管端点,则必须拥有 API 密钥。 **连接凭据** > 单击 **新建。** 但是,如果您使用本地设置,则这是可选的。 + +
+ +3. 输入型号名称,然后瞧[🎉](https://emojipedia.org/party-popper/),您的 **聊天 NVIDIA NIM 节点**现在就可以在 Flowise 中使用了! + +
+ +### 资源 + +- [NVIDIA LLM 使用入门](https://docs.nvidia.com/nim/large-language-models/latest/getting-started.html) +- [NVIDIA NIM](https://build.nvidia.com/microsoft/phi-3-mini-4k?snippet_tab=Docker) diff --git a/cn/integrations/langchain/document-loaders/README.md b/cn/integrations/langchain/document-loaders/README.md new file mode 100644 index 00000000..1cf954b7 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/README.md @@ -0,0 +1,53 @@ +--- +description: LangChain文档加载器节点 +--- + +# 文档加载器 + +*** + +文档加载器允许您加载来自不同来源的文档,例如 PDF、TXT、CSV、Notion、Confluence 等。它们通常与 [向量存储](../vector-stores/) 一起使用,以作为嵌入写入更新,然后可以在查询时检索。 + +### 观看有关文档加载器的介绍 + +{% embed url="https://youtu.be/kMtf9sNIcao" %} + +### 文档加载器节点: + +* [Airtable](airtable.md) +* [API 加载程序](api-loader.md) +* [Apify 网站内容爬网程序](apify-website-content-crawler.md) +* [BraveSearch 加载程序](bravesearch-api.md) +* [Cheerio 网络抓取工具](cheerio-web-scraper.md) +* [Confluence](confluence.md) +* [Csv 文件](csv-file.md) +* [自定义文档加载器](custom-document-loader.md) +* [文档存储](document-store.md) +* [Docx 文件](docx-file.md) +* [Epub 文件](epub-file.md) +* [Figma](figma.md) +* [文件](file-loader.md) +* [FireCrawl](firecrawl.md) +* [文件夹](folder.md) +* [GitBook](gitbook.md) +* [Github](github.md) +* [Google 云端硬盘](google-drive.md) +* [Google 表格](google-sheets.md) +* [Jira](jira.md) +* [Json 文件](json-file.md) +* [Json 行文件](jsonlines.md) +* [Microsoft Excel](microsoft-excel.md) +* [Microsoft Powerpoint](microsoft-powerpoint.md) +* [Microsoft Word](microsoft-word.md) +* [概念](notion.md) +* [PDF 文件](pdf-file.md) +* [纯文本](plain-text.md) +* [剧作家网络爬虫](playwright-web-scraper.md) +* [Puppeteer 网络抓取工具](puppeteer-web-scraper.md) +* [S3 文件加载器](s3-file-loader.md) +* [用于网页搜索的SearchApi](searchapi-for-web-search.md) +* [用于网页搜索的 SerpApi](serpapi-for-web-search.md) +* [Spider - 网络搜索和抓取工具](spider-web-scraper-crawler.md) +* [文本文件](text-file.md) +* [非结构化文件加载器](unstructured-file-loader.md) +* [非结构化文件夹加载器](unstructured-folder-loader.md) diff --git a/cn/integrations/langchain/document-loaders/airtable.md b/cn/integrations/langchain/document-loaders/airtable.md new file mode 100644 index 00000000..449e2901 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/airtable.md @@ -0,0 +1,73 @@ +--- +description: 从 Airtable 表加载数据。 +--- + +# 空中桌 + +

空中桌节点

+ +Airtable 是一种云协作服务,它将电子表格的功能与数据库相结合。该模块提供了从 Airtable 表加载和处理数据的全面功能。 + +该模块提供了一个复杂的 Airtable 文档加载器,可以: + +* 从特定的 Airtable 库、表和视图加载数据 +* 过滤并选择特定字段 +* 处理分页和大数据集 +* 支持自定义公式过滤 +* 使用文本分割器处理数据 +* 自定义元数据提取 + +## 输入 + +### 必需参数 + +* **Base Id**:Airtable 基本标识符(例如 app11RobdGoX0YNsC) +* **Table Id**:特定的表标识符(例如,tblJdmvbrgizbYICO) +* **连接凭据**:Airtable API 凭据 + +### 可选参数 + +* **视图 ID**:特定视图标识符(例如 viw9UrP77Id0CE4ee) +* **文本分割器**:处理提取内容的文本分割器 +* **仅包含字段**:要包含的字段名称或 ID 的逗号分隔列表 +* **Return All**:是否返回所有结果(默认:true) +* **限制**:Return All 为 false 时返回的结果数(默认值:100) +* **按公式过滤**:用于过滤记录的 Airtable 公式 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 特点 + +* 基于API的数据检索 +* 字段选择和过滤 +* 分页支持 +* 基于公式的过滤 +* 可定制的元数据处理 +* 文本分割功能 +* 无效输入的错误处理 + +## 注释 + +* 需要有效的 Airtable API 凭据 +* 基础ID和表ID为必填项 +* 包含逗号的字段名称应使用字段 ID 代替 +* 过滤公式必须遵循 Airtable 公式语法 +* 速率限制和 API 配额适用 +* 支持完整和部分数据检索 + +## URL 结构示例 + +对于表 URL 例如: + +``` +https://airtable.com/app11RobdGoX0YNsC/tblJdmvbrgizbYICO/viw9UrP77Id0CE4ee +``` + +* 基本 ID:app11RobdGoX0YNsC +*表ID:tblJdmvbrgizbYICO +*查看ID:viw9UrP77Id0CE4ee diff --git a/cn/integrations/langchain/document-loaders/api-loader.md b/cn/integrations/langchain/document-loaders/api-loader.md new file mode 100644 index 00000000..c67082ed --- /dev/null +++ b/cn/integrations/langchain/document-loaders/api-loader.md @@ -0,0 +1,82 @@ +--- +description: 从 API 加载数据。 +--- + +# API 文档加载器 + +

API 加载器节点

+ +API 文档加载器提供使用 HTTP 请求加载和处理来自外部 API 的数据的功能。该模块支持与 RESTful API 和 Web 服务的无缝集成。 + +该模块提供了一个多功能的 API 文档加载器,可以: +- 发出 HTTP GET 和 POST 请求 +- 处理自定义标头和请求正文 +- 将 API 回复处理成文档 +- 支持JSON数据结构 +- 自定义元数据提取 +- 使用文本分割器处理响应 + +## 输入 + +### 必需参数 +- **URL**:要调用的 API 端点 URL +- **方法**:要使用的 HTTP 方法(GET 或 POST) + +### 可选参数 +- **标头**:包含 HTTP 标头的 JSON 对象 +- **Body**:JSON 对象用于 POST 请求正文 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- HTTP 方法支持 (GET/POST) +- 自定义标头配置 +- 请求主体定制 +- 响应处理 +- 错误处理 +- 元数据定制 +- 文本分割功能 + +## 用法示例 + +### GET 请求 +```json +{ + "method": "GET", + "url": "https://api.example.com/data", + "headers": { + "Authorization": "Bearer token123", + "Accept": "application/json" + } +} +``` + +### POST 请求 +```json +{ + "method": "POST", + "url": "https://api.example.com/data", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer token123" + }, + "body": { + "query": "example", + "limit": 10 + } +} +``` + +## 注释 +- 支持 JSON 请求/响应格式 +- 处理 HTTP 错误响应 +- 自动将响应数据处理成文档 +- 可以与文本分割器结合进行内容处理 +- 支持自定义元数据添加和省略 +- 错误响应得到正确处理和报告 diff --git a/cn/integrations/langchain/document-loaders/apify-website-content-crawler.md b/cn/integrations/langchain/document-loaders/apify-website-content-crawler.md new file mode 100644 index 00000000..49ca561c --- /dev/null +++ b/cn/integrations/langchain/document-loaders/apify-website-content-crawler.md @@ -0,0 +1,106 @@ +--- +description: 从 Apify 网站内容爬虫加载数据。 +--- + +# Apify 网站内容爬虫 + +

Apify网站内容爬虫节点

+ +[Apify](https://apify.com/) 网站内容抓取工具是一款功能强大的网络抓取工具,可以使用各种抓取引擎从网站中提取内容。该模块提供与 Apify 网站内容爬虫的集成,以加载和处理 Web 内容。 + +该模块提供了一个复杂的网络爬虫,可以: + +* 从指定的起始URL抓取多个网站 +* 使用不同的抓取引擎(Chrome、Firefox、Cheerio、JSDOM) +* 控制抓取深度和页面限制 +* 处理 JavaScript 渲染的内容 +* 使用文本分割器处理提取的内容 +* 自定义元数据提取 + +## 输入 + +### 必需参数 + +* **开始 URL**:以逗号分隔的 URL 列表,从中开始抓取 +* **连接 Apify API**:Apify API 凭据 +* **爬虫类型**:爬虫引擎的选择: + * 无头网络浏览器(Chrome+Playwright) + * 隐形网络浏览器(Firefox+Playwright) + * 原始 HTTP 客户端 (Cheerio) + * 具有 JavaScript 执行功能的原始 HTTP 客户端 (JSDOM) + +### 可选参数 + +* **文本分割器**:处理提取内容的文本分割器 +* **最大爬行深度**:要遵循的页面链接的最大深度(默认值:1) +* **Max Crawl Pages**:要抓取的最大页面数(默认值:3) +* **附加输入**:具有附加爬虫配置的 JSON 对象 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 特点 + +* 多种抓取引擎支持 +* 可配置爬取参数 +* JavaScript渲染支持 +* 深度和页数限制控制 +* 元数据定制 +* 文本分割功能 +* 错误处理 + +## 爬虫类型 + +### 无头 Chrome(剧作家) + +* 最适合现代网络应用程序 +* 完整的 JavaScript 支持 +* 更高的资源使用率 + +### 隐秘的火狐(剧作家) + +* 适合有机器人检测的网站 +* 完整的 JavaScript 支持 +* 操作更加隐秘 + +### 谢里奥 + +* 快速且轻量 +* 不支持 JavaScript +* 降低资源使用率 + +### JSDOM(实验) + +* JavaScript执行支持 +* 浏览器的轻量级替代品 +* 实验特性 + +## 注释 + +* 需要有效的 Apify API 令牌 +* 不同类型的爬虫有不同的能力 +* 资源使用情况因爬虫类型而异 +* JavaScript 支持取决于爬虫类型 +* 根据 Apify 计划,速率限制可能适用 +* 可通过 JSON 输入进行其他配置 + +## 抓取整个网站 + +1._(可选)_连接[**文本分割器**](../text-splitters/)。 +2. 连接 Apify API(使用您的 [Apify API 令牌](https://my.apify.com/account#/integrations) 创建新凭据)。 +3. 输入一个或多个爬虫将启动的 URL(以逗号分隔),例如 `https://docs.flowiseai.com/`。 +4. 选择爬虫类型。有关详细信息,请参阅[网站内容爬网程序文档](https://apify.com/apify/website-content-crawler/input-schema#crawlerType)。 +5._(可选)_指定其他参数,例如最大爬网深度和最大爬网页面数。 + +## 输出 + +将网站内容加载为文档。 + +## 资源 + +* [Apify-Flowise 集成](https://docs.apify.com/platform/integrations/flowise) +* [网站内容抓取工具](https://apify.com/apify/website-content-crawler) diff --git a/cn/integrations/langchain/document-loaders/bravesearch-api.md b/cn/integrations/langchain/document-loaders/bravesearch-api.md new file mode 100644 index 00000000..33decea9 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/bravesearch-api.md @@ -0,0 +1,50 @@ +# BraveSearch API 文档加载器 + +BraveSearch 是一个注重隐私的搜索引擎,为网络搜索提供强大的 API。该模块可以将 BraveSearch 的搜索结果加载并处理到文档中。 + +该模块提供了一个复杂的搜索文档加载器,可以: +- 使用 BraveSearch API 执行网络搜索 +- 将搜索结果转换为结构化文档 +- 从结果中提取片段和元数据 +- 使用文本分割器处理结果 +- 自定义元数据提取 + +## 输入 + +### 必需参数 +- **查询**:要执行的搜索查询 +- **连接凭据**:BraveSearch API 凭据 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 注重隐私的网络搜索 +- 结构化结果处理 +- 自动元数据提取 +- 结果内容分割 +- 可定制的元数据处理 +- API 响应的错误处理 + +## 文档结构 +每个搜索结果都会转换为一个文档: +- **pageContent**:搜索结果中的片段/内容 +- **元数据**: + - title:网页的标题 + - 链接:网页的 URL + - 指定的附加自定义元数据 + +## 注释 +- 需要有效的 BraveSearch API 密钥 +- 结果包括网页片段和元数据 +- 可以与文本分割器结合进行内容处理 +- 支持自定义元数据添加和省略 +- 处理 API 速率限制和错误 +- 保留注重隐私的搜索功能 \ No newline at end of file diff --git a/cn/integrations/langchain/document-loaders/cheerio-web-scraper.md b/cn/integrations/langchain/document-loaders/cheerio-web-scraper.md new file mode 100644 index 00000000..0bb4090f --- /dev/null +++ b/cn/integrations/langchain/document-loaders/cheerio-web-scraper.md @@ -0,0 +1,75 @@ +# Cheerio 网页抓取工具 + +Cheerio 是专为服务器设计的核心 jQuery 的快速、灵活且精益的实现。该模块提供了强大的网页抓取功能,使用 Cheerio 从网页中提取内容。 + +该模块提供了一个复杂的网络抓取工具,可以: + +* 从单个或多个网页加载内容 +* 从网站爬取相关链接 +* 使用 CSS 选择器提取内容 +* 处理 XML 站点地图 +* 使用文本分割器处理网页内容 + +## 输入 + +* **URL**:要抓取的网页 URL +* **文本分割器**(可选):用于处理提取内容的文本分割器 +* **获取相对链接方法**(可选):选择: + * 网页抓取:从 HTML URL 抓取相关链接 + * 抓取 XML 站点地图:从 XML 站点地图 URL 抓取相关链接 +* **获取相对链接限制**(可选):要处理的相对链接数量限制(默认值:10,所有链接为 0) +* **选择器 (CSS)** (可选):用于定位特定内容的 CSS 选择器 +* **附加元数据**(可选):JSON 对象以及要添加到文档的附加元数据 +* **省略元数据键**(可选):要省略的以逗号分隔的元数据键列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 特点 + +* CSS 基于选择器的内容提取 +* 网页抓取功能 +* XML 站点地图处理 +* 可配置的链接限制 +* 无效 URL 和 PDF 的错误处理 +* 元数据定制 +* 调试日志支持 + +## 注释 + +* 不支持 PDF 文件,将被跳过 +* 无效的 URL 将引发错误 +* 将链接限制设置为 0 将检索所有可用链接(可能需要更长时间) +* 调试模式提供抓取过程的详细日志记录 + +## 刮一粒 URL + +1._(可选)_连接[**文本分割器**](../text-splitters/)。 +2. 输入需要抓取的URL。 + +## 爬行和抓取多个 URL + +1. 在**获取相对链接方法**中选择`Web Crawl` 或`Scrape XML Sitemap`。 +2. 在**获取相对链接限制**中输入`0`,以检索提供的URL中的所有可用链接。 + +
+ +### 管理链接(可选) + +1. 输入需要抓取的URL。 +2. 单击“**获取链接**”,根据**获取相对链接方法**和**附加参数**中的**获取相对链接限制**的输入来检索链接。 +3. 在 **已爬网链接** 部分中,通过单击 **红色垃圾桶图标** 删除不需要的链接。 +4. 最后,单击“**保存**”。 + +
+ +## 输出 + +将 URL 内容加载为文档 + +## 资源 + +* [LangChain JS Cheerio](https://js.langchain.com/docs/integrations/document_loaders/web_loaders/web_cheerio) +* [Cheerio](https://cheerio.js.org/) diff --git a/cn/integrations/langchain/document-loaders/confluence.md b/cn/integrations/langchain/document-loaders/confluence.md new file mode 100644 index 00000000..2ca06cf0 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/confluence.md @@ -0,0 +1,86 @@ +--- +description: 从 Confluence 文档加载数据 +--- + +# 汇合 + +## 汇合 + +

汇合节点

+ +## Confluence 文档加载器 + +Confluence 是 Atlassian 的企业 wiki 和协作平台。该模块提供从 Confluence 空间和页面加载和处理内容的功能。 + +该模块提供了一个复杂的 Confluence 文档加载器,可以: + +* 从特定 Confluence 空间加载内容 +* 支持云和服务器/数据中心部署 +* 处理多种方法的认证 +* 限制检索的页数 +* 使用文本分割器处理内容 +* 自定义元数据提取 + +### 输入 + +#### 必需参数 + +* **基础 URL**:Confluence 实例 URL(例如 https://example.atlassian.net/wiki) +* **Space Key**:Confluence 空间的唯一标识符 +* **连接凭据**:选择: + * Confluence Cloud API 凭据(用户名 + 访问令牌) + * Confluence 服务器/DC API 凭据(个人访问令牌) + +#### 可选参数 + +* **文本分割器**:处理提取内容的文本分割器 +* **限制**:检索的最大页数(0表示无限制) +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +### 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +### 特点 + +* 多部署支持(云/服务器/DC) +* 灵活的身份验证选项 +* 页数限制控制 +* 内容处理能力 +* 元数据定制 +* 错误处理 +* 支持文本分割 + +### 身份验证方法 + +#### 汇流云 + +* 需要用户名和访问令牌 +* 从 Atlassian 帐户设置生成的访问令牌 +* 支持API令牌认证 + +#### Confluence 服务器/数据中心 + +* 使用个人访问令牌 +* 从 Confluence 实例生成的令牌 +* 支持直接服务器访问 + +### 注释 + +* 空格键可以在 Confluence 空间设置中找到 +* 云与服务器的不同身份验证方法 +* 速率限制可能根据实例而适用 +* 内容包括页面文本和元数据 +* 支持完整和部分内容检索 +* 无效凭据或 URL 的错误处理 + +### 寻找空格键 + +要查找您的 Confluence Space 密钥: + +1. 导航至 Confluence 中的空间 +2.进入空间设置 +3.在概览中查找“空格键” +4. 格式示例:\~EXAMPLE362906de5d343d49dcdbae5dEXAMPLE diff --git a/cn/integrations/langchain/document-loaders/csv-file.md b/cn/integrations/langchain/document-loaders/csv-file.md new file mode 100644 index 00000000..e81fe9b0 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/csv-file.md @@ -0,0 +1,37 @@ +--- +description: 从 CSV 文件加载数据。 +--- + +# CSV 文件 + +

Csv 文件节点

+ +CSV(逗号分隔值)是一种简单的文件格式,用于存储表格数据,例如电子表格或数据库。此模块提供在工作流程中加载和处理 CSV 文件的功能。 + +该模块提供了一个多功能的 CSV 文档加载器,可以: +- 加载单个或多个 CSV 文件 +- 支持base64编码的文件和存储中的文件 +- 提取特定列或整个内容 +- 高效处理大型数据集 +- 处理自定义元数据管理 + +## 输入 + +- **CSV 文件**:要处理的 CSV 文件(需要 .csv 扩展名) +- **文本分割器**(可选):用于处理提取内容的文本分割器 +- **单列提取**(可选):要提取的特定列的名称 +- **附加元数据**(可选):JSON 对象以及要添加到文档的附加元数据 +- **省略元数据键**(可选):要从默认元数据中省略的以逗号分隔的元数据键列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:所有文档的页面内容的串联字符串 + +## 特点 +- 多文件处理支持 +- 单柱萃取能力 +- 高效处理大型数据集 +- 可定制的元数据处理 +- 存储集成支持 +- Base64 和 blob 处理能力 diff --git a/cn/integrations/langchain/document-loaders/custom-document-loader.md b/cn/integrations/langchain/document-loaders/custom-document-loader.md new file mode 100644 index 00000000..d044df49 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/custom-document-loader.md @@ -0,0 +1,91 @@ +--- +description: 加载文档的自定义功能。 +--- + +# 自定义文档加载器 + +

自定义文档加载器节点

+ +自定义文档加载器提供了使用 JavaScript 创建自定义文档加载功能的能力。该模块通过用户定义的功能实现灵活和定制的文档处理。 + +该模块提供了一个灵活的文档加载器,可以: +- 执行自定义 JavaScript 函数以加载文档 +- 动态处理输入变量 +- 支持文档和文本输出 +- 在沙盒环境中运行 +- 访问流程上下文和变量 +- 处理自定义元数据 + +## 输入 + +### 必需参数 +- **Javascript 函数**:返回以下任一内容的自定义代码: + - 文档对象数组(用于文档输出) + - 字符串(用于文本输出) + +### 可选参数 +- **输入变量**:JSON 对象,包含可在函数中使用 $ 前缀访问的变量 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 沙盒执行环境 +- 变量注入支持 +- 流程上下文访问 +- 自定义依赖支持 +- 错误处理 +- 超时保护 +- 输入验证 + +## 文档结构 +返回文档时,每个对象必须具有: +```javascript +{ + pageContent: 'Document Content', + metadata: { + title: 'Document Title', + // ... other metadata + } +} +``` + +## 用法示例 + +### 文档输出 +```javascript +return [ + { + pageContent: 'Document Content', + metadata: { + title: 'Document Title', + source: 'Custom Source' + } + } +] +``` + +### 文本输出 +```javascript +return "Processed text content" +``` + +## 可用上下文 +- **$input**:传递给函数的输入值 +- **$vars**:访问流变量 +- **$flow**:流上下文对象包含: + - 聊天流ID + - 会话ID + - 聊天ID + - 输入 + +## 注释 +- 函数在安全沙箱中运行 +- 10秒执行超时 +- 可用的内置依赖项 +- 可配置的外部依赖项 +- 输入变量必须有效 JSON +- 无效退货的错误处理 +- 支持异步操作 diff --git a/cn/integrations/langchain/document-loaders/document-store.md b/cn/integrations/langchain/document-loaders/document-store.md new file mode 100644 index 00000000..91bc0499 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/document-store.md @@ -0,0 +1,133 @@ +--- +description: 从预先配置的文档存储加载数据。 +--- + +# 文档存储 + +

文档存储节点

+ +文档存储加载程序使您能够从数据库中预先配置的文档存储加载数据。该加载程序提供了一种便捷的方式来访问和利用工作流程中之前处理和存储的文档。 + +## 特点 + +* 从同步存储加载文档 +* 自动元数据处理 +* 多种输出格式 +* 异步商店选择 +* 数据库集成 +* 基于块的文档检索 +* JSON 元数据支持 + +## 它是如何工作的 + +1. **店铺选择**: + * 列出所有处于“SYNC”状态的可用文档存储 + * 提供商店信息,包括名称和描述 + * 只允许从同步商店中选择 +2. **文献检索**: + * 从选定的存储中获取文档块 + * 使用原始元数据重建文档 + * 维护文档结构和关系 + +## 参数 + +### 必需参数 + +* **选择存储**:从可用的同步文档存储中选择 + * 显示商店名称和描述 + * 仅显示处于“SYNC”状态的商店 + * 根据数据库内容动态更新 + +## 输出 + +加载器提供两种输出格式: + +### 文档输出 + +返回文档对象数组,每个对象包含: + +* **pageContent**:文档块的实际内容 +* **元数据**:JSON 格式的原始文档元数据 + +### 文本输出 + +返回一个连接字符串,其中包含: + +* 所有文档块的内容 +* 以换行符分隔 +* 正确转义字符 + +## 数据库集成 + +加载程序通过以下方式与您的数据库集成: + +* TypeORM数据源连接 +* 文件存储实体管理 +* 基于块的存储和检索 +* 元数据保存 + +## 文档结构 + +每个加载的文档包含: + +```typescript +{ + pageContent: string, // The actual content + metadata: { // Parsed JSON metadata + // Original document metadata + // Store-specific information + // Custom metadata fields + } +} +``` + +## 用法示例 + +### 基本商店选择 + +```json +{ + "selectedStore": "store-id-123" +} +``` + +### 访问文档内容 + +```typescript +// Document output format +[ + { + "pageContent": "Document content here...", + "metadata": { + "source": "original-file.pdf", + "page": 1, + "category": "reports" + } + } +] + +// Text output format +"Document content here...\nNext document content here...\n" +``` + +## 最佳实践 + +1. 访问前确保存储同步 +2. 为您的用例选择适当的输出格式 +3. 在工作流程中适当处理元数据 +4. 处理大文档时考虑块大小 +5. 监控大型存储的数据库性能 + +## 注释 + +* 仅同步店铺可供选择 +* 元数据自动从JSON解析 +* 文档是从块重建的 +* 支持文档和文本输出格式 +* 与TypeORM集成以进行数据库访问 +* 处理文本输出中的转义字符 +* 保持原始文档结构 + +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](broken-reference/)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/document-loaders/docx-file.md b/cn/integrations/langchain/document-loaders/docx-file.md new file mode 100644 index 00000000..51a1bf53 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/docx-file.md @@ -0,0 +1,37 @@ +--- +description: 从 DOCX 文件加载数据。 +--- + +# Docx 文件 + +

Docx 文件节点

+ +Microsoft Word 文档 (DOCX) 是一种广泛使用的文档格式,用于创建和编辑文本文档。此模块提供在工作流程中加载和处理 DOCX 文件的功能。 + +该模块提供了一个全面的 DOCX 文档加载器,可以: + +* 加载单个或多个DOCX 文件 +* 支持base64编码的文件和存储中的文件 +* 提取带有元数据的文本内容 +* 与文本分割器集成以进行内容处理 +* 处理自定义元数据管理 + +## 输入 + +* **DOCX 文件**:要处理的 DOCX 文件(需要 .docx 扩展名) +* **文本分割器**(可选):用于处理提取内容的文本分割器 +* **附加元数据**(可选):JSON 对象以及要添加到文档的附加元数据 +* **省略元数据键**(可选):要从默认元数据中省略的以逗号分隔的元数据键列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:所有文档的页面内容的串联字符串 + +## 特点 + +* 多文件处理支持 +* 灵活的文本分割选项 +* 可定制的元数据处理 +* 存储集成支持 +* Base64 和 blob 处理能力 diff --git a/cn/integrations/langchain/document-loaders/epub-file.md b/cn/integrations/langchain/document-loaders/epub-file.md new file mode 100644 index 00000000..d0e30e65 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/epub-file.md @@ -0,0 +1,62 @@ +# EPUB 文件加载器 + +EPUB(电子出版)是国际数字出版论坛 (IDPF) 制定的免费开放电子书标准。此模块提供在工作流程中加载和处理 EPUB 文件的功能。 + +该模块提供了一个复杂的 EPUB 文档加载器,可以: +- 加载单个或多个 EPUB 文件 +- 支持base64编码的文件和存储中的文件 +- 提取每章或每个文件的内容 +- 使用文本分割器处理内容 +- 处理元数据提取 +- 管理临时文件处理 + +## 输入 + +### 必需参数 +- **EPUB 文件**:要处理的 EPUB 文件(需要 .epub 扩展名) +- **用法**:选择: + - 每章一个文档:按章节拆分内容 + - 每个文件一个文档:将整个文件作为一个文档处理 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 多文件处理 +- 章节级别拆分 +- 文件级处理 +- 存储集成 +- 元数据定制 +- 文本分割支持 +- 临时文件处理 +- 错误处理 + +## 处理模式 + +### 每章模式 +- 为每一章创建单独的文档 +- 保持章节结构 +- 保留章节元数据 +- 更好地进行详细分析 + +### 每个文件模式 +- 将整个文件作为一个文档处理 +- 保持整体结构 +- 更简单的文档组织 +- 更适合概览分析 + +## 注释 +- 支持本地和基于存储的文件 +- 处理base64编码内容 +- 自动清理临时文件 +- 保留文档结构 +- 支持自定义元数据添加 +- 无效文件的错误处理 +- 内存高效处理 \ No newline at end of file diff --git a/cn/integrations/langchain/document-loaders/figma.md b/cn/integrations/langchain/document-loaders/figma.md new file mode 100644 index 00000000..558cb284 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/figma.md @@ -0,0 +1,67 @@ +--- +description: 从 Figma 文件加载数据。 +--- + +# Figma 文档加载器 + +

Figma 节点

+ +Figma 是一个用于界面设计的协作网络应用程序。该模块提供加载和处理 Figma 文件内容的功能,包括文本、组件和元数据。 + +该模块提供了一个复杂的 Figma 文档加载器,可以: +- 从特定 Figma 文件加载内容 +- 从选定的节点中提取文本 +- 递归处理内容 +- 使用 Figma API 处理身份验证 +- 使用文本分割器处理内容 +- 自定义元数据提取 + +## 输入 + +### 必需参数 +- **文件密钥**:Figma 文件的唯一标识符(来自文件 URL) +- **节点 ID**:要提取的以逗号分隔的节点标识符列表 +- **连接凭据**:Figma API 凭据(访问令牌) + +### 可选参数 +- **Recursive**:是否递归处理节点 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 基于API的内容提取 +- 节点级内容选择 +- 递归处理 +- 文本分割支持 +- 元数据定制 +- 错误处理 +- 认证管理 + +## 文件密钥格式 +文件密钥可以在 Figma 文件 URL 中找到: +``` +https://www.figma.com/file/:key/:title +``` +示例:在 `https://www.figma.com/file/12345/Website` 中,文件密钥为 `12345` + +## 节点 ID +获取节点 ID: +1.在Figma中安装Node Inspector插件 +2. 选择所需的元素 +3. 从检查器复制节点 ID +4. 使用逗号分隔格式:“0, 1, 2” + +## 注释 +- 需要有效的 Figma 访问令牌 +- 节点 ID 必须对文件有效 +- 支持递归内容提取 +- 可以同时处理多个节点 +- 处理 API 速率限制和错误 +- 保留元数据中的节点层次结构 +- 支持自定义元数据添加 diff --git a/cn/integrations/langchain/document-loaders/file-loader.md b/cn/integrations/langchain/document-loaders/file-loader.md new file mode 100644 index 00000000..7b2f34ad --- /dev/null +++ b/cn/integrations/langchain/document-loaders/file-loader.md @@ -0,0 +1,86 @@ +# 文件 + +
+ +文件加载器是一款多功能文档加载器,支持多种文件格式,包括 TXT、JSON、CSV、DOCX、PDF、Excel、PowerPoint 等。该模块提供了加载和处理各种文件类型的统一接口。 + +该模块提供了一个复杂的文件加载器,可以: + +* 加载多种文件格式 +* 支持base64编码的文件和存储中的文件 +* 处理 PDF 特定的处理选项 +* 使用指针提取处理 JSON 和 JSONL +* 支持文本分割 +* 自定义元数据提取 +* 处理文件存储集成 + +## 输入 + +### 必需参数 + +* **文件**:要处理的文件(支持多种格式) + +### 可选参数 + +* **文本分割器**:处理提取内容的文本分割器 +* **PDF 用法**:选择: + * 每页一个文档 + * 每个文件一个文档 +* **使用旧版本**:使用旧版本解决 PDF 兼容性问题 +* **JSONL 指针提取**:JSONL 文件的指针名称 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 支持的文件类型 + +* 文本文件 (.txt) +* JSON 文件 (.json) +* JSONL 文件 (.jsonl) +* CSV 文件 (.csv) +* PDF 文件 (.pdf) +* Word 文档 (.docx) +* Excel 文件(.xlsx、.xls) +* PowerPoint 文件(.pptx、.ppt) +* 还有更多... + +## 特点 + +* 多格式支持 +* 存储集成 +* PDF 处理选项 +* JSON 指针提取 +* 支持文本分割 +* 元数据定制 +* 错误处理 +* MIME类型检测 + +## 文件处理选项 + +### PDF 处理 + +* 每页分割 +* 单文档模式 +* 旧版构建支持 +* OCR 兼容性 + +### JSON/JSONL 处理 + +* 基于指针的提取 +* 结构化数据处理 +* 数组处理 +* 嵌套对象支持 + +## 注释 + +* 自动检测文件类型 +* 同时处理多个文件 +* 支持文件存储集成 +* 保留文件元数据 +* 高效处理大文件 +* 无效文件的错误处理 +* 内存高效处理 diff --git a/cn/integrations/langchain/document-loaders/firecrawl.md b/cn/integrations/langchain/document-loaders/firecrawl.md new file mode 100644 index 00000000..44420426 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/firecrawl.md @@ -0,0 +1,94 @@ +--- +description: 使用 FireCrawl 从 URL 加载数据。 +--- + +# 火爬行 + +

火爬节点

+ +# FireCrawl 文档加载器 + +[FireCrawl](https://www.firecrawl.dev) 是一种强大的网络爬行和抓取服务,提供从网站提取内容的高级功能。该模块允许通过 FireCrawl API 加载和处理 Web 内容。 + +该模块提供了一个复杂的网络爬虫,可以: +- 抓取单个网页 +- 抓取整个网站 +- 提取结构化数据 +- 处理 JavaScript 渲染的内容 +- 使用文本分割器处理内容 +- 自定义元数据提取 +- 支持多种操作模式 + +## 输入 + +### 必需参数 +- **URL**:要处理的网页或网站 URL +- **连接凭据**:FireCrawl API 凭据 +- **模式**:选择: + - 抓取:单页提取 + - 爬行:多页面网站爬行 + - 提取:结构化数据提取 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **刮擦选项**: + - 包含标签:要包含的 HTML 标签 + - 排除标签:要排除的 HTML 标签 + - 移动:使用移动用户代理 + - 跳过 TLS 验证:绕过 SSL 检查 + - 超时:请求超时 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 多种操作模式 +- 高级抓取选项 +- 结构化数据提取 +- JavaScript 渲染 +- 移动设备模拟 +- 自定义超时设置 +- 错误处理 + +## 操作模式 + +### 抓取模式 +- 单页处理 +- 主要内容提取 +- 格式选择 +- 自定义标签过滤 + +### 爬行模式 +- 多页面抓取 +- 子域处理 +- 站点地图处理 +- 链接提取 + +### 提取模式 +- 结构化数据提取 +- 基于模式的解析 +- LLM-动力提取 +- 自定义提取提示词 + +## 文档结构 +每个文档包含: +- **pageContent**:以 Markdown 格式提取的内容 +- **元数据**: + - 标题:页面标题 + - 描述:元描述 + - 语言:内容语言 + - 来源网址:原始 URL + - 额外的自定义元数据 + +## 注释 +- 需要有效的 [FireCrawl API 密钥](https://www.firecrawl.dev/app/api-keys) +- 支持多种内容格式 +- 处理速率限制 +- 作业状态监控 +- 错误处理和重试 +- 可定制的请求选项 +- 内存高效处理 diff --git a/cn/integrations/langchain/document-loaders/folder.md b/cn/integrations/langchain/document-loaders/folder.md new file mode 100644 index 00000000..c69d37ad --- /dev/null +++ b/cn/integrations/langchain/document-loaders/folder.md @@ -0,0 +1,92 @@ +# 带有文件加载器的文件夹 + +

带有文件节点的文件夹

+ +文件夹加载器提供从目录加载和处理多个文件的功能。该模块支持多种文件格式,并且可以递归处理子目录。 + +该模块提供了一个复杂的文件夹加载器,可以: +- 同时加载多种文件类型 +- 递归处理目录 +- 处理各种文档格式 +- 支持PDF特定处理 +- 处理结构化数据文件 +- 自定义元数据提取 +- 支持文本分割 + +## 输入 + +### 必需参数 +- **文件夹路径**:包含文件的目录的路径 +- **递归**:是否处理子目录 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **PDF 用法**:选择: + - 每页一个文档 + - 每个文件一个文档 +- **JSONL 指针提取**:JSONL 文件的指针名称 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 支持的文件类型 + +### 文件 +- PDF (.pdf) +- Word(.doc、.docx) +- Excel(.xls、.xlsx、.xlsm、.xlsb) +- PowerPoint(.ppt、.pptx) +- 文本(.txt) +- Markdown(.md、.markdown) +- HTML (.html) +- XML (.xml) + +### 数据文件 +- JSON (.json) +- JSONL (.jsonl) +- CSV (.csv) + +### 编程语言 +- Python(.py、.python) +- JavaScript (.js) +- 打字稿(.ts) +- Java (.java) +- C/C++(.c、.cpp、.h) +- C# (.cs) +- 红宝石(.rb、.ruby) +- 去(.go) +- PHP (.php) +- 斯威夫特(.swift) +- 铁锈 (.rs) +- Scala(.scala、.sc) +- 科特林 (.kt) +- 坚固性(.sol) + +### 网络技术 +- CSS (.css) +- SCSS (.scss) +- LESS (.less) +- SQL (.sql) +- 协议缓冲区(.proto) + +## 特点 +- 多格式支持 +- 递归目录处理 +- PDF 处理选项 +- 结构化数据处理 +- 文本分割支持 +- 元数据定制 +- 错误处理 + +## 注释 +- 自动检测文件类型 +- 处理大型目录 +- 保留文件元数据 +- 内存高效处理 +- 支持自定义文件扩展名 +- 无效文件的错误处理 +- 灵活的输出格式 \ No newline at end of file diff --git a/cn/integrations/langchain/document-loaders/gitbook.md b/cn/integrations/langchain/document-loaders/gitbook.md new file mode 100644 index 00000000..7550b720 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/gitbook.md @@ -0,0 +1,77 @@ +--- +description: 从 GitBook 加载数据。 +--- + +# GitBook + +

GitBook 节点

+ +# GitBook 文档加载器 + +GitBook 是一个现代文档平台,可以帮助团队共享知识。该模块提供从 GitBook 文档站点加载和处理内容的功能。 + +该模块提供了一个复杂的 GitBook 文档加载器,可以: +- 从特定的 GitBook 页面加载内容 +- 抓取整个 GitBook 文档站点 +- 提取结构化内容 +- 使用文本分割器处理内容 +- 自定义元数据提取 +- 处理递归页面加载 + +## 输入 + +### 必需参数 +- **Web 路径**:GitBook 页面或根路径的 URL + - 单页:例如 https://docs.gitbook.com/product-tour/navigation + - 根路径:例如 https://docs.gitbook.com/ + +### 可选参数 +- **Should Load All Paths**:是否从根路径递归加载所有页面 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 单页加载 +- 递归站点爬行 +- 内容提取 +- 文本分割支持 +- 元数据定制 +- 错误处理 +- 路径管理 + +## 加载模式 + +### 单页模式 +- 从特定页面加载内容 +- 提取页面内容和元数据 +- 保留页面结构 +- 单页访问速度更快 + +### 所有路径模式 +- 从根目录递归加载所有页面 +- 维护站点层次结构 +- 提取所有可用内容 +- 保留导航结构 + +## 文档结构 +每个文档包含: +- **pageContent**:从页面中提取的内容 +- **元数据**: + - 标题:页面标题 + - url:原始页面URL + - 额外的自定义元数据 + +## 注释 +- 支持单页和全站加载 +- 处理 GitBook 的动态内容 +- 保留文档结构 +- 支持自定义元数据添加 +- 无效 URL 的错误处理 +- 内存高效处理 +- 灵活的输出格式 diff --git a/cn/integrations/langchain/document-loaders/github.md b/cn/integrations/langchain/document-loaders/github.md new file mode 100644 index 00000000..d61b1a43 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/github.md @@ -0,0 +1,82 @@ +--- +description: 从 GitHub 存储库加载数据。 +--- + +# GitHub 文档加载器 + +

Github节点

+ +GitHub 是一个版本控制和协作平台。该模块提供从 GitHub 存储库加载和处理内容的功能,支持公共和私有存储库。 + +该模块提供了一个复杂的 GitHub 文档加载器,可以: +- 从 GitHub 存储库加载内容 +- 支持私有仓库访问 +- 递归处理存储库 +- 处理自定义 GitHub 实例 +- 控制并发和重试 +- 自定义文件过滤 +- 使用文本分割器处理内容 + +## 输入 + +### 必需参数 +- **Repo 链接**:GitHub 存储库 URL(例如 https://github.com/FlowiseAI/Flowise) +- **分支**:从中加载内容的分支(默认:主分支) + +### 可选参数 +- **连接凭据**:GitHub API 凭据(私人存储库需要) +- **递归**:是否处理子目录 +- **最大并发**:并发文件加载的最大数量 +- **Github 库 URL**:用于企业实例的自定义 GitHub 库 URL +- **Github 实例 API**:针对企业实例的自定义 GitHub API URL +- **忽略路径**:要忽略的路径的全局模式数组 +- **最大重试次数**:最大重试次数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 公共/私人回购支持 +- 企业实例支持 +- 递归目录处理 +- 并发控制 +- 重试机制 +- 路径过滤 +- 文本分割支持 +- 元数据定制 + +## 验证方法 + +### 公共存储库 +- 无需身份验证 +- 适用费率限制 +- 仅限于公共内容 + +### 私有存储库 +- 需要 GitHub 访问令牌 +- 更高的速率限制 +- 访问私人内容 +- 企业支持 + +## 文档结构 +每个文档包含: +- **页面内容**:文件内容 +- **元数据**: + - 来源:存储库中的文件路径 + - 分支:存储库分支 + - 提交:提交哈希值 + - 额外的自定义元数据 + +## 注释 +- 支持公共和私人回购 +- 支持企业 GitHub 实例 +- 自动处理速率限制 +- 重试的指数退避 +- 使用全局模式进行路径过滤 +- 内存高效处理 +- 无效存储库的错误处理 diff --git a/cn/integrations/langchain/document-loaders/google-drive.md b/cn/integrations/langchain/document-loaders/google-drive.md new file mode 100644 index 00000000..ae72aa16 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/google-drive.md @@ -0,0 +1,111 @@ +# 谷歌云端硬盘 + +
+ +Google Drive 是一项云存储和文件同步服务。该模块提供从 Google Drive 加载和处理文件的功能,支持各种文件格式和 Google 工作区 文档。 + +该模块提供了一个复杂的 Google Drive 文档加载器,可以: + +* 加载多种文件类型 +* 处理 Google 工作区 文档 +* 处理基于文件夹的加载 +* 支持共享驱动器 +* 递归处理文件 +* 自定义文件类型过滤 +* 处理OAuth2认证 + +### 必需参数 + +* **连接凭据**:Google Drive OAuth2 凭据。请参阅[#Google 云端硬盘](../tools/google-drive.md) +* **选择文件** 或 **文件夹 ID**:选择特定文件或提供文件夹 ID + +### 可选参数 + +* **文件类型**:要加载的文件类型: + * 谷歌文档 + * 谷歌表格 + * 谷歌幻灯片 + * PDF 文件 + * 文本文件 + * Word文档 + * 幻灯片 + * Excel 文件 +* **包括子文件夹**:处理子文件夹中的文件 +* **包括共享驱动器**:从共享驱动器访问文件 +* **最大文件**:要加载的最大文件数(默认值:50) +* **文本分割器**:处理提取内容的文本分割器 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 支持的文件类型 + +### Google 工作区 + +* 谷歌文档(application/vnd.google-apps.document) +* Google 表格 (application/vnd.google-apps.spreadsheet) +* 谷歌幻灯片(application/vnd.google-apps.presentation) + +### 微软办公软件 + +* 字 (.docx) +* Excel (.xlsx) +* PowerPoint (.pptx) + +### 其他格式 + +* PDF (.pdf) +* 文本文件 (.txt) + +## 特点 + +* OAuth2认证 +* 多种文件类型支持 +* 文件夹处理 +* 共享驱动器访问 +* 文件类型过滤 +* 支持文本分割 +* 元数据定制 +* 错误处理 + +## 加载方法 + +### 文件选择模式 + +* 直接选择文件 +* 多文件支持 +* 文件类型过滤 +* 元数据保存 + +### 文件夹模式 + +* 递归文件夹处理 +* 子文件夹支持 +* 文件类型过滤 +* 批处理 + +## 文档结构 + +每个文档包含: + +* **pageContent**:从文件中提取的内容 +* **元数据**: + * fileName: 原始文件名 + * 文件类型:MIME 类型 + * fileId: Google 云端硬盘文件 ID + * 来源:文件路径/URL + * 额外的自定义元数据 + +## 注释 + +* 需要 OAuth2 身份验证 +* 处理速率限制 +* 支持大文件 +* 临时文件管理 +* 内存高效处理 +* 无效文件的错误处理 +* 自动令牌刷新 diff --git a/cn/integrations/langchain/document-loaders/google-sheets.md b/cn/integrations/langchain/document-loaders/google-sheets.md new file mode 100644 index 00000000..aae2a572 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/google-sheets.md @@ -0,0 +1,99 @@ +# 谷歌表格 + +
+ +Google Sheets 是一个基于网络的电子表格应用程序。该模块提供从 Google Sheets 文档加载和处理数据的功能,支持各种数据格式选项和工作表选择。 + +该模块提供了一个复杂的 Google Sheets 文档加载器,可以: + +* 从多个电子表格加载数据 +* 选择特定的表格和范围 +* 处理格式化和未格式化的值 +* 处理公式和计算 +* 自定义标头处理 +* 使用文本分割器处理内容 +* 处理OAuth2认证 + +## 输入 + +### 必需参数 + +* **连接凭据**:Google Sheets OAuth2 凭据。请参阅[#Google 表格](../tools/google-sheets.md) +* **选择电子表格**:从您的 Google 云端硬盘中选择电子表格 + +### 可选参数 + +* **工作表名称**:要加载的工作表名称的逗号分隔列表 +* **范围**:要加载的特定范围(例如,A1:E10) +* **包含标题**:是否包含第一行作为标题(默认值:true) +* **值渲染选项**:值应如何表示: + * 格式化值:如 UI 所示 + * 未格式化的值:原始值 + * 配方:原始配方 +* **文本分割器**:处理提取内容的文本分割器 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 特点 + +* OAuth2认证 +* 多种电子表格支持 +* 板材选择 +* 范围规格 +* 标头处理 +* 值格式选项 +* 支持文本分割 +* 元数据定制 + +## 值渲染选项 + +### 格式化值 + +* UI 中显示的值 +* 包括格式 +* 带小数点的数字/货币 +* 指定格式的日期 + +### 未格式化的值 + +* 原始单元格值 +* 不带格式的数字 +* 日期为序列号 +* 布尔值真/假 + +### 公式 + +* 原创配方 +* 单元格参考 +* 功能 +* 计算 + +## 文档结构 + +每个文档包含: + +* **pageContent**:格式化的工作表内容 +* **元数据**: + *电子表格ID:Google表格ID + * 电子表格名称:文档名称 + *sheetName: 工作表名称 + *范围:选择的范围 + * headers:列标题(如果包含) + *lastModified:最后修改日期 + * url: 网页查看链接 + * 额外的自定义元数据 + +## 注释 + +* 需要 OAuth2 身份验证 +* 处理速率限制 +* 支持大型电子表格 +* 内存高效处理 +* 无效范围的错误处理 +* 自动令牌刷新 +* 实时数据访问 diff --git a/cn/integrations/langchain/document-loaders/jira.md b/cn/integrations/langchain/document-loaders/jira.md new file mode 100644 index 00000000..7943131f --- /dev/null +++ b/cn/integrations/langchain/document-loaders/jira.md @@ -0,0 +1,76 @@ +# Jira 文档加载器 + +
+ +Jira 是一种流行的问题跟踪和项目管理工具。该模块提供从 Jira 项目加载和处理问题的功能,支持各种过滤选项和元数据自定义。 + +该模块提供了一个复杂的 Jira 文档加载器,可以: +- 从 Jira 项目加载问题 +- 按创建日期过滤问题 +- 控制请求的批量大小 +- 使用文本分割器处理内容 +- 自定义元数据提取 +- 处理 API 身份验证 + +## 输入 + +### 必需参数 +- **连接凭据**:Jira API 凭据(用户名和访问令牌) +- **主机**:Jira 实例 URL(例如 https://jira.example.com) +- **项目密钥**:从中加载问题的 Jira 项目的密钥 + +### 可选参数 +- **每个请求限制**:每个 API 请求获取的问题数(默认值:100) +- **创建于**:过滤在特定日期(例如 2024-01-01)之后创建的问题 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- API 令牌认证 +- 基于项目的问题加载 +- 创建日期过滤 +- 批量大小控制 +- 文本分割支持 +- 元数据定制 +- 灵活的输出格式 + +## 身份验证 +装载机需要: +- Jira 用户名 +- API 访问令牌 +- 托管 Jira 实例的 URL + +## 文档结构 +每个文档包含: +- **pageContent**:问题内容和描述 +- **元数据**: + - 特定于问题的元数据(可定制) + - 项目信息 + - 创建日期 + - 问题状态 + - 额外的自定义元数据 + +## 元数据处理 +自定义元数据的两种方法: +1. **附加元数据**:添加新的元数据字段 + - 指定为 JSON 对象 + - 与现有元数据合并 + +2. **省略元数据键**:删除不需要的元数据 + - 以逗号分隔的键列表 + - 使用 * 删除所有默认元数据 + - 支持嵌套键(例如 key1、key2、key3.nestedKey1) + +## 注释 +- 处理 API 速率限制 +- 高效的批处理 +- 内存高效加载 +- API 请求的错误处理 +- 支持云和自托管 Jira +- 实时问题数据访问 diff --git a/cn/integrations/langchain/document-loaders/json-file.md b/cn/integrations/langchain/document-loaders/json-file.md new file mode 100644 index 00000000..31759051 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/json-file.md @@ -0,0 +1,66 @@ +--- +description: 从 JSON 文件加载数据。 +--- + +# Json 文件 + +

Json 文件节点

+ +JSON(JavaScript 对象表示法)是一种轻量级数据交换格式,易于人类阅读和编写,易于机器解析和生成。该模块提供了在工作流程中加载和处理 JSON 文件的高级功能。 + +该模块提供了一个复杂的 JSON 文档加载器,可以: + +* 加载单个或多个JSON 文件 +* 支持base64编码的文件和存储中的文件 +* 使用JSON指针提取特定数据 +* 处理动态元数据提取 +* 处理嵌套的 JSON 结构 + +## 输入 + +* **JSON 文件**:要处理的 JSON 文件(需要 .json 扩展名) +* **文本分割器**(可选):用于处理提取内容的文本分割器 +* **指针提取**(可选):以逗号分隔的 JSON 指针列表,用于提取特定数据 +* **附加元数据**(可选):JSON 对象,用于从文档中动态提取元数据 +* **省略元数据键**(可选):要从默认元数据中省略的以逗号分隔的元数据键列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 特点 + +* 多文件处理支持 +* JSON 基于指针的数据提取 +* 动态元数据映射 +* 嵌套JSON结构处理 +* 存储集成支持 +* Base64 和 blob 处理能力 + +## 用法示例 + +对于 JSON 文档,例如: + +```json +[ + { + "url": "https://www.google.com", + "body": "This is body 1" + }, + { + "url": "https://www.yahoo.com", + "body": "This is body 2" + } +] +``` + +您可以使用以下方法提取特定字段作为元数据: + +```json +{ + "source": "/url" +} +``` + +这会将 URL 值添加为元数据,并为每个文档添加键“source”。 diff --git a/cn/integrations/langchain/document-loaders/jsonlines.md b/cn/integrations/langchain/document-loaders/jsonlines.md new file mode 100644 index 00000000..9e107f3e --- /dev/null +++ b/cn/integrations/langchain/document-loaders/jsonlines.md @@ -0,0 +1,102 @@ +# Json 行文件 + +

Json 行文件节点

+ +JSON 行 (JSONL) 是一种文本格式,其中每行都是有效的 JSON 值。该模块提供加载和处理 JSONL 文件的功能,并支持基于指针的内容提取和动态元数据处理。 + +该模块提供了一个复杂的 JSONL 文档加载器,可以: + +* 加载单个或多个JSONL 文件 +* 使用JSON指针提取特定值 +* 处理动态元数据提取 +* 使用文本分割器处理内容 +* 支持base64编码文件 +* 处理文件存储集成 +* 自定义元数据提取 + +## 输入 + +### 必需参数 + +* **JSONL 文件**:要处理的 JSONL 文件(.jsonl 扩展名) +* **指针提取**:JSON 提取内容的指针(例如,`{"key": "value"}` 的“key”) + +### 可选参数 + +* **文本分割器**:处理提取内容的文本分割器 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 特点 + +* JSON 指针提取 +* 动态元数据处理 +* 支持文本分割 +* Base64文件支持 +* 文件存储集成 +* 错误处理 +* 内存高效处理 + +## JSON 指针提取 + +### 基本示例 + +对于 JSONL 内容: + +```jsonl +{"key": "value1", "source": "file1.txt"} +{"key": "value2", "source": "file2.txt"} +``` + +使用指针“key”,提取:“value1”、“value2” + +### 动态元数据 + +您可以使用 JSON 指针将值提取为元数据: + +```json +{ + "source": "/source", + "custom": "/metadata/field" +} +``` + +## 文档结构 + +每个文档包含: + +* **pageContent**:使用指针提取内容 +* **元数据**: + * source: 原始文件路径 + * line: 文件中的行号 + * 指针:使用JSON指针 + * 额外的动态元数据 + +## 文件处理 + +### 本地文件 + +* 直接文件加载 +* Base64编码的内容 +* 多文件支持 + +### 存储集成 + +* 文件存储系统支持 +* 基于组织的存储 +* 基于Chatflow的存储 + +## 注释 + +* 每 JSONL 行一份文档 +* 无效的 JSON 行被跳过 +* 内存高效处理 +* 无效指针的错误处理 +* 支持嵌套 JSON 结构 +* 动态元数据提取 +* 灵活的输出格式 diff --git a/cn/integrations/langchain/document-loaders/microsoft-excel.md b/cn/integrations/langchain/document-loaders/microsoft-excel.md new file mode 100644 index 00000000..67447e26 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/microsoft-excel.md @@ -0,0 +1,86 @@ +# Microsoft Excel 文档加载器 + +
+ +Microsoft Excel 是一种电子表格程序,具有计算工具、数据透视表和宏编程语言。该模块提供使用 SheetJS 加载和处理 Excel 文件的功能。 + +该模块提供了一个复杂的 Excel 文档加载器,可以: +- 加载多种Excel文件格式 +- 处理多个工作表 +- 将行转换为结构化文档 +- 处理各种数据类型 +- 保留单元格格式 +- 提取每行元数据 +- 支持类型推断 + +## 输入 + +### 必需参数 +- **Excel 文件**:要处理的 Excel 文件(.xls、.xlsx、.xlsm、.xlsb) + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 多种格式支持 +- 多张加工 +- 数据类型保存 +- 元数据提取 +- 类型推断 +- 错误处理 +- 内存高效处理 + +## 支持的格式 +- Excel 二进制 (.xls) +- Excel 工作簿 (.xlsx) +- Excel 宏启用 (.xlsm) +- Excel 二进制工作簿 (.xlsb) + +## 数据类型处理 + +### 支持的类型 +- 文本(字符串) +- 数字(数字) +- 日期(日期) +- 布尔值(布尔值) +- 公式(计算值) +- 空单元格(空) + +## 文档结构 +每个文档包含: +- **pageContent**:将行内容格式化为键值对 +- **元数据**: + - 工作表:工作表名称 + - rowNum:行索引 + - 原始列值 + - 额外的自定义元数据 + +## 行处理 +每行都转换为一个文档: +- 每个单元格的键值对 +- 保留的列标题 +- 类型信息 +- 行位置 + +## 元数据属性 +默认属性包括: +- 工作表:工作表或工作表名称(字符串) +- rowNum:行索引(数字) +- 基于列标题的动态属性 + +## 注释 +- 使用SheetJS进行解析 +- 保留数据类型 +- 处理多张纸 +- 推断列类型 +- 内存高效处理 +- 无效文件的错误处理 +- 灵活的输出格式 +- 列类型推断 diff --git a/cn/integrations/langchain/document-loaders/microsoft-powerpoint.md b/cn/integrations/langchain/document-loaders/microsoft-powerpoint.md new file mode 100644 index 00000000..18179825 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/microsoft-powerpoint.md @@ -0,0 +1,84 @@ +# Microsoft PowerPoint 文档加载器 + +
+ +Microsoft PowerPoint 是一个用于创建和显示幻灯片的演示程序。该模块提供使用 officeparser 加载和处理 PowerPoint 文件的功能。 + +该模块提供了一个复杂的 PowerPoint 文档加载器,可以: +- 加载 PowerPoint 演示文稿 +- 从幻灯片中提取文本 +- 将内容分割成单独的幻灯片 +- 处理幻灯片编号 +- 处理每张幻灯片的元数据 +- 支持多种幻灯片格式 +- 处理各种载玻片分离器 + +## 输入 + +### 必需参数 +- **PowerPoint 文件**:要处理的 PowerPoint 文件(.ppt、.pptx) + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 文本提取 +- 幻灯片分离 +- 元数据处理 +- 错误处理 +- 内存高效处理 +- 启发式幻灯片检测 +- 内容过滤 + +## 载玻片检测方法 + +### 模式识别 +加载程序尝试使用常见模式识别幻灯片: +- “幻灯片 X”标记 +- “第 X 页”标记 +- “X/Y”页码 +- 下划线分隔符 +- 破折号分隔符 +- 多个换行符 + +### 后备机制 +如果模式识别失败: +1. 用双换行符分割 +2. 将内容视为单张幻灯片 + +## 文档结构 +每个文档包含: +- **pageContent**:从幻灯片中提取的文本内容 +- **元数据**: + - SlideNumber:连续幻灯片编号 + - 文档类型:“powerpoint” + - 额外的自定义元数据 + +## 内容处理 +- 空幻灯片被过滤掉 +- 删除了前导/尾随空格 +- 最小内容长度验证 +- 合理的载玻片计数验证 + +## 元数据属性 +默认属性包括: +- SlideNumber:幻灯片编号(编号) +- documentType:文档类型(字符串) +- 来自输入的自定义元数据 + +## 注释 +- 使用officeparser进行提取 +- 处理各种幻灯片格式 +- 智能滑动检测 +- 内容验证 +- 内存高效处理 +- 无效文件的错误处理 +- 灵活的输出格式 +- 强大的后备机制 diff --git a/cn/integrations/langchain/document-loaders/microsoft-word.md b/cn/integrations/langchain/document-loaders/microsoft-word.md new file mode 100644 index 00000000..eb3b0a45 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/microsoft-word.md @@ -0,0 +1,86 @@ +# Microsoft Word 文档加载器 + +
+ +Microsoft Word 是一款用于创建和编辑文本文档的文字处理软件。该模块提供使用officeparser加载和处理Word文档的功能。 + +该模块提供了一个复杂的 Word 文档加载器,可以: +- 加载Word文档 +- 提取文本内容 +- 将内容分成几个部分 +- 处理页码 +- 处理每个部分的元数据 +- 支持多种节格式 +- 处理各种部分分隔符 + +## 输入 + +### 必需参数 +- **Word 文件**:要处理的 Word 文件(.doc、.docx) + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 文本提取 +- 部分分离 +- 元数据处理 +- 错误处理 +- 内存高效处理 +- 启发式部分检测 +- 内容过滤 + +## 切片检测方法 + +### 模式识别 +加载器尝试使用常见模式来识别部分: +- “第 X 页”标记 +- “X 部分”标记 +- “第十章”标记 +- 编号部分(例如“1.”、“2.”) +- ALL CAPS 标题 +- 长下划线分隔符 +- 长破折号分隔符 + +### 后备机制 +如果模式识别失败: +1.由多个换行符分割 +2. 用双换行符分割 +3. 将内容视为单个部分 + +## 文档结构 +每个文档包含: +- **pageContent**:从该部分中提取的文本内容 +- **元数据**: + - 文档类型:“word” + - pageNumber:连续节号 + - 额外的自定义元数据 + +## 内容处理 +- 空部分被过滤掉 +- 删除了前导/尾随空格 +- 最小内容长度验证 +- 合理的节数验证 + +## 元数据属性 +默认属性包括: +- documentType:文档类型(字符串) +- pageCount:页数/节数(数量) +- 来自输入的自定义元数据 + +## 注释 +- 使用officeparser进行提取 +- 处理各种文档格式 +- 智能断面检测 +- 内容验证 +- 内存高效处理 +- 无效文件的错误处理 +- 灵活的输出格式 +- 强大的后备机制 diff --git a/cn/integrations/langchain/document-loaders/notion.md b/cn/integrations/langchain/document-loaders/notion.md new file mode 100644 index 00000000..212dc2b0 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/notion.md @@ -0,0 +1,116 @@ +# 概念 + +Notion 是一个结合了笔记、知识管理和项目管理的协作平台。该模块提供了三种不同的加载器来处理Notion内容:数据库、页面和文件夹加载器。 + +## 概念数据库加载器 + +

概念数据库节点

+ +数据库加载器从概念数据库中提取内容,将每一行视为一个单独的文档。 + +### 特点 + +* 将数据库行加载为文档 +* 提取属性作为元数据 +* 支持属性标头 +* 处理并发加载 +* 使用文本分割器处理内容 +* 自定义元数据提取 + +### 必需参数 + +* **连接凭据**:概念 API 凭据 +* **Database Id**:Notion数据库的唯一标识符 + +## 概念页面加载器 + +

概念页面节点

+ +页面加载器从 Notion 页面中提取内容,包括所有子页面作为单独的文档。 + +### 特点 + +* 将页面内容加载为文档 +* 递归处理子页面 +* 提取页面属性 +* 处理页面层次结构 +* 支持文本分割 +* 自定义元数据提取 + +### 必需参数 + +* **连接凭据**:概念 API 凭据 +* **页面 ID**:页面 URL 中的 32 个字符的十六进制标识符 + +## 概念文件夹加载器 + +

概念文件夹节点

+ +文件夹加载器处理从本地文件夹导出和解压缩的 Notion 内容。 + +### 特点 + +* 处理导出的Notion内容 +* 处理多个页面 +* 支持本地文件系统 +* 提取页面内容 +* 维护文档结构 +* 支持文本分割 +* 自定义元数据提取 + +### 必需参数 + +* **Notion 文件夹**:导出并解压的 Notion 文件夹的路径 + +## 共同特点 + +所有 Notion 加载器都支持: + +### 可选参数 + +* **文本分割器**:处理提取内容的文本分割器 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +### 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 身份验证 + +### API 身份验证(数据库和页面加载器) + +* 需要 Notion 集成代币 +* API 自动处理速率限制 +* 支持工作区级别访问 +* 安全凭据管理 + +### 本地访问(文件夹加载器) + +* 无需身份验证 +* 直接文件系统访问 +* 处理离线内容 +* 处理导出的数据 + +## 文档结构 + +每个文档包含: + +* **pageContent**:提取的文本内容 +* **元数据**: + * 来源:原始来源(URL 或文件路径) + * title: 页面或数据库标题 + * 属性:概念属性 + * 额外的自定义元数据 + +## 注释 + +* API 加载器需要 Notion 集成设置 +* 文件夹加载器需要导出内容 +* 自动处理速率限制 +* 内存高效处理 +* 无效输入的错误处理 +* 支持大型数据集 +* 灵活的输出格式 +* 元数据定制 diff --git a/cn/integrations/langchain/document-loaders/oxylabs.md b/cn/integrations/langchain/document-loaders/oxylabs.md new file mode 100644 index 00000000..019b0f4f --- /dev/null +++ b/cn/integrations/langchain/document-loaders/oxylabs.md @@ -0,0 +1,42 @@ +--- +description: 使用 Oxylabs 从任何网站获取数据。 +--- + +# Oxylabs 文档加载器 + +Oxylabs 是一项网络抓取服务,可大规模检索公共网络数据,并提供旨在克服区域限制的工具。 + +

Oxylabs 文档加载器节点

+ + +### 特点 +- 从 Google、Amazon 和任何其他网站检索数据 +- 设置地理位置 +- 利用浏览器渲染 +- 解析数据 +- 指定用户代理类型 +- 使用文本分割器处理内容 + +### 必需参数 +- **连接凭据**:Oxylabs API 凭据 +- **查询**:搜索查询或 URL +- **来源**:可用来源之一: + - 通用 - 抓取任何网站 + - Google 搜索 - 抓取 Google 搜索结果 + - 亚马逊产品 - 抓取亚马逊产品信息 + - 亚马逊搜索 - 抓取亚马逊搜索结果 + +### 可选参数 +- **地理位置**:设置代理的地理位置以检索数据。有关更多详细信息,请参阅[文档](https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiwDdoZGfMbUe5cRL2417%2Fuploads%2FxoQb19qSyodB2D4no0DZ%2FList%20of%20supported%20geo_location%20values_sapi.json?alt=media&token=d2e2df7b-10ba-4399-a547-0c4a99e62293)。 +- **渲染**:设置为 true 时启用 JavaScript 渲染。 +- **解析**:设置为 true 时返回解析数据,只要提交的 URL 页面类型存在专用解析器。 +- **用户代理类型**:设备类型和浏览器。 + +### 输出 +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + + +## 文档结构 +每个文档包含: +- **pageContent**:提取的页面内容 diff --git a/cn/integrations/langchain/document-loaders/pdf-file.md b/cn/integrations/langchain/document-loaders/pdf-file.md new file mode 100644 index 00000000..c8e0c386 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/pdf-file.md @@ -0,0 +1,85 @@ +# PDF 文档加载器 + +PDF(便携式文档格式)是 Adob​​e 开发的一种文件格式,用于跨软件平台一致地呈现文档。该模块提供使用 pdf.js 加载和处理 PDF 文件的功能。 + +该模块提供了一个复杂的 PDF 文档加载器,可以: +- 加载单个或多个 PDF 文件 +- 按页面或文件拆分文档 +- 支持base64编码文件 +- 处理文件存储集成 +- 使用文本分割器处理内容 +- 支持旧版 PDF 版本 +- 自定义元数据提取 + +## 输入 + +### 必需参数 +- **PDF 文件**:要处理的 PDF 文件(.pdf 扩展名) +- **用法**:选择: + - 每页一个文档 + - 每个文件一个文档 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **使用旧版构建**:是否使用旧版 PDF.js 构建 +- **附加元数据**:带有附加元数据的 JSON 对象 +- **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 多文件支持 +- 页面级拆分 +- 旧版本支持 +- 文本提取 +- 元数据处理 +- 错误处理 +- 内存高效处理 + +## 处理模式 + +### 每页模式 +- 每一页都成为一个文档 +- 保留页码 +- 单个页面元数据 +- 精细的内容访问 + +### 每个文件模式 +- 整个 PDF 作为一个文档 +- 组合内容 +- 单一元数据集 +- 内存高效 + +## 文档结构 +每个文档包含: +- **pageContent**:提取的文本内容 +- **元数据**: + - source:原始文件路径 + - pdf:PDF 特定元数据 + - page:页码(在每页模式下) + - 额外的自定义元数据 + +## 文件处理 + +### 本地文件 +- 直接文件加载 +- Base64编码的内容 +- 多文件支持 + +### 存储集成 +- 文件存储系统支持 +- 基于组织的存储 +- 基于聊天流的存储 + +## 注释 +- 使用pdf.js进行提取 +- 旧版本支持 +- 内存高效处理 +- 无效文件的错误处理 +- 支持大型 PDF +- 灵活的输出格式 +- 元数据定制 +- 文本编码处理 diff --git a/cn/integrations/langchain/document-loaders/plain-text.md b/cn/integrations/langchain/document-loaders/plain-text.md new file mode 100644 index 00000000..7163d221 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/plain-text.md @@ -0,0 +1,95 @@ +# 纯文本 + +

纯文本节点

+ +纯文本是文本数据的最基本形式,不包含格式或其他嵌入信息。该模块提供直接加载和处理纯文本内容的功能。 + +该模块提供了一个简单的文本文档加载器,可以: + +* 直接加载文本内容 +* 使用分割器处理文本 +* 添加自定义元数据 +* 处理转义字符 +* 支持文档分割 +* 自定义元数据提取 +* 管理文本编码 + +## 输入 + +### 必需参数 + +* **Text**:要处理的纯文本内容 + +### 可选参数 + +* **文本分割器**:处理内容的文本分割器 +* **附加元数据**:带有附加元数据的 JSON 对象 +* **省略元数据键**:要省略的元数据键的逗号分隔列表 + +## 输出 + +* **Document**:包含元数据和页面内容的文档对象数组 +* **文本**:来自文档页面内容的串联字符串 + +## 特点 + +* 直接文本输入 +* 支持文本分割 +* 元数据处理 +* 错误处理 +* 内存高效处理 +* 字符编码处理 +* 灵活的输出格式 + +## 文本处理 + +### 直接模式 + +* 单一文档创建 +* 保留原始文本 +* 基本元数据处理 +* 内存高效 + +### 分割模式 + +* 多文档创建 +* 自定义拆分规则 +* 单独的块元数据 +* 精细的内容访问 + +## 文档结构 + +每个文档包含: + +* **pageContent**:原始或分割文本内容 +* **元数据**: + * 来自输入的自定义元数据 + * 特定于分割的元数据(使用分割器时) + * 附加元数据属性 + +## 内容处理 + +### 文本输入 + +* 直接字符串输入 +* 多行支持 +* 统一码支持 +* 转义字符处理 + +### 处理选项 + +* 文本分割 +* 元数据添加 +* 字符标准化 +* 空白处理 + +## 注释 + +* 简单高效 +* 无需处理文件 +* 内存高效处理 +* 无效输入的错误处理 +* 支持大文本 +* 灵活的输出格式 +* 元数据定制 +* 字符编码支持 diff --git a/cn/integrations/langchain/document-loaders/playwright-web-scraper.md b/cn/integrations/langchain/document-loaders/playwright-web-scraper.md new file mode 100644 index 00000000..e33e2bcc --- /dev/null +++ b/cn/integrations/langchain/document-loaders/playwright-web-scraper.md @@ -0,0 +1,65 @@ +# 剧作家网络爬虫 + +Playwright 是一个强大的浏览器自动化库,可以使用单个 API 控制 Chromium、Firefox 和 WebKit。该模块提供高级网页抓取功能,使用 Playwright 从网页中提取内容,包括需要 JavaScript 执行的动态内容。 + +该模块提供了一个复杂的网络抓取工具,可以: +- 从单个或多个网页加载内容 +- 处理 JavaScript 渲染的内容 +- 支持多种页面加载策略 +- 等待特定元素加载 +- 从网站抓取相关链接 +- 处理 XML 站点地图 + +## 输入 + +- **URL**:要抓取的网页 URL +- **文本分割器**(可选):用于处理提取内容的文本分割器 +- **获取相对链接方法**(可选):选择: + - 网页抓取:从 HTML URL 抓取相关链接 + - 抓取 XML 站点地图:从 XML 站点地图 URL 抓取相关链接 +- **获取相对链接限制**(可选):要处理的相对链接数量限制(默认值:10,所有链接为 0) +- **等待**(可选):页面加载策略: + - 加载:等待加载事件触发 + - DOM 内容已加载:等待 DOMContentLoaded 事件 + - 网络空闲:等待 500 毫秒无网络连接 + - 提交:等待初始网络响应和文档加载 +- **等待选择器加载**(可选):CSS 选择器在抓取之前等待 +- **附加元数据**(可选):JSON 对象以及要添加到文档的附加元数据 +- **省略元数据键**(可选):要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- 多浏览器引擎支持(Chromium、Firefox、WebKit) +- JavaScript 执行支持 +- 可配置的页面加载策略 +- 元素等待功能 +- 网页抓取功能 +- XML 站点地图处理 +- 无头浏览器操作 +- 沙箱配置 +- 无效 URL 的错误处理 +- 元数据定制 + +## 注释 +- 默认情况下以无头模式运行 +- 使用无沙箱模式来实现兼容性 +- 无效的 URL 将引发错误 +- 将链接限制设置为 0 将检索所有可用链接(可能需要更长时间) +- 支持在提取之前等待特定的 DOM 元素 + +## 刮一粒 URL + +1. _(可选)_ 连接 **[文本分割器](../text-splitters/)**。 +2. 输入需要抓取的URL。 + +## 爬行和抓取多个 URL +请访问 **[网络抓取](../../use-cases/web-crawl.md)** 指南以允许抓取多个页面。 + +## 资源 + +* [LangChain JS 编剧](https://js.langchain.com/docs/integrations/document_loaders/web_loaders/web_playwright) +* [编剧](https://playwright.dev/) diff --git a/cn/integrations/langchain/document-loaders/puppeteer-web-scraper.md b/cn/integrations/langchain/document-loaders/puppeteer-web-scraper.md new file mode 100644 index 00000000..7ef78103 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/puppeteer-web-scraper.md @@ -0,0 +1,68 @@ +# Puppeteer 网页抓取工具 + +Puppeteer 是一个 Node.js 库,它提供高级 API 来通过 DevTools 协议控制 Chrome/Chromium。该模块提供高级网页抓取功能,使用 Puppeteer 从网页中提取内容,包括需要 JavaScript 执行的动态内容。 + +该模块提供了一个复杂的网络抓取工具,可以: +- 从单个或多个网页加载内容 +- 处理 JavaScript 渲染的内容 +- 支持多种页面加载策略 +- 等待特定元素加载 +- 从网站抓取相关链接 +- 处理 XML 站点地图 + +## 输入 + +- **URL**:要抓取的网页 URL +- **文本分割器**(可选):用于处理提取内容的文本分割器 +- **获取相对链接方法**(可选):选择: + - 网页抓取:从 HTML URL 抓取相关链接 + - 抓取 XML 站点地图:从 XML 站点地图 URL 抓取相关链接 +- **获取相对链接限制**(可选):要处理的相对链接数量限制(默认值:10,所有链接为 0) +- **等待**(可选):页面加载策略: + - 加载:加载初始 HTML 文档的 DOM 时 + - DOM 内容已加载:加载完成 HTML 文档的 DOM 后 + - 网络空闲 0:500 毫秒无网络连接 + - 网络空闲 2:500 毫秒内网络连接不超过 2 个 +- **等待选择器加载**(可选):CSS 选择器在抓取之前等待 +- **附加元数据**(可选):JSON 对象以及要添加到文档的附加元数据 +- **省略元数据键**(可选):要省略的元数据键的逗号分隔列表 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- JavaScript 执行支持 +- 可配置的页面加载策略 +- 元素等待功能 +- 网页抓取功能 +- XML 站点地图处理 +- 无头浏览器操作 +- 沙箱配置 +- 无效 URL 的错误处理 +- 元数据定制 + +## 注释 +- 默认情况下以无头模式运行 +- 使用无沙箱模式来实现兼容性 +- 无效的 URL 将引发错误 +- 将链接限制设置为 0 将检索所有可用链接(可能需要更长时间) +- 支持在提取之前等待特定的 DOM 元素 + +## 刮一粒 URL + +1. _(可选)_ 连接 **[文本分割器](../text-splitters/)**。 +2. 输入需要抓取的URL。 + +## 爬行和抓取多个 URL +请访问 **[网络抓取](../../use-cases/web-crawl.md)** 指南以允许抓取多个页面。 + +## 输出 + +将 URL 内容加载为文档 + +## 资源 + +* [LangChain JS Puppeteer](https://js.langchain.com/docs/integrations/document_loaders/web_loaders/web_puppeteer) +* [木偶师](https://pptr.dev/) diff --git a/cn/integrations/langchain/document-loaders/s3-file-loader.md b/cn/integrations/langchain/document-loaders/s3-file-loader.md new file mode 100644 index 00000000..c7bac60c --- /dev/null +++ b/cn/integrations/langchain/document-loaders/s3-file-loader.md @@ -0,0 +1,94 @@ +# S3 文件加载器 + +Amazon S3(简单存储服务)是一种对象存储服务,提供业界领先的可扩展性、数据可用性、安全性和性能。该模块提供了加载和处理存储在 S3 存储桶中的文件的全面功能。 + +该模块提供了一个复杂的 S3 文档加载器,可以: +- 使用 AWS 凭据从 S3 存储桶加载文件 +- 支持多种文件格式(PDF、DOCX、CSV、Excel、PowerPoint、文本文件) +- 使用内置加载器或 Unstructed.io API 处理文件 +- 处理文本和二进制文件 +- 自定义元数据提取 + +## 输入 + +### 必需参数 +- **Bucket**:S3 存储桶的名称 +- **对象密钥**:S3存储桶中对象的唯一标识符 +- **Region**:桶所在的AWS区域(默认:us-east-1) + +### 处理选项 +- **文件处理方法**:选择: + - 内置加载器:使用本机文件格式处理器 + - 非结构化:使用 Unstructed.io API 进行高级处理 +- **文本分割器**(可选):用于内置处理的文本分割器 +- **附加元数据**(可选):带有附加元数据的 JSON 对象 +- **省略元数据键**(可选):要从元数据中省略的键 + +### 非结构化.io 选项 +- **非结构化 API URL**:Unstructed.io API 的端点 +- **非结构化 API KEY** (可选):API 用于身份验证的密钥 +- **策略**:处理策略(hi_res、fast、ocr_only、auto) +- **Encoding**:文本编码方式(默认:utf-8) +- **跳过推断表类型**:跳过表提取的文档类型 + +## 输出 + +- **Document**:包含元数据和页面内容的文档对象数组 +- **文本**:来自文档页面内容的串联字符串 + +## 特点 +- AWS S3 集成 +- 多种文件格式支持 +- 内置和非结构化.io 处理 +- 可配置的 AWS 区域 +- 灵活的元数据处理 +- 二进制文件处理 +- 临时文件管理 +- MIME 类型检测 + +## 支持的文件类型 +- PDF 文件 +- Microsoft Word (DOCX) +- 微软Excel +- 微软PowerPoint +- CSV 文件 +- 文本文件 +- 以及更多来自 Unstructed.io 的信息 + +## 注释 +- 需要 AWS 凭据(如果使用 IAM 角色,则可选) +- 某些文件类型可能需要特定的处理方法 +- Unstructed.io API 需要单独的设置和凭据 +- 自动创建和管理临时文件 +- 对不支持的文件类型的错误处理 + +## 非结构化设置 + +您可以使用托管的 API 或通过 Docker 在本地运行。 + +* [托管 API](https://unstructured-io.github.io/unstructured/api.html) +* 码头工人:`docker run -p 8000:8000 -d --rm --name unstructured-api quay.io/unstructured-io/unstructured-api:latest --port 8000 --host 0.0.0.0` + +## S3 文件加载器设置 + +1\.将 S3 文件加载器拖放到画布上: + +
+ +2\. AWS 凭据:为您的 AWS 帐户创建新凭据。您将需要访问权限和密钥。请记住向关联帐户授予 s3 存储桶策略。您可以在[此处](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Integrating.Authorizing.IAM.S3CreatePolicy.html)参阅政策指南。 + +
+ +3. Bucket:登录 AWS 控制台并导航到 S3。获取您的存储桶名称: + +
+ +4. Key:点击您想要使用的对象,并获取Key名称: + +
+ +5. 非结构化 API URL:根据您使用非结构化的方式(无论是通过托管 API 还是通过 Docker),更改非结构化 API URL 参数。如果您使用托管 API,则还需要 API 密钥。 +6. 然后,您可以开始与 S3 中的文件聊天。您不必指定文本分割器来对文档进行分块,因为这是由 Unstructed 自动处理的。 + +
+ diff --git a/cn/integrations/langchain/document-loaders/searchapi-for-web-search.md b/cn/integrations/langchain/document-loaders/searchapi-for-web-search.md new file mode 100644 index 00000000..d8ca291c --- /dev/null +++ b/cn/integrations/langchain/document-loaders/searchapi-for-web-search.md @@ -0,0 +1,88 @@ +--- +description: 从实时搜索结果加载数据。 +--- + +# 用于网页搜索的 SearchApi + +

用于网页搜索的 SearchApi

+ +用于 Web 搜索的 SearchApi 加载程序使用 SearchApi 服务提供对来自多个搜索引擎的实时搜索结果的访问。此加载程序使您能够获取、处理和构建搜索结果作为可在工作流程中使用的文档。 + +## 特点 + +* 多个搜索引擎的实时搜索结果 +* 可自定义搜索参数 +* 文本分割功能 +* 灵活的元数据处理 +* 多种输出格式 +* API 密钥认证 + +## 输入 + +### 必需参数 + +* **连接凭据**:SearchApi API 密钥凭据 +* 至少其中一项: + * **查询**:搜索查询字符串 + * **自定义参数**:带有搜索参数的 JSON 对象 + +### 可选参数 + +* **查询**:要执行的搜索查询(如果不使用自定义参数) +* **自定义参数**:带有附加搜索参数的 JSON 对象 + * 支持 [SearchApi 文档](https://www.searchapi.io/docs/google) 中的所有参数 + * 可以覆盖默认设置 + * 允许特定于发动机的配置 +* **文本分割器**:处理提取内容的文本分割器 +* **附加元数据**:JSON 对象以及要添加到文档的附加元数据 +* **省略元数据键**:要排除的元数据键的逗号分隔列表 + * 格式:`key1, key2, key3.nestedKey1` + * 使用 \* 删除所有默认元数据 + +## 输出 + +* **文档**:文档对象数组,包含: + * 元数据:搜索结果元数据 + * pageContent: 搜索结果内容 +* **文本**:所有搜索结果内容的串联字符串 + +## 文档结构 + +每个文档包含: + +* **pageContent**:搜索结果的主要内容 +* **元数据**: + * 默认搜索结果元数据 + * 自定义元数据(如果指定) + * 过滤元数据(基于省略的键) + +## 元数据处理 + +自定义元数据的两种方法: + +1. **附加元数据** + * 通过 JSON 添加新的元数据字段 + * 与现有元数据合并 + * 对于添加自定义跟踪或分类很有用 +2. **省略元数据键** + * 删除不需要的元数据字段 + * 以逗号分隔的要排除的键列表 + * 支持嵌套键删除 + * 使用 \* 删除所有默认元数据 + +## 使用提示词 + +* 提供特定的搜索查询以获得更好的结果 +* 使用自定义参数进行高级搜索配置 +* 考虑对大型搜索结果使用文本分割器 +* 管理元数据以保留相关信息 +* 通过适当的查询间隔处理速率限制 + +## 注释 + +* 需要 SearchApi API 密钥 +* 遵守 API 速率限制 +* 支持多种搜索引擎 +* 实时搜索结果 +* 内存高效处理 +* API 请求的错误处理 diff --git a/cn/integrations/langchain/document-loaders/serpapi-for-web-search.md b/cn/integrations/langchain/document-loaders/serpapi-for-web-search.md new file mode 100644 index 00000000..ef38b5d3 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/serpapi-for-web-search.md @@ -0,0 +1,89 @@ +--- +description: 加载并处理网络搜索结果中的数据。 +--- + +# 用于网页搜索的 SerpApi + +

用于 Web 搜索节点的 SerpApi

+ +用于 Web 搜索的 SerpApi 加载程序使您能够使用 SerpApi 服务获取和处理 Web 搜索结果。该加载程序将搜索结果转换为结构化文档,可以轻松集成到您的工作流程中,使其成为需要实时网络搜索数据的应用程序的理想选择。 + +## 特点 +- 实时网络搜索结果 +- 文本分割功能 +- 可定制的元数据处理 +- 多种输出格式 +- API 密钥认证 +- 高效的文档处理 + +## 输入 + +### 必需参数 +- **连接凭据**:SerpApi API 密钥凭据 +- **查询**:要执行的搜索查询 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:JSON 对象以及要添加到文档的附加元数据 +- **省略元数据键**:要排除的元数据键的逗号分隔列表 + - 格式:`key1, key2, key3.nestedKey1` + - 使用 * 删除除自定义元数据之外的所有默认元数据 + +## 输出 + +- **文档**:文档对象数组,包含: + - 元数据:搜索结果元数据 + - pageContent:搜索结果内容 +- **文本**:所有搜索结果内容的串联字符串 + +## 文档结构 +每个文档包含: +- **pageContent**:搜索结果的主要内容 +- **元数据**: + - 默认搜索结果元数据 + - 自定义元数据(如果指定) + - 过滤元数据(基于省略的键) + +## 元数据处理 +自定义元数据的两种方法: +1. **附加元数据** + - 通过 JSON 添加新的元数据字段 + - 与现有元数据合并 + - 对于添加自定义跟踪或分类很有用 + +2. **省略元数据键** + - 删除不需要的元数据字段 + - 要排除的以逗号分隔的键列表 + - 支持嵌套键删除 + - 使用 * 删除所有默认元数据 + +## 使用提示词 +- 提供特定的搜索查询以获得更好的结果 +- 使用文本分割器获得大量搜索结果 +- 自定义元数据以满足您的需求 +- 进行多个查询时考虑速率限制 +- 根据大小适当处理搜索结果 + +## 注释 +- 需要 SerpApi API 密钥 +- 遵守 API 速率限制 +- 实时搜索结果 +- 内存高效处理 +- API 请求的错误处理 +- 支持文档和文本输出格式 + +## 用法示例 +```typescript +// Example search query +query: "artificial intelligence latest developments" + +// Example additional metadata +metadata: { + "source": "serpapi", + "category": "tech", + "timestamp": "2024-03-21" +} + +// Example metadata keys to omit +omitMetadataKeys: "snippet, position, link" +``` diff --git a/cn/integrations/langchain/document-loaders/spider-web-scraper-crawler.md b/cn/integrations/langchain/document-loaders/spider-web-scraper-crawler.md new file mode 100644 index 00000000..fb27ee9c --- /dev/null +++ b/cn/integrations/langchain/document-loaders/spider-web-scraper-crawler.md @@ -0,0 +1,100 @@ +--- +description: 使用 Spider 抓取和爬网 - 最快的开源网络抓取器和爬虫。 +--- + +# 蜘蛛网抓取器/爬行器 + +
Spider Node

蜘蛛网爬虫/爬虫节点

+ +[Spider](https://spider.cloud/?ref=flowise) 是最快的开源网络抓取工具和爬行程序,可返回 LLM 就绪数据。要开始使用此节点,您需要来自 [Spider.cloud](https://spider.cloud/?ref=flowise) 的 API 密钥。 + +## 开始使用 + +1. 访问 [Spider.cloud](https://spider.cloud/?ref=flowise) 网站并注册免费帐户。 +2. 然后转到 [API 密钥](https://spider.cloud/api-keys) 并创建新的 API 密钥。 +3. 复制 API 密钥并将其粘贴到 Spider 节点的“Credential”字段中。 + +## 特点 +- 两种操作模式:抓取和爬行 +- 文本分割功能 +- 可定制的元数据处理 +- 灵活的参数配置 +- 多种输出格式 +- Markdown 格式的内容 +- 速率限制处理 + +## 输入 + +### 必需参数 +- **模式**:选择: + - **Scrape**:从单个页面提取数据 + - **抓取**:从同一域内的多个页面提取数据 +- **网页 URL**:要抓取或爬行的目标 URL(例如 https://spider.cloud) +- **凭据**:Spider API 密钥 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **限制**:抓取的最大页面数(默认:25,仅适用于抓取模式) +- **附加元数据**:JSON 对象以及要添加到文档的附加元数据 +- **其他参数**:JSON 对象,带有 [Spider API 参数](https://spider.cloud/docs/api) + - 示例:`{ "anti_bot": true }` + - 注意:`return_format` 始终设置为“markdown” +- **省略元数据键**:要排除的元数据键的逗号分隔列表 + - 格式:`key1, key2, key3.nestedKey1` + - 使用 * 删除所有默认元数据 + +## 输出 + +- **文档**:文档对象数组,包含: + - 元数据:页面元数据和自定义字段 + - pageContent:以markdown格式提取的内容 +- **文本**:所有提取内容的串联字符串 + +## 文档结构 +每个文档包含: +- **pageContent**:markdown格式的网页主要内容 +- **元数据**: + - 来源:页面的 URL + - 其他自定义元数据(如果指定) + - 过滤元数据(基于省略的键) + +## 用法示例 + +### 基本抓取 +```json +{ + "mode": "scrape", + "url": "https://example.com", + "limit": 1 +} +``` + +### 高级爬行 +```json +{ + "mode": "crawl", + "url": "https://example.com", + "limit": 25, + "additional_metadata": { + "category": "blog", + "source_type": "web" + }, + "params": { + "anti_bot": true, + "wait_for": ".content-loaded" + } +} +``` + +## 示例 + +
Example on using spider node

使用Spider节点的示例

+ +## 注释 +- 爬虫遵守爬行操作的指定限制 +- 所有内容均以markdown格式返回 +- 错误处理是针对抓取和爬行操作的内置错误处理 +- 无效的 JSON 配置得到妥善处理 +- 大型网站的内存高效处理 +- 支持单页和多页提取 +- 自动元数据处理和过滤 diff --git a/cn/integrations/langchain/document-loaders/text-file.md b/cn/integrations/langchain/document-loaders/text-file.md new file mode 100644 index 00000000..d141a1b4 --- /dev/null +++ b/cn/integrations/langchain/document-loaders/text-file.md @@ -0,0 +1,121 @@ +--- +description: 从文本文件加载数据。 +--- + +# 文本文件 + +

文本文件节点

+ +文本文件加载器使您能够加载和处理各种基于文本的文件格式的内容。它支持多种文件类型,并为文本分割和元数据处理提供灵活的选项。 + +## 特点 +- 支持多种基于文本的文件格式 +- 多文件加载能力 +- 文本分割支持 +- 可定制的元数据处理 +- 存储集成支持 +- Base64 文件处理 +- 多种输出格式 + +## 支持的文件类型 +该加载程序支持多种基于文本的文件格式: +- 文本文件(.txt) +- 网页文件(.html、.aspx、.asp、.css) +- 编程语言: + - C/C++(.cpp、.c、.h) + - C# (.cs) + - 去(.go) + - Java (.java) + - JavaScript/TypeScript(.js、.ts) + - PHP (.php) + - Python(.py、.python) + - 红宝石(.rb、.ruby) + - 铁锈 (.rs) + - 斯卡拉(.sc,.scala) + - 坚固性(.sol) + - 斯威夫特(.swift) + - Visual Basic (.vb) +- 标记/样式: + - CSS/LESS/SCSS(.css、.less、.scss) + - Markdown(.md、.markdown) + - XML (.xml) + - LaTeX(.tex、.ltx) +- 其他: + - 协议缓冲区(.proto) + - SQL (.sql) + - RST (.rst) + +## 输入 + +### 必需参数 +- **Txt 文件**:要处理的一个或多个文本文件 + - 接受来自本地上传或存储的文件 + - 支持多文件选择 + +### 可选参数 +- **文本分割器**:处理提取内容的文本分割器 +- **附加元数据**:JSON 对象以及要添加到文档的附加元数据 +- **省略元数据键**:要排除的元数据键的逗号分隔列表 + - 格式:`key1, key2, key3.nestedKey1` + - 使用 * 删除所有默认元数据 + +## 输出 + +- **文档**:文档对象数组,包含: + - 元数据:文件元数据和自定义字段 + - pageContent:提取的文本内容 +- **文本**:所有提取内容的串联字符串 + +## 文档结构 +每个文档包含: +- **pageContent**:文本文件的主要内容 +- **元数据**: + - 默认文件元数据 + - 其他自定义元数据(如果指定) + - 过滤元数据(基于省略的键) + +## 用法示例 + +### 单个文件处理 +```json +{ + "txtFile": "example.txt", + "metadata": { + "source": "local", + "category": "documentation" + } +} +``` + +### 多个文件处理 +```json +{ + "txtFile": ["doc1.txt", "doc2.md", "code.py"], + "metadata": { + "batch": "docs-2024", + "processor": "text-loader" + }, + "omitMetadataKeys": "source, timestamp" +} +``` + +## 存储集成 +加载器支持两种文件源模式: +1. **直接上传**:通过界面直接上传文件 +2. **存储集成**:通过存储系统访问文件 + - 格式:`FILE-STORAGE::filename.txt` + - 支持组织和聊天流特定的存储 + +## 注释 +- 处理单个和多个文件 +- 支持base64编码的文件内容 +- 自动处理不同的文件编码 +- 大文件的内存高效处理 +- 在需要时保留文件元数据 +- 支持大文档的文本分割 +- 处理输出文本中的转义字符 +- 与组织特定的存储集成 + +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](broken-reference)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/document-loaders/unstructured-file-loader.md b/cn/integrations/langchain/document-loaders/unstructured-file-loader.md new file mode 100644 index 00000000..bfe69ded --- /dev/null +++ b/cn/integrations/langchain/document-loaders/unstructured-file-loader.md @@ -0,0 +1,128 @@ +--- +description: 使用 Unstructed.io 从文件路径加载数据。 +--- + +# 非结构化文件加载器 + +

非结构化文件加载器节点

+ +非结构化文件加载器使用 [Unstructed.io](https://unstructured.io) 提取和处理各种文件格式的内容。它提供高级文档解析功能以及 OCR、分块和元数据提取的可配置选项。 + +## 特点 +- 高级文档解析 +- OCR 支持多种语言选项 +- 灵活的分块策略 +- 表结构推断 +- 坐标提取 +- 分页符处理 +- XML 标签处理 +- 可定制的型号选择 +- 元数据提取 + +## 配置 + +### API 设置 +- 默认 API URL: `https://api.unstructuredapp.io/general/v0/general` +- 需要 Unstructed.io 的 API 密钥 +- 可以通过环境变量进行配置: + - `UNSTRUCTURED_API_URL` + - `UNSTRUCTURED_API_KEY` + +### 处理策略 +- **策略**:默认为“hi_res” + - 选项包括针对不同文档类型的各种处理策略 +- **分块策略**: + - 无(默认) + - by_title(基于标题的文本块) + +## 参数 + +### 必需参数 +- **文件**:要处理的文档 +- **API 键**:Unstructed.io API 键(如果未通过环境设置) + +### 可选参数 + +#### OCR 选项 +- **OCR 语言**:用于 OCR 处理的语言数组 +- **编码**:指定文档编码 + +#### 处理选项 +- **坐标**:提取元素坐标(真/假) +- **PDF 表结构**:推断 PDF 中的表结构(正确/错误) +- **XML 标签**:在输出中保留 XML 标签(true/false) +- **跳过表类型**:要跳过推理的表类型数组 +- **高分辨率模型**:指定高分辨率模型名称 +- **包括分页符**:包括分页符信息(正确/错误) + +#### 文本分块选项 +- **多页部分**:处理跨页面的部分(正确/错误) +- **Combine Under N Chars**:合并指定字符数下的元素 +- **New After N Chars**:在指定字符数后创建新元素 +- **最大字符数**:每个元素的最大字符数 + +## 输出结构 + +### 文档格式 +每个处理后的元素都会成为一个文档,其中包含: +- **pageContent**:提取的文本内容 +- **元数据**: + - 类别:元素类型 + - 处理过程中的附加元数据 + +### 元素类型 +加载器可以识别各种元素类型: +- 文本块 +- 桌子 +- 列表 +- 标题 +- 页脚 +- 分页符(如果启用) +- 其他结构元件 + +## 用法示例 + +### 基本配置 +```typescript +{ + "apiKey": "your-api-key", + "strategy": "hi_res", + "ocrLanguages": ["eng"] +} +``` + +### 先进处理 +```typescript +{ + "apiKey": "your-api-key", + "strategy": "hi_res", + "coordinates": true, + "pdfInferTableStructure": true, + "chunkingStrategy": "by_title", + "multiPageSections": true, + "combineUnderNChars": 100, + "maxCharacters": 4000 +} +``` + +## 注释 +- 对每个文件处理请求进行 API 调用 +- 响应包括带有文本和元数据的结构化元素 +- 元素被过滤以确保有效的文本内容 +- 支持基于缓冲区的处理 +- API 响应的错误处理 +- 自动元数据分类 +- 内存高效处理 + +## 最佳实践 +1. 为您的用例设置适当的分块参数 +2. 考虑非英语文档的 OCR 语言设置 +3.为带有表格的文档启用表格结构推断 +4. 当空间信息很重要时使用坐标 +5. 根据下游处理需求配置字符限制 +6. 监控 API 使用情况和响应时间 +7. 处理工作流程中潜在的 API 错误 + +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](broken-reference)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/document-loaders/unstructured-folder-loader.md b/cn/integrations/langchain/document-loaders/unstructured-folder-loader.md new file mode 100644 index 00000000..6d2cb38a --- /dev/null +++ b/cn/integrations/langchain/document-loaders/unstructured-folder-loader.md @@ -0,0 +1,155 @@ +--- +description: >- + 使用 Unstructed.io 从文件夹加载数据。注:目前没有 + 支持 .png 和 .heic,直到更新非结构化。 +--- + +# 非结构化文件夹加载器 + +

非结构化文件夹加载器节点

+ +非结构化文件夹加载程序使用 [Unstructed.io](https://unstructured.io) 从文件夹加载和处理多个文档。它提供高级文档解析功能以及用于 OCR、分块和元数据提取的广泛配置选项。 + +{% hint style="warning" %} +目前不支持 .png 和 .heic 文件,直到更新非结构化文件。 +{% endhint %} + +## 特点 +- 批量处理多个文档 +- 多种处理策略 +- OCR 支持超过 15 种语言 +- 灵活的分块策略 +- 表结构推断 +- XML 处理选项 +- 分页符处理 +- 坐标提取 +- 元数据定制 + +## 配置 + +### API 设置 +- 默认 API URL: `http://localhost:8000/general/v0/general` +- 可以通过环境变量配置:`UNSTRUCTURED_API_URL` +- 可选的 API 密钥身份验证 + +## 参数 + +### 必需参数 +- **文件夹路径**:包含要处理的文档的文件夹的路径 + +### 可选参数 + +#### 基本配置 +- **非结构化 API URL**:API 端点(默认值:http://localhost:8000/general/v0/general) +- **策略**:处理策略(默认:自动) + - hi_res:高分辨率处理 + - 快速:快速处理 + - ocr_only:以 OCR 为重点的处理 + - 自动:自动选择 +- **Encoding**:文档编码(默认:utf-8) + +#### OCR 选项 +- **OCR 语言**:多语言支持包括: + - 英语(eng) + - 西班牙语(水疗) + - 普通话 (cmn) + - 印地语(hin) + - 阿拉伯语(ara) + - 葡萄牙语(por) + - 孟加拉语(ben) + - 俄语(rus) + - 日语 (jpn) + - 还有更多... + +#### 处理选项 +- **跳过推断表类型**:跳过表提取的文件类型(默认值:[“pdf”、“jpg”、“png”]) +- **高分辨率模型名称**:高分辨率策略的模型选择(默认: detectorron2_onnx) + - 削片机:Unstructured 的内部 VDU 模型 + - detectorron2_onnx:Facebook AI 的快速物体检测 + - yolox:单级实时检测器 + - yolox_quantized:优化的YOLOX版本 +- **坐标**:提取元素坐标(默认值:false) +- **包括分页符**:包括分页符元素 +- **XML 保留标签**:保留 XML 标签 +- **多页部分**:处理多页部分 + +#### 文本分块选项 +- **分块策略**:文本分块方法(默认:by_title) + - 无:无分块 + - by_title:按文档标题划分的块 +- **在 N 个字符下合并**:最小块大小 +- **新的 After N Chars**:软最大块大小 +- **最大字符数**:硬最大块大小(默认值:500) + +#### 元数据选项 +- **Source ID Key**:文档来源标识的密钥(默认:来源) +- **附加元数据**:自定义元数据为 JSON +- **省略元数据键**:要从元数据中排除的键 + +## 支持的文件类型 +- 文档:.doc、.docx、.odt、.ppt、.pptx、.pdf +- 电子表格:.xls、.xlsx +- 文本:.txt、.text、.md、.rtf +- 网页:.html、.htm +- 电子邮件:.eml、.msg +- 图片:.jpg、.jpeg(注意:目前不支持 .png 和 .heic) + +## 输出结构 + +### 文档格式 +每个处理的文档包括: +- **pageContent**:提取的文本内容 +- **元数据**: + - 来源:文档来源标识符 + - 处理中的附加元数据 + - 自定义元数据(如果指定) + +## 用法示例 + +### 基本配置 +```json +{ + "folderPath": "/path/to/documents", + "strategy": "auto", + "encoding": "utf-8" +} +``` + +### 先进处理 +```json +{ + "folderPath": "/path/to/documents", + "strategy": "hi_res", + "hiResModelName": "detectron2_onnx", + "ocrLanguages": ["eng", "spa", "fra"], + "chunkingStrategy": "by_title", + "maxCharacters": 500, + "coordinates": true, + "metadata": { + "source": "company_docs", + "department": "legal" + } +} +``` + +## 最佳实践 +1.根据文档质量和处理需求选择合适的策略 +2.根据文档内容配置OCR语言 +3.调整分块参数以获得最佳文本分割 +4. 针对您的用例使用适当的高分辨率模型 +5.处理大文件夹时考虑内存使用 +6. 监控 API 使用情况和响应时间 +7. 处理工作流程中潜在的 API 错误 + +## 注释 +- 批量处理多个文档 +- 支持多种文件格式 +- 内存高效处理 +- 自动元数据处理 +- 灵活的输出格式 +- API 响应的错误处理 +- 可配置的处理选项 + +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](broken-reference)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/README.md b/cn/integrations/langchain/embeddings/README.md new file mode 100644 index 00000000..0224081d --- /dev/null +++ b/cn/integrations/langchain/embeddings/README.md @@ -0,0 +1,37 @@ +--- +description: LangChain嵌入节点 +--- + +# 嵌入 + +*** + +嵌入是浮点数的向量(列表)。两个向量之间的距离衡量它们的相关性。距离小表明相关性高,距离大表明相关性低。 + +嵌入可用于创建文本数据的数字表示。这种数字表示很有用,因为它可以用来查找相似的文档。 + +它们通常用于: + +* 搜索(结果按与查询字符串的相关性排名) +* 聚类(文本字符串按相似性分组) +* 推荐(推荐具有相关文本字符串的项目) +* 异常检测(识别出相关性很小的异常值) +* 多样性测量(分析相似性分布) +* 分类(文本字符串按最相似的标签进行分类) + +### 嵌入节点: + +* [AWS 基岩嵌入](aws-bedrock-embeddings.md) +* [Azure OpenAI 嵌入](azure-openai-embeddings.md) +* [Cohere 嵌入](cohere-embeddings.md) +* [Google GenerativeAI 嵌入](googlegenerativeai-embeddings.md) +* [Google PalLM 嵌入](broken-reference) +* [Google VertexAI 嵌入](googlevertexai-embeddings.md) +* [HuggingFace 推理嵌入](huggingface-inference-embeddings.md) +* [本地AI嵌入](localai-embeddings.md) +* [MistralAI 嵌入](mistralai-embeddings.md) +* [Ollama 嵌入](ollama-embeddings.md) +* [OpenAI 嵌入](openai-embeddings.md) +* [OpenAI 嵌入自定义](openai-embeddings-custom.md) +* [TogetherAI 嵌入](togetherai-embedding.md) +* [VoyageAI 嵌入](voyageai-embeddings.md) diff --git a/cn/integrations/langchain/embeddings/aws-bedrock-embeddings.md b/cn/integrations/langchain/embeddings/aws-bedrock-embeddings.md new file mode 100644 index 00000000..67326cc4 --- /dev/null +++ b/cn/integrations/langchain/embeddings/aws-bedrock-embeddings.md @@ -0,0 +1,11 @@ +--- +description: AWSBedrock 嵌入模型用于为给定文本生成嵌入。 +--- + +# AWS 基岩嵌入 + +

AWS 基岩嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/azure-openai-embeddings.md b/cn/integrations/langchain/embeddings/azure-openai-embeddings.md new file mode 100644 index 00000000..146cadcd --- /dev/null +++ b/cn/integrations/langchain/embeddings/azure-openai-embeddings.md @@ -0,0 +1,59 @@ +# Azure OpenAI 嵌入 + +## 先决条件 + +1. [登录](https://portal.azure.com/)或[注册](https://azure.microsoft.com/en-us/free/)到 Azure +2. [创建](https://portal.azure.com/#create/Microsoft.CognitiveServicesOpenAI)您的 Azure OpenAI 并等待大约 10 个工作日的批准 +3. 您的 API 密钥将在 **Azure OpenAI** 中提供 > 单击 **名称\_azure\_openai** > 单击 **单击此处管理密钥** + +
+ +## 设置 + +### Azure OpenAI 嵌入 + +1. 单击“**转到 Azure OpenaAI Studio**” + +
+ +2. 单击**部署** + +
+ +3. 单击“**创建新部署**” + +
+ +4.如下图选择,点击**创建** + +
+ +5. 成功创建**Azure OpenAI Embeddings** + +* 部署名称:`text-embedding-ada-002` +* 实例名称:`top right conner` + +
+ +### 流动 + +1. **嵌入** > 拖动 **Azure OpenAI Embeddings** 节点 + +
+ +2. **连接凭据** > 单击 **新建** + +
+ +3. 将每个详细信息(API 密钥、实例和部署名称、[API 版本](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#chat-completions))复制并粘贴到 **Azure OpenAI Embeddings** 凭据中 + +
+ +4.瞧[🎉](https://emojipedia.org/party-popper/),您已在 Flowise 中创建了 **Azure OpenAI Embeddings 节点** + +
+ +## 资源 + +* [LangChain JS Azure OpenAI 嵌入](https://js.langchain.com/docs/modules/data\_connection/text\_embedding/integrations/azure\_openai) +* [Azure OpenAI 服务 REST API 参考](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference) diff --git a/cn/integrations/langchain/embeddings/cohere-embeddings.md b/cn/integrations/langchain/embeddings/cohere-embeddings.md new file mode 100644 index 00000000..89c2b3c1 --- /dev/null +++ b/cn/integrations/langchain/embeddings/cohere-embeddings.md @@ -0,0 +1,11 @@ +--- +description: Coher API 为给定文本生成嵌入 +--- + +# 连贯嵌入 + +

Cohere 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/googlegenerativeai-embeddings.md b/cn/integrations/langchain/embeddings/googlegenerativeai-embeddings.md new file mode 100644 index 00000000..ac9775ae --- /dev/null +++ b/cn/integrations/langchain/embeddings/googlegenerativeai-embeddings.md @@ -0,0 +1,11 @@ +--- +description: Google Generative API 为给定文本生成嵌入。 +--- + +# Google GenerativeAI 嵌入 + +

Google GenerativeAI 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/googlevertexai-embeddings.md b/cn/integrations/langchain/embeddings/googlevertexai-embeddings.md new file mode 100644 index 00000000..99024d8e --- /dev/null +++ b/cn/integrations/langchain/embeddings/googlevertexai-embeddings.md @@ -0,0 +1,11 @@ +--- +description: Google vertexAI API 为给定文本生成嵌入。 +--- + +# Google VertexAI 嵌入 + +

Google VertexAI 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/huggingface-inference-embeddings.md b/cn/integrations/langchain/embeddings/huggingface-inference-embeddings.md new file mode 100644 index 00000000..1874be2f --- /dev/null +++ b/cn/integrations/langchain/embeddings/huggingface-inference-embeddings.md @@ -0,0 +1,11 @@ +--- +description: HuggingFace 推理 API 为给定文本生成嵌入。 +--- + +# HuggingFace 推理嵌入 + +

HuggingFace 推理嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/localai-embeddings.md b/cn/integrations/langchain/embeddings/localai-embeddings.md new file mode 100644 index 00000000..1f87742a --- /dev/null +++ b/cn/integrations/langchain/embeddings/localai-embeddings.md @@ -0,0 +1,46 @@ +# LocalAI 嵌入 + +## LocalAI 设置 + +[**LocalAI**](https://github.com/go-skynet/LocalAI) 是 REST API 的直接替代品,与 OpenAI API 本地推理规范兼容。它允许您使用消费级硬件在本地或本地运行 LLM(不仅如此),支持与 ggml 格式兼容的多个模型系列。 + +要在 Flowise 中使用 LocalAI Embeddings,请按照以下步骤操作: + +1. ```bash + git 克隆 https://github.com/go-skynet/LocalAI + ``` +2.
cd LocalAI
+   
+3. LocalAI provides an [API endpoint](https://localai.io/api-endpoints/index.html#applying-a-model---modelsapply) to download/install the model. In this example, we are going to use BERT Embeddings model: + +
+ +4. In the `/models` folder, you should be able to see the downloaded model in there: + +
+ +5. You can now test the embeddings: + +```bash +卷曲 http://localhost:8080/v1/embeddings -H“内容类型:application/json”-d '{ + “输入”:“测试”, + “模型”:“文本嵌入-ada-002” + }' +``` + +6. Response should looks like: + +
+ +## Flowise Setup + +Drag and drop a new LocalAIEmbeddings component to canvas: + +
+ +Fill in the fields: + +* **Base Path**: The base url from LocalAI such as [http://localhost:8080/v1](http://localhost:8080/v1) +* **Model Name**: The model you want to use. Note that it must be inside `/models` folder of LocalAI directory. For instance: `text-embedding-ada-002` + +That's it! For more information, refer to LocalAI [docs](https://localai.io/models/index.html#embeddings-bert). diff --git a/cn/integrations/langchain/embeddings/mistralai-embeddings.md b/cn/integrations/langchain/embeddings/mistralai-embeddings.md new file mode 100644 index 00000000..b45d6cc9 --- /dev/null +++ b/cn/integrations/langchain/embeddings/mistralai-embeddings.md @@ -0,0 +1,11 @@ +--- +description: MistralAI API 为给定文本生成嵌入。 +--- + +# MistralAI 嵌入 + +

MistralAI 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/ollama-embeddings.md b/cn/integrations/langchain/embeddings/ollama-embeddings.md new file mode 100644 index 00000000..c923b18b --- /dev/null +++ b/cn/integrations/langchain/embeddings/ollama-embeddings.md @@ -0,0 +1,11 @@ +--- +description: 使用 Ollama 上的开源模型为给定文本生成嵌入。 +--- + +# Ollama 嵌入 + +

Ollama 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/openai-embeddings-custom.md b/cn/integrations/langchain/embeddings/openai-embeddings-custom.md new file mode 100644 index 00000000..95371af4 --- /dev/null +++ b/cn/integrations/langchain/embeddings/openai-embeddings-custom.md @@ -0,0 +1,11 @@ +--- +description: OpenAI API 为给定文本生成嵌入。 +--- + +# OpenAI 嵌入自定义 + +

OpenAI 嵌入自定义节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/openai-embeddings.md b/cn/integrations/langchain/embeddings/openai-embeddings.md new file mode 100644 index 00000000..3d952c07 --- /dev/null +++ b/cn/integrations/langchain/embeddings/openai-embeddings.md @@ -0,0 +1,11 @@ +--- +description: OpenAI API 为给定文本生成嵌入。 +--- + +# OpenAI 嵌入 + +

OpenAI 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/togetherai-embedding.md b/cn/integrations/langchain/embeddings/togetherai-embedding.md new file mode 100644 index 00000000..e1f2b567 --- /dev/null +++ b/cn/integrations/langchain/embeddings/togetherai-embedding.md @@ -0,0 +1,11 @@ +--- +description: TogetherAI Embedding 模型可为给定文本生成嵌入。 +--- + +#TogetherAI 嵌入 + +

TogetherAI嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/embeddings/voyageai-embeddings.md b/cn/integrations/langchain/embeddings/voyageai-embeddings.md new file mode 100644 index 00000000..0e21edb3 --- /dev/null +++ b/cn/integrations/langchain/embeddings/voyageai-embeddings.md @@ -0,0 +1,11 @@ +--- +description: Voyage AI API 为给定文本生成嵌入。 +--- + +# VoyageAI 嵌入 + +

VoyageAI 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/llms/README.md b/cn/integrations/langchain/llms/README.md new file mode 100644 index 00000000..c0ecbab1 --- /dev/null +++ b/cn/integrations/langchain/llms/README.md @@ -0,0 +1,22 @@ +--- +description: LangChain LLM 节点 +--- + +# 法学硕士 + +*** + +大型语言模型,简称LLM,是一个经过大量文本数据训练的人工智能系统。这使他们能够交流并生成类似人类的文本来响应各种提示词和问题。本质上,他们可以理解复杂的语言并做出反应。 + +### LLM 节点: + +* [AWS Bedrock](aws-bedrock.md) +* [Azure OpenAI](azure-openai.md) +* [NIBittensorLLM](broken-reference) +* [一致](cohere.md) +* [GooglePaLM](broken-reference) +* [GoogleVertex AI](googlevertex-ai.md) +* [HuggingFace 推理](huggingface-inference.md) +* [Ollama](ollama.md) +* [OpenAI](openai.md) +* [复制](replicate.md) diff --git a/cn/integrations/langchain/llms/aws-bedrock.md b/cn/integrations/langchain/llms/aws-bedrock.md new file mode 100644 index 00000000..1604ac29 --- /dev/null +++ b/cn/integrations/langchain/llms/aws-bedrock.md @@ -0,0 +1,35 @@ +--- +description: 围绕 AWS 基岩大型语言模型的包装。 +--- + +# AWS 基岩 + + +**AWS Bedrock LLM** 节点与 Amazon Bedrock 集成,这是一项托管服务,提供对用于构建生成 AI 应用程序的基础模型的访问。 + +要在 Flowise 中使用 AWS Bedrock,请将 **AWS Bedrock LLM** 节点添加到您的 聊天流。 + +# 设置 + +1. 为 Flowise 配置 AWS 凭据。 + +在 Amazon Bedrock 中,确保您的账户有权访问您想要与 Flowise 一起使用的模型。 + +2. 将 AWS Bedrock 节点添加到您的 聊天流。 + +在 Flowise 画布中,将 AWS Bedrock LLM 节点拖放到您的 聊天流 中。 + +3. 配置 AWS Bedrock 输入: +

AWS 基岩节点

+ +* AWS 凭据:选择现有 AWS 凭据或创建一个新凭据。关联的 IAM 用户或角色必须拥有 `bedrock:InvokeModel` 以及 聊天流 中任何其他所需 AWS 服务的权限。 +* 区域:您的基岩模型可用的 AWS 区域。 +* 模型名称:对话式 AI 的 AWS 基岩基础模型。 + +4. 连接 聊天流 中的 AWS Bedrock 节点。 + +添加其他 聊天流 组件(例如输入节点、输出节点、内存节点)后,将 AWS Bedrock LLM 节点连接到相应的组件以创建 聊天流。 + +有关在 AWS 上部署 Flowise 的信息,请参阅 [AWS](../../../configuration/deployment/aws.md)。 + + diff --git a/cn/integrations/langchain/llms/azure-openai.md b/cn/integrations/langchain/llms/azure-openai.md new file mode 100644 index 00000000..e5ed2a9b --- /dev/null +++ b/cn/integrations/langchain/llms/azure-openai.md @@ -0,0 +1,9 @@ +--- +description: Azure OpenAI 大型语言模型的包装器。 +--- + +# Azure OpenAI + +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/llms/cohere.md b/cn/integrations/langchain/llms/cohere.md new file mode 100644 index 00000000..ab0cfe75 --- /dev/null +++ b/cn/integrations/langchain/llms/cohere.md @@ -0,0 +1,11 @@ +--- +description: Cohere 大型语言模型的包装。 +--- + +# 连贯 + +

连贯节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/llms/googlevertex-ai.md b/cn/integrations/langchain/llms/googlevertex-ai.md new file mode 100644 index 00000000..bba802ca --- /dev/null +++ b/cn/integrations/langchain/llms/googlevertex-ai.md @@ -0,0 +1,11 @@ +--- +description: GoogleVertexAI 大语言模型的包装。 +--- + +# GoogleVertex AI + +

GoogleVertex 人工智能节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/llms/huggingface-inference.md b/cn/integrations/langchain/llms/huggingface-inference.md new file mode 100644 index 00000000..a0281958 --- /dev/null +++ b/cn/integrations/langchain/llms/huggingface-inference.md @@ -0,0 +1,11 @@ +--- +description: HuggingFace 大型语言模型的包装。 +--- + +# HuggingFace 推理 + +

HuggingFace 推理节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/llms/ollama.md b/cn/integrations/langchain/llms/ollama.md new file mode 100644 index 00000000..be6d897c --- /dev/null +++ b/cn/integrations/langchain/llms/ollama.md @@ -0,0 +1,11 @@ +--- +description: Ollama 上开源大型语言模型的包装。 +--- + +#奥拉马 + +

奥拉马节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/llms/openai.md b/cn/integrations/langchain/llms/openai.md new file mode 100644 index 00000000..af5d3b54 --- /dev/null +++ b/cn/integrations/langchain/llms/openai.md @@ -0,0 +1,11 @@ +--- +description: OpenAI 大语言模型的包装器。 +--- + +# 开放人工智能 + +

OpenAI节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/llms/replicate.md b/cn/integrations/langchain/llms/replicate.md new file mode 100644 index 00000000..36e79e1e --- /dev/null +++ b/cn/integrations/langchain/llms/replicate.md @@ -0,0 +1,11 @@ +--- +description: 使用 Replicate 在云上运行开源模型。 +--- + +# 复制 + +

复制节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/memory/README.md b/cn/integrations/langchain/memory/README.md new file mode 100644 index 00000000..2c3441e0 --- /dev/null +++ b/cn/integrations/langchain/memory/README.md @@ -0,0 +1,81 @@ +--- +description: LangChain内存节点 +--- + +# 内存 + +*** + +记忆可以让你与人工智能聊天,就好像人工智能拥有之前对话的记忆一样。 + +_人类:嗨,我是鲍勃_ + +_AI:你好,鲍勃!很高兴认识你。今天我能为您提供什么帮助?_ + +_人类:我叫什么名字?_ + +_AI:正如您之前提到的,您的名字是鲍勃。_ + +在底层,这些对话存储在数组或数据库中,并作为上下文提供给 LLM。例如: + +``` +You are an assistant to a human, powered by a large language model trained by OpenAI. + +Whether the human needs help with a specific question or just wants to have a conversation about a particular topic, you are here to assist. + +Current conversation: +{history} +``` + +### 内存节点: + +* [缓冲内存](buffer-memory.md) +* [缓冲窗口内存](buffer-window-memory.md) +* [对话摘要记忆](conversation-summary-memory.md) +* [对话摘要缓冲区内存](conversation-summary-buffer-memory.md) +* [DynamoDB 聊天内存](dynamodb-chat-memory.md) +* [Mem0 内存](mem0-memory.md) +* [MongoDB Atlas 聊天内存](mongodb-atlas-chat-memory.md) +* [Redis 支持的聊天内存](redis-backed-chat-memory.md) +* [Upstash Redis 支持的聊天内存](upstash-redis-backed-chat-memory.md) +* [Zep 内存](zep-memory.md) + +## 多个用户的单独对话 + +### UI 和嵌入式聊天 + +默认情况下,UI 和嵌入式聊天会自动分隔不同用户的对话。这是通过为每个新交互生成唯一的 **`chatId`** 来完成的。该逻辑由 Flowise 在幕后处理。 + +### 预测 API + +您可以通过指定唯一的 **`sessionId`** 来分隔多个用户的对话 + +1. 对于每个内存节点,您应该能够看到一个输入参数 **`Session ID`** + +
+ +
+ +2. 在 `/api/v1/prediction/{your-chatflowid}` POST 正文请求中,指定 **`overrideConfig`** 中的 **`sessionId`** + +```json +{ + "question": "hello!", + "overrideConfig": { + "sessionId": "user1" + } +} +``` + +### 消息 API + +* GET `/api/v1/chatmessage/{your-chatflowid}` +* DELETE `/api/v1/chatmessage/{your-chatflowid}` + +
查询参数类型价值
会话ID字符串
排序枚举ASC 或 DESC
开始日期字符串
结束日期字符串
+ +所有对话也可以通过 UI 进行可视化和管理: + +
+ +对于 OpenAI 助手,[Threads](../agents/openai-assistant/threads.md) 将用于存储对话。 diff --git a/cn/integrations/langchain/memory/buffer-memory.md b/cn/integrations/langchain/memory/buffer-memory.md new file mode 100644 index 00000000..395a1b0b --- /dev/null +++ b/cn/integrations/langchain/memory/buffer-memory.md @@ -0,0 +1,12 @@ +# 缓冲存储器 + +使用 Flowise 数据库表 `chat_message` 作为存储/检索对话的存储机制。 + +
+ +## 输入 + +|参数|描述 |默认| +| ---------- | ----------------------------------------------------------------------------- | ------------- | +|会话 ID |用于检索/存储消息的 ID。如果未指定,将使用随机 ID。 | | +|记忆钥匙|提示词模板中用于格式化消息的按键|聊天\_历史| diff --git a/cn/integrations/langchain/memory/buffer-window-memory.md b/cn/integrations/langchain/memory/buffer-window-memory.md new file mode 100644 index 00000000..5ebea568 --- /dev/null +++ b/cn/integrations/langchain/memory/buffer-window-memory.md @@ -0,0 +1,15 @@ +# 缓冲窗口内存 + +使用 Flowise 数据库表 `chat_message` 作为存储/检索对话的存储机制。 + +不同之处在于它只获取最后 K 次交互。这种方法有利于保留最近交互的滑动窗口,确保缓冲区的大小保持可管理。 + +
+ +## 输入 + +|参数|描述 |默认| +| ---------- | ----------------------------------------------------------------------------- | ------------- | +|尺寸|要获取的最后 K 条消息 | 4 | +|会话 ID |用于检索/存储消息的 ID。如果未指定,将使用随机 ID。 | | +|记忆钥匙|提示词模板中用于格式化消息的按键|聊天\_历史| diff --git a/cn/integrations/langchain/memory/conversation-summary-buffer-memory.md b/cn/integrations/langchain/memory/conversation-summary-buffer-memory.md new file mode 100644 index 00000000..40947155 --- /dev/null +++ b/cn/integrations/langchain/memory/conversation-summary-buffer-memory.md @@ -0,0 +1,16 @@ +# 对话摘要缓冲区内存 + +使用 Flowise 数据库表 `chat_message` 作为存储/检索对话的存储机制。 + +该内存保留最近交互的缓冲区,并将旧的交互编译成摘要,并在其存储中使用两者。现在,它不再仅仅根据数量来刷新旧的交互,而是考虑令牌的总长度来决定何时清除它们。 + +
+ +## 输入 + +|参数|描述 |默认| +| --------------- | ----------------------------------------------------------------------------- | ------------- | +|聊天模型| LLM 用于执行汇总 | | +|最大代币限制 |达到令牌限制后汇总对话 | 2000 | 2000 +|会话 ID |用于检索/存储消息的 ID。如果未指定,将使用随机 ID。 | | +|记忆钥匙|提示词模板中用于格式化消息的按键|聊天\_历史| diff --git a/cn/integrations/langchain/memory/conversation-summary-memory.md b/cn/integrations/langchain/memory/conversation-summary-memory.md new file mode 100644 index 00000000..65e35827 --- /dev/null +++ b/cn/integrations/langchain/memory/conversation-summary-memory.md @@ -0,0 +1,15 @@ +# 对话摘要记忆 + +使用 Flowise 数据库表 `chat_message` 作为存储/检索对话的存储机制。 + +这种记忆类型会随着时间的推移创建对话的简短摘要。这对于缩短长时间讨论中的信息很有用。随着对话的进行,它会更新并保存当前摘要。这在较长的聊天中特别有用,因为保存过去的每条消息会占用太多空间。 + +
+ +## 输入 + +|参数|描述 |默认| +| ---------- | ----------------------------------------------------------------------------- | ------------- | +|聊天模型| LLM 用于执行汇总 | | +|会话 ID |用于检索/存储消息的 ID。如果未指定,将使用随机 ID。 | | +|记忆钥匙|提示词模板中用于格式化消息的按键|聊天\_历史| diff --git a/cn/integrations/langchain/memory/dynamodb-chat-memory.md b/cn/integrations/langchain/memory/dynamodb-chat-memory.md new file mode 100644 index 00000000..2f554633 --- /dev/null +++ b/cn/integrations/langchain/memory/dynamodb-chat-memory.md @@ -0,0 +1,11 @@ +--- +description: 将对话存储在 dynamo 数据库表中。 +--- + +# DynamoDB 聊天内存 + +

DynamoDB 聊天内存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/memory/mem0-memory.md b/cn/integrations/langchain/memory/mem0-memory.md new file mode 100644 index 00000000..911403d2 --- /dev/null +++ b/cn/integrations/langchain/memory/mem0-memory.md @@ -0,0 +1,93 @@ +# Mem0 内存 + +[Mem0](https://github.com/mem0ai/mem0)(发音为“mem-zero”)通过智能内存层增强 AI 助手和代理,从而实现个性化的 AI 交互。它会记住用户偏好,适应个人需求,并随着时间的推移不断改进。这使其成为客户支持聊天机器人、人工智能助手和自主AI 智能体等应用的理想选择。 + +Mem0 提供了一整套内存管理功能,允许无缝集成到各种人工智能驱动的应用程序中。 + +--- + +## 将 Mem0 与 Flowise 结合使用 + +请按照以下步骤将 Mem0 与 Flowise 集成: + +### 1. 设置 Flowise + +1. 打开 Flowise 应用程序并创建新画布,或从 Flowise 市场选择模板。 +2. 在此示例中,我们使用 **Conversation Chain** 模板。 +3. 将默认的 **Buffer Memory** 替换为 **Mem0 Memory**。 + +
Flowise Memory Integration
Flowise 与 Mem0 集成
+ +### 2. 获取您的 Mem0 API 密钥 + +1. 导航至 [Mem0 API 关键仪表板](https://app.mem0.ai/dashboard/api-keys)。 +2. 生成或复制现有的 Mem0 API 密钥。 + +
Mem0 API Key
从 Mem0 检索 API 密钥
+ +### 3. 在 Flowise 中配置 Mem0 凭据 + +1. 在 Mem0 凭据部分输入 **Mem0 API 密钥**。 + +
Mem0 Credentials
配置 API 凭据
+ +### 4. 保存并测试聊天流 + +1. 保存您的 Flowise 配置。 +2. 运行测试聊天并存储一些信息。 + +
Flowise Test Chat
测试内存存储
+ +### 5. 验证 Mem0 仪表板中存储的内存 + +1. 访问[Mem0 控制板](https://app.mem0.ai/dashboard/requests) 查看存储的内存。 + +
Mem0 Stored Memories
回顾储存的记忆
+ +### 6. 验证内存保留 + +1. 清除 Flowise 中的聊天记录。 +2. 根据之前存储的信息提出问题以确认保留。 + +
Testing Memory Retention
确认内存持久性
+ +--- + +## 附加设置 + +Mem0 提供各种定制选项: + +
Mem0 Settings
Mem0 配置选项
+ +1. **仅搜索模式**:启用内存检索而不创建新内存。聊天记录会一直保留,直至手动清除。 +2. **Mem0 实体**:利用 `user_id`、`run_id`、`app_id` 和 `agent_id` 等标识符进行精细内存控制。 +3. **项目 ID**:将内存分配给特定项目。通过[Mem0 项目](https://app.mem0.ai/settings/projects/overview) 管理项目。 +4. **组织ID**:将内存存储分配给特定组织。通过[Mem0 组织](https://app.mem0.ai/settings/organizations/overview) 管理组织。 + +--- + +## Mem0 平台配置 + +[Mem0 项目设置](https://app.mem0.ai/dashboard/project-settings) 下提供了其他配置: + +1. **自定义指令**:定义项目级指令以细化内存提取。示例:仅提取学术详细信息。 +2. **有效期**:设置存储记忆的有效期,以便在必要时自动处理数据。 + +
Mem0 Project Settings
自定义项目级别设置
+ +--- + +## 在 Flowise 中配置 Mem0 凭据 + +要在 Flowise 中添加凭据: + +1. 导航至凭据设置。 +2. 为 Mem0 添加新的凭据条目。 +3. 将 [Mem0 API 密钥](https://app.mem0.ai/dashboard/api-keys) 粘贴到 API 密钥字段中。 + +
Adding API Key in Flowise
在 Flowise 中输入 API
+ +--- + +通过这些配置,您的 Flowise 设置将与 Mem0 无缝集成,提供增强的内存保留和个性化的 AI 交互。 + diff --git a/cn/integrations/langchain/memory/mongodb-atlas-chat-memory.md b/cn/integrations/langchain/memory/mongodb-atlas-chat-memory.md new file mode 100644 index 00000000..7a400eef --- /dev/null +++ b/cn/integrations/langchain/memory/mongodb-atlas-chat-memory.md @@ -0,0 +1,11 @@ +--- +description: 将对话存储在 MongoDB Atlas 中。 +--- + +# MongoDB Atlas 聊天内存 + +

MongoDB Atlas 聊天内存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/memory/redis-backed-chat-memory.md b/cn/integrations/langchain/memory/redis-backed-chat-memory.md new file mode 100644 index 00000000..fb44f643 --- /dev/null +++ b/cn/integrations/langchain/memory/redis-backed-chat-memory.md @@ -0,0 +1,11 @@ +--- +description: 总结对话并将内存存储在Redis服务器中。 +--- + +# Redis 支持的聊天内存 + +

Redis 支持的聊天内存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/memory/upstash-redis-backed-chat-memory.md b/cn/integrations/langchain/memory/upstash-redis-backed-chat-memory.md new file mode 100644 index 00000000..354dc0aa --- /dev/null +++ b/cn/integrations/langchain/memory/upstash-redis-backed-chat-memory.md @@ -0,0 +1,11 @@ +--- +description: 总结对话并将内存存储在 Upstash Redis 服务器中。 +--- + +# Upstash Redis 支持的聊天内存 + +

Upstash Redis 支持的聊天内存节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/memory/zep-memory.md b/cn/integrations/langchain/memory/zep-memory.md new file mode 100644 index 00000000..6487d7ec --- /dev/null +++ b/cn/integrations/langchain/memory/zep-memory.md @@ -0,0 +1,120 @@ +# 泽普记忆 + +[Zep](https://github.com/getzep/zep) 是 LLM 应用程序的长期内存存储。它存储、总结、嵌入、索引和丰富 LLM 应用程序/聊天机器人历史记录,并通过简单、低延迟的 API 公开它们。 + +## 部署 Zep 渲染指南 + +您可以轻松地将 Zep 部署到云服务,例如 [Render](https://render.com/)、[Flyio](https://fly.io/)。如果您希望在本地进行测试,还可以按照[快速指南](https://github.com/getzep/zep#quick-start)启动 Docker 容器。 + +在此示例中,我们将部署到渲染。 + +1. 前往 [Zep Repo](https://github.com/getzep/zep#quick-start) 并单击 **部署到渲染** +2. 这将带您进入渲染的蓝图页面,然后只需单击 **创建新资源** + +
+ +3. 部署完成后,您应该会在仪表板上看到创建的 3 个应用程序 + +
+ +4. 只需单击第一个名为 **zep** 并复制部署的 URL + +
+ +## 将 Zep 部署到 Digital Ocean 的指南(通过 Docker) + +1. 克隆存储库 + +```bash +git clone https://github.com/getzep/zep.git +cd zep +nano .env + +``` + +2. 添加您的 OpenAI API 密钥.ENV + +```bash +ZEP_OPENAI_API_KEY= + +``` + +```bash +docker compose up -d --build +``` + +3.允许防火墙访问8000端口 + +```bash +sudo ufw allow from any to any port 8000 proto tcp +ufw status numbered +``` + +如果使用数字海洋与仪表板分开的防火墙,请确保端口 8000 也添加在那里 + +## 在 Flowise UI 中使用 + +1. 返回 Flowise 应用程序,只需创建一个新画布或使用市场中的模板之一。在此示例中,我们将使用 **简单对话链** + +
+ +2. 将 **缓冲内存** 替换为 **Zep 内存**。然后将 **Base URL** 替换为您在上面复制的 Zep URL + +
+ +3. 保存聊天流并进行测试以查看对话是否被记住。 + +
+ +4. 现在尝试清除聊天记录,您应该会看到它现在无法记住以前的对话。 + +
+ +## Zep 身份验证 + +Zep 允许您使用 JWT 身份验证来保护您的实例。我们将使用 `zepcli` 命令行实用程序[此处](https://github.com/getzep/zepcli/releases)。 + +#### 1. 生成秘密和 JWT 令牌 + +下载 ZepCLI 后: + +在 Linux 或 MacOS 上 + +``` +./zepcli -i +``` + +在 Windows 上 + +``` +zepcli.exe -i +``` + +您将首先获得您的 SECRET 令牌: + +
+ +然后您将获得 JWT 代币: + +
+ +#### 2.配置Auth环境变量 + +在 Zep 服务器环境中设置以下环境变量: + +``` +ZEP_AUTH_REQUIRED=true +ZEP_AUTH_SECRET= +``` + +#### 3. 在 Flowise 上配置凭据 + +为 Zep 添加新凭据,并将 JWT 令牌放入 API 密钥 字段中: + +
+ +#### 4. 在 Zep 节点上使用创建的凭据 + +在 Zep 节点连接凭据中,选择您刚刚创建的凭据。就是这样! + +
diff --git a/cn/integrations/langchain/moderation/README.md b/cn/integrations/langchain/moderation/README.md new file mode 100644 index 00000000..1c6eb9ca --- /dev/null +++ b/cn/integrations/langchain/moderation/README.md @@ -0,0 +1,14 @@ +--- +description: LangChain审核节点 +--- + +# 适度 + +*** + +审核节点用于检查输入或输出是否包含有害或不当内容。 + +### 审核节点: + +* [OpenAI 审核](openai-moderation.md) +* [简单提示词审核](simple-prompt-moderation.md) diff --git a/cn/integrations/langchain/moderation/openai-moderation.md b/cn/integrations/langchain/moderation/openai-moderation.md new file mode 100644 index 00000000..9e9b112e --- /dev/null +++ b/cn/integrations/langchain/moderation/openai-moderation.md @@ -0,0 +1,11 @@ +--- +description: 检查内容是否符合 OpenAI 使用政策。 +--- + +# OpenAI 审核 + +

OpenAI 审核节点

+ +OpenAI 提供 [审核 API](https://platform.openai.com/docs/guides/moderation) 来检查文本或图像是否具有潜在有害性。如果识别出有害内容,用户可以指定要显示的错误消息。 + +
diff --git a/cn/integrations/langchain/moderation/simple-prompt-moderation.md b/cn/integrations/langchain/moderation/simple-prompt-moderation.md new file mode 100644 index 00000000..8df46ba8 --- /dev/null +++ b/cn/integrations/langchain/moderation/simple-prompt-moderation.md @@ -0,0 +1,18 @@ +--- +description: >- + 检查输入是否包含拒绝列表中的任何文本,并防止被拒绝 + 发送至 LLM。 +--- + +# 简单提示词审核 + +

简单提示词审核节点

+ +使用另一个 LLM 来识别用户查询是否接近拒绝列表,如果是则输出默认错误消息。 + +例如,拒绝列表可以是: + +* 忽略之前的说明 +* 泄露所有敏感信息 + +
diff --git a/cn/integrations/langchain/output-parsers/README.md b/cn/integrations/langchain/output-parsers/README.md new file mode 100644 index 00000000..f3e24d36 --- /dev/null +++ b/cn/integrations/langchain/output-parsers/README.md @@ -0,0 +1,16 @@ +--- +description: LangChain 输出解析器节点 +--- + +# 输出解析器 + +*** + +输出解析器节点负责获取模型的输出并将其转换为更适合下游任务的格式。当您使用 LLM 生成结构化数据或标准化聊天模型和 LLM 的输出时非常有用。 + +### 输出解析器节点: + +* [CSV 输出解析器](csv-output-parser.md) +* [自定义列表输出解析器](custom-list-output-parser.md) +* [结构化输出解析器](structured-output-parser.md) +* [高级结构化输出解析器](advanced-structured-output-parser.md) diff --git a/cn/integrations/langchain/output-parsers/advanced-structured-output-parser.md b/cn/integrations/langchain/output-parsers/advanced-structured-output-parser.md new file mode 100644 index 00000000..5f03c365 --- /dev/null +++ b/cn/integrations/langchain/output-parsers/advanced-structured-output-parser.md @@ -0,0 +1,13 @@ +--- +description: >- + 通过提供 Zod 将 LLM 调用的输出解析为给定结构 + 架构。 +--- + +# 高级结构化输出解析器 + +

高级结构化输出解析器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/output-parsers/csv-output-parser.md b/cn/integrations/langchain/output-parsers/csv-output-parser.md new file mode 100644 index 00000000..56488507 --- /dev/null +++ b/cn/integrations/langchain/output-parsers/csv-output-parser.md @@ -0,0 +1,11 @@ +--- +description: 将 LLM 调用的输出解析为逗号分隔的值列表。 +--- + +# CSV 输出解析器 + +

CSV 输出解析器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/output-parsers/custom-list-output-parser.md b/cn/integrations/langchain/output-parsers/custom-list-output-parser.md new file mode 100644 index 00000000..4202a2ac --- /dev/null +++ b/cn/integrations/langchain/output-parsers/custom-list-output-parser.md @@ -0,0 +1,11 @@ +--- +description: 将 LLM 调用的输出解析为值列表。 +--- + +# 自定义列表输出解析器 + +

自定义列表输出解析器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/output-parsers/structured-output-parser.md b/cn/integrations/langchain/output-parsers/structured-output-parser.md new file mode 100644 index 00000000..345e8374 --- /dev/null +++ b/cn/integrations/langchain/output-parsers/structured-output-parser.md @@ -0,0 +1,11 @@ +--- +description: 将 LLM 调用的输出解析为给定的 (JSON) 结构。 +--- + +# 结构化输出解析器 + +

结构化输出解析器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/prompts/README.md b/cn/integrations/langchain/prompts/README.md new file mode 100644 index 00000000..05147ad6 --- /dev/null +++ b/cn/integrations/langchain/prompts/README.md @@ -0,0 +1,15 @@ +--- +description: LangChain提示词节点 +--- + +# 提示词 + +*** + +提示词模板节点有助于将用户输入和参数转换为语言模型的指令。这可用于指导模型的响应,帮助其理解上下文并生成相关且连贯的基于语言的输出。 + +### 提示词节点: + +* [聊天提示词模板](chat-prompt-template.md) +* [少量拍摄提示词模板](few-shot-prompt-template.md) +* [提示词模板](prompt-template.md) diff --git a/cn/integrations/langchain/prompts/chat-prompt-template.md b/cn/integrations/langchain/prompts/chat-prompt-template.md new file mode 100644 index 00000000..33602ac0 --- /dev/null +++ b/cn/integrations/langchain/prompts/chat-prompt-template.md @@ -0,0 +1,11 @@ +--- +description: 表示聊天提示词的架构。 +--- + +# 聊天提示词模板 + +

聊天提示词模板节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/prompts/few-shot-prompt-template.md b/cn/integrations/langchain/prompts/few-shot-prompt-template.md new file mode 100644 index 00000000..18accab8 --- /dev/null +++ b/cn/integrations/langchain/prompts/few-shot-prompt-template.md @@ -0,0 +1,11 @@ +--- +description: 您可以使用示例构建提示词模板。 +--- + +# 少量镜头提示词模板 + +

少镜头提示词模板节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/prompts/prompt-template.md b/cn/integrations/langchain/prompts/prompt-template.md new file mode 100644 index 00000000..e215be96 --- /dev/null +++ b/cn/integrations/langchain/prompts/prompt-template.md @@ -0,0 +1,11 @@ +--- +description: 表示 LLM 基本提示词的架构。 +--- + +# 提示词模板 + +

提示词模板节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/record-managers.md b/cn/integrations/langchain/record-managers.md new file mode 100644 index 00000000..e7e24aee --- /dev/null +++ b/cn/integrations/langchain/record-managers.md @@ -0,0 +1,97 @@ +--- +description: LangChain记录管理器节点 +--- + +# 记录管理器 + +*** + +记录管理器会跟踪您的索引文档,防止在[矢量存储](vector-stores/)中出现重复的矢量嵌入。 + +当写入更新文档块时,将使用 [SHA-1](https://github.com/emn178/js-sha1) 算法对每个块进行哈希处理。这些哈希值将存储在记录管理器中。如果存在现有哈希,则将跳过嵌入和写入更新过程。 + +在某些情况下,您可能希望删除与正在编制索引的新文档具有相同来源的现有文档。为此,记录管理器有 3 种清理模式: + +{% tabs %} +{% tab title="Incremental" %} +当您写入更新多个文档,并且想要防止删除不属于当前写入更新过程的现有文档时,请使用 **增量** 清理模式。 + +1. 让我们有一个记录管理器,其中 `Incremental` Cleanup 和 `source` 作为 SourceId 键 + +
+ +2.并具备以下2份文件: + +|文字|元数据 | +| ---- | ---------------- | +|猫 | `{source:"cat"}` | +|狗 | `{source:"dog"}` | + +
+ +
+ +3. 写入更新后,我们将看到 2 个已更新的文档: + +
+ +4. 现在,如果我们删除 **Dog** 文档,并将 **Cat** 更新为 **Cats**,我们现在将看到以下内容: + +
+ +* 原**Cat**文档被删除 +* 添加了带有 **Cats** 的新文档 +* **Dog** 文档保持不变 +* 向量存储 中剩余的向量嵌入是 **Cats** 和 **Dog** + +
+{% endtab %} + +{% tab title="Full" %} +当您写入更新多个文档时,**完整**清理模式将自动删除不属于当前写入更新过程的任何矢量嵌入。 + +1. 让我们有一个具有 `Full` Cleanup 功能的记录管理器。对于完全清理模式,我们不需要 SourceId Key。 + +
+ +2.并具备以下2份文件: + +|文字|元数据 | +| ---- | ---------------- | +|猫 | `{source:"cat"}` | +|狗 | `{source:"dog"}` | + +
+ +
+ +3. 写入更新后,我们将看到 2 个已更新的文档: + +
+ +4. 现在,如果我们删除 **Dog** 文档,并将 **Cat** 更新为 **Cats**,我们现在将看到以下内容: + +
+ +* 原**Cat**文档被删除 +* 添加了带有 **Cats** 的新文档 +* **Dog** 文档已删除 +* 向量存储 中剩余的向量嵌入只是 **Cats** + +
+{% endtab %} + +{% tab title="None" %} +不会执行任何清理操作 +{% endtab %} +{% endtabs %} + +当前可用的记录管理器节点有: + +* SQLite +* MySQL +* PostgreSQLSQL + +## 资源 + +* [LangChain 索引 - 工作原理](https://js.langchain.com/docs/how_to/indexing/#how-it-works) diff --git a/cn/integrations/langchain/retrievers/README.md b/cn/integrations/langchain/retrievers/README.md new file mode 100644 index 00000000..ed5fea3c --- /dev/null +++ b/cn/integrations/langchain/retrievers/README.md @@ -0,0 +1,22 @@ +--- +description: 浪链检索器节点 +--- + +# 猎犬 + +*** + +检索器节点返回给定非结构化查询的文档。它比矢量存储更通用。检索器不需要能够存储文档,只需返回(或检索)它们即可。 + +### 检索器节点: + +* [Cohere 重新排序检索器](cohere-rerank-retriever.md) +* [嵌入过滤器检索器](embeddings-filter-retriever.md) +* [HyDE 猎犬](hyde-retriever.md) +* [LLM 过滤器检索器](llm-filter-retriever.md) +* [多查询检索器](multi-query-retriever.md) +* [提示词检索器](prompt-retriever.md) +* [倒数排名融合检索器](reciprocal-rank-fusion-retriever.md) +* [相似度分数阈值检索器](similarity-score-threshold-retriever.md) +* [矢量存储检索器](vector-store-retriever.md) +* [Voyage AI 重新排序检索器](page.md) diff --git a/cn/integrations/langchain/retrievers/cohere-rerank-retriever.md b/cn/integrations/langchain/retrievers/cohere-rerank-retriever.md new file mode 100644 index 00000000..ffbff913 --- /dev/null +++ b/cn/integrations/langchain/retrievers/cohere-rerank-retriever.md @@ -0,0 +1,13 @@ +--- +description: >- + Cohere Rerank 按语义相关性从高到低对文档进行索引 + 到查询。 +--- + +# Cohere 重新排序检索器 + +

Cohere 重新排序检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/custom-retriever.md b/cn/integrations/langchain/retrievers/custom-retriever.md new file mode 100644 index 00000000..8a8b9f7b --- /dev/null +++ b/cn/integrations/langchain/retrievers/custom-retriever.md @@ -0,0 +1,49 @@ +--- +description: 自定义检索器允许用户将上下文的格式指定为 LLM +--- + +# 自定义检索器 + +
+ +默认情况下,当从向量存储中检索上下文时,它们采用以下格式: + +```json +[ + { + "pageContent": "This is an example", + "metadata": { + "source": "example.pdf" + } + }, + { + "pageContent": "This is example 2", + "metadata": { + "source": "example2.txt" + } + } +] +``` + +数组的 **pageContent** 将作为字符串连接在一起,并反馈到 LLM 完成。 + +但是,在某些情况下,您可能希望包含元数据中的信息,以便为 LLM 提供更多信息,例如源、链接等。这就是 **自定义检索器** 的用武之地。我们可以指定返回到 LLM 的格式。 + +例如,使用以下格式: + +```javascript +{{context}} +Source: {{metadata.source}} +``` + +将产生如下组合字符串: + +``` +This is an example +Source: example.pdf + +This is example 2 +Source: example2.txt +``` + +这将被发送回 LLM。由于 LLM 现在有了答案的来源,我们可以使用提示词来指示 LLM 返回答案,然后引用。 diff --git a/cn/integrations/langchain/retrievers/embeddings-filter-retriever.md b/cn/integrations/langchain/retrievers/embeddings-filter-retriever.md new file mode 100644 index 00000000..0c25d7c8 --- /dev/null +++ b/cn/integrations/langchain/retrievers/embeddings-filter-retriever.md @@ -0,0 +1,13 @@ +--- +description: >- + 文档压缩器,使用嵌入来删除与内容无关的文档 + 查询。 +--- + +# 嵌入过滤器检索器 + +

嵌入过滤器检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/extract-metadata-retriever.md b/cn/integrations/langchain/retrievers/extract-metadata-retriever.md new file mode 100644 index 00000000..23792435 --- /dev/null +++ b/cn/integrations/langchain/retrievers/extract-metadata-retriever.md @@ -0,0 +1,7 @@ +# 提取元数据检索器 + +该检索器旨在自动从查询中提取关键字。提取的 JSON 输出用作向量存储的元数据过滤器。 + +例如,当我们问一个问题:“Apple 的利润是多少”时,LLM 将给出 `{source: "apple"}` 的输出,并且该输出将被传递到 Vectore Store 的元数据过滤器。 + +
diff --git a/cn/integrations/langchain/retrievers/hyde-retriever.md b/cn/integrations/langchain/retrievers/hyde-retriever.md new file mode 100644 index 00000000..b9a619ff --- /dev/null +++ b/cn/integrations/langchain/retrievers/hyde-retriever.md @@ -0,0 +1,11 @@ +--- +description: 使用 HyDE 检索器从向量存储中检索。 +--- + +# HyDE 猎犬 + +

HyDE 检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/llm-filter-retriever.md b/cn/integrations/langchain/retrievers/llm-filter-retriever.md new file mode 100644 index 00000000..c1e56da3 --- /dev/null +++ b/cn/integrations/langchain/retrievers/llm-filter-retriever.md @@ -0,0 +1,13 @@ +--- +description: >- + 迭代最初返回的文档并从每个文档中仅提取 + 与查询相关的内容。 +--- + +# LLM 过滤器检索器 + +

LLM 过滤器检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/multi-query-retriever.md b/cn/integrations/langchain/retrievers/multi-query-retriever.md new file mode 100644 index 00000000..6175fed3 --- /dev/null +++ b/cn/integrations/langchain/retrievers/multi-query-retriever.md @@ -0,0 +1,13 @@ +--- +description: >- + 针对给定的用户输入从不同角度生成多个查询 + 查询。 +--- + +# 多查询检索器 + +

多查询检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/page.md b/cn/integrations/langchain/retrievers/page.md new file mode 100644 index 00000000..36ae0569 --- /dev/null +++ b/cn/integrations/langchain/retrievers/page.md @@ -0,0 +1,13 @@ +--- +description: >- + Voyage AI Rerank 按语义从最多到最少对文档进行索引 + 与查询相关。 +--- + +# Voyage AI 重新排序检索器 + +

Voyage AI Rerank 检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/prompt-retriever.md b/cn/integrations/langchain/retrievers/prompt-retriever.md new file mode 100644 index 00000000..10eefc2f --- /dev/null +++ b/cn/integrations/langchain/retrievers/prompt-retriever.md @@ -0,0 +1,13 @@ +--- +description: >- + 存储带有名称和描述的提示词模板以供稍后查询 + 多提示词链。 +--- + +# 提示词检索器 + +

提示词检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/reciprocal-rank-fusion-retriever.md b/cn/integrations/langchain/retrievers/reciprocal-rank-fusion-retriever.md new file mode 100644 index 00000000..55cae178 --- /dev/null +++ b/cn/integrations/langchain/retrievers/reciprocal-rank-fusion-retriever.md @@ -0,0 +1,11 @@ +--- +description: 倒数排名融合通过多个查询生成对搜索结果重新排名。 +--- + +# 倒数排名融合检索器 + +

倒数排名融合检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/similarity-score-threshold-retriever.md b/cn/integrations/langchain/retrievers/similarity-score-threshold-retriever.md new file mode 100644 index 00000000..486b3c9d --- /dev/null +++ b/cn/integrations/langchain/retrievers/similarity-score-threshold-retriever.md @@ -0,0 +1,11 @@ +--- +description: 根据最小相似度百分比返回结果。 +--- + +# 相似度阈值检索器 + +

相似度阈值检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/retrievers/vector-store-retriever.md b/cn/integrations/langchain/retrievers/vector-store-retriever.md new file mode 100644 index 00000000..99dec961 --- /dev/null +++ b/cn/integrations/langchain/retrievers/vector-store-retriever.md @@ -0,0 +1,11 @@ +--- +description: 将向量存储存储为检索器,以便稍后由 MultiRetrievalQAChain 查询。 +--- + +# 矢量存储检索器 + +

向量存储检索器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/text-splitters/README.md b/cn/integrations/langchain/text-splitters/README.md new file mode 100644 index 00000000..905c43cb --- /dev/null +++ b/cn/integrations/langchain/text-splitters/README.md @@ -0,0 +1,30 @@ +--- +description: LangChain文本分割器节点 +--- + +# 文本分割器 + +*** + +**当您想要处理长文本时,有必要将该文本分割成块。**\ +这听起来很简单,但这里存在很多潜在的复杂性。理想情况下,您希望将语义相关的文本片段保留在一起。 “语义相关”的含义可能取决于文本的类型。本笔记本展示了实现此目的的几种方法。 + +**在较高层面上,文本分割器的工作原理如下:** + +1. 将文本分成小的、具有语义意义的块(通常是句子)。 +2. 开始将这些小块组合成一个更大的块,直到达到一定的大小(通过某些函数测量)。 +3. 达到该大小后,将该块设为自己的文本片段,然后开始创建具有一些重叠的新文本块(以保留块之间的上下文)。 + +**这意味着您可以沿着两个不同的轴自定义文本分割器:** + +1. 文本如何分割 +2. chunk 大小如何测量 + +### 文本分割器节点: + +* [字符文本分割器](character-text-splitter.md) +* [代码文本分割器](code-text-splitter.md) +* [Html-To-Markdown 文本分割器](html-to-markdown-text-splitter.md) +* [Markdown 文本分割器](markdown-text-splitter.md) +* [递归字符文本分割器](recursive-character-text-splitter.md) +* [令牌文本分割器](token-text-splitter.md) diff --git a/cn/integrations/langchain/text-splitters/character-text-splitter.md b/cn/integrations/langchain/text-splitters/character-text-splitter.md new file mode 100644 index 00000000..e5ccb5de --- /dev/null +++ b/cn/integrations/langchain/text-splitters/character-text-splitter.md @@ -0,0 +1,11 @@ +--- +description: 仅针对一种类型的字符进行拆分(默认为“\n\n”)。 +--- + +# 字符文本分割器 + +

字符文本分割器

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/text-splitters/code-text-splitter.md b/cn/integrations/langchain/text-splitters/code-text-splitter.md new file mode 100644 index 00000000..0871d5e0 --- /dev/null +++ b/cn/integrations/langchain/text-splitters/code-text-splitter.md @@ -0,0 +1,11 @@ +--- +description: 根据特定于语言的语法拆分文档。 +--- + +# 代码文本分割器 + +

代码文本分割器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/text-splitters/html-to-markdown-text-splitter.md b/cn/integrations/langchain/text-splitters/html-to-markdown-text-splitter.md new file mode 100644 index 00000000..ac745576 --- /dev/null +++ b/cn/integrations/langchain/text-splitters/html-to-markdown-text-splitter.md @@ -0,0 +1,13 @@ +--- +description: >- + 将 Html 转换为 Markdown,然后根据以下内容将内容拆分为文档 + Markdown 标题。 +--- + +# Html-To-Markdown 文本分割器 + +

Html-To-Markdown 文本分割器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/text-splitters/markdown-text-splitter.md b/cn/integrations/langchain/text-splitters/markdown-text-splitter.md new file mode 100644 index 00000000..10917e64 --- /dev/null +++ b/cn/integrations/langchain/text-splitters/markdown-text-splitter.md @@ -0,0 +1,11 @@ +--- +description: 根据 Markdown 标题将内容拆分为文档。 +--- + +# Markdown 文本分割器 + +

Markdown 文本分割器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/text-splitters/recursive-character-text-splitter.md b/cn/integrations/langchain/text-splitters/recursive-character-text-splitter.md new file mode 100644 index 00000000..b990bdb8 --- /dev/null +++ b/cn/integrations/langchain/text-splitters/recursive-character-text-splitter.md @@ -0,0 +1,13 @@ +--- +description: >- + 按不同字符递归拆分文档 - 以“\n\n”开头, + 然后是“\n”,然后是“”。 +--- + +# 递归字符文本分割器 + +

递归字符文本分割器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/text-splitters/token-text-splitter.md b/cn/integrations/langchain/text-splitters/token-text-splitter.md new file mode 100644 index 00000000..3fde3ecf --- /dev/null +++ b/cn/integrations/langchain/text-splitters/token-text-splitter.md @@ -0,0 +1,14 @@ +--- +description: >- + 通过首先将文本转换为 BPE 标记来分割原始文本字符串,然后 + 将这些令牌分割成块并在单个块内转换令牌 + 回到文本中。 +--- + +# 令牌文本分割器 + +

令牌文本分割器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/README.md b/cn/integrations/langchain/tools/README.md new file mode 100644 index 00000000..8b5b00a1 --- /dev/null +++ b/cn/integrations/langchain/tools/README.md @@ -0,0 +1,32 @@ +--- +description: LangChain工具节点 +--- + +# 工具 + +*** + +工具是代理可以用来与世界交互的功能。这些工具可以是通用实用程序(例如搜索)、其他链,甚至其他代理。 + +### 工具节点: + +* [BraveSearch API](bravesearch-api.md) +* [无浏览器 MCP](browserless-mcp.md) +* [计算器](calculator.md) +* [链条工具](chain-tool.md) +* [聊天流工具](chatflow-tool.md) +* [自定义工具](custom-tool.md) +* [Exa 搜索](exa-search.md) +* [Google 自定义搜索](google-custom-search.md) +* [OpenAPI 工具包](openapi-toolkit.md) +* [Python 解释器](python-interpreter.md) +* [读取文件](read-file.md) +* [请求获取](request-get.md) +* [请求帖子](request-post.md) +* [检索工具](retriever-tool.md) +* [SearchApi](searchapi.md) +* [SearXNG](searxng.md) +* [Serp API](serp-api.md) +* [Serper](serper.md) +* [网络浏览器](web-browser.md) +* [写入文件](write-file.md) diff --git a/cn/integrations/langchain/tools/bravesearch-api.md b/cn/integrations/langchain/tools/bravesearch-api.md new file mode 100644 index 00000000..79de6d01 --- /dev/null +++ b/cn/integrations/langchain/tools/bravesearch-api.md @@ -0,0 +1,13 @@ +--- +description: >- + BraveSearch API 的包装 - 用于访问 Brave 搜索的实时 API + 结果。 +--- + +# BraveSearch API + +

BraveSearch API 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/browserless-mcp.md b/cn/integrations/langchain/tools/browserless-mcp.md new file mode 100644 index 00000000..1a0a19b1 --- /dev/null +++ b/cn/integrations/langchain/tools/browserless-mcp.md @@ -0,0 +1,85 @@ +--- +description: MCP 无浏览器服务器 - 抓取页面、截取屏幕截图、生成 PDF 等 +--- + +# 无浏览器 MCP + +**无浏览器 MCP** 节点通过模型上下文协议 (MCP) 将您的 Flowise 代理连接到 [无浏览器](https://browserless.io)。它支持浏览器自动化功能,例如网页抓取、截取屏幕截图、生成 PDF 等,而无需您自行管理无头浏览器基础设施。 + +--- + +## 1.先决条件 + +在使用Browserless MCP节点之前,您需要: + +- **无浏览器帐户**:在 [browserless.io](https://browserless.io) 免费注册。 +- **API 令牌**:从无浏览器仪表板获取您的令牌。 + +--- + +## 2. 设置凭据 + +1. 在 Flowise 中,从侧边栏导航至 **凭据**。 +2. 单击“**添加凭据**”并搜索“**无浏览器 API**”。 +3. 填写以下字段: + +|领域 |描述 | +| :---- | :---- | +| **API 代币** |来自仪表板的无浏览器 API 令牌 | + +4. 单击“**保存**”。 + +--- + +## 3. 添加无浏览器 MCP 节点 + +1. 在 Flowise 画布中打开聊天流。 +2. 添加 **Agent** 节点(例如 工具 Agent)。 +3. 从 **工具 (MCP)** 类别中,将 **无浏览器 MCP** 节点拖到画布上。 +4. 将无浏览器 MCP 节点的输出连接到代理节点的 **工具** 输入。 +5. 配置节点(参见下一节)。 + +--- + +## 4. 节点配置 + +|参数|类型 |必填|描述 | +| :---- | :---- | :---- | :---- | +| **连接凭据** |凭据选择器 |是的 |选择您在步骤 2 中创建的无浏览器 API 凭据。 +| **可用操作** |多选(异步)|是的 |连接凭据后,单击 **刷新** 图标以从无浏览器 MCP 服务器加载可用操作列表。选择您想要向代理公开的具体操作。 | + +--- + +## 5. 选择操作 + +提供有效凭据后,单击 **可用操作** 旁边的 **刷新** 图标。该节点将连接到无浏览器 MCP 服务器并检索所有可用工具。 + +每个操作均列出: + +- **名称:** 工具标识符 +- **描述:** 该工具的作用 + +仅选择您的代理需要的操作。更少的工具可以帮助 LLM 做出更好的决策并减少令牌使用。 + +--- + +## 6. 可用功能 + +无浏览器 MCP 服务器提供了一系列浏览器自动化工具,包括: + +- **网页抓取** — 从网页中提取内容 +- **屏幕截图** — 捕获页面屏幕截图 +- **PDF Generation** — 从网页生成 PDF +- **浏览器自动化** — 以编程方式与页面交互 + +当您刷新 **可用操作** 下拉列表时,将从 MCP 服务器动态加载可用操作的完整列表。 + +--- + +## 7. 外部参考 + +|资源 |链接 | +| :---- | :---- | +|无浏览器 MCP 服务器文档 | [docs.browserless.io/mcp/browserless-mcp-server](https://docs.browserless.io/mcp/browserless-mcp-server) | +|无浏览器文档 | [docs.browserless.io](https://docs.browserless.io) | +|无浏览器网站 | [browserless.io](https://browserless.io) | diff --git a/cn/integrations/langchain/tools/calculator.md b/cn/integrations/langchain/tools/calculator.md new file mode 100644 index 00000000..f821e597 --- /dev/null +++ b/cn/integrations/langchain/tools/calculator.md @@ -0,0 +1,11 @@ +--- +description: 对响应进行计算。 +--- + +# 计算器 + +

计算器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/chain-tool.md b/cn/integrations/langchain/tools/chain-tool.md new file mode 100644 index 00000000..9189a0fa --- /dev/null +++ b/cn/integrations/langchain/tools/chain-tool.md @@ -0,0 +1,11 @@ +--- +description: 使用链条作为代理允许的工具。 +--- + +# 链工具 + +

链工具节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/chatflow-tool.md b/cn/integrations/langchain/tools/chatflow-tool.md new file mode 100644 index 00000000..df7442b4 --- /dev/null +++ b/cn/integrations/langchain/tools/chatflow-tool.md @@ -0,0 +1,11 @@ +--- +description: 执行另一个聊天流并获取响应。 +--- + +# 聊天流工具 + +
+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/custom-tool.md b/cn/integrations/langchain/tools/custom-tool.md new file mode 100644 index 00000000..de7b17fb --- /dev/null +++ b/cn/integrations/langchain/tools/custom-tool.md @@ -0,0 +1,482 @@ +# 自定义工具 + +观看如何使用自定义工具 + +{% embed url="https://youtu.be/HSp9LkkTVY0" %} + +## 问题 + +函数通常接受结构化输入数据。假设您希望 LLM 能够调用 Airtable 创建记录 [API](https://airtable.com/developers/web/api/create-records),主体参数必须以特定方式构建。例如: + +```json +"records": [ + { + "fields": { + "Address": "some address", + "Name": "some name", + "Visited": true + } + } +] +``` + +理想情况下,我们希望 LLM 返回正确的结构化数据,如下所示: + +```json +{ + "Address": "some address", + "Name": "some name", + "Visited": true +} +``` + +因此我们可以提取该值并将其解析到 API 所需的主体中。然而,指示 LLM 输出准确的模式很困难。 + +借助新的 [OpenAI 函数调用](https://openai.com/blog/function-calling-and-other-api-updates) 模型,现在可以实现这一点。 `gpt-4-0613` 和 `gpt-3.5-turbo-0613` 经过专门训练,可返回结构化数据。该模型将智能地选择输出一个 JSON 对象,其中包含调用这些函数的参数。 + +## 教程 + +**目标**:让代理自动获取股票价格变动,检索相关股票新闻,并向 Airtable 添加新记录。 + +让我们开始[🚀](https://emojipedia.org/rocket/) + +### 创建工具 + +我们需要 3 个工具来实现目标: + +* 获取股价变动 +* 获取股票新闻 +* 添加Airtable记录 + +#### 获取股价变动 + +使用以下详细信息创建一个新工具(您可以根据需要进行更改): + +* 名称:获取\_stock\_movers +* 描述:获取价格/成交量变动最大的股票,例如积极者、获益者、受损者等 + +描述是一个重要的部分,因为 ChatGPT 依靠它来决定何时使用该工具。 + +
+ +* JavaScript 函数:我们将使用 [Morning Star](https://rapidapi.com/apidojo/api/morning-star) `/market/v2/get-movers` API 来获取数据。首先,您必须单击“订阅测试”(如果还没有),然后复制代码并将其粘贴到 JavaScript 函数中。 + * 在顶部添加 `const fetch = require('node-fetch');` 以导入库。您可以导入任何内置 NodeJS [modules](https://www.w3schools.com/nodejs/ref_modules.asp) 和 [外部库](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/src/utils.ts#L289)。 + * 最后返回 `result` 。 + +
+ +最终代码应该是: + +```javascript +const fetch = require('node-fetch'); +const url = 'https://morning-star.p.rapidapi.com/market/v2/get-movers'; +const options = { + method: 'GET', + headers: { + 'X-RapidAPI-Key': 'replace with your api key', + 'X-RapidAPI-Host': 'morning-star.p.rapidapi.com' + } +}; + +try { + const response = await fetch(url, options); + const result = await response.text(); + console.log(result); + return result; +} catch (error) { + console.error(error); + return ''; +} +``` + +您现在可以保存它。 + +#### 获取股票新闻 + +使用以下详细信息创建一个新工具(您可以根据需要进行更改): + +* 名称: 获取\_stock\_news +* 描述:获取股票的最新消息 +* 输入模式: + * 属性:性能ID + * 类型:字符串 + * 描述:股票的id,在API中称为performanceID + * 必填:真实 + +输入架构告诉 LLM 作为 JSON 对象返回什么。在这种情况下,我们期待一个 JSON 对象,如下所示: + +
{ "performanceId": "SOME TICKER" }
+
+ +
+ +* JavaScript 函数:我们将使用 [Morning Star](https://rapidapi.com/apidojo/api/morning-star) `/news/list` API 来获取数据。首先,您必须单击“订阅测试”(如果还没有),然后复制代码并将其粘贴到 JavaScript 函数中。 + * 在顶部添加 `const fetch = require('node-fetch');` 以导入库。您可以导入任何内置 NodeJS [modules](https://www.w3schools.com/nodejs/ref_modules.asp) 和 [外部库](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/src/utils.ts#L289)。 + * 最后返回 `result` 。 +* 接下来,将硬编码的url查询参数performanceId:`0P0000OQN8`替换为Input Schema中指定的属性变量:`$performanceId` +* 您可以通过在变量名称前面附加前缀 `$` 来将输入架构中指定的任何属性用作 JavaScript 函数中的变量。 + +
+ +最终代码: + +```javascript +const fetch = require('node-fetch'); +const url = 'https://morning-star.p.rapidapi.com/news/list?performanceId=' + $performanceId; +const options = { + method: 'GET', + headers: { + 'X-RapidAPI-Key': 'replace with your api key', + 'X-RapidAPI-Host': 'morning-star.p.rapidapi.com' + } +}; + +try { + const response = await fetch(url, options); + const result = await response.text(); + console.log(result); + return result; +} catch (error) { + console.error(error); + return ''; +} +``` + +您现在可以保存它。 + +#### 添加Airtable记录 + +使用以下详细信息创建一个新工具(您可以根据需要进行更改): + +* 名称: add\_airtable +* 描述:将股票、新闻摘要和价格变动添加到 Airtable +* 输入模式: + * 财产:库存 + * 类型:字符串 + * 描述:股票行情 + * 必填:真实 + * 属性:移动 + * 类型:字符串 + * 描述:价格变动百分比 + * 必填:真实 + * 属性:新闻\_摘要 + * 类型:字符串 + * 描述:该股新闻摘要 + * 必填:真实 + +ChatGPT 将返回一个 JSON 对象,如下所示: + +```json +{ "stock": "SOME TICKER", "move": "20%", "news_summary": "Some summary" } +``` + +
+ +* JavaScript 函数:我们将使用 [Airtable Create Record API](https://airtable.com/developers/web/api/create-records) 在现有表中创建新记录。您可以从[此处](https://www.highviewapps.com/kb/where-can-i-find-the-airtable-base-id-and-table-id/)找到tableId和baseId。您还需要创建个人访问令牌,请在[此处](https://www.highviewapps.com/kb/how-do-i-create-an-airtable-personal-access-token/)了解操作方法。 + +最终代码应如下所示。请注意我们如何传入 `$stock`、`$move` 和 `$news_summary` 作为变量: + +```javascript +const fetch = require('node-fetch'); +const baseId = 'your-base-id'; +const tableId = 'your-table-id'; +const token = 'your-token'; + +const body = { + "records": [ + { + "fields": { + "stock": $stock, + "move": $move, + "news_summary": $news_summary, + } + } + ] +}; + +const options = { + method: 'POST', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify(body) +}; + +const url = `https://api.airtable.com/v0/${baseId}/${tableId}` + +try { + const response = await fetch(url, options); + const text = await response.text(); + return text; +} catch (error) { + console.error(error); + return ''; +} +``` + +您现在可以保存它。 + +您应该会看到创建了 3 个工具: + +
+ +### 创建聊天流 + +您可以使用市场上的 **OpenAI Function** **Agent** 模板,并将工具替换为 **自定义工具**。选择您创建的工具。 + +注:OpenAI Function Agent 目前仅支持 0613 型号。 + +
+ +保存聊天流并开始测试。对于初学者,您可以尝试询问: + +_今天价格变动最大的股票是什么?_ + +_今天价格变动最大的股票是 Overstock.com (OSTK),价格变动为 17.47%。_ + +然后,您可以跟进另一个问题来获取该特定股票的新闻: + +_该股票的最新消息有哪些可能导致价格变动?_ + +_以下是有关 Overstock.com (OSTK) 的可能导致价格变动的最新消息:_ + +1._标题:“Overstock 股价飙升,成功以 2150 万美元竞购 Bed Bath & Beyond 资产” 来源:MarketWatch 发布日期:2023 年 6 月 22 日 摘要:成功竞购价值 2150 万美元的 Bed Bath & Beyond 资产后,Overstock.com 股价大幅上涨。_ +2._标题:“考虑在 Meta Platforms、Overstock.com、沃尔玛、家得宝或联合包裹服务公司中交易期权或股票吗?”来源:美通社 发布日期:2023 年 6 月 22 日 摘要:这篇新闻文章讨论了投资者可能考虑的潜在交易选项和股票,包括 Overstock.com。_ + +_请注意,这些新闻文章仅供参考,可能不是价格变动的唯一原因。始终建议在做出任何投资决定之前进行彻底的研究和分析。_ + +最后,您可以要求 ChatGPT 将新记录添加到 Airtable: + +_您可以向 Airtable 添加包含股票行情、价格变动和新闻摘要的记录吗?_ + +_我已向 Airtable 添加了一条记录,其中包含以下详细信息:_ + +_股票代码:OSTK 价格变动:17.47% 新闻摘要:Overstock.com 成功竞购 Bed Bath & Beyond 价值 2150 万美元资产后,股价大幅上涨。_ + +[🎉](https://emojipedia.org/party-popper/)[🎉](https://emojipedia.org/party-popper/)**瞧!** 这样您就可以创建自己的自定义工具并将其与 OpenAI Function Agent 一起使用! + +## 附加 + +### 将会话 ID 传递给函数 + +默认情况下,自定义工具中的 Function 可以访问以下流配置: + +```json5 +$flow.sessionId +$flow.chatId +$flow.chatflowId +$flow.input +``` + +以下是将 sessionId 发送到 Discord webhook 的示例: + +{% tabs %} +{% tab title="Javascript" %} +```javascript +const fetch = require('node-fetch'); +const webhookUrl = "https://discord.com/api/webhooks/1124783587267"; +const content = $content; // captured from input schema +const sessionId = $flow.sessionId; + +const body = { + "content": `${mycontent} and the sessionid is ${sessionId}` +}; + +const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(body) +}; + +const url = `${webhookUrl}?wait=true` + +try { + const response = await fetch(url, options); + const text = await response.text(); + return text; +} catch (error) { + console.error(error); + return ''; +} +``` +{% endtab %} +{% endtabs %} + +### 将变量传递给函数 + +在某些情况下,您希望将变量传递给自定义工具函数。 + +例如,您正在创建一个使用自定义工具的聊天机器人。自定义工具正在执行 HTTP POST 调用,成功验证请求需要 API 密钥。您可以将其作为变量传递。 + +默认情况下,自定义工具中的函数可以访问变量: + +``` +$vars. +``` + +如何使用 API 和嵌入式在 Flowise 中传递变量的示例: + +{% tabs %} +{% tab title="Javascript API" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/prediction/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "question": "Hey, how are you?", + "overrideConfig": { + "vars": { + "apiKey": "abc" + } + } +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} + +{% tab title="Embed" %} +```html + +``` +{% endtab %} +{% endtabs %} + +如何在自定义工具中接收变量的示例: + +{% tabs %} +{% tab title="Javascript" %} +```javascript +const fetch = require('node-fetch'); +const webhookUrl = "https://discord.com/api/webhooks/1124783587267"; +const content = $content; // captured from input schema +const sessionId = $flow.sessionId; +const apiKey = $vars.apiKey; + +const body = { + "content": `${mycontent} and the sessionid is ${sessionId}` +}; + +const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${apiKey}` + }, + body: JSON.stringify(body) +}; + +const url = `${webhookUrl}?wait=true` + +try { + const response = await fetch(url, options); + const text = await response.text(); + return text; +} catch (error) { + console.error(error); + return ''; +} +``` +{% endtab %} +{% endtabs %} + +### 覆盖自定义工具 + +以下参数可以被覆盖 + +|参数|描述 | +| ---------------- | ---------------- | +|自定义工具名称 |工具名称 | +|自定义工具描述 |工具说明| +|自定义工具架构 |工具架构| +|自定义工具函数 |工具功能| + +用于覆盖自定义工具参数的 API 调用示例: + +{% tabs %} +{% tab title="Javascript API" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/prediction/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "question": "Hey, how are you?", + "overrideConfig": { + "customToolName": "example_tool", + "customToolSchema": "z.object({title: z.string()})" + } +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +### 导入外部依赖 + +您可以将任何内置 NodeJS [modules](https://www.w3schools.com/nodejs/ref_modules.asp) 和支持的 [外部库](https://github.com/FlowiseAI/Flowise/blob/main/packages/components/src/utils.ts#L289) 导入到 Function 中。 + +1. 要导入任何不支持的库,您可以轻松地将新的 npm 包添加到 `packages/components` 文件夹中的 `package.json` 中。 + +```bash +cd Flowise && cd packages && cd components +pnpm add +cd .. && cd .. +pnpm install +pnpm build +``` + +2. 然后,将导入的库添加到 `TOOL_FUNCTION_EXTERNAL_DEP` 环境变量中。有关更多详细信息,请参阅[#内置和外部依赖关系](../../../configuration/environment-variables.md#builtin-and-external-dependencies "mention")。 +3.启动应用程序 + +```bash +pnpm start +``` + +4. 然后,您可以在 **JavaScript Function** 中使用新添加的库,如下所示: + +```javascript +const axios = require('axios') +``` + +观看如何添加额外的依赖项和导入库 + +{% embed url="https://youtu.be/0H1rrisc0ok" %} diff --git a/cn/integrations/langchain/tools/exa-search.md b/cn/integrations/langchain/tools/exa-search.md new file mode 100644 index 00000000..6d6d4c8b --- /dev/null +++ b/cn/integrations/langchain/tools/exa-search.md @@ -0,0 +1,11 @@ +--- +description: Exa Search API 的包装 - 完全设计供法学硕士使用的搜索引擎。 +--- + +# Exa 搜索 + +

Exa搜索节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/gmail.md b/cn/integrations/langchain/tools/gmail.md new file mode 100644 index 00000000..b92897dc --- /dev/null +++ b/cn/integrations/langchain/tools/gmail.md @@ -0,0 +1,72 @@ +# 邮箱 + +## 在 Flowise 中创建凭据 + +1. 添加新的 Gmail OAuth2 凭据 +2. 输入凭据的名称。 +3. 复制 OAuth 重定向 URL。 +4. 请注意,需要填写以下字段: + * 客户ID + * 客户秘密 + +
+ +## 创建/使用 Google 项目 + +1. 登录您的 [**Google Cloud**](https://console.cloud.google.com/) 帐户。 +2. 导航至 [**Google Cloud Console > API 和服务**](https://console.cloud.google.com/apis/credentials),然后从左上角的下拉列表中选择您要使用的项目(或创建一个新项目并选择它)。 +3. 如果您之前未配置过,请设置 **OAuth 同意屏幕**。 + +
+ +4. 转至 **凭据**,然后单击 **+ CREATE CREDENTIALS > OAuth 客户端 ID**。 + +
+ +5. 在 **应用程序类型** 下拉列表中,选择 **Web 应用程序**。 +6. 在 **授权重定向 URI** 下,单击 **+ ADD URI** 并粘贴之前复制的 OAuth 重定向 URL。 +7. 单击“**创建**”。 + +
+ +8. 复制客户端 ID 和客户端密钥: + +
+ +9. 在**启用的 API 和服务**中,单击 **+ ENABLE APIS AND SERVICES**。 +10. 搜索并启用 **Gmail API**。 + +
+ +11. 返回**凭据**,单击 **OAuth 2.0 客户端 ID** 下新创建的凭据,在详细信息页面上,您将找到 **客户端 ID** 和 **客户端密钥**。 + +## 在 Flowise 中完成设置 + +1. 填写之前复制的所有值。然后点击“**验证**”: + +
+ +2. 会弹出Google登录窗口: + +
+ +3.授予权限: + +
+ +4. 弹出窗口将自动关闭,凭据将被保存并可供使用。 + +## 用作代理工具 + +可以选择多种操作,让代理智能地选择合适的操作。\ +参数可以留空,以允许代理自行确定值。但是,如果用户提供值,这些值将覆盖代理的选择。 + +
+ +## 用作工具节点 + +它还可以在确定的工作流程场景中用作工具节点。例如,在继续下一步之前检索草稿消息列表。\ +在此模式下,**工具输入参数必须显式定义并填充值**。\ +与 [**用作代理工具**](gmail.md#use-as-agent-tool) 选项不同,没有代理可以自动确定输入。用户必须手动填充字段,方法是输入固定值或使用双大括号 `{{ }}` 中包含的变量。 + +
diff --git a/cn/integrations/langchain/tools/google-calendar.md b/cn/integrations/langchain/tools/google-calendar.md new file mode 100644 index 00000000..bc1d43b9 --- /dev/null +++ b/cn/integrations/langchain/tools/google-calendar.md @@ -0,0 +1,72 @@ +# 谷歌日历 + +## 在 Flowise 中创建凭据 + +1. 添加新的 Google 日历 OAuth2 凭据 +2. 输入凭据的名称。 +3. 复制 OAuth 重定向 URL。 +4. 请注意,需要填写以下字段: + * 客户ID + * 客户秘密 + +
+ +## 创建/使用 Google 项目 + +1. 登录您的 [**Google Cloud**](https://console.cloud.google.com/) 帐户。 +2. 导航至 [**Google Cloud Console > API 和服务**](https://console.cloud.google.com/apis/credentials),然后从左上角的下拉列表中选择您要使用的项目(或创建一个新项目并选择它)。 +3. 如果您之前未配置过,请设置 **OAuth 同意屏幕**。 + +
+ +4. 转至 **凭据**,然后单击 **+ CREATE CREDENTIALS > OAuth 客户端 ID**。 + +
+ +5. 在 **应用程序类型** 下拉列表中,选择 **Web 应用程序**。 +6. 在 **授权重定向 URI** 下,单击 **+ ADD URI** 并粘贴之前复制的 OAuth 重定向 URL。 +7. 单击“**创建**”。 + +
+ +8. 复制客户端 ID 和客户端密钥: + +
+ +9. 在**启用的 API 和服务**中,单击 **+ ENABLE APIS AND SERVICES**。 +10. 搜索并启用 **Google 日历 API**。 + +
+ +11. 返回**凭据**,单击 **OAuth 2.0 客户端 ID** 下新创建的凭据,在详细信息页面上,您将找到 **客户端 ID** 和 **客户端密钥**。 + +## 在 Flowise 中完成设置 + +1. 填写之前复制的所有值。然后点击“**验证**”: + +
+ +2. 会弹出Google登录窗口: + +
+ +3.授予权限: + +
+ +4. 弹出窗口将自动关闭,凭据将被保存并可供使用。 + +## 用作代理工具 + +可以选择多种操作,让代理智能地选择合适的操作。\ +参数可以留空,以允许代理自行确定值。但是,如果用户提供值,这些值将覆盖代理的选择。 + +
+ +## 用作工具节点 + +它还可以在确定的工作流程场景中用作工具节点。例如,在继续下一步之前检索草稿消息列表。\ +在此模式下,**工具输入参数必须显式定义并填充值**。\ +与 [**用作代理工具**](google-calendar.md#use-as-agent-tool) 选项不同,没有代理可以自动确定输入。用户必须手动填充字段,方法是输入固定值或使用双大括号 `{{ }}` 中包含的变量。 + +
diff --git a/cn/integrations/langchain/tools/google-custom-search.md b/cn/integrations/langchain/tools/google-custom-search.md new file mode 100644 index 00000000..e8954eeb --- /dev/null +++ b/cn/integrations/langchain/tools/google-custom-search.md @@ -0,0 +1,13 @@ +--- +description: >- + Google 自定义搜索 API 的包装 - 用于访问 Google 的实时 API + 搜索结果。 +--- + +# Google 自定义搜索 + +

Google 自定义搜索节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/google-drive.md b/cn/integrations/langchain/tools/google-drive.md new file mode 100644 index 00000000..18a5a2d1 --- /dev/null +++ b/cn/integrations/langchain/tools/google-drive.md @@ -0,0 +1,76 @@ +# 谷歌云端硬盘 + +## 在 Flowise 中创建凭据 + +1. 添加新的 Google Drive OAuth2 凭据 +2. 输入凭据的名称。 +3. 复制 OAuth 重定向 URL。 +4. 请注意,需要填写以下字段: + * 客户ID + * 客户秘密 + +
+ +## 创建/使用 Google 项目 + +1. 登录您的 [**Google Cloud**](https://console.cloud.google.com/) 帐户。 +2. 导航至 [**Google Cloud Console > API 和服务**](https://console.cloud.google.com/apis/credentials),然后从左上角的下拉列表中选择您要使用的项目(或创建一个新项目并选择它)。 +3. 如果您之前未配置过,请设置 **OAuth 同意屏幕**。 + +
+ +4. 转至 **凭据**,然后单击 **+ CREATE CREDENTIALS > OAuth 客户端 ID**。 + +
+ +5. 在 **应用程序类型** 下拉列表中,选择 **Web 应用程序**。 +6. 在 **授权重定向 URI** 下,单击 **+ ADD URI** 并粘贴之前复制的 OAuth 重定向 URL。 +7. 单击“**创建**”。 + +
+ +8. 复制客户端 ID 和客户端密钥: + +
+ +9. 在**启用的 API 和服务**中,单击 **+ ENABLE APIS AND SERVICES**。 +10. 搜索并启用 **Google Drive API**。 + +
+ +11. 返回**凭据**,单击 **OAuth 2.0 客户端 ID** 下新创建的凭据,在详细信息页面上,您将找到 **客户端 ID** 和 **客户端密钥**。 + +## 在 Flowise 中完成设置 + +1. 填写之前复制的所有值。然后点击“**验证**”: + +
+ +2. 会弹出Google登录窗口: + +
+ +3.授予权限: + +
+ +4. 弹出窗口将自动关闭,凭据将被保存并可供使用。 + +## 用作代理工具 + +可以选择多种操作,让代理智能地选择合适的操作。\ +参数可以留空,以允许代理自行确定值。但是,如果用户提供值,这些值将覆盖代理的选择。 + +
+ +## 用作工具节点 + +它还可以在确定的工作流程场景中用作工具节点。例如,在继续下一步之前获取特定的电子表格。\ +在此模式下,**工具输入参数必须显式定义并填充值**。\ +与 [**用作代理工具**](google-drive.md#use-as-agent-tool) 选项不同,没有代理可以自动确定输入。用户必须手动填充字段,方法是输入固定值或使用双大括号 `{{ }}` 中包含的变量。 + +
+ +从上述工具节点在 Google Drive 中创建的示例 PDF 文件: + +
diff --git a/cn/integrations/langchain/tools/google-sheets.md b/cn/integrations/langchain/tools/google-sheets.md new file mode 100644 index 00000000..624450e7 --- /dev/null +++ b/cn/integrations/langchain/tools/google-sheets.md @@ -0,0 +1,72 @@ +# 谷歌表格 + +## 在 Flowise 中创建凭据 + +1. 添加新的 Google Sheets OAuth2 凭据 +2. 输入凭据的名称。 +3. 复制 OAuth 重定向 URL。 +4. 请注意,需要填写以下字段: + * 客户ID + * 客户秘密 + +
+ +## 创建/使用 Google 项目 + +1. 登录您的 [**Google Cloud**](https://console.cloud.google.com/) 帐户。 +2. 导航至 [**Google Cloud Console > API 和服务**](https://console.cloud.google.com/apis/credentials),然后从左上角的下拉列表中选择您要使用的项目(或创建一个新项目并选择它)。 +3. 如果您之前未配置过,请设置 **OAuth 同意屏幕**。 + +
+ +4. 转至 **凭据**,然后单击 **+ CREATE CREDENTIALS > OAuth 客户端 ID**。 + +
+ +5. 在 **应用程序类型** 下拉列表中,选择 **Web 应用程序**。 +6. 在 **授权重定向 URI** 下,单击 **+ ADD URI** 并粘贴之前复制的 OAuth 重定向 URL。 +7. 单击“**创建**”。 + +
+ +8. 复制客户端 ID 和客户端密钥: + +
+ +9. 在**启用的 API 和服务**中,单击 **+ ENABLE APIS AND SERVICES**。 +10. 搜索并启用 **Google 表格 API**。 + +
+ +11. 返回**凭据**,单击 **OAuth 2.0 客户端 ID** 下新创建的凭据,在详细信息页面上,您将找到 **客户端 ID** 和 **客户端密钥**。 + +## 在 Flowise 中完成设置 + +1. 填写之前复制的所有值。然后点击“**验证**”: + +
+ +2. 会弹出Google登录窗口: + +
+ +3.授予权限: + +
+ +4. 弹出窗口将自动关闭,凭据将被保存并可供使用。 + +## 用作代理工具 + +可以选择多种操作,让代理智能地选择合适的操作。\ +参数可以留空,以允许代理自行确定值。但是,如果用户提供值,这些值将覆盖代理的选择。 + +
+ +## 用作工具节点 + +它还可以在确定的工作流程场景中用作工具节点。例如,在继续下一步之前获取特定的电子表格。\ +在此模式下,**工具输入参数必须显式定义并填充值**。\ +与 [**用作代理工具**](google-sheets.md#use-as-agent-tool) 选项不同,没有代理可以自动确定输入。用户必须手动填充字段,方法是输入固定值或使用双大括号 `{{ }}` 中包含的变量。 + +
diff --git a/cn/integrations/langchain/tools/microsoft-outlook.md b/cn/integrations/langchain/tools/microsoft-outlook.md new file mode 100644 index 00000000..9d6c2a45 --- /dev/null +++ b/cn/integrations/langchain/tools/microsoft-outlook.md @@ -0,0 +1,78 @@ +# 微软 Outlook + +## 先决条件 + +分配给 Azure Active Directory 用户的有效 Microsoft 365 许可证。请参阅:[https://learn.microsoft.com/en-us/answers/questions/761931/microsoft-graph-api-throws-the-mailbox-is-either-i](https://learn.microsoft.com/en-us/answers/questions/761931/microsoft-graph-api-throws-the-mailbox-is-either-i) + +## 在 Flowise 中创建凭据 + +1. 添加新的 Microsoft Outlook OAuth2 凭据 +2. 输入凭据的名称。 +3. 复制 OAuth 重定向 URL。 +4. 请注意,需要填写以下字段: + * 授权URL + * 访问令牌 URL + * 客户ID + * 客户秘密 + +
+ +## 创建 Azure 应用程序 + +1. 登录您现有的[Azure](https://login.microsoftonline.com/)帐户,或者[注册](https://signup.live.com/signup)(如果您尚未注册) +2. 搜索**应用程序注册**。 +3. 接下来,在[应用注册](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/CreateApplicationBlade/quickStartType~/null/isMSAApp~/false)中注册一个新的 Azure 应用程序。 + +
+ +4. 在“重定向 URI(可选)”下,选择“Web”并粘贴您之前复制的“OAuth 重定向 URL”。 + +
+ +5. 创建应用程序后,导航到 **证书和密钥** > **客户端密钥**,然后单击“**新客户端密钥**”按钮以创建客户端密钥。复制秘密以供稍后使用。 + +
+ +6. 导航到**概述**并单击“**端点**”。复制“**OAuth 2.0 授权端点 (v2)**”和“**OAuth 2.0 令牌端点 (v2)**”的端点。 + +
+ +7. 关闭端点弹出窗口,复制**应用程序(客户端)ID**: + +
+ +## 在 Flowise 中完成设置 + +1. 填写之前复制的所有值。然后点击“**验证**”: + +
+ +2. 将弹出 Microsoft 窗口,选择帐户。 + +{% hint style="warning" %} +帐户用户必须拥有有效的 Microsoft 365 许可 +{% endhint %} + +
+ +3. 授予所需的权限: + +
+ +4. 弹出窗口将自动关闭,随后将保存凭据。 + +## 用作代理工具 + +可以选择多种操作,让代理智能地选择合适的操作。\ +参数可以留空,以允许代理自行确定值。但是,如果用户提供值,这些值将覆盖代理的选择。 + +
+ +## 用作工具节点 + +它还可以在确定的工作流程场景中用作工具节点。例如,在继续下一步之前检索 Outlook 邮件列表。\ +在此模式下,**工具输入参数必须显式定义并填充值**。\ +与 [**用作代理工具**](microsoft-outlook.md#use-as-agent-tool) 选项不同,没有代理可以自动确定输入。用户必须手动填充字段,方法是输入固定值或使用双大括号 `{{ }}` 中包含的变量。 + +
+ diff --git a/cn/integrations/langchain/tools/microsoft-teams.md b/cn/integrations/langchain/tools/microsoft-teams.md new file mode 100644 index 00000000..5185f3e2 --- /dev/null +++ b/cn/integrations/langchain/tools/microsoft-teams.md @@ -0,0 +1,77 @@ +# 微软团队 + +## 先决条件 + +分配给 Azure Active Directory 用户的有效 Microsoft 365 许可证。请参阅:[https://learn.microsoft.com/en-us/answers/questions/761931/microsoft-graph-api-throws-the-mailbox-is-either-i](https://learn.microsoft.com/en-us/answers/questions/761931/microsoft-graph-api-throws-the-mailbox-is-either-i) + +## 在 Flowise 中创建凭据 + +1. 添加新的 Microsoft Teams OAuth2 凭据 +2. 输入凭据的名称。 +3. 复制 OAuth 重定向 URL。 +4. 请注意,需要填写以下字段: + * 授权URL + * 访问令牌 URL + * 客户ID + * 客户秘密 + +
+ +## 创建 Azure 应用程序 + +1. 登录您现有的[Azure](https://login.microsoftonline.com/)帐户,或者[注册](https://signup.live.com/signup)(如果您尚未注册) +2. 搜索**应用程序注册**。 +3. 接下来,在[应用注册](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/CreateApplicationBlade/quickStartType~/null/isMSAApp~/false)中注册一个新的 Azure 应用程序。 + +
+ +4. 在“重定向 URI(可选)”下,选择“Web”并粘贴您之前复制的“OAuth 重定向 URL”。 + +
+ +5. 创建应用程序后,导航到 **证书和密钥** > **客户端密钥**,然后单击“**新客户端密钥**”按钮以创建客户端密钥。复制秘密以供稍后使用。 + +
+ +6. 导航到**概述**并单击“**端点**”。复制“**OAuth 2.0 授权端点 (v2)**”和“**OAuth 2.0 令牌端点 (v2)**”的端点。 + +
+ +7. 关闭端点弹出窗口,复制**应用程序(客户端)ID**: + +
+ +## 在 Flowise 中完成设置 + +1. 填写之前复制的所有值。然后点击“**验证**”: + +
+ +2. 将弹出 Microsoft 窗口,选择帐户。 + +{% hint style="warning" %} +帐户用户必须拥有有效的 Microsoft 365 许可 +{% endhint %} + +
+ +3. 授予所需的权限: + +
+ +4. 弹出窗口将自动关闭,随后将保存凭据。 + +## 用作代理工具 + +可以选择多种操作,让代理智能地选择合适的操作。\ +参数可以留空,以允许代理自行确定值。但是,如果用户提供值,这些值将覆盖代理的选择。 + +
+ +## 用作工具节点 + +它还可以在确定的工作流程场景中用作工具节点。例如,在继续下一步之前检索 Teams 消息列表。\ +在此模式下,**工具输入参数必须显式定义并填充值**。\ +与 [**用作代理工具**](microsoft-teams.md#use-as-agent-tool) 选项不同,没有代理可以自动确定输入。用户必须手动填充字段,方法是输入固定值或使用双大括号 `{{ }}` 中包含的变量。 + +
diff --git a/cn/integrations/langchain/tools/openapi-toolkit.md b/cn/integrations/langchain/tools/openapi-toolkit.md new file mode 100644 index 00000000..252cd6ca --- /dev/null +++ b/cn/integrations/langchain/tools/openapi-toolkit.md @@ -0,0 +1,11 @@ +--- +description: 加载 OpenAPI 规范。 +--- + +# OpenAPI 工具包 + +

OpenAPI 工具包节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/pipedream-mcp-user-guide-1.md b/cn/integrations/langchain/tools/pipedream-mcp-user-guide-1.md new file mode 100644 index 00000000..a7fdfa1a --- /dev/null +++ b/cn/integrations/langchain/tools/pipedream-mcp-user-guide-1.md @@ -0,0 +1,77 @@ +# 松弛 MCP + +## 1.先决条件 + +在使用 Slack MCP 节点之前,您需要: + +* **Slack 帐户**:在 [https://slack.com/](https://slack.com/) 处注册 +* **Slack 工作区** +* **OAuth 客户端应用程序**:在 Slack 工作区中生成。这将为您提供 **客户端 ID** 和 **客户端密钥**。 + +*** + +## 2. 设置 Slack 凭据 + +### 2.1 在 Slack 中创建一个新应用 + +1. 转到[https://api.slack.com/apps/new](https://api.slack.com/apps/new) +2. 通过清单或从头开始创建一个新应用程序。 + +
+ +3. 创建应用程序后,获取客户端 ID 和客户端密钥。 + +
+ +### 2.2 在 Flowise 中添加凭据 + +1. 在 Flowise 中,从侧边栏导航至 **凭据**。 +2. 单击“**添加凭据**”并搜索“**Slack 用户令牌 OAuth2**”。 +3. 填写以下字段: + +
领域描述示例
客户IDSlack 中的 OAuth 客户端 IDwBSGhxxxx
客户秘密OAuth 客户端密钥(安全存储)••••••••
范围(可选) 空格分隔的范围。

search:read.public search:read.private search:read.mpim search:read.im search:read.files search:read.users groups:history

mpim:history

im:history

channels:history

chat:write

canvases:read canvases:write

users:read

users:read.email

+ +4. 复制 OAuth 重定向 URL,然后单击 **保存**。 + +
+ +**提示词:** 对于生产环境,请使用您需要的最窄范围。查看可用的[范围](https://docs.slack.dev/reference/scopes/)。 + +### 2.3 添加重定向 URL 到 Slack 应用程序 + +1. 从左侧导航栏中选择 OAuth & Permissions: + +
+ +2. 向下滚动,您将看到重定向 URL 部分。添加从上一步复制的重定向 URL。然后单击保存 URL。 + +
+ +*** + +## 3. 添加松弛 MCP + +1. 拖放一个 Agent 节点。 +2. 添加新的 Slack MCP 工具。 + +
+ +3. 选择预配置的凭据,然后单击编辑按钮。单击“身份验证”。 + +
+ +3. 将出现一个 slack 弹出窗口,检查权限并单击允许。 + +
+ +4. 通过身份验证后,单击刷新按钮以加载可用的操作。 + +
+ +5. 选择操作。 _提示词:仅选择您的代理需要的操作。更少的工具可以帮助 LLM 做出更好的决策并减少代币使用。_ + +
+ +6.瞧!您可以开始与 Agent 聊天,看看它如何调用 Slack MCP 工具。 + +
diff --git a/cn/integrations/langchain/tools/pipedream-mcp-user-guide.md b/cn/integrations/langchain/tools/pipedream-mcp-user-guide.md new file mode 100644 index 00000000..189c9145 --- /dev/null +++ b/cn/integrations/langchain/tools/pipedream-mcp-user-guide.md @@ -0,0 +1,182 @@ +# 白日梦 MCP + +**Pipedream MCP** 节点通过 [Pipedream Connect](https://pipedream.com/docs/connect/mcp/developers) 将您的 Flowise 代理连接到 3,000 多个 API 和 10,000 多个预构建工具。您的代理可以发送 Slack 消息、创建 GitHub 问题、更新 Google Sheets、管理 Notion 页面等等 - 所有这些都使用标准化的 MCP(模型上下文协议)接口和完全托管的 OAuth。 + +*** + +## 1.先决条件 + +在使用 Pipedream MCP 节点之前,您需要: + +* **Pipedream 帐户**:在 [pipedream.com](https://pipedream.com) 上注册(免费套餐最多支持 1,000 个关联帐户)。 +* **Pipedream Connect 项目**:通过 Pipedream 仪表板或 CLI (`pd init connect`) 创建一个项目。 +* **OAuth 客户端**:在 Pipedream 工作区的 [API 设置](https://pipedream.com/settings/api) 内生成。这将为您提供 **客户端 ID** 和 **客户端密钥**。 + +*** + +## 2. 设置 Pipedream 凭据 + +### 2.1 在 Pipedream 中创建 OAuth 客户端 + +1. 转至 [pipedream.com/settings/api](https://pipedream.com/settings/api)。 +2. 单击“**新建 OAuth 客户端**”。 +3. 为您的客户端命名(例如 `Flowise Agent`),然后单击 **创建**。 +4. **立即复制客户端密钥,**它不会再次显示。 +5. 从列表中复制**客户端 ID**。 + +
+ +### 2.2 查找您的项目 ID + +1. 从仪表板打开 Pipedream 项目。 +2. 项目 ID 在项目设置中可见(格式:`proj_xxxxxxx`)。 + +
+ +### 2.3 在 Flowise 中添加凭据 + +1. 在 Flowise 中,从侧边栏导航至 **凭据**。 +2. 单击“**添加凭据**”并搜索“**Pipedream Connect**”。 +3. 填写以下字段: + +|领域 |描述 |示例| +| ----------------- | --------------------------------------------------------------------------- | ------------- | +| **客户端ID** | Pipedream 中的 OAuth 客户端 ID | `wBSGhxxxx` | +| **客户秘密** | OAuth 客户端密钥(安全存储)| `••••••••` | +| **项目ID** |您的 Pipedream Connect 项目 ID | `proj_xyz789` | +| **OAuth 范围** | _(可选)_ 以空格分隔的范围。如果留空,则默认为 `connect:*`。 | `connect:*` | + +4. 单击“**保存**”。 + +
+ +**提示词:** 对于生产环境,请使用您需要的最窄范围。请参阅[Pipedream 身份验证文档](https://pipedream.com/docs/connect/api-reference/authentication) 了解可用范围。 + +*** + +## 3. 添加 Pipedream MCP 节点 + +1. 在 Flowise 画布中打开智能体流程。 +2. 添加**Agent**节点。 +3. 从 **工具 (MCP)** 类别中,选择 **Pipedream MCP**。 +4. 配置节点(参见下一节)。 + +
+ +*** + +## 4. 节点配置参考 + +|参数|类型 |必填|描述 | +| ---------------------- | ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **连接凭据** |凭据选择器 |是的 |选择您在步骤 2 中创建的 Pipedream Connect 凭据。 +| **环境** |下拉|是的 | `Development` 或 `Production`。控制您连接的帐户和工具调用运行的 Pipedream 环境。使用 `Development` 进行测试。 | +| **应用程序段** |文字|是的 | Pipedream 应用程序的唯一标识符(例如 `slack`、`gmail`、`notion`、`linear`)。浏览 [mcp.pipedream.com](https://mcp.pipedream.com) 上的所有可用应用。通过逗号分隔支持**多个应用程序**(例如,`slack,notion`)。 | +| **用户ID** |文本(接受变量)|是的 |最终用户的唯一标识符。支持 Flowise 变量 `{{$vars.user_email}}` 和流变量 `{{$flow.sessionId}}`。请参阅[第 7 节](pipedream-mcp-user-guide.md#7-using-variables-for-user-id)。 | +| **工具模式** |下拉|是的 |目前支持 `工具 only` 模式,该模式将应用程序的预构建操作作为单独的工具公开给代理。 | +| **可用操作** |多选(异步)|是的 |填写应用程序 Slug 和用户 ID 后,单击 **刷新** 按钮加载指定应用程序的可用操作列表。选择您想要向代理公开的具体操作。 | + +
+ +*** + +## 5. 选择操作 + +提供有效的 **App Slug** 和 **用户 ID** 后,单击 **可用操作** 旁边的刷新图标。该节点将连接到 Pipedream 的远程 MCP 服务器并检索指定应用程序的所有可用工具。 + +每个操作均列出: + +* **名称:** 工具标识符(以大写形式显示),例如 `GITHUB-GET-REPOSITORY` +* **描述:** 该工具的作用,例如_“获取特定存储库的信息”_ + +仅选择您的代理需要的操作。更少的工具可以帮助 LLM 做出更好的决策并减少令牌使用。 + +
+ +### 查找应用程序 Slug + +**app slug** 是 Pipedream 上 URL 中显示的小写名称。例如: + +* `pipedream.com/apps/slack` → 段塞是 `slack` +* `pipedream.com/apps/google-sheets` → 段塞是 `google-sheets` +* `pipedream.com/apps/notion` → 段塞是 `notion` + +请访问 [mcp.pipedream.com](https://mcp.pipedream.com) 或 [pipedream.com/explore](https://pipedream.com/explore) 浏览完整目录。 + +
+ +*** + +## 6. 账户连接流程 + +当代理为尚未连接该应用程序帐户的用户调用 Pipedream 工具时,Pipedream 会返回 **Connect URL**。 Pipedream MCP 节点会自动检测到这一点,并向用户提供连接 URL。连接 URL 打开 Pipedream 托管页面,用户在其中授权应用程序(例如,通过 OAuth 登录 Slack)。该链接仅限于特定用户,并在 4 小时后过期。 + +**要点:** + +* 连接 URL 在聊天 UI 中呈现为可点击链接。 +* 用户连接账户后,后续工具调用将正常执行。 +* 用户凭据在 Pipedream 的服务器上静态加密,并且永远不会暴露给 LLM。 + +
+ +*** + +## 7. 使用变量作为用户 ID + +**用户 ID** 字段标识 Pipedream Connect 中的最终用户。这对于每个用户连接自己帐户的多用户场景至关重要。 + +### 支持的变量类型 + +|变量语法 |来源 |解决于 | +| ---------------------- | --------------------------- | --------------------- | +| `{{$vars.user_email}}` | Flowise 工作区变量 |设计时 + 运行时 | +| `{{$flow.sessionId}}` |流程上下文(会话)|仅运行时 | + +### 工作区变量 + +1. 在 Flowise 中,从侧边栏转到 **变量**。 +2. 创建一个变量(例如,值为 `john@example.com` 的 `user_email`)。 +3. 在 Pipedream MCP 节点中,将 **用户 ID** 设置为 `{{$vars.user_email}}`。 + +
+ +### 流变量 + +使用 `{{$flow.sessionId}}` 自动确定每个聊天会话的 Pipedream 帐户范围。当每个会话代表不同的用户时,这非常有用。 + +**重要提示词:** 像 `{{$flow.sessionId}}` 这样的流变量仅在运行时解析。在编辑器中单击“可用操作”上的“刷新”时,节点会使用后备预览用户 ID (`flowise_preview_user`),以便操作列表仍然有效。 + +### 静态用户 ID + +对于单用户或测试场景,您还可以输入纯字符串,例如 `test-user-1` 或 `admin@mycompany.com`。 + +**允许的字符:** 字母、数字、`.` `_` `@` `+` `-`(最多 250 个字符)。 + +*** + +## 8. 安全最佳实践 + +|实践|详情 | +| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| **启用“需要人工输入”** |对于破坏性或写入操作(发送消息、删除数据),请在代理节点上启用人工批准。 | +| **使用狭窄的 OAuth 范围** |在您的 Pipedream 凭据中,仅指定您需要的范围。 | +| **使用每用户 ID** |始终为每个最终用户使用唯一的用户 ID。这可确保 Pipedream 将凭据范围限定为单个用户。 | +| **在产品中使用生产环境** |部署时从 `Development` 切换到 `Production`。 Pipedream 为每个环境保留单独的凭据存储。 | +| **选择最少的操作** |仅公开您的代理需要的操作。更少的工具可以减少攻击面并提高 LLM 准确性。 | +| **保护您的客户秘密** |切勿在客户端代码或版本控制中暴露客户端密钥。 Flowise 将其加密存储。 | + +*** + +## 9. 外部参考 + +|资源 |链接 | +| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| Pipedream MCP 开发人员文档 | [pipedream.com/docs/connect/mcp/developers](https://pipedream.com/docs/connect/mcp/developers) | +|浏览可用的 MCP 应用程序和工具 | [mcp.pipedream.com](https://mcp.pipedream.com) | +|探索 Pipedream Actions | [pipedream.com/explore](https://pipedream.com/explore) | +| Pipedream Connect 概述 | [pipedream.com/docs/connect/mcp](https://pipedream.com/docs/connect/mcp) | +| OAuth / 身份验证文档 | [pipedream.com/docs/connect/api-reference/authentication](https://pipedream.com/docs/connect/api-reference/authentication) | +|应用程序发现| [pipedream.com/docs/connect/app-discovery](https://pipedream.com/docs/connect/app-discovery) | +|连接快速入门 (CLI) | [pipedream.com/docs/connect/quickstart](https://pipedream.com/docs/connect/quickstart) | +| Pipedream 安全与隐私 | [pipedream.com/docs/privacy-and-security](https://pipedream.com/docs/privacy-and-security) | +| MCP 工具模式(子代理/完整配置)| [pipedream.com/docs/connect/mcp/tool-modes](https://pipedream.com/docs/connect/mcp/tool-modes) | diff --git a/cn/integrations/langchain/tools/python-interpreter.md b/cn/integrations/langchain/tools/python-interpreter.md new file mode 100644 index 00000000..40b8565b --- /dev/null +++ b/cn/integrations/langchain/tools/python-interpreter.md @@ -0,0 +1,5 @@ +# E2B 的代码解释器 + +[E2B](https://e2b.dev/) 是一个开源运行时,用于在安全云沙箱中执行 AI 生成的代码。例如,当用户要求生成数据的条形图时,LLM 将输出绘制该图所需的 python 代码。生成的代码将被发送到 E2B,执行的输出将包含图形、代码、文本等图像。这些输出将被发送回 LLM 进行最终处理,然后显示在聊天中。 + +
diff --git a/cn/integrations/langchain/tools/read-file.md b/cn/integrations/langchain/tools/read-file.md new file mode 100644 index 00000000..73d5ff2c --- /dev/null +++ b/cn/integrations/langchain/tools/read-file.md @@ -0,0 +1,11 @@ +--- +description: 从磁盘读取文件。 +--- + +# 读取文件 + +{% hint style="warning" %} +该工具将在 Flowise v3.0.11 中删除 +{% endhint %} + +

读取文件节点

diff --git a/cn/integrations/langchain/tools/request-get.md b/cn/integrations/langchain/tools/request-get.md new file mode 100644 index 00000000..a7b02960 --- /dev/null +++ b/cn/integrations/langchain/tools/request-get.md @@ -0,0 +1,11 @@ +--- +description: 执行 HTTP GET 请求。 +--- + +# 请求获取 + +

请求获取节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/request-post.md b/cn/integrations/langchain/tools/request-post.md new file mode 100644 index 00000000..c9c157a3 --- /dev/null +++ b/cn/integrations/langchain/tools/request-post.md @@ -0,0 +1,11 @@ +--- +description: 执行 HTTP POST 请求。 +--- + +# 请求帖子 + +

请求发布节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/retriever-tool.md b/cn/integrations/langchain/tools/retriever-tool.md new file mode 100644 index 00000000..9e27f09e --- /dev/null +++ b/cn/integrations/langchain/tools/retriever-tool.md @@ -0,0 +1,11 @@ +--- +description: 使用检索器作为代理允许的工具。 +--- + +# 检索工具 + +

检索工具节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/searchapi.md b/cn/integrations/langchain/tools/searchapi.md new file mode 100644 index 00000000..7d5a99f8 --- /dev/null +++ b/cn/integrations/langchain/tools/searchapi.md @@ -0,0 +1,11 @@ +--- +description: 实时 API 用于访问 Google 搜索数据。 +--- + +# 搜索API + +

SearchApi节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/searxng.md b/cn/integrations/langchain/tools/searxng.md new file mode 100644 index 00000000..d3c23fa0 --- /dev/null +++ b/cn/integrations/langchain/tools/searxng.md @@ -0,0 +1,34 @@ +--- +description: SearXNG 的包装 - 一个免费的互联网元搜索引擎。 +--- + +# 西尔XNG + +

SearXNG 节点

+ +### 设置 SearXNG + +按照[官方文档](https://docs.searxng.org/admin/installation.html)在本地设置 SearXNG。在本例中,我们将使用 Docker Compose 进行设置。 + +导航到 [searxng-docker](https://github.com/searxng/searxng-docker) 存储库并按照设置说明进行操作。 + +确保将 `server.limiter` 设置为 `false` 并且 `json` 包含在 `search.formats` 中。这些参数可以在 `searxng/settings.yml` 中定义: + +```yaml +server: + limiter: false +general: + debug: true +search: + formats: + - html + - json +``` + +`docker-compose up -d` 启动容器。打开网络浏览器并转到 **http://localhost:8080/search**, 您将能够看到 SearXNG 页面。 + +### 在 Flowise 中使用 + +将 SearXNG 节点拖放到画布上。将 Base URL 填写为 **http://localhost:8080.** 如果需要,您还可以指定其他搜索参数。 LLM 将自动找出用于搜索查询问题的内容。 + +
diff --git a/cn/integrations/langchain/tools/serp-api.md b/cn/integrations/langchain/tools/serp-api.md new file mode 100644 index 00000000..c286ab29 --- /dev/null +++ b/cn/integrations/langchain/tools/serp-api.md @@ -0,0 +1,11 @@ +--- +description: SerpAPI 的包装器 - 用于访问 Google 搜索结果的实时 API。 +--- + +# Serp API + +
+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/serper.md b/cn/integrations/langchain/tools/serper.md new file mode 100644 index 00000000..538e263c --- /dev/null +++ b/cn/integrations/langchain/tools/serper.md @@ -0,0 +1,11 @@ +--- +description: Serper.dev 的包装 - Google 搜索 API。 +--- + +# 毒蛇 + +

Serper节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/tavily-ai.md b/cn/integrations/langchain/tools/tavily-ai.md new file mode 100644 index 00000000..a5e70b95 --- /dev/null +++ b/cn/integrations/langchain/tools/tavily-ai.md @@ -0,0 +1,19 @@ +--- +description: TavilyAI API 的包装 - 为 LLM 和 RAG 量身定制的实时、准确的搜索结果。 +--- + +# 塔维利人工智能 + +

塔维利节点

+ +## 设置 + +1. 添加Tavily API 节点。单击添加节点按钮,**LangChain** > **工具** > **Tavily API** + +2. 为 Tavily 创建凭据。请参阅[官方指南](https://docs.tavily.com/guides/quickstart),了解如何获取 Tavily API 密钥。 + +
+ +
+ +3. 现在您可以将此节点连接到任何接受工具输入的节点以获取实时搜索结果。 diff --git a/cn/integrations/langchain/tools/web-browser.md b/cn/integrations/langchain/tools/web-browser.md new file mode 100644 index 00000000..02b6c2d5 --- /dev/null +++ b/cn/integrations/langchain/tools/web-browser.md @@ -0,0 +1,11 @@ +--- +description: 使代理能够访问网站并提取信息。 +--- + +# 网页浏览器 + +

网络浏览器节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/tools/write-file.md b/cn/integrations/langchain/tools/write-file.md new file mode 100644 index 00000000..58b5a87e --- /dev/null +++ b/cn/integrations/langchain/tools/write-file.md @@ -0,0 +1,11 @@ +--- +description: 将文件写入磁盘。 +--- + +# 写入文件 + +{% hint style="warning" %} +该工具将在 Flowise v3.0.11 中删除 +{% endhint %} + +

写文件节点

diff --git a/cn/integrations/langchain/vector-stores/README.md b/cn/integrations/langchain/vector-stores/README.md new file mode 100644 index 00000000..15c882fd --- /dev/null +++ b/cn/integrations/langchain/vector-stores/README.md @@ -0,0 +1,36 @@ +--- +description: LangChain向量存储节点 +--- + +# 向量存储 + +*** + +矢量存储或矢量数据库是指专门用于存储和检索高维数值矢量的数据库系统。矢量存储旨在有效管理和索引这些矢量,从而实现快速相似性搜索。 + +### 观看有关 向量存储 的介绍以及如何在 Flowise 上使用它 + +{% embed url="https://youtu.be/m0nr1_pnAxc" %} + +### 向量存储节点: + +* [AstraDB](astradb.md) +* [色度](chroma.md) +* [沙发底座](couchbase.md) +* [弹性](elastic.md) +* [费斯](faiss.md) +* [内存中矢量存储](in-memory-vector-store.md) +* [Milvus](milvus.md) +* [MongoDB Atlas](mongodb-atlas.md) +* [打开搜索](opensearch.md) +* [松果](pinecone.md) +* [Postgres](postgres.md) +* [Qdrant](qdrant.md) +* [Redis](redis.md) +* [SingleStore](singlestore.md) +* [Supabase](supabase.md) +* [Upstash 矢量](upstash-vector.md) +* [Vectara](vectara.md) +* [取消](weaviate.md) +* [Zep 集合 - 开源](zep-collection-open-source.md) +* [Zep 集合 - 云](zep-collection-cloud.md) diff --git a/cn/integrations/langchain/vector-stores/astradb.md b/cn/integrations/langchain/vector-stores/astradb.md new file mode 100644 index 00000000..b5483d3d --- /dev/null +++ b/cn/integrations/langchain/vector-stores/astradb.md @@ -0,0 +1,40 @@ +# 阿斯特拉数据库 + +## 设置 + +1. 在 [AstraDB](https://astra.datastax.com/) 上注册帐户 +2. 登录门户。创建数据库 + +
+ +3.选择Serverless(Vector),填写Database name、Provider、Region + +
+ +4. 数据库设置完毕后,获取 API 端点,并生成应用程序令牌 + +
+ +5. 创建一个新集合,选择所需的维度和相似度指标: + +
+ +6. 返回 Flowise 画布,拖放 Astra 节点。从凭据下拉列表中单击 **新建**: + +
+ +7. 指定 API 端点和应用程序令牌: + +
+ +8.您现在可以将数据写入更新到 AstraDB + +
+ +9. 导航回 Astra 门户,然后返回您的集合,您将能够看到已写入更新的所有数据: + +
+ +10.开始查询! + +
diff --git a/cn/integrations/langchain/vector-stores/chroma.md b/cn/integrations/langchain/vector-stores/chroma.md new file mode 100644 index 00000000..f245bcb2 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/chroma.md @@ -0,0 +1,84 @@ +# 色度 + +## 先决条件 + +您需要一台 Chroma 服务器。您可以: + +1. 安装 Chroma CLI 并使用 `chroma run` 运行服务器 +2. 注册[Chroma Cloud](https://trychroma.com/home)。 +3. 在 [Docker](https://docs.trychroma.com/guides/deploy/docker) 中部署您自己的 Chroma 实例。 + +## 设置 + +|输入 |描述 |默认 |云| +| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ----- | +|文件|可以与 [文档加载器](../document-loaders/) 中的节点连接 | | | +|嵌入 |可以与 [Embeddings](../embeddings/) 中的节点连接 | | | +|收藏名称 |色度集合名称。请参阅[此处](https://docs.trychroma.com/usage-guide#creating-inspecting-and-deleting-collections)了解命名约定 | | | +|色度 URL |指定色度实例的 URL | http://localhost:8000 | https://api.trychroma.com:8000 | + +对于 Chroma Cloud,您需要获取租户 ID,并创建数据库和 API 密钥。 + +
+ +### 附加 + +如果您在 Docker 上运行 Flowise 和 Chroma,则还需要执行其他步骤。 + +1. 首先启动 Chroma 泊坞窗 + +```bash +docker compose up -d --build +``` + +2. 在 Flowise 中打开 `docker-compose.yml` + +```bash +cd Flowise && cd docker +``` + +3、修改文件为: + +```sh +version: '3.1' + +services: + flowise: + image: flowiseai/flowise + restart: always + environment: + - PORT=${PORT} + - DEBUG=${DEBUG} + - DATABASE_PATH=${DATABASE_PATH} + - SECRETKEY_PATH=${SECRETKEY_PATH} + - FLOWISE_SECRETKEY_OVERWRITE=${FLOWISE_SECRETKEY_OVERWRITE} + - LOG_PATH=${LOG_PATH} + - LOG_LEVEL=${LOG_LEVEL} + - EXECUTION_MODE=${EXECUTION_MODE} + ports: + - '${PORT}:${PORT}' + volumes: + - ~/.flowise:/root/.flowise + networks: + - flowise_net + command: /bin/sh -c "sleep 3; flowise start" +networks: + flowise_net: + name: chroma_net + external: true +``` + +4. 启动 Flowise docker 镜像 + +```bash +docker compose up -d +``` + +5. 在 Chroma URL 上,对于 Windows 和 MacOS 操作系统,指定 [http://host.docker.internal:8000](http://host.docker.internal:8000/). 对于基于 Linux 的系统,应使用默认 docker 网关,因为 host.docker.internal 不可用:[http://172.17.0.1:8000](http://172.17.0.1:8000/) + +
+ +## 资源 + +* [LangChain JS Chroma](https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/chroma) +* [Chroma 入门](https://docs.trychroma.com/getting-started) diff --git a/cn/integrations/langchain/vector-stores/couchbase.md b/cn/integrations/langchain/vector-stores/couchbase.md new file mode 100644 index 00000000..3acbc755 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/couchbase.md @@ -0,0 +1,158 @@ +--- +description: >- + 使用 Couchbase(一个 + 适用于人工智能驱动的关键应用程序的 NoSQL 云开发人员数据平台。 +--- + +# 沙发底座 + +## 先决条件 + +### 要求 + +1. Couchbase 集群(自我管理或 Capella)版本 **7.6+**,带有 [搜索服务](https://docs.couchbase.com/server/current/search/search.html)。 +2. Capella 设置:要了解有关连接到 Capella 集群的更多信息,请按照[说明](https://docs.couchbase.com/cloud/get-started/connect.html?_gl=1*1yhpmel*_gcl_au*MTMzNDE3NTQxLjE3MzY5MjA5MzQ.)操作。 + + 具体来说,您需要执行以下操作: + + * 创建[数据库凭据](https://docs.couchbase.com/cloud/clusters/manage-database-users.html?_gl=1*19zk7vq*_gcl_au*MTMzNDE3NTQxLjE3MzY5MjA5MzQ.)以访问集群。 + * [允许从运行应用程序的 IP 访问](https://docs.couchbase.com/cloud/clusters/allow-ip-address.html?_gl=1*19zk7vq*_gcl_au*MTMzNDE3NTQxLjE3MzY5MjA5MzQ.)集群。 + + 自我管理设置: + + * 按照[Couchbase 安装选项](https://developer.couchbase.com/tutorial-couchbase-installation-options) 安装最新的 Couchbase 数据库服务器实例。确保添加搜索服务。 +3. 在 Couchbase 的全文服务上创建搜索索引。 + +### 导入搜索索引 + +#### [Couchbase 卡佩拉](\(https:/docs.couchbase.com/cloud/search/import-search-index.html) + +请按照以下步骤在 Capella 中导入搜索索引: + +* 将索引定义复制到名为 `index.json` 的新文件中。 +* 按照文档中的说明将文件导入 Capella。 +* 点击创建索引,完成索引创建。 + +#### [Couchbase 服务器](\(https:/docs.couchbase.com/server/current/search/import-search-index.html) + +对于 Couchbase 服务器,请执行以下步骤: + +* 导航至搜索 → 添加索引 → 导入。 +* 将提供的索引定义复制到导入屏幕中。 +* 点击创建索引,完成索引创建。 + +您还可以使用 [Couchbase Capella](https://docs.couchbase.com/cloud/vector-search/create-vector-search-index-ui.html?_gl=1*1rglcpj*_gcl_au*MTMzNDE3NTQxLjE3MzY5MjA5MzQ.) 和 [Couchbase 自管理服务器](https://docs.couchbase.com/server/current/vector-search/create-vector-search-index-ui.html?_gl=1*t7aeet*_gcl_au*MTMzNDE3NTQxLjE3MzY5MjA5MzQ.) 上的搜索 UI 创建矢量索引。 + +### 索引定义 + +在这里,我们在文档上创建索引 `vector-index`。矢量字段设置为 `embedding`,维度为 1536,文本字段设置为 `text`。我们还将文档中 `metadata` 下的所有字段作为动态映射进行索引和存储,以考虑不同的文档结构。相似性度量设置为 `dot_product`。如果这些参数发生变化,请相应调整索引。 + +```json +{ + "name": "vector-index", + "type": "fulltext-index", + "params": { + "doc_config": { + "docid_prefix_delim": "", + "docid_regexp": "", + "mode": "scope.collection.type_field", + "type_field": "type" + }, + "mapping": { + "default_analyzer": "standard", + "default_datetime_parser": "dateTimeOptional", + "default_field": "_all", + "default_mapping": { + "dynamic": true, + "enabled": false + }, + "default_type": "_default", + "docvalues_dynamic": false, + "index_dynamic": true, + "store_dynamic": false, + "type_field": "_type", + "types": { + "_default._default": { + "dynamic": true, + "enabled": true, + "properties": { + "embedding": { + "enabled": true, + "dynamic": false, + "fields": [ + { + "dims": 1536, + "index": true, + "name": "embedding", + "similarity": "dot_product", + "type": "vector", + "vector_index_optimized_for": "recall" + } + ] + }, + "metadata": { + "dynamic": true, + "enabled": true + }, + "text": { + "enabled": true, + "dynamic": false, + "fields": [ + { + "index": true, + "name": "text", + "store": true, + "type": "text" + } + ] + } + } + } + } + }, + "store": { + "indexType": "scorch", + "segmentVersion": 16 + } + }, + "sourceType": "gocbcore", + "sourceName": "pdf-chat", + "sourceParams": {}, + "planParams": { + "maxPartitionsPerPIndex": 64, + "indexPartitions": 16, + "numReplicas": 0 + } +} + +``` + +## 设置 + +1. 在画布上添加一个新的 **Couchbase** 节点,并填写 Bucket Name、Scope Name、Collection Name 和 Index Name + +
+ +2. 添加新凭据并填写参数: + * Couchbase 连接字符串 + * 集群用户名 + * 集群密码 + +
+ +3. 将其他节点添加到画布并启动写入更新过程 + * **文档**可以与[**文档加载器**](../document-loaders/)类别下的任何节点连接 + * **嵌入**可以与 [**嵌入**](../embeddings/)category 下的任何节点连接 + +
+ +
+ +5. 从 Couchbase UI 验证数据是否已成功写入更新! + +## 资源 + +* LangChain Couchbase 矢量存储集成 + * [Python](https://python.langchain.com/docs/integrations/vectorstores/couchbase/) + * [NodeJS](https://js.langchain.com/docs/integrations/vectorstores/couchbase/) +* 请参阅[Couchbase 文档](https://docs.couchbase.com/home/index.html) 了解 Couchbase。 diff --git a/cn/integrations/langchain/vector-stores/elastic.md b/cn/integrations/langchain/vector-stores/elastic.md new file mode 100644 index 00000000..ed344f26 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/elastic.md @@ -0,0 +1,69 @@ +# 弹性 + +## 先决条件 + +1. 您可以使用[官方 Docker 映像](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html)开始,也可以使用 [Elastic Cloud](https://www.elastic.co/cloud/)(Elastic 的官方云服务)。在本指南中,我们将使用云版本。 +2. [注册](https://cloud.elastic.co/registration)一个帐户或使用 Elastic Cloud 上的现有帐户[登录](https://cloud.elastic.co/login)。 + +
+ +3. 单击**创建部署**。然后,为您的部署命名,并选择提供商。 + +
+ +4. 部署完成后,您应该能够看到如下所示的设置指南。单击“**设置矢量搜索**”选项。 + +
+ +5. 您现在应该看到 **矢量搜索** 的 **入门** 页面。 + +
+ +6. 在左侧栏上,单击“**索引**”。然后,**创建一个新索引**。 + +
+ +7. 选择 **API** 摄取方法 + +
+ +8. 命名您的搜索索引名称,然后**创建索引** + +
+ +9. 创建索引后,生成新的 API 键,记下生成的 API 键和 URL + +
+ +## 流畅设置 + +1.在画布上添加一个新的**Elasticsearch**节点并填写**索引名称** + +
+ +2. 通过 **Elasticsearch API** 添加新凭据 + +
+ +3. 从 Elasticsearch 中获取 URL 和 API 键,填写字段 + +
+ +4.凭据创建成功后,就可以开始写入更新数据了 + +
+ +
+ +5. 数据成功插入后,您可以从 Elastic 仪表板进行验证: + +
+ +6.瞧!您现在可以开始在聊天中提问 + +
+ +## 资源 + +* [LangChain JS Elastic](https://js.langchain.com/docs/integrations/vectorstores/elasticsearch) +* [矢量搜索 (kNN) 实施指南 - API 版本](https://www.elastic.co/search-labs/blog/articles/vector-search-implementation-guide-api-edition) diff --git a/cn/integrations/langchain/vector-stores/faiss.md b/cn/integrations/langchain/vector-stores/faiss.md new file mode 100644 index 00000000..41d2be57 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/faiss.md @@ -0,0 +1,52 @@ +--- +description: >- + 使用 Meta 的 Faiss 库写入更新嵌入数据并执行相似性搜索。 +--- + +#费斯 + +Faiss 是一个用于高效相似性搜索和密集向量聚类的库。与云矢量存储不同,Faiss 在您的计算机上本地运行并将数据保存到您的文件系统中。 + +

费斯节点

+ +## 先决条件 + +### 方法一:NPM/源码安装 +对于本地安装,请确保您的计算机可以编译 C++ 模块。 +* **Linux:** 安装 `build-essential`。 +* **MacOS:** 运行 `xcode-select --install` 以获取 Clang/C++ 工具。 +* **Windows:** 安装 Visual Studio 构建工具和 Python。 + +### 方法2:Docker +如果您使用 Docker 运行 Flowise,则可以使用 Faiss。 + +## 设置 + +### 输入 + +|输入 |描述 | +| :--- | :--- | +| **文件** |连接文档加载器类别中的任何节点。 | +| **嵌入** |连接嵌入类别中的任何节点。 | + +### 参数 + +* **基本路径:** 将保存索引文件(`faiss.index` 和 `docstore.json`)的文件夹路径。 + * 如果留空,数据将存储在 RAM 中,并会在 Flowise 重新启动时丢失。 + * **Docker 路径示例:** `/root/.flowise/faiss` + * > **注意:** 确保路径映射到 `docker-compose.yml` 文件中的卷,以防止容器重新启动时数据丢失。 + * **本地路径示例:** `C:\Users\YourName\flowise_data` + +## 配置和摄取 + +1. 在画布上添加一个新的 **Faiss** 节点。 +2. 在 **Faiss** 节点的 **Base Path** 字段中输入文件夹路径。 +3. 将文档加载器和嵌入节点连接到 **Faiss** 节点。 +4. 单击 **写入更新矢量数据库** 处理您的文档。 + +## 验证 + +要验证您的数据是否已写入更新,请导航到您在 **基本路径** 字段中指定的文件夹。您应该看到文件 `faiss.index` 和 `docstore.json`。 + +## 资源 +* [LangChain JS Faiss文档](https://docs.langchain.com/oss/javascript/integrations/vectorstores/faiss) diff --git a/cn/integrations/langchain/vector-stores/in-memory-vector-store.md b/cn/integrations/langchain/vector-stores/in-memory-vector-store.md new file mode 100644 index 00000000..6e5d91ea --- /dev/null +++ b/cn/integrations/langchain/vector-stores/in-memory-vector-store.md @@ -0,0 +1,13 @@ +--- +description: >- + 内存中向量存储,用于存储嵌入并执行精确的线性搜索 + 对于最相似的嵌入。 +--- + +# 内存中向量存储 + +

内存中向量存储节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/vector-stores/milvus.md b/cn/integrations/langchain/vector-stores/milvus.md new file mode 100644 index 00000000..239bb28d --- /dev/null +++ b/cn/integrations/langchain/vector-stores/milvus.md @@ -0,0 +1,13 @@ +--- +description: >- + 使用 Milvus 写入更新嵌入数据并根据查询执行相似性搜索, + 世界上最先进的开源矢量数据库。 +--- + +# 米尔乌斯 + +

Milvus 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/vector-stores/mongodb-atlas.md b/cn/integrations/langchain/vector-stores/mongodb-atlas.md new file mode 100644 index 00000000..621debf5 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/mongodb-atlas.md @@ -0,0 +1,67 @@ +--- +description: >- + 写入更新嵌入数据并在查询时执行相似性或 mmr 搜索 + MongoDB Atlas,一个托管云 mongodb 数据库。 +--- + +# MongoDB 阿特拉斯 + +

MongoDB Atlas节点

+ +### 集群配置[​](https://js.langchain.com/docs/integrations/vectorstores/mongodb_atlas/#initial-cluster-configuration) + +要设置 MongoDB Atlas 集群,请访问 [MongoDB Atlas](https://www.mongodb.com/) 网站并注册(如果您没有帐户)。出现提示词时,创建并命名您的集群,该集群将显示在“数据库”部分下。然后,选择“**浏览集合**”以创建新集合或使用提供的示例数据中的集合。 + +{% hint style="warning" %} +确保您创建的集群是7.0或更高版本。 +{% endhint %} + +### 创建索引 + +设置集群后,下一步是为要搜索的集合字段创建索引。 + +1. 转到 **Atlas 搜索** 选项卡,然后单击 **创建搜索索引**。 +2. 选择 **Atlas Vector Search - JSON Editor**,选择适当的数据库和集合,然后将以下内容粘贴到文本框中: + +```json +{ + "fields": [ + { + "numDimensions": 1536, + "path": "embedding", + "similarity": "euclidean", + "type": "vector" + } + ] +} +``` + +确保 `numDimensions` 属性对应于您正在使用的嵌入的维度。例如,Cohere 嵌入通常有 1024 个维度,而 OpenAI 嵌入默认有 1536 个维度。 + +**注意:** 矢量存储需要某些默认值,例如: + +* 索引名称 `default` +* 集合字段名称 `embedding` +* 原始文本字段名称 `text` + +确保使用与索引和集合架构匹配的字段名称初始化向量存储,如上面的示例所示。 + +完成此操作后,继续构建索引。 + +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} + +### Flowise 配置 + +拖放 MongoDB Atlas 向量存储,然后添加新凭据。使用 MongoDB Atlas 仪表板提供的连接字符串: + +
+ +填写其余字段: + +
+ +您还可以从其他参数配置更多详细信息: + +
diff --git a/cn/integrations/langchain/vector-stores/opensearch.md b/cn/integrations/langchain/vector-stores/opensearch.md new file mode 100644 index 00000000..0613d1fd --- /dev/null +++ b/cn/integrations/langchain/vector-stores/opensearch.md @@ -0,0 +1,13 @@ +--- +description: >- + 写入更新嵌入数据并根据查询执行相似性搜索 + OpenSearch,一个开源的一体化矢量数据库。 +--- + +# 打开搜索 + +

开放搜索节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/vector-stores/pinecone.md b/cn/integrations/langchain/vector-stores/pinecone.md new file mode 100644 index 00000000..8124c9e5 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/pinecone.md @@ -0,0 +1,61 @@ +--- +description: >- + 使用 Pinecone 写入更新嵌入数据并根据查询执行相似性搜索, + 领先的完全管理的托管矢量数据库。 +--- + +# 松果 + +## 先决条件 + +1. 注册 [Pinecone](https://app.pinecone.io/) 帐户 +2. 点击**创建索引** + +
+ +3. 填写必填字段: + - **索引名称**,要创建的索引的名称。 (例如“流程测试”) + - **维度**,要插入索引中的向量的大小。 (例如 1536) + +
+ +4. 单击**创建索引** + +## 设置 + +1. 获取/创建您的 **API 密钥** + +
+ +2. 在画布上添加一个新的 **Pinecone** 节点并填写参数: + - 松果指数 + - Pinecone 命名空间(可选) + +
+ +3. 创建新的 Pinecone 凭据 -> 填写 **API 密钥** + +
+ +4. 将其他节点添加到画布并启动写入更新过程 + - **文档**可以与[**文档加载器**](../document-loaders/)类别下的任何节点连接 + - **嵌入**可以与 [**嵌入**](../embeddings/)category 下的任何节点连接 + +
+ +
+ +5. 从[Pinecone 仪表板](https://app.pinecone.io) 进行验证,查看数据是否已成功写入更新: + +
+ +6. + +## 资源 + +- LangChain Pinecone矢量存储集成 + - [Python](https://python.langchain.com/v0.2/docs/integrations/providers/pinecone/) + - [NodeJS](https://js.langchain.com/v0.2/docs/integrations/vectorstores/pinecone) +- [Pinecone LangChain 集成](https://docs.pinecone.io/integrations/langchain) +- [Pinecone Flowise 集成](https://docs.pinecone.io/integrations/flowise) +- [松果官方客户](https://docs.pinecone.io/reference/pinecone-clients) diff --git a/cn/integrations/langchain/vector-stores/postgres.md b/cn/integrations/langchain/vector-stores/postgres.md new file mode 100644 index 00000000..14c491e3 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/postgres.md @@ -0,0 +1,54 @@ +--- +description: >- + 使用 pgvector 写入更新嵌入数据并根据查询执行相似性搜索 + 在 Postgres 上。 +--- + +# Postgres + +

Postgres 节点

+ +根据实例的设置方式,有多种方法可以连接到 Postgres。下面是使用 pgvector 团队提供的预构建 Docker 映像进行本地配置的示例。 + +创建一个名为 `docker-compose.yml` 的文件,内容如下: + +```yaml +# Run this command to start the database: +# docker-compose up --build +version: "3" +services: + db: + hostname: 127.0.0.1 + image: pgvector/pgvector:pg16 + ports: + - 5432:5432 + restart: always + environment: + - POSTGRES_DB=api + - POSTGRES_USER=myuser + - POSTGRES_PASSWORD=ChangeMe + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql +``` + +`docker compose up` 启动 Postgres 容器。 + +使用配置的用户和密码创建新凭据: + +
+ +使用 `docker-compose.yml` 中配置的值填写节点字段。例如: + +* 主机:**本地主机** +* 数据库:**api** +* 端口:**5432** + +瞧!您现在已经成功设置了 Postgres Vector,可以使用了。 + +### 故障排除 + +如果 Flowise 和 Postgres 都在 Docker 上运行,您可能会看到以下错误: **聚合错误**。 + +尝试将主机值从 `localhost` 更改为 `host.docker.internal` + +
diff --git a/cn/integrations/langchain/vector-stores/qdrant.md b/cn/integrations/langchain/vector-stores/qdrant.md new file mode 100644 index 00000000..ee459610 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/qdrant.md @@ -0,0 +1,75 @@ +#Qdrant + +## 先决条件 + +[本地运行的 Qdrant 实例](https://qdrant.tech/documentation/quick-start/) 或 Qdrant 云实例。 + +要获取 Qdrant 云实例: + +1. 前往 [Cloud Dashboard](https://cloud.qdrant.io/overview) 的集群部分。 +2. 选择**集群**,然后单击**+ 创建**。 + +
+ +3. 选择您的集群配置和区域。 +4. 点击 **创建** 以配置您的集群。 + +## 设置 + +1. 从 [云控制面板](https://cloud.qdrant.io/overview) 的**数据访问控制**部分获取/创建您的 **API 密钥**。 +2. 在画布上添加新的 **Qdrant** 节点。 +3. 使用 API 密钥创建新的 Qdrant 凭据 + +
+ +4. 在 **Qdrant** 节点中输入所需信息: + * Qdrant 服务器 URL + * 收藏名称 + +
+ +5. **文档**输入可以与[**文档加载器**](../document-loaders/)类别下的任何节点连接。 +6. **嵌入**输入可以与 [**嵌入**](../embeddings/) 类别下的任何节点连接。 + +## 过滤 + +假设您写入更新了不同的文档,每个文档都在元数据键 `{source}` 下指定了唯一值 + +
+ +
+ + + +
+ +
+ +然后,您想通过它进行过滤。在过滤方面,Qdrant 支持以下[语法](https://qdrant.tech/documentation/concepts/filtering/#nested-key): + +**用户界面** + +
+ +**API** + +```json +"overrideConfig": { + "qdrantFilter": { + "should": [ + { + "key": "metadata.source", + "match": { + "value": "apple" + } + } + ] + } +} +``` + +## 资源 + +* [Qdrant 文档](https://qdrant.tech/documentation/) +* [LangChain JS Qdrant](https://js.langchain.com/docs/integrations/vectorstores/qdrant) +* [Qdrant 过滤器](https://qdrant.tech/documentation/concepts/filtering/#nested-key) diff --git a/cn/integrations/langchain/vector-stores/redis.md b/cn/integrations/langchain/vector-stores/redis.md new file mode 100644 index 00000000..adb338a6 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/redis.md @@ -0,0 +1,34 @@ +# 雷迪斯 + +## 先决条件 + +1. 使用 Docker 启动 [Redis-Stack 服务器](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/docker/) + +```bash +docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest +``` + +## 设置 + +1. 在画布上添加一个新的 **Redis** 节点。 +2. 创建新的 Redis 凭据。 + +
+ +3. 选择Redis 凭据类型。如果您有用户名和密码,请选择 Redis API,否则选择 Redis URL: + +
+ +4.填写网址: + +
+ +5. 现在您可以开始使用 Redis 写入更新数据: + +
+ +
+ +6. 导航到 Redis Insight 门户,然后转到您的数据库,您将能够看到已写入更新的所有数据: + +
diff --git a/cn/integrations/langchain/vector-stores/singlestore.md b/cn/integrations/langchain/vector-stores/singlestore.md new file mode 100644 index 00000000..75d0cad2 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/singlestore.md @@ -0,0 +1,62 @@ +# 单店 + +## 设置 + +1. 在[SingleStore](https://www.singlestore.com/)上注册帐户 +2. 登录门户。在左侧面板上,单击 **CLOUD** -> **创建新工作区组。** 然后单击 **创建工作区** 按钮。 + +
+ +3. 选择云提供商和数据区域,然后单击**下一步**: + +
+ +4. 查看并单击“**创建工作区**”: + +
+ +5. 您现在应该看到已创建的工作区: + +
+ +6. 继续创建数据库 + +
+ +7. 您应该能够看到数据库已创建并附加到工作区: + +
+ +8. 从工作区下拉列表中单击“连接”->“直接连接”: + +
+ +9. 您可以指定一个新密码或使用默认生成的密码。然后点击继续: + +
+ +10. 在选项卡上,切换到 **您的应用程序**,然后从下拉列表中选择 **Node.js**。记下/保存 `Username`、`Host`、`Password`,因为稍后您将在 Flowise 中需要这些。 + +
+ +11. 返回 Flowise 画布,拖放 SingleStore 节点。从凭据下拉列表中单击 **新建**: + +
+ +11. 输入上面的用户名和密码: + +
+ +13. 然后指定主机和数据库名称: + +
+ +13. 现在您可以开始使用 SingleStore 写入更新数据: + +
+ +
+ +14. 导航回 SingleStore 门户,然后返回您的数据库,您将能够看到已写入更新的所有数据: + +
diff --git a/cn/integrations/langchain/vector-stores/supabase.md b/cn/integrations/langchain/vector-stores/supabase.md new file mode 100644 index 00000000..29e38178 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/supabase.md @@ -0,0 +1,164 @@ +# 苏帕贝斯 + +## 先决条件 + +1. 注册 [Supabase](https://supabase.com/) 帐户 +2. 单击**新建项目** + +
+ +3. 输入必填字段 + +|字段名称 |描述 | +| ------------------------- | ------------------------------------------------- | +| **姓名** |要创建的项目的名称。 (例如 Flowise)| +| **数据库** **密码** | postgres 数据库的密码 | + +
+ +4.点击**创建新项目**并等待项目完成设置 +5. 单击 **SQL 编辑器** + +
+ +6. 单击“**新查询**” + +
+ +7. 复制并粘贴以下 SQL 查询并通过 `Ctrl + Enter` 运行它或单击 **RUN**。记下表名称和函数名称。 + +* **表名称**:`documents` +* **查询名称**:`match_documents` + +```plsql +-- Enable the pgvector extension to work with embedding vectors +create extension vector; + +-- Create a table to store your documents +create table documents ( + id bigserial primary key, + content text, -- corresponds to Document.pageContent + metadata jsonb, -- corresponds to Document.metadata + embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed +); + +-- Create a function to search for documents +create function match_documents ( + query_embedding vector(1536), + match_count int DEFAULT null, + filter jsonb DEFAULT '{}' +) returns table ( + id bigint, + content text, + metadata jsonb, + similarity float +) +language plpgsql +as $$ +#variable_conflict use_column +begin + return query + select + id, + content, + metadata, + 1 - (documents.embedding <=> query_embedding) as similarity + from documents + where metadata @> filter + order by documents.embedding <=> query_embedding + limit match_count; +end; +$$; + +``` + +在某些情况下,您可能会使用[记录管理器](../record-managers.md)来跟踪写入更新并防止重复。由于记录管理器为每个嵌入生成随机 UUID ,因此您必须将 id 列实体更改为文本: + +```sql +-- Enable the pgvector extension to work with embedding vectors +create extension vector; + +-- Create a table to store your documents +create table documents ( + id text primary key, -- CHANGE TO TEXT + content text, + metadata jsonb, + embedding vector(1536) +); + +-- Create a function to search for documents +create function match_documents ( + query_embedding vector(1536), + match_count int DEFAULT null, + filter jsonb DEFAULT '{}' +) returns table ( + id text, -- CHANGE TO TEXT + content text, + metadata jsonb, + similarity float +) +language plpgsql +as $$ +#variable_conflict use_column +begin + return query + select + id, + content, + metadata, + 1 - (documents.embedding <=> query_embedding) as similarity + from documents + where metadata @> filter + order by documents.embedding <=> query_embedding + limit match_count; +end; +$$; + +``` + +
+ +## 设置 + +1. 点击**项目设置** + +
+ +2. 获取您的 **项目 URL 和 API 密钥** + +
+ +3. 将每个详细信息(_API 密钥、URL、表名称、查询名称_)复制并粘贴到 **Supabase** 节点 + +
+ +4. **文档**可以与[**文档加载器**](../document-loaders/)类别下的任何节点连接 +5. **嵌入**可以与[**嵌入**](../embeddings/)category下的任何节点连接 + +## 过滤 + +假设您写入更新了不同的文档,每个文档都在元数据键 `{source}` 下指定了唯一值 + +
+ +您可以使用元数据过滤来查询特定元数据: + +**用户界面** + +
+ +**API** + +```json +"overrideConfig": { + "supabaseMetadataFilter": { + "source": "henry" + } +} +``` + +## 资源 + +* [LangChain JS Supabase](https://js.langchain.com/docs/modules/indexes/vector_stores/integrations/supabase) +* [Supabase 博客文章](https://supabase.com/blog/openai-embeddings-postgres-vector) +* [元数据过滤](https://js.langchain.com/docs/integrations/vectorstores/supabase#metadata-filtering) diff --git a/cn/integrations/langchain/vector-stores/upstash-vector.md b/cn/integrations/langchain/vector-stores/upstash-vector.md new file mode 100644 index 00000000..01d8eafc --- /dev/null +++ b/cn/integrations/langchain/vector-stores/upstash-vector.md @@ -0,0 +1,41 @@ +# Upstash 向量 + +## 先决条件 + +1. 注册或登录[Upstash Console](https://console.upstash.com) +2. 导航到向量页面并单击 **创建索引** + +
+3. 进行必要的配置并创建索引。 + + 1. **索引名称**,要创建的索引名称。 (例如“flowise-upstash-demo”) + 2. **维度**,要插入索引中的向量的大小。 (例如 1536) + 3. **嵌入模型**,要在 [Upstash Embeddings](https://upstash.com/docs/vector/features/embeddingmodels) 中使用的模型。这是可选的。如果启用它,则不需要提供嵌入模型。 + +
+ +## 设置 + +1. 获取您的索引凭据 + +
+ +1.创建新的Upstash Vector凭据并填写 + 1. 从控制台上的 UPSTASH\_VECTOR\_REST\_URL Upstash 矢量 REST URL + 2. 在控制台上从 UPSTASH\_VECTOR\_REST\_TOKEN Upstash Vector Rest 令牌 + +
+ +1. 添加一个新的 **Upstash Vector** 节点到画布 + +
+ +1. 将其他节点添加到画布并启动写入更新过程 + * **文档**可以与[**文档加载器**](../document-loaders/)类别下的任何节点连接 + * **嵌入**可以与 [**嵌入**](../embeddings/)category 下的任何节点连接 + +
+ +1. 从[Upstash 仪表板](https://console.upstash.com) 验证数据是否已成功更新: + +
diff --git a/cn/integrations/langchain/vector-stores/vectara.md b/cn/integrations/langchain/vector-stores/vectara.md new file mode 100644 index 00000000..ef1e6345 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/vectara.md @@ -0,0 +1,55 @@ +# 维克塔拉 + +## 快速入门教程 + +{% embed url="https://www.youtube.com/watch?v=rBqpvFcD5XY" %} + +## 先决条件 + +1. 注册 [Vectara](https://vectara.com/integrations/flowise) 帐户 +2.点击**创建语料库** + +
+ +为要创建的语料库命名,点击**创建语料库**,然后等待语料库完成设置。 + +## 设置 + +1. 单击语料库视图中的**“访问控制”**选项卡 + +
+ +2. 单击 **“创建 API 密钥”** 按钮,为 API 密钥选择名称,然后选择 **QueryService 和 IndexService** 选项 + +
+ +3. 单击“**创建**”以创建 API 密钥 +4. 通过单击新 API 密钥的“复制”下的向下箭头,获取您的 **Corpus ID、API 密钥和客户 ID**: + +
+ +5. 返回 Flowise 画布,并创建您的聊天流。从凭据下拉列表中单击 **新建**,然后输入您的 Vectara 凭据。 + +
+ +6.享受吧! + +## Vectara 查询参数 + +为了更好地控制 Vectara 查询参数,请单击“**其他参数**”,然后您可以更新以下参数的默认值: + +* 元数据过滤器:Vectara 支持元数据过滤。要使用 [filtering](https://docs.vectara.com/docs/common-use-cases/filtering-by-metadata/filter-overview),请确保您要作为筛选依据的元数据字段已在您的 Vectara 语料库中定义。 +*“Sentences before”和“Sentences after”:这些控制匹配文本之前/之后有多少句子作为 Vectara 检索引擎的结果返回 +* Lambda:定义 Vectara 中 [混合搜索](https://docs.vectara.com/docs/learn/hybrid-search) 的行为 +* Top-K:Vectara查询返回多少条结果 +* MMR-K:用于 [MMR](https://docs.vectara.com/docs/api-reference/search-apis/reranking#maximal-marginal-relevance-mmr-reranker) 的结果数(最大边际相关性) + +
+ +## 资源 + +* [LangChain JS Vectara 博客文章](https://blog.langchain.dev/langchain-vectara-better-together/) +* [使用 Vectara 的 Langchain 集成博客文章的 5 个理由](https://vectara.com/5-reasons-to-use-vectaras-langchain-integration/) +* [Vectara 中的最大边际相关性](https://vectara.com/blog/get-diverse-results-and-comprehensive-summaries-with-vectaras-mmr-reranker/) +* [Vectara Boomerang 嵌入模型博客文章](https://vectara.com/introducing-boomerang-vectaras-new-and-improved-retrieval-model/) +* [使用 Vectara 的 HHEM](https://vectara.com/blog/cut-the-bull-detecting-hallucinations-in-large-language-models/) 检测幻觉 diff --git a/cn/integrations/langchain/vector-stores/weaviate.md b/cn/integrations/langchain/vector-stores/weaviate.md new file mode 100644 index 00000000..14d4b720 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/weaviate.md @@ -0,0 +1,42 @@ +--- +description: >- + 使用 Weaviate(a)写入更新嵌入数据并执行相似性或 mmr 搜索 + 可扩展的开源矢量数据库。 +--- + +# 维维特 + +

编织节点

+ +## 过滤 + +Weaviate 在过滤时支持以下[语法](https://weaviate.io/developers/weaviate/search/filters): + +**用户界面** + +
+ +**API** + +```json +"overrideConfig": { + "weaviateFilter": { + "where": { + "operator": "Equal", + "path": [ + "test" + ], + "valueText": "key" + } + } +} +``` + +## 资源 + +* [LangchainJS Weaviate](https://js.langchain.com/v0.1/docs/integrations/vectorstores/weaviate/#usage-query-documents) +* [取消过滤](https://weaviate.io/developers/weaviate/search/filters) + +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/vector-stores/zep-collection-cloud.md b/cn/integrations/langchain/vector-stores/zep-collection-cloud.md new file mode 100644 index 00000000..6b320dfa --- /dev/null +++ b/cn/integrations/langchain/vector-stores/zep-collection-cloud.md @@ -0,0 +1,13 @@ +--- +description: >- + 写入更新嵌入数据并在查询时执行相似性或 mmr 搜索 + Zep,一个用于 LLM 应用程序的快速且可扩展的构建块。 +--- + +# Zep 集合 - 云 + +

Zep Collection - 云节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/langchain/vector-stores/zep-collection-open-source.md b/cn/integrations/langchain/vector-stores/zep-collection-open-source.md new file mode 100644 index 00000000..d65ae510 --- /dev/null +++ b/cn/integrations/langchain/vector-stores/zep-collection-open-source.md @@ -0,0 +1,13 @@ +--- +description: >- + 写入更新嵌入数据并在查询时执行相似性或 mmr 搜索 + Zep,一个用于 LLM 应用程序的快速且可扩展的构建块。 +--- + +# Zep 集合 - 开源 + +

Zep Collection - 开源节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/litellm/README.md b/cn/integrations/litellm/README.md new file mode 100644 index 00000000..202a7443 --- /dev/null +++ b/cn/integrations/litellm/README.md @@ -0,0 +1,60 @@ +--- +description: 了解 Flowise 如何与 LiteLLM Proxy 集成 +--- + +# LiteLLM 代理 + +将 [LiteLLM 代理](https://docs.litellm.ai/docs/simple_proxy) 与 Flowise 结合使用,可以: + +- 负载平衡 Azure OpenAI/LLM 端点 +- 调用 OpenAI 格式的 100 多个法学硕士 +- 使用虚拟钥匙设置预算、速率限制并跟踪使用情况 + +## 如何将 LiteLLM 代理与 Flowise 结合使用 + +### 步骤 1:在 LiteLLM config.yaml 文件中定义 LLM 模型 + +LiteLLM 需要定义所有模型的配置 - 我们将此文件称为 `litellm_config.yaml` + +[有关如何设置 litellm 配置的详细文档 - 此处](https://docs.litellm.ai/docs/proxy/configs) + +```yaml +model_list: + - model_name: gpt-4 + litellm_params: + model: azure/chatgpt-v-2 + api_base: https://openai-gpt-4-test-v-1.openai.azure.com/ + api_version: "2023-05-15" + api_key: + - model_name: gpt-4 + litellm_params: + model: azure/gpt-4 + api_key: + api_base: https://openai-gpt-4-test-v-2.openai.azure.com/ + - model_name: gpt-4 + litellm_params: + model: azure/gpt-4 + api_key: + api_base: https://openai-gpt-4-test-v-2.openai.azure.com/ +``` + + +### 步骤 2. 启动 litellm 代理 + +```shell +docker run \ + -v $(pwd)/litellm_config.yaml:/app/config.yaml \ + -p 4000:4000 \ + ghcr.io/berriai/litellm:main-latest \ + --config /app/config.yaml --detailed_debug +``` + +成功后,代理将开始在 `http://localhost:4000/` 上运行 + +### 步骤 3:在 Flowise 中使用 LiteLLM 代理 + +在 Flowise 中,指定 **标准 OpenAI 节点(不是 Azure OpenAI 节点)** - 这适用于 **聊天模型、嵌入、llms - 一切** + +- 将 `BasePath` 设置为 LiteLLM 代理 URL(本地运行时为 `http://localhost:4000`) +- 设置以下标头“授权:承载者”` + diff --git a/cn/integrations/llamaindex/README.md b/cn/integrations/llamaindex/README.md new file mode 100644 index 00000000..8379adb6 --- /dev/null +++ b/cn/integrations/llamaindex/README.md @@ -0,0 +1,21 @@ +--- +description: 了解 Flowise 如何与 LlamaIndex 框架集成 +--- + +# 骆驼指数 + +*** + +[LlamaIndex](https://www.llamaindex.ai/) 是一个数据框架,供 LLM 应用程序摄取、构建和访问私有或特定于域的数据。它具有用于设计 RAG(检索增强生成)应用程序的高级检索技术。 + +Flowise 通过提供可视化界面来补充 LlamaIndex。在这里,节点被组织成不同的部分,从而更容易构建工作流程。 + +### LlamaIndex 部分: + +* [代理](agents/) +* [聊天模型](chat-models/) +* [嵌入](embeddings/) +* [引擎](engine/) +* [响应合成器](response-synthesizer/) +* [工具](tools/) +* [向量存储](vector-stores/) diff --git a/cn/integrations/llamaindex/agents/README.md b/cn/integrations/llamaindex/agents/README.md new file mode 100644 index 00000000..32e9d965 --- /dev/null +++ b/cn/integrations/llamaindex/agents/README.md @@ -0,0 +1,16 @@ +--- +description: LlamaIndex 代理节点 +--- + +# 代理 + +*** + +语言模型本身无法采取行动——它们只是输出文本。 + +代理是使用 LLM 作为推理引擎来确定要采取哪些操作以及这些操作的输入应该是什么的系统。然后,这些操作的结果可以反馈给代理,并确定是否需要更多操作,或者是否可以完成。 + +### 代理节点: + +* [OpenAI 工具代理](openai-tool-agent.md) +* [人类工具代理](openai-tool-agent-1.md) diff --git a/cn/integrations/llamaindex/agents/openai-tool-agent-1.md b/cn/integrations/llamaindex/agents/openai-tool-agent-1.md new file mode 100644 index 00000000..4ed090c4 --- /dev/null +++ b/cn/integrations/llamaindex/agents/openai-tool-agent-1.md @@ -0,0 +1,13 @@ +--- +description: >- + 使用人择函数调用来选择要调用的工具和参数的代理 + 使用 LlamaIndex。 +--- + +# 人择工具代理 + +
+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/agents/openai-tool-agent.md b/cn/integrations/llamaindex/agents/openai-tool-agent.md new file mode 100644 index 00000000..210b3dfc --- /dev/null +++ b/cn/integrations/llamaindex/agents/openai-tool-agent.md @@ -0,0 +1,13 @@ +--- +description: >- + 使用 OpenAI 函数调用来选择要调用的工具和参数的代理 + 使用 LlamaIndex。 +--- + +# OpenAI 工具代理 + +

OpenAI工具代理节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/chat-models/README.md b/cn/integrations/llamaindex/chat-models/README.md new file mode 100644 index 00000000..d16f713e --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/README.md @@ -0,0 +1,19 @@ +--- +description: LlamaIndex 聊天模型节点 +--- + +# 聊天模型 + +*** + +聊天模型将消息列表作为输入,并返回模型生成的消息作为输出。这些模型(例如 **gpt-3.5-turbo** 或 **gpt4**)比其前身 Completions 模型(例如 **text-davincii-003**)功能强大且便宜。 + +### 聊天模型节点: + +* [AzureChatOpenAI](azurechatopenai.md) +* [ChatAnthropic](chatanthropic.md) +* [ChatMistral](chatmistral.md) +* [ChatOllama](chatollama.md) +* [ChatOpenAI](chatopenai.md) +* [ChatTogetherAI](chattogetherai.md) +* [ChatGroq](chatgroq.md) diff --git a/cn/integrations/llamaindex/chat-models/azurechatopenai.md b/cn/integrations/llamaindex/chat-models/azurechatopenai.md new file mode 100644 index 00000000..b33bbda1 --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/azurechatopenai.md @@ -0,0 +1,11 @@ +--- +description: 特定于 LlamaIndex 的 Azure OpenAI 聊天 LLM 的包装。 +--- + +# AzureChatOpenAI + +

AzureChatOpenAI 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/chat-models/chatanthropic.md b/cn/integrations/llamaindex/chat-models/chatanthropic.md new file mode 100644 index 00000000..b9cb12c3 --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/chatanthropic.md @@ -0,0 +1,11 @@ +--- +description: 特定于 LlamaIndex 的 ChatAnthropic LLM 的包装。 +--- + +# 聊天人类 + +

聊天人择节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/chat-models/chatgroq.md b/cn/integrations/llamaindex/chat-models/chatgroq.md new file mode 100644 index 00000000..a0e104c3 --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/chatgroq.md @@ -0,0 +1,11 @@ +--- +description: 针对 LlamaIndex 的 Groq LLM 的包装。 +--- + +#ChatGroq + +

ChatGroq 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/chat-models/chatmistral.md b/cn/integrations/llamaindex/chat-models/chatmistral.md new file mode 100644 index 00000000..ece02ca6 --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/chatmistral.md @@ -0,0 +1,11 @@ +--- +description: 针对 LlamaIndex 的 ChatMistral LLM 的包装。 +--- + +# 聊天米斯特拉尔 + +

聊天米斯特拉尔节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/chat-models/chatollama.md b/cn/integrations/llamaindex/chat-models/chatollama.md new file mode 100644 index 00000000..4beadcc1 --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/chatollama.md @@ -0,0 +1,11 @@ +--- +description: 针对 LlamaIndex 的 ChatOllama LLM 的包装。 +--- + +# 聊天奥拉马 + +

ChatOllama 节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/chat-models/chatopenai.md b/cn/integrations/llamaindex/chat-models/chatopenai.md new file mode 100644 index 00000000..cbd7c4c7 --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/chatopenai.md @@ -0,0 +1,11 @@ +--- +description: 针对 LlamaIndex 的 OpenAI Chat LLM 的包装。 +--- + +# 聊天OpenAI + +

ChatOpenAI节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/chat-models/chattogetherai.md b/cn/integrations/llamaindex/chat-models/chattogetherai.md new file mode 100644 index 00000000..de8719c0 --- /dev/null +++ b/cn/integrations/llamaindex/chat-models/chattogetherai.md @@ -0,0 +1,11 @@ +--- +description: 针对 LlamaIndex 的 ChatTogetherAI LLM 的包装。 +--- + +#ChatTogetherAI + +

ChatTogetherAI节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/embeddings/README.md b/cn/integrations/llamaindex/embeddings/README.md new file mode 100644 index 00000000..c555c3d8 --- /dev/null +++ b/cn/integrations/llamaindex/embeddings/README.md @@ -0,0 +1,25 @@ +--- +description: LlamaIndex 嵌入节点 +--- + +# 嵌入 + +*** + +嵌入是浮点数的向量(列表)。两个向量之间的距离衡量它们的相关性。距离小表明相关性高,距离大表明相关性低。 + +嵌入可用于创建文本数据的数字表示。这种数字表示很有用,因为它可以用来查找相似的文档。 + +它们通常用于: + +* 搜索(结果按与查询字符串的相关性排名) +* 聚类(文本字符串按相似性分组) +* 推荐(推荐具有相关文本字符串的项目) +* 异常检测(识别出相关性很小的异常值) +* 多样性测量(分析相似性分布) +* 分类(文本字符串按最相似的标签进行分类) + +### 嵌入节点: + +* [Azure OpenAI 嵌入](azure-openai-embeddings.md) +* [OpenAI 嵌入](openai-embedding.md) diff --git a/cn/integrations/llamaindex/embeddings/azure-openai-embeddings.md b/cn/integrations/llamaindex/embeddings/azure-openai-embeddings.md new file mode 100644 index 00000000..57cf6505 --- /dev/null +++ b/cn/integrations/llamaindex/embeddings/azure-openai-embeddings.md @@ -0,0 +1,11 @@ +--- +description: 特定于 LlamaIndex 的 Azure OpenAI API 嵌入。 +--- + +# Azure OpenAI 嵌入 + +
+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/embeddings/openai-embedding.md b/cn/integrations/llamaindex/embeddings/openai-embedding.md new file mode 100644 index 00000000..3389f7b5 --- /dev/null +++ b/cn/integrations/llamaindex/embeddings/openai-embedding.md @@ -0,0 +1,11 @@ +--- +description: 专门针对 LlamaIndex 的 OpenAI 嵌入。 +--- + +# OpenAI 嵌入 + +

OpenAI 嵌入节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/llamaindex/engine/README.md b/cn/integrations/llamaindex/engine/README.md new file mode 100644 index 00000000..ff0d063d --- /dev/null +++ b/cn/integrations/llamaindex/engine/README.md @@ -0,0 +1,16 @@ +--- +description: LlamaIndex 引擎节点 +--- + +# 引擎 + +*** + +在LlamaIndex中,引擎节点指的是处理信息处理和用户交互的两个关键组件。 + +### 引擎节点: + +* [查询引擎](query-engine.md) +* [简单聊天引擎](simple-chat-engine.md) +* [上下文聊天引擎](context-chat-engine.md) +* [子问题查询引擎](sub-question-query-engine.md) diff --git a/cn/integrations/llamaindex/engine/context-chat-engine.md b/cn/integrations/llamaindex/engine/context-chat-engine.md new file mode 100644 index 00000000..79be33bf --- /dev/null +++ b/cn/integrations/llamaindex/engine/context-chat-engine.md @@ -0,0 +1,24 @@ +# 上下文聊天引擎 + +聊天引擎充当端到端管道,用于与数据进行类似人类的对话,允许多次交换而不是单个问答交互。 + +
+ +## 输入 + +* 聊天模型 +* 矢量存储检索器 +* [内存](../../langchain/memory/) + +## 参数 + +|名称 |描述 | +| ----------------------- | ------------------------------------------------------------------- | +|返回源文件 |返回用于构建响应的引文/来源 | +|系统消息 | LLM 关于如何回答查询的说明 | + +## 输出 + +|名称 |描述 | +| ----------------- | ----------------------------- | +| ContextChatEngine |返回响应的最终节点 | diff --git a/cn/integrations/llamaindex/engine/query-engine.md b/cn/integrations/llamaindex/engine/query-engine.md new file mode 100644 index 00000000..c9bb8590 --- /dev/null +++ b/cn/integrations/llamaindex/engine/query-engine.md @@ -0,0 +1,22 @@ +# 查询引擎 + +查询引擎充当端到端管道,使用户能够询问有关其数据的问题。它接收自然语言查询并提供响应,并附带检索并传递到 LLM(大型语言模型)的相关上下文信息。 + +
+ +## 输入 + +* 矢量存储检索器 +* [响应合成器](../response-synthesizer/) + +## 参数 + +|名称 |描述 | +| ----------------------- | ------------------------------------------------------------------- | +|返回源文件 |返回用于构建响应的引文/来源 | + +## 输出 + +|名称 |描述 | +| ----------- | ----------------------------- | +|查询引擎 |返回响应的最终节点 | diff --git a/cn/integrations/llamaindex/engine/simple-chat-engine.md b/cn/integrations/llamaindex/engine/simple-chat-engine.md new file mode 100644 index 00000000..ba511252 --- /dev/null +++ b/cn/integrations/llamaindex/engine/simple-chat-engine.md @@ -0,0 +1,22 @@ +# 简单的聊天引擎 + +一个简单的聊天引擎充当人工智能和用户之间对话的完整管道,无需上下文检索。不过,它确实配备了[内存](../../langchain/memory/),可以记住对话。 + +
+ +## 输入 + +* 聊天模型 +* [内存](../../langchain/memory/) + +## 参数 + +|名称 |描述 | +| -------------- | --------------------------------------------- | +|系统消息 | LLM 关于如何回答查询的说明 | + +## 输出 + +|名称 |描述 | +| ---------------- | ----------------------------- | +|简单聊天引擎 |返回响应的最终节点 | diff --git a/cn/integrations/llamaindex/engine/sub-question-query-engine.md b/cn/integrations/llamaindex/engine/sub-question-query-engine.md new file mode 100644 index 00000000..151dc412 --- /dev/null +++ b/cn/integrations/llamaindex/engine/sub-question-query-engine.md @@ -0,0 +1,24 @@ +# 子问题查询引擎 + +一个查询引擎,旨在解决使用多个数据源回答复杂查询的问题。它首先将复杂的查询分解为每个相关数据源的子问题,然后收集所有中间响应并合成最终响应。 + +
+ +## 输入 + +* 查询引擎工具 +* 聊天模型 +* 嵌入 +* [响应合成器](../response-synthesizer/) + +## 参数 + +|名称 |描述 | +| ----------------------- | ------------------------------------------------------------------- | +|返回源文件 |返回用于构建响应的引文/来源 | + +## 输出 + +|名称 |描述 | +| ---------------------- | ----------------------------- | +|子问题查询引擎 |返回响应的最终节点 | diff --git a/cn/integrations/llamaindex/response-synthesizer/README.md b/cn/integrations/llamaindex/response-synthesizer/README.md new file mode 100644 index 00000000..d53379cc --- /dev/null +++ b/cn/integrations/llamaindex/response-synthesizer/README.md @@ -0,0 +1,16 @@ +--- +description: LlamaIndex 响应合成器节点 +--- + +# 响应合成器 + +*** + +响应合成器节点负责将查询、节点和提示词模板发送到 LLM 以生成响应。有 4 种生成响应的模式: + +### 合成器节点: + +* [优化](refine.md) +* [紧凑和细化](compact-and-refine.md) +* [简单响应生成器](simple-response-builder.md) +* [树摘要](tree-summarize.md) diff --git a/cn/integrations/llamaindex/response-synthesizer/compact-and-refine.md b/cn/integrations/llamaindex/response-synthesizer/compact-and-refine.md new file mode 100644 index 00000000..84ad7cef --- /dev/null +++ b/cn/integrations/llamaindex/response-synthesizer/compact-and-refine.md @@ -0,0 +1,36 @@ +# 紧凑和精炼 + +当没有明确定义响应合成器时,这是默认值。 + +在每次 LLM 调用期间,通过填充尽可能多的适合最大提示词大小的文本块来压缩提示词。如果一个提示词中的内容太多,无法填充,请通过多个紧凑的提示词来“创建和完善”答案。 + +**优点**:与 [Refine](refine.md) 相同,适合提供更详细的答案,并且应该会减少 LLM 调用 + +**缺点**:由于多次 LLM 调用,可能会很昂贵 + +
+ +**优化提示词** + +```markup +The original query is as follows: {query} +We have provided an existing answer: {existingAnswer} +We have the opportunity to refine the existing answer (only if needed) with some more context below. +------------ +{context} +------------ +Given the new context, refine the original answer to better answer the query. If the context isn't useful, return the original answer. +Refined Answer: +``` + +**文本质量检查提示词** + +``` +Context information is below. +--------------------- +{context} +--------------------- +Given the context information and not prior knowledge, answer the query. +Query: {query} +Answer: +``` diff --git a/cn/integrations/llamaindex/response-synthesizer/refine.md b/cn/integrations/llamaindex/response-synthesizer/refine.md new file mode 100644 index 00000000..e343d2b3 --- /dev/null +++ b/cn/integrations/llamaindex/response-synthesizer/refine.md @@ -0,0 +1,34 @@ +# 细化 + +通过按顺序浏览每个检索到的文本块来创建和完善答案。 + +**优点**:有利于获得更详细的答案 + +**缺点**:每个节点单独的 LLM 调用(可能很昂贵) + +
+ +**优化提示词** + +```markup +The original query is as follows: {query} +We have provided an existing answer: {existingAnswer} +We have the opportunity to refine the existing answer (only if needed) with some more context below. +------------ +{context} +------------ +Given the new context, refine the original answer to better answer the query. If the context isn't useful, return the original answer. +Refined Answer: +``` + +**文本质量检查提示词** + +``` +Context information is below. +--------------------- +{context} +--------------------- +Given the context information and not prior knowledge, answer the query. +Query: {query} +Answer: +``` diff --git a/cn/integrations/llamaindex/response-synthesizer/simple-response-builder.md b/cn/integrations/llamaindex/response-synthesizer/simple-response-builder.md new file mode 100644 index 00000000..95bf304a --- /dev/null +++ b/cn/integrations/llamaindex/response-synthesizer/simple-response-builder.md @@ -0,0 +1,9 @@ +# 简单的响应生成器 + +使用文本段和查询的集合,对每个段执行查询,将响应收集到一个数组中。返回包含所有响应的组合字符串。 + +**优点**:对于使用相同查询单独查询每个文本段很有用 + +**缺点**:不适合复杂而详细的答案 + +
diff --git a/cn/integrations/llamaindex/response-synthesizer/tree-summarize.md b/cn/integrations/llamaindex/response-synthesizer/tree-summarize.md new file mode 100644 index 00000000..d54ff6ae --- /dev/null +++ b/cn/integrations/llamaindex/response-synthesizer/tree-summarize.md @@ -0,0 +1,21 @@ +# 树总结 + +当提供文本块和查询时,递归地构建树结构并返回根节点作为结果。 + +**优点**:有利于总结任务 + +**缺点**:在遍历树结构期间可能会丢失答案的准确性 + +
+ +**提示词** + +``` +Context information from multiple sources is below. +--------------------- +{context} +--------------------- +Given the information from multiple sources and not prior knowledge, answer the query. +Query: {query} +Answer: +``` diff --git a/cn/integrations/llamaindex/tools/README.md b/cn/integrations/llamaindex/tools/README.md new file mode 100644 index 00000000..8757be25 --- /dev/null +++ b/cn/integrations/llamaindex/tools/README.md @@ -0,0 +1,13 @@ +--- +description: LlamaIndex 代理节点 +--- + +# 工具 + +*** + +工具是代理可以用来与世界交互的功能。这些工具可以是通用实用程序(例如搜索)、其他链,甚至其他代理。 + +### 工具节点: + +* [查询引擎工具](query-engine-tool.md) diff --git a/cn/integrations/llamaindex/tools/query-engine-tool.md b/cn/integrations/llamaindex/tools/query-engine-tool.md new file mode 100644 index 00000000..e1750179 --- /dev/null +++ b/cn/integrations/llamaindex/tools/query-engine-tool.md @@ -0,0 +1,22 @@ +# 查询引擎工具 + +将查询引擎转变为可由[子问题查询引擎](../engine/sub-question-query-engine.md)或代理使用的工具。 + +
+ +## 输入 + +* 向量存储索引 + +## 参数 + +|名称 |描述 | +| ---------------- | --------------------------------------------------- | +|工具名称|工具名称 | +|工具说明|说明 LLM 何时应使用此工具 | + +## 输出 + +|名称 |描述 | +| --------------- | ------------------------------------------------------------------------------------------------ | +|查询引擎工具 |连接点到代理或[子问题查询引擎](../engine/sub-question-query-engine.md) | diff --git a/cn/integrations/llamaindex/vector-stores/README.md b/cn/integrations/llamaindex/vector-stores/README.md new file mode 100644 index 00000000..0efd0350 --- /dev/null +++ b/cn/integrations/llamaindex/vector-stores/README.md @@ -0,0 +1,18 @@ +--- +description: LlamaIndex 向量存储节点 +--- + +# 向量存储 + +*** + +矢量存储或矢量数据库是指专门用于存储和检索高维数值矢量的数据库系统。矢量存储旨在有效管理和索引这些矢量,从而实现快速相似性搜索。 + +### 观看有关 向量存储 的介绍以及如何在 Flowise 上使用它 + +{% embed url="https://youtu.be/m0nr1_pnAxc" %} + +### 向量存储节点: + +* [松果](pinecone.md) +* [SimpleStore](queryengine-tool.md) diff --git a/cn/integrations/llamaindex/vector-stores/pinecone.md b/cn/integrations/llamaindex/vector-stores/pinecone.md new file mode 100644 index 00000000..995b6a3b --- /dev/null +++ b/cn/integrations/llamaindex/vector-stores/pinecone.md @@ -0,0 +1,53 @@ +--- +description: >- + 使用 Pinecone 写入更新嵌入数据并根据查询执行相似性搜索, + 领先的完全管理的托管矢量数据库。 +--- + +# 松果 + +## 先决条件 + +1. 注册 [Pinecone](https://app.pinecone.io/) 帐户 +2. 点击**创建索引** + +
+ +3. 填写必填字段: +* **索引名称**,要创建的索引的名称。 (例如“流程测试”) + * **维度**,要插入索引中的向量的大小。 (例如 1536) + +
+ +4. 单击**创建索引** + +## 设置 + +1. 获取/创建您的 **API 密钥** + +
+ +2. 在画布上添加一个新的 **Pinecone** 节点并填写参数: + * 松果指数 + * Pinecone命名空间(可选) + +

松果节点

+ +3. 创建新的 Pinecone 凭据 -> 填写 **API 密钥** + +
+ +4. 将其他节点添加到画布并启动写入更新过程 + * **文档**可以与[**文档加载器**](../../langchain/document-loaders/)类别下的任何节点连接 + +

LlamaIndex 的文档加载器和文本分割器尚不可用,但使用 LangChain 下可用的文档加载器和文本分割器之一仍允许正常使用 LlamaIndex 进行查询。

+ +\- \*\*Embeddings\*\* 可以与 \[\*\*Embeddings\*\* ]\(../embeddings/)category 下的任意节点连接 + +
+ +
+ +5. 在 [Pinecone 仪表板](https://app.pinecone.io) 上验证数据是否已成功写入更新: + +
diff --git a/cn/integrations/llamaindex/vector-stores/queryengine-tool.md b/cn/integrations/llamaindex/vector-stores/queryengine-tool.md new file mode 100644 index 00000000..d48403fe --- /dev/null +++ b/cn/integrations/llamaindex/vector-stores/queryengine-tool.md @@ -0,0 +1,11 @@ +--- +description: 将嵌入数据更新到本地路径并执行相似性搜索。 +--- + +# 简单商店 + +

SimpleStore节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/utilities/README.md b/cn/integrations/utilities/README.md new file mode 100644 index 00000000..1056c4cb --- /dev/null +++ b/cn/integrations/utilities/README.md @@ -0,0 +1,16 @@ +--- +description: 了解如何使用 Flowise 实用程序节点 +--- + +# 实用程序 + +*** + +实用程序节点是帮助您在流程中实现自定义 JS、逻辑和注释的开发工具。 + +### 可用实用程序: + +* [自定义 JS 函数](custom-js-function.md) +* [设置/获取变量](set-get-variable.md) +* [如果否则](if-else.md) +* [便签](sticky-note.md) diff --git a/cn/integrations/utilities/custom-js-function.md b/cn/integrations/utilities/custom-js-function.md new file mode 100644 index 00000000..bec828c9 --- /dev/null +++ b/cn/integrations/utilities/custom-js-function.md @@ -0,0 +1,11 @@ +--- +description: 执行自定义 JavaScript 函数。 +--- + +# 自定义 JS 函数 + +

自定义JS函数节点

+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/integrations/utilities/if-else.md b/cn/integrations/utilities/if-else.md new file mode 100644 index 00000000..c5303956 --- /dev/null +++ b/cn/integrations/utilities/if-else.md @@ -0,0 +1,56 @@ +# 如果否则 + +Flowise 允许您根据 If/Else 条件将聊天流分成不同的分支。 + +
+ +### 输入变量 + +
+ +从上图中可以看出,它接收具有 `json` 输出的任何节点。一些示例包括:自定义函数、LLM 链输出预测、获取/设置变量。 + +
+ +然后您可以指定变量名称: + +
+ +然后,可以在 [If 函数](if-else.md#if-function) 和 [Else 函数](if-else.md#else-function) 中使用该变量(前缀为 `$`)。例如: + +``` +$output +``` + +### 如果是其他名称 + +您可以为节点命名,以便更轻松地直观地了解其功能。 + +### 如果函数 + +这是一段在 Node 沙箱上运行的 JS 代码。它必须: + +* 包含 `if` 语句 +* 返回 `if` 语句中的值 + +
+ +这为用户提供了更大的灵活性来进行复杂的比较,如正则表达式、日期比较等等。 + +### 其他函数 + +与 If 函数类似,它必须返回一个值。仅当 [If Function](if-else.md#if-function) 不返回值时才会运行此函数。 + +
+ +### 输出 + +
+ +当 [If Function](if-else.md#if-function) 成功返回一个值时,它将被传递到 **True** 输出点,如上所示。这允许用户将值传递到下一个节点。 + +否则,[Else Function](if-else.md#else-function) 的返回值将传递到 **False** 输出点。 + +用户还可以查看市场中的 If Else 模板: + +
diff --git a/cn/integrations/utilities/set-get-variable.md b/cn/integrations/utilities/set-get-variable.md new file mode 100644 index 00000000..9809fe67 --- /dev/null +++ b/cn/integrations/utilities/set-get-variable.md @@ -0,0 +1,17 @@ +# 设置/获取变量 + +如果您正在运行自定义函数或 LLM 链,您可能希望在其他节点中重用结果,而不必再次重新计算/重新运行相同的操作。您可以将输出结果保存为变量,并将其重新用于流程路径下游的其他节点。 + +
+ +### 设置变量 + +从输出 `string, number, boolean, json, array,` 的任何节点获取输入,我们可以为其分配一个变量名称。 + +
+ +### 获取变量 + +稍后您可以从变量名称中获取变量值: + +
diff --git a/cn/integrations/utilities/sticky-note.md b/cn/integrations/utilities/sticky-note.md new file mode 100644 index 00000000..f2f95c45 --- /dev/null +++ b/cn/integrations/utilities/sticky-note.md @@ -0,0 +1,11 @@ +--- +description: 向流程添加便签。 +--- + +# 便利贴 + +
+ +{% hint style="info" %} +本部分正在进行中。我们感谢您在完成本节时提供的任何帮助。请查看我们的[贡献指南](/broken/pages/G48tdmpQ3z4CTWEspqkA)以开始使用。 +{% endhint %} diff --git a/cn/migration-guide/README.md b/cn/migration-guide/README.md new file mode 100644 index 00000000..05ca5ffd --- /dev/null +++ b/cn/migration-guide/README.md @@ -0,0 +1,18 @@ +--- +description: 了解 Flowise 的旧版本 +--- + +# 迁移指南 + +*** + +Flowise 通常提供向后兼容性,这意味着它的更新遵循持续的开发路径。然而,有时可能会发生重大变化。 + +本节提供迁移到不同破坏版本时的指导。 + +## 版本 + +* [云迁移](cloud-migration.md) +* [v1.3.0 迁移指南](v1.3.0-migration-guide.md) +* [v1.4.3 迁移指南](v1.4.3-migration-guide.md) +* [v2.1.4 迁移指南](v2.1.4-migration-guide.md) diff --git a/cn/migration-guide/cloud-migration.md b/cn/migration-guide/cloud-migration.md new file mode 100644 index 00000000..70e70046 --- /dev/null +++ b/cn/migration-guide/cloud-migration.md @@ -0,0 +1,72 @@ +# 云迁移 + +本指南旨在帮助用户从Cloud V1迁移到V2。 + +在 Cloud V1 中,应用程序的 URL 看起来像 **https://\.app.flowiseai.com** + +在 Cloud V2 中,应用程序的 URL 是**https://cloud.flowiseai.com** + +为什么选择云V2?我们从头开始重写了云,速度提高了 5 倍,能够拥有多个工作区、组织成员,最重要的是,它通过 [生产就绪架构](../configuration/running-in-production.md) 实现高度可扩展。 + +1. 通过[https://flowiseai.com/auth/login](https://flowiseai.com/auth/login)登录Cloud V1 +2. 在仪表板的右上角: + +
+ +3. **选择版本,然后更新到最新版本。** + +
+ +4. 选择导出,选择您要导出的数据: + +
+ +5. 保存导出的 JSON 文件。 +6. 导航到云 V2 [https://cloud.flowiseai.com](https://cloud.flowiseai.com/) +7. Cloud V2 帐户不会与您在 Cloud V1 中的现有帐户同步,您必须重新注册或使用 Google/Github 登录。 + +
+ +8. 登录后,从仪表板右上角单击“导入”并上传导出的 JSON 文件。 + +
+ +9. 默认情况下,新用户使用 **免费计划**,限制为 2 个流程和助理(每个流程)。如果导出的数据超过此数量,则导入导出的 JSON 文件将引发错误。这就是我们给予的原因 **FIRST MONTH FREE** **入门计划**,拥有无限流量和助手! + +
+ +10. 单击 **开始** 按钮,然后添加您的首选付款方式: + +
+ +
+ +11. 添加付款方式后,导航回 Flowise,在所选计划上单击开始并确认更改: + +
+ +12.如果一切顺利,你应该是Starter Plan,无限流量和无限助手!万岁:tada:如果之前由于免费计划限制而失败,请尝试再次导入 JSON 文件。 + +{% hint style="success" %} +导出数据中的所有 ID 保持不变,因此您不必担心更新 API 的 ID,您只需更新 URL 例如 [https://cloud.flowiseai.com/api/v1/prediction/69fb1055-ghj324-ghj-0a4ytrerf](https://cloud.flowiseai.com/api/v1/prediction/69fb1055-ghj324-ghj-0a4ytrerf) +{% endhint %} + +{% hint style="warning" %} +不导出凭据。您必须创建新的凭据并在流程和助手中使用这些凭据。 +{% endhint %} + +13. 确认一切正常后,您现在可以取消 Cloud V1 订阅。 +14. 在左侧面板中,单击帐户设置,滚动到底部,您将看到**取消先前的订阅**: + +
+ +15. 输入您之前用于注册 Cloud V1 的电子邮件,然后点击 **发送说明**。 +16. 然后您将收到一封电子邮件以取消您之前的订阅: + +
+ +17. 单击 **管理订阅** 按钮将带您进入一个门户,您可以在其中取消 Cloud V1 订阅。您的 Cloud V1 应用程序将在下一个计费周期关闭。 + +
+ +对于迁移过程中给您带来的任何不便,我们深表歉意。如果我们愿意提供任何帮助,请随时通过 support@flowiseai.com 与我们联系。 diff --git a/cn/migration-guide/v1.3.0-migration-guide.md b/cn/migration-guide/v1.3.0-migration-guide.md new file mode 100644 index 00000000..44505adf --- /dev/null +++ b/cn/migration-guide/v1.3.0-migration-guide.md @@ -0,0 +1,38 @@ +--- +description: 在 v1.3.0 中,我们引入了 凭据 +--- + +# v1.3.0 迁移指南 + +*** + +凭据允许用户将所有第 3 方 API 密钥存储到数据库中,并且可以轻松地在各个节点上重复使用,而不必每次都复制粘贴。 + +凭据通过使用密码创建的加密密钥进行加密。只有有权访问密钥的用户才能加密/解密凭据。此外,解密的凭据永远不会发送回客户端,以避免网络欺骗。 + +以下是帮助您迁移到 v1.3.0 的一些重要指南: + +1. 设置 `PASSPHRASE` 环境变量。这用于生成用于加密/解密您的凭据的加密密钥 +2. 设置 `SECRETKEY_PATH` 环境变量。要保留加密密钥,请指定保存加密密钥的位置。 + +典型的 `.env` 文件应如下所示: + +```sh +PORT=3000 +PASSPHRASE=MYPASSPHRASE +DATABASE_PATH=/root/.flowise +SECRETKEY_PATH=/root/.flowise +LOG_PATH=/root/.flowise/logs +``` + +3.节点版本。如果版本过时,节点右上角会显示警告消息。这意味着节点上有新的更改,您应该从菜单列表中删除并重新添加它。 + +
+ +就是这样!如果您遇到任何问题,请告诉我们。升级快乐! + +## 视频教程 + +在此视频教程中,Leon 展示了如何在 Flowise 上设置凭据。 + +{% embed url="https://youtu.be/32DFgPdYMcs" %} diff --git a/cn/migration-guide/v1.4.3-migration-guide.md b/cn/migration-guide/v1.4.3-migration-guide.md new file mode 100644 index 00000000..4999ee9e --- /dev/null +++ b/cn/migration-guide/v1.4.3-migration-guide.md @@ -0,0 +1,42 @@ +--- +description: 在v1.4.3中,我们引入了统一的Vector Store节点 +--- + +# v1.4.3 迁移指南 + +*** + +## 之前 + +以前,用户必须创建 2 个流来执行写入更新和查询: + +### 写入更新 + +
+ +### 加载现有的 + +
+ +这种技术有两个缺点: + +* 需要进行额外的 LLM 调用才能进行写入更新 +* 任何微小的变化都会导致流程再次更新 + +## 之后 + +现在,用户只需使用一个节点即可完成所有操作: + +
+ +用户现在可以选择通过单击右上角的 **绿色** 按钮来手动启动写入更新: + +
+ +
+ +它配备了新的 API - `/api/v1/vector/upsert`: + +
+ +未来,我们将推出查询、删除索引的功能。这是以更灵活的方式执行向量相关操作的第一步。我们强烈建议用户更新到新节点。 diff --git a/cn/migration-guide/v2.1.4-migration-guide.md b/cn/migration-guide/v2.1.4-migration-guide.md new file mode 100644 index 00000000..a303762f --- /dev/null +++ b/cn/migration-guide/v2.1.4-migration-guide.md @@ -0,0 +1,30 @@ +# v2.1.4 迁移指南 + +OverrideConfig 使用户能够从 API 或使用 嵌入 时覆盖流配置。出于安全考虑,现在默认情况下禁用它。 + +用户必须明确指定可以从 UI 覆盖哪些配置。 + +1.) 转到配置: + +
+ +2.) 启用覆盖配置: + +
+ +3.) 打开可覆盖配置的开关并保存。 + +
+ +4.) 例如,用户可以覆盖这些变量和配置。请参阅[OverrideConfig](/broken/pages/F2AfRpI7qYixNiBWpmIe#override-config)。 + +```json +{ + "overrideConfig": { + "systemMessage": "You are helpful assistant", + "vars": { + "character": "nice" + } + } +} +``` diff --git a/cn/text-splitters/charater-text-splitter.md b/cn/text-splitters/charater-text-splitter.md new file mode 100644 index 00000000..c8f90a04 --- /dev/null +++ b/cn/text-splitters/charater-text-splitter.md @@ -0,0 +1,8 @@ +# 字符文本分割器 +这是最简单的文本分割方法。这基于字符(默认为“\n\n”)进行分割,并按字符数测量块长度。 +## 输入 +分隔符:默认“\n\n”
+块大小:块长度的最大大小(按字符数计算)
+Chunck Overlap:块之间的最大重叠。最好有一些重叠来保持块之间的连续性(例如,做一个滑动窗口)
+## 输出 +字符文本分割器:分割文本块 diff --git a/cn/tutorials/README.md b/cn/tutorials/README.md new file mode 100644 index 00000000..d4857c0a --- /dev/null +++ b/cn/tutorials/README.md @@ -0,0 +1,2 @@ +# 教程 + diff --git a/cn/tutorials/agent-as-tool.md b/cn/tutorials/agent-as-tool.md new file mode 100644 index 00000000..e0e4cbb3 --- /dev/null +++ b/cn/tutorials/agent-as-tool.md @@ -0,0 +1,102 @@ +# 代理作为工具 + +在本教程中,我们将了解如何利用其他流作为父代理的工具。这种方法允许您创建一个父代理,该父代理可以将特定任务委托给专门的子代理 + +## 概述 + +1.通过父代理接收用户输入 +2. Agent 决定从文档存储中检索数据,或调用 智能体流程 工具。 + +
+ +### 第 1 步:设置起始节点 + +首先向画布添加 **Start** 节点。这是您的代理系统的入口点。 + +### 步骤 2:创建父代理 + +添加 **Agent** 节点并将其连接到 Start 节点。 + +### 步骤 3:配置代理工具 + +此流程的关键功能是将另一个代理配置为工具。在父代理的 **工具** 部分中: + +
+ +#### 工具配置: + +* **工具**:选择“**代理作为工具**” + +#### 代理工具设置: + +* **选定的智能体流程**:选择您的子智能体流程 +* **名称**:智能体流程的名称 +* **描述**:描述此智能体流程何时有用。示例: + +``` +Useful for searching user availability, scheduling meetings and email related query +``` + +{% hint style="warning" %} +该工具的名称和描述非常重要!它们必须清晰并正确地描述该工具的用途。请参阅[最佳实践](https://platform.openai.com/docs/guides/function-calling?api-mode=chat#best-practices-for-defining-functions)指南。 +{% endhint %} + +### 步骤4:添加知识源 + +配置 **知识(文档存储)** 部分以使您的父代理能够访问相关信息。这与 [RAG](rag.md) 教程相同。 + +
+ +#### 文档存储配置: + +* **文档存储**:选择您预先配置的文档存储(例如“AI-Paper”) +* **描述知识**:描述知识的内容 + +*** + +## 交互示例 + +#### 示例查询和预期行为: + +**调度查询:** + +* 用户:“你能查一下我下周二有空吗?” +* 流程:家长代理→个人\_助理工具→专业调度响应 + +
+ +**技术查询:** + +* 用户:“什么是 AIGC 以及它是如何工作的?” +* 流程:父代理 → AI-Paper 知识库 → 技术解释及来源 + +
+ +**一般查询:** + +* 用户:“你好,你好吗?” +* 流程:父代理 → 直接响应(无需工具) + +**复杂查询:** + +* 用户:“下周二安排一次关于 AIGC 实施的会议,提取关键见解和谈话要点” +* Flow:家长代理→既个人\_辅助工具ANDAI-Paper知识→协调响应 + +
+ +*** + +## 最佳实践 + +#### 设计指南: + +1. **清晰的工具描述**:使工具名称和描述具体且可操作 +2. **适当的委派**:更好的系统提示词父代理有效委派 + +#### 常见用例: + +* **客户服务**:家长代理拥有用于计费、技术支持和一般查询的专用工具 +* **研究助理**:家长拥有不同研究领域(法律、技术、市场研究)的工具 +* **项目管理**:父级提供日程安排、资源分配和进度跟踪工具 +* **内容创建**:家长拥有用于写作、编辑、研究和格式化的工具 + diff --git a/cn/tutorials/agentic-rag.md b/cn/tutorials/agentic-rag.md new file mode 100644 index 00000000..33e720bf --- /dev/null +++ b/cn/tutorials/agentic-rag.md @@ -0,0 +1,195 @@ +# 代理 RAG + +代理 RAG 是一种基于代理的方法,以精心策划的方式执行 [RAG](rag.md)。它可能涉及从各种文档源检索数据、比较摘要以及实施自动自我更正机制。 + +在本教程中,我们将探索如何构建一个自校正 RAG 系统,该系统检查检索到的数据的相关性,并在结果不相关时自动重新生成查询。 + +## 概述 + +Agentic RAG 流程实现了一个多步骤过程: + +1. 验证传入查询并对其进行分类 +2. 为矢量数据库检索生成优化的搜索查询 +3. 评估检索到的文档的相关性 +4. 当结果不相关时通过重新生成查询进行自我纠正 +5. 根据检索到的信息提供上下文响应 + +
+ +### 第 1 步:设置起始节点 + +首先向画布添加 **Start** 节点。这是您的智能体流程的入口点。 + +
+ +#### 配置: + +* **输入类型**:选择“聊天输入”接受用户问题 +* **流状态**:添加一个带有键“`query`”和空值的状态变量 + +Start 节点使用空的 `query` 变量初始化流状态,该变量将在整个过程中更新。 + +### 步骤 2:添加查询验证 + +添加 **Condition Agent** 节点并将其连接到 Start 节点。 + +
+ +#### 配置: + +* **说明**:“检查用户是否询问人工智能相关主题,或者只是一般查询” +* **输入**:`{{ question }}`(引用用户的输入) +* **场景**: + * 场景1:“AI相关” + * 场景2:“一般” + +该节点充当路由器,确定查询是否需要专门的人工智能知识或可以普遍回答。 + +### 步骤 3:创建一般响应分支 + +对于非 AI 相关查询,添加连接到条件代理的输出 1 的 **LLM** 节点。 + +
+ +这为一般查询提供了直接响应,无需检索文档。您还可以替换为直接回复节点以返回预定义的答案。 + +
+ +### 步骤 4:设置查询生成 + +对于 AI 相关查询,添加一个连接到条件代理的输出 0 的 **LLM** 节点 - 这是“AI 相关”的场景。 + +
+ +#### 配置: + +* **消息**:添加系统消息: + + ``` + Given the user question and history, construct a short string that can be used for searching vector database. Only generate the query, no meta comments, no explanation + + Example: + Question: what are the events happening today? + Query: today's event + + Example: + Question: how about the address? + Query: business address of the shop + + Question: {{ question }} + Query: + ``` +* **更新流状态**:将键“query”设置为值 `{{ output }}`。这会将“query”的值更新为此 LLM 节点的输出。 + +该节点将用户的自然语言问题转换为矢量数据库的优化搜索查询。 + +### 步骤 5:配置矢量数据库检索器 + +添加 **检索器** 节点并将其连接到“生成查询”LLM。 + +
+ +#### 配置: + +* **知识(文档存储)**:选择您预先配置的文档存储(例如“ai paper”) +* **检索器查询**:`{{ $flow.state.query }}`(使用共享状态中的“查询”值) + +该节点使用优化的查询搜索您的矢量数据库并返回相关文档。 + +### 步骤 6:添加文档相关性检查 + +添加另一个连接到检索器的 **条件代理** 节点。 + +
+ +#### 配置: + +* **说明**:“确定文档是否与用户问题相关。用户问题为 \{{ question \}}” +* **输入**:`{{ retrieverAgentflow_0 }}`(引用步骤 5 中检索到的文档) +* **场景**: + * 场景 1:“相关” + * 场景 2:“无关紧要” + +这评估检索到的文档是否实际上包含与用户问题相关的信息。 + +### 步骤 7:创建最终响应生成器 + +对于相关文档,添加一个连接到相关性检查器的输出 0 的 **LLM** 节点 - 这是匹配场景“相关”时的情况。 + +
+ +#### 配置: + +* **输入消息**: + + ``` + Given the question: {{ question }} + And the findings: {{ retrieverAgentflow_0 }} + Output the final response + ``` + +该节点通过将用户的问题与相关检索到的文档相结合来创建最终答案。 + +### 步骤 8:实施自我纠正 + +对于不相关的文档,添加一个连接到相关性检查器的输出 1 的 **LLM** 节点 - 对于第二种情况 - “不相关”。 + +
+ +
+ +#### 配置: + +* **消息**:添加系统消息:“您是一个有用的助手,可以转换查询以产生更好的问题。” +* **输入消息**: + + ``` + Look at the input and try to reason about the underlying semantic intent / meaning. + Here is the initial question: {{ $flow.state.query }} + Formulate an improved question: + ``` +* **更新流状态**:将键“query”设置为值 `{{ output }}` + +
+ +该节点分析初始查询未返回相关结果的原因并生成改进版本。 + +### 步骤9:添加环回机制 + +添加连接到“重新生成问题”LLM 的 **Loop** 节点。 + +
+ +#### 配置: + +* **循环返回**:选择“retrieverAgentflow\_0-检索器 Vector DB” +* **最大循环计数**:设置为 5(防止无限循环) + +这会创建一个反馈循环,允许系统在初始结果不令人满意时重试改进的查询。 + +## 完整的流程结构 + +{% file src="../.gitbook/assets/Agentic RAG V2.json" %} + +## 总结 + +1. 开始→检查查询是否有效 +2. 检查查询是否有效(AI相关)→ 生成查询 +3. 检查查询是否有效(一般)→一般答案 +4. 生成查询→检索器向量数据库 +5. 检索器 Vector DB → 检查文档是否相关 +6. 检查文档是否相关(Relevant)→ 生成响应 +7. 检查文档是否相关(不相关)→ 重新生成问题 +8. 重新生成问题 → 循环回到检索器 + +## 测试你的流程 + +用各种类型的问题测试你的流程: + +* 人工智能相关查询:“机器学习的最新进展是什么?” +* 一般查询:“今天天气怎么样?” +* 可能需要细化的复杂查询:“这项新技术是如何工作的?” + +
+ +这个 Agentic RAG 为基于文档的问答提供了一个强大的、自我改进的系统,可以处理简单和复杂的查询,同时通过迭代细化保持高精度。 diff --git a/cn/tutorials/customer-support.md b/cn/tutorials/customer-support.md new file mode 100644 index 00000000..e6961819 --- /dev/null +++ b/cn/tutorials/customer-support.md @@ -0,0 +1,312 @@ +# 客户支持 + +客户支持是目前人工智能最大的用例之一。然而,许多人倾向于通过引入多个代理来使其变得过于复杂。在许多情况下,只要您拥有精心设计的系统提示词、精心挑选的工具和精心策划的知识库,您就可以通过单个代理实现所需的结果。通常仅当您的系统需要处理广泛的支持领域时才需要多智能体架构。例如,您可能有一个人力资源代理,负责管理人力资源政策并执行提交休假请求或更新员工记录等任务,以及一个财务代理,负责处理报销、退款和其他与财务相关的查询。 + +当您的系统涉及超过 15 或 20 个工具和知识源时,通常不建议使单个代理过载。相反,为特定领域配备专门的代理往往会表现更好。根据您的使用案例,我们始终建议从单个代理开始,评估性能,识别瓶颈,然后才考虑多智能体架构。 + +Anthropic 对此提供了很好的指南 - [https://docs.anthropic.com/en/docs/about-claude/use-case-guides/customer-support-chat](https://docs.anthropic.com/en/docs/about-claude/use-case-guides/customer-support-chat) + +## 单智能体 + +
+ +对于单一代理来说,提示词是最关键的部分。每个模型的行为都不同。例如,当特定于任务的指令放置在“用户”消息而不是“系统”消息中时,Claude 表现最佳(一种称为 [角色提示词](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/system-prompts#legal-contract-analysis-with-role-prompting) 的技术)。这通常是一个反复试验的过程,以确定什么最有效。然而,好的提示词包含以下基本要素: + +#### 第 1 步:角色 + +第一步是为代理分配角色和个性。例如: + +``` +You are John, a friendly, knowledgeable, and professional customer support agent for Acme Events, an event management company that has been delivering exceptional events since 1985. + +Your job is to help customers with any inquiries related to Acme’s event services, including: + +- Corporate events & conferences + +- Weddings & private parties + +- Public festivals & community events + +- Hybrid and virtual event solutions + +You are warm, helpful, and solution-oriented. Always aim to resolve customer issues efficiently while maintaining a positive tone. If a question is outside your scope, politely inform the user and escalate the matter or suggest contacting the appropriate team. +``` + +#### 第 2 步:指南 + +您希望代理如何响应用户查询、要遵循的一组步骤或准则。 + +``` +Important guidelines: + +- Always introduce yourself as John from Acme Events. + +- Keep your responses clear, concise, and professional. + +- Ask clarifying questions when needed. + +- If a customer is asking about virtual or hybrid events, highlight that Acme has specialized solutions to reach global audiences. + +- For time-sensitive inquiries, suggest calling the customer service number if it's during business hours. +``` + +{% hint style="success" %} +如果代理无法调用特定工具来响应某些用户查询,您可以在此处添加其他说明。例如:_“使用报价工具生成个性化报价。”_ +{% endhint %} + +#### 步骤 3:业务背景 + +提供公司的一般信息。例如: + +``` +About Acme Events: + +At Acme Events, we believe every occasion is a story waiting to be told. Since 1985, we’ve been designing and delivering exceptional events that leave lasting impressions—from intimate gatherings to large-scale productions. + +Whether you're planning a corporate conference, a dream wedding, or a public festival, Acme is your trusted partner from concept to curtain call. Our team of seasoned planners, creative designers, and on-the-ground coordinators ensures every detail is handled with precision and flair. + +With our award-winning service, innovative solutions, and seamless execution, you can focus on enjoying the moment while we bring your vision to life. We don’t just manage events—we create experiences that resonate. + +Choose Acme Events and let us turn your ideas into unforgettable memories. Because at Acme, we don’t just plan events—we celebrate life’s biggest moments with you. + +Note: We also specialize in hybrid and virtual events, ensuring your message reaches audiences anywhere in the world. + +Acme Events offers the following services: +- Corporate events & conferences +- Weddings & private parties +- Public festivals & community events +- Hybrid and virtual event solutions + +Business hours: Monday–Friday, 9 AM – 5 PM EST +Customer service number: 1-800-123-4567 +``` + +#### 第 4 步:提供示例 + +通过提供示例来教会代理如何响应用户查询也非常重要,这种技术称为“少样本提示词”。 + +
Here are a few examples of how you can interact with customers:
+
+<示例1>
+H:嗨,你们为孩子们组织生日聚会吗?
+
+答:您好!我是来自 Acme Events 的约翰,感谢您与我们联系。虽然我们主要专注于公司活动、婚礼和公共节日,但我们偶尔也会组织私人聚会,包括生日聚会。
+
+您能否分享有关您计划举办的聚会的更多详细信息(例如,宾客人数、地点和日期)?我很高兴看到我们能提供什么帮助!
+
+
+<示例2>
+H: 你们的营业时间是几点?
+
+答:我们的工作时间为周一至周五上午 9 点至下午 5 点EST。
+
+如果您有任何与活动相关的问题或需要规划帮助,请随时在上述时间内与我们联系。今天我能为您提供什么帮助?
+
+
+<示例3>
+H:你们处理混合会议吗?
+
+答:当然!我们专注于混合和虚拟活动解决方案,非常适合吸引现场和远程观众。
+
+我们处理从直播和技术设置到观众互动工具和事后分析的一切事务。您很快就会计划举办混合活动吗?我很想了解更多有关您的要求的信息。
+
+
+<示例4>
+H:我正在考虑筹办一场婚礼。你能帮忙吗?
+
+答:恭喜!是的,我们很乐意帮助您计划您的重要日子。在 Acme Events,我们提供全方位婚礼策划服务——从场地选择和主题设计到供应商协调和当天执行。
+
+您想安排一次免费咨询来讨论您的愿景和时间表吗?
+
+
+<示例5>
+H:我可以获得公司活动的报价吗?
+
+答:当然!为了准备准确的报价,我需要一些细节:
+
+1. 您计划举办什么类型的企业活动(例如研讨会、晚会、务虚会)?
+
+2. 预计参加人数?
+
+3. 首选日期和地点?
+
+4. 您需要任何具体服务(例如餐饮、AV 设置、品牌推广)吗?
+
+获得此信息后,我将使用我们的报价工具为您生成个性化报价。
+
+
+ +#### 步骤 5:护栏和注释 + +最后,为了防止客服人员偏离轨道,建议明确列出客服人员应如何与客户互动的注意事项。 + +``` +Please adhere to the following guardrails: + +1. Only provide information about the services listed in Acme Events' official offerings (e.g., corporate events, weddings, public festivals, hybrid/virtual events). +2. If asked about services we don't offer (e.g., catering-only, travel booking), politely clarify that we do not provide those services. +3. Do not speculate about future service expansions, new packages, or unannounced partnerships. +4. Never make commitments, guarantees, or enter into agreements on behalf of the company. You are here to inform and guide, not to negotiate. +5. Do not reference or compare to any competitors or their offerings. +6. If a query is sensitive, urgent, or requires escalation, kindly direct the customer to contact our team at **1-800-123-4567** during business hours. +7. Always maintain a friendly, professional tone and ensure customer privacy is respected at all times. +``` + +为了帮助提示词,您可以使用“**生成**”按钮,这将按照上述最佳实践生成系统提示词: + +
+ +
+ +#### 步骤 6:工具和知识命名和描述 + +大多数预构建工具都有清晰的名称和描述,因此用户通常不需要修改它们。然而,对于自定义工具和知识库,提供清晰且描述性的名称对于确保 LLM 知道何时以及如何使用适当的工具至关重要。请参阅[定义函数的最佳实践](https://platform.openai.com/docs/guides/function-calling?api-mode=chat#best-practices-for-defining-functions)。您还可以使用“**生成**”按钮来帮助进行知识描述: + +
+ +## 多智能体 + +对于多智能体架构,我们将创建一个系统,自动对客户查询进行分类,并根据查询的性质将其路由给专门的代理。 + +虽然此设置旨在展示架构的功能,但值得注意的是,我们将探索的示例实际上可以由单个代理处理。 + +### 概述 + +1. **起始节点**:通过结构化表格收集客户询价 +2. **条件代理**:分析查询并确定适当的路由 +3. **人力资源代理**:通过访问人力资源知识库处理人力资源相关查询 +4. **事件管理器**:使用 API 集成功能管理与事件相关的请求 +5. **总代理**:处理一般查询并提供广泛协助 + +
+ +#### 第 1 步:创建起始节点 + +
+ +1. 首先向画布添加 **Start** 节点 +2. 在Start节点配置**Form Input**来收集客户询问 +3. 使用以下配置设置表单: + * **输入类型**:表单输入 + * **表格标题**:“询价” + * **表格说明**:“客户询价” + * **表单输入类型**:配置两个字符串输入: + * **主题**:变量名称 `subject` + * **主体**:变量名称 `body` + +
+ +#### 步骤 2:添加条件代理(检测用户意图) + +
+ +1. 将 **Condition Agent** 节点连接到 Start 节点 +2. 设置系统指令以充当客户支持代理。您还可以参考[单智能体](customer-support.md#single-agent)中使用的提示词。这是一个简单的例子: + +``` +You are a customer support agent. Understand and process support tickets by automatically triaging them to the correct departments or individuals, generating immediate responses for common issues, and gathering necessary information for complex queries. + +Follow the following routine with the user: + +1. First, greet the user and see how you can help the user +2. If question is related to HR query, handoff to HR Agent +3. If question is related to events query, handoff to Event Manager + +Note: Transfers between agents are handled seamlessly in the background; do not mention or draw attention to these transfers in your conversation with the user +``` + +4. 配置**输入**来分析表单主题:`{{ $form.subject }}` +5. 设置路由的**场景**: + * **场景0**:“查询与HR相关” + * **场景1**:“查询与事件相关” + * **场景2**:“查询为普通查询” + +
+ +#### 步骤 3:创建 HR 代理 + +
+ +1. 添加 **Agent** 节点并将其连接到 **Condition 0** 输出 +2. 设置HR专业化的系统消息: + +``` +You are an HR agent responsible for retrieving and applying internal knowledge sources to answer employee queries about HR policies, procedures, and guidelines. + +When responding to HR-related questions, you must first identify the relevant policy areas, search through available internal knowledge sources, and then provide accurate, comprehensive answers based on official company documentation. + +# Steps +1. **Analyze the Query**: Identify the specific HR topic, policy area, or procedure the user is asking about +2. **Retrieve Relevant Information**: Search through internal HR knowledge sources including: + - Employee handbooks + - Policy documents + - Procedure manuals + - Benefits information + - Compliance guidelines + - Company-specific regulations +3. **Cross-Reference Sources**: Verify information across multiple relevant documents to ensure accuracy and completeness +4. **Synthesize Response**: Combine retrieved information into a coherent, actionable answer +5. **Provide Supporting Details**: Include relevant policy numbers, effective dates, or references to specific sections when applicable + +# Notes +- Always prioritize the most current version of policies and note when information may be subject to change +- If conflicting information exists across sources, flag this and recommend contacting HR directly +- For sensitive topics (discrimination, harassment, legal issues), provide both policy information and appropriate escalation contacts +- When policies vary by location, employment type, or other factors, clearly specify which version applies +- If insufficient information is available in internal sources, explicitly state this limitation and suggest alternative resources +``` + +4. **配置知识源 (RAG)**: + * 新增**文献库**:《人力资源法》 + * **说明**:“此信息在确定 2016 年《人力资源法》及其 2020 年实施条例下人力资源管理的法律框架和实施要求时非常有用。” + * **返回源文档**:启用 + +
+ +#### 步骤 4:创建事件管理器 + +
+ +1. 添加另一个 **Agent** 节点并将其连接到 **Condition 1** 输出 +2. 设置系统消息: + +``` +Act as an event manager that can determine actions on events such as create, update, get, list and delete. +``` + +4. **配置工具**: + * 添加带有事件管理 API 配置的 **OpenAPI 工具包**。有关更多详细信息,请参阅[OpenAPI 工具包](interacting-with-api.md#tool-openapi-toolkit)。 + +
+ +事件管理器可以访问完整的事件管理 API ,它可以: + +* 列出所有事件 +* 创建新事件 +* 根据ID获取活动详情 +* 更新活动信息 +* 删除事件 + +有关示例代码,请参阅[事件管理服务器](interacting-with-api.md#prerequisite)。 + +#### 步骤 5:创建总代理 + +
+ +1. 添加第三个 **Agent** 节点并将其连接到 **Condition 2** 输出。这将充当可以回答任何不相关查询的后备路由。如果您只想返回默认响应,也可以替换为 [Direct Reply](../using-flowise/agentflowv2.md#id-12.-direct-reply-node) 节点。 +2. **配置**: + * 一般查询无需额外工具 + * 无需知识来源 + +### 测试流程 + +1. **测试人力资源查询**:提交有关公司政策、福利或人力资源程序的查询 +2. **测试事件查询**:尝试创建、更新或查询公司事件 +3. **测试一般查询**:提出一般性问题,看看系统如何路由到总代理 +4. **观察路由**:注意条件代理如何在不暴露传输过程的情况下无缝路由查询 + +
+ +### 完整的流程结构 + +{% file src="../.gitbook/assets/Customer Support Agents.json" %} diff --git a/cn/tutorials/deep-research.md b/cn/tutorials/deep-research.md new file mode 100644 index 00000000..ae11d6c4 --- /dev/null +++ b/cn/tutorials/deep-research.md @@ -0,0 +1,269 @@ +# 深入研究 + +深度研究代理是一个复杂的多智能体系统,可以通过将复杂的查询分解为可管理的任务、部署专门的研究代理以及将研究结果合成为详细的报告来对任何主题进行全面的研究。 + +这种方法的灵感来自 Anthropic 的博客 - [我们如何构建多主体研究系统](https://www.anthropic.com/engineering/built-multi-agent-research-system) + +## 概述 + +深度研究代理工作流程由几个协同工作的关键组件组成: + +1. **Planner Agent**:分析研究查询并生成专门研究任务的列表 +2. **迭代**:创建多个研究代理来处理查询的不同方面 +3. **研究子代理**:使用网络搜索和其他工具进行重点研究的个人代理 +4. **作家代理**:将所有调查结果综合成一份连贯、全面的报告 +5. **条件代理**:确定是否需要额外的研究或者研究结果是否足够 +6. **循环**:循环回到Planner Agent以提高研究质量 + +
+ +### 步骤1:创建起始节点 + +
+ +1. 首先向画布添加 **Start** 节点 +2. 使用**表单输入**配置开始节点以收集用户的研究查询 +3. 使用以下配置设置表单: + * **表格标题**:“研究” + * **表单描述**:“接受查询并返回详细报告的研究代理” + * **表单输入类型**:添加带有标签“Query”和变量名称“query”的字符串输入 +4. 使用两个关键变量初始化 Flow State: + * `subagents`:存储子代理要执行的研究任务列表 + * `findings`: 积累研究成果 + +
+ +### 第 2 步:添加 Planner 代理 + +
+ +1. 将 **LLM** 节点连接到 Start 节点。 +2、建立专家研究带头人制度提示词,主要职责如下: + * 分析并分解用户查询 + * 制定详细的研究计划 + * 为子代理生成特定任务 + * 示例提示词 - [research\_lead\_agent.md](https://github.com/anthropics/anthropic-cookbook/blob/main/patterns/agents/prompts/research_lead_agent.md) + +
+ +3. 配置 **JSON 结构化输出** 以返回子代理任务列表: + +```json +{ + "task": { + "type": "string", + "description": "The research task for subagent" + } +} +``` + +4. 通过存储生成的子代理列表来更新流状态 + +
+ +### 步骤 3:创建子代理迭代块 + +
+ +1. 添加**迭代**节点。 +2. 将其连接到 Planner 输出 +3. 将迭代输入配置为流状态:`{{ $flow.state.subagents }}`。对于数组中的每个项目,将生成一个子代理来执行研究任务。示例: + +
+ +```json +{ + "subagents": [ + { + "task": "Research the current state and recent developments in autonomous multi-agent systems technology. Focus on defining what autonomous multi-agent systems are, key technical components (coordination algorithms, communication protocols, decision-making frameworks), major technological advances in the last 2-3 years, and leading research institutions/companies working in this space. Use web search to find recent academic papers, industry reports, and technical documentation. Prioritize sources from IEEE, ACM, Nature, Science, and major tech companies' research divisions. Compile findings into a comprehensive technical overview covering definitions, core technologies, recent breakthroughs, and key players in the field." + }, + { + "task": "Investigate real-world applications and deployments of autonomous multi-agent systems across different industries. Research specific use cases in robotics (swarm robotics, warehouse automation), transportation (autonomous vehicle fleets, traffic management), manufacturing (coordinated production systems), defense/military applications, smart cities, and any other domains where these systems are actively deployed. For each application area, identify specific companies, products, success stories, and quantitative results where available. Focus on practical implementations rather than theoretical research. Use web search to find case studies, company announcements, industry reports, and news articles about actual deployments." + } + ] +} +``` + +### 步骤 4:构建研究子代理 + +1. 在迭代块内,添加 **Agent** 节点。 +2. 配置系统提示词符以充当重点研究子代理: + * 清晰的任务理解能力 + * 高效的研究规划(每个任务 2-5 个工具调用) + * 源码质量评估 + * 并行工具使用以提高效率 + * 示例提示词 - [research\_subagent.md](https://github.com/anthropics/anthropic-cookbook/blob/main/patterns/agents/prompts/research_subagent.md) + +
+ +3.添加以下研究工具,您可以使用自己喜欢的工具: + * **Google 搜索**:用于网络搜索链接 + * **Web Scraper**:用于提取网页内容。这将从 Google 搜索中抓取链接的内容。 + * **ArXiv Search**:用于搜索和加载学术论文内容 + +
+ +4.设置用户消息传递当前迭代任务:`{{ $iteration.task }}` + +### 步骤 5:添加写入代理 + +
+ +1. 迭代完成后连接 **LLM** 节点。 +2. 需要更大的上下文 LLM (如 Gemini,具有 1-2 百万上下文大小)来综合所有发现并生成报告。 +3. 设置系统提示词以充当专家研究撰稿人: +* 保留研究结果的完整背景 + * 保持引用的完整性 + * 增加结构和清晰度 + * 输出专业的Markdown报告 +4. 配置用户消息以包括: + * 研究主题:`{{ $form.query }}` + * 现有发现:`{{ $flow.state.findings }}` + * 新发现:`{{ iterationAgentflow_0 }}` + +
+ +4. 使用写入代理的输出更新 `{{ $flow.state.findings }}`。 + +
+ +### 第 6 步:实施条件检查 + +
+ +1. 添加**条件代理。** +2. 设置条件逻辑以确定是否需要进行额外研究 +3. 配置两种场景: + *“需要更多的子代理” + *“调查结果足够” +4. 提供输入上下文,包括: + * 研究课题 + * 目前的子代理商列表 + * 累积的调查结果 + +
+ +### 步骤 7:创建循环机制 + +1. 对于 **“需要更多子代理”** 路径,添加 **Loop** 节点 +2.配置环回Planner节点 +3.设置最大循环次数为5,防止无限循环 +4. Planner Agent 将查看当前报告,并生成额外的研究任务。 + +
+ +### 步骤 8:添加最终输出 + +1. 对于“**发现足够**”路径,添加**直接回复** +2. 配置其输出最终报告:`{{ $flow.state.findings }}` + +
+ +
+ +## 测试流程 + +1. 从一个简单的主题开始,例如“现实环境中的自治多智能体系统” +2. 观察规划者如何将研究分解为重点任务 +3. 监控子代理进行并行研究 +4. 审查作家代理的调查结果综合 +5. 注意条件代理是否要求额外研究 + +
+ +**生成的报告:** + +{% file src="../.gitbook/assets/Deep Research Report.pdf" %} + +## 完整的流程结构 + +{% file src="../.gitbook/assets/Deep Research Dynamic SubAgents.json" %} + +## 演练 + +1. 🧠 Planner Agent - 分析研究查询并生成专门研究任务的列表 +2. 🖧 子代理 - 创建多个研究子代理,使用网络搜索、网络抓取和 arxiv 工具进行重点研究 +3. ✍️ 作家代理 - 将所有发现综合成一份连贯、全面的报告并附有引文 +4. ⇄ 条件代理 - 确定是否需要额外的研究或者研究结果是否足够 +5. 🔄 循环回到Planner Agent以生成更多子agent + +### 🧠 规划代理 + +作为专家研究导致: + +* 分析并分解用户查询 +* 制定详细的研究计划 +* 为子代理生成特定任务 + +输出一系列研究任务。 + +
+ +### 🖧 子代理 + +对于任务列表中的每项任务,都会生成一个新的子代理来进行重点研究。 + +每个子代理有: + +* 清晰的任务理解能力 +* 高效的研究规划(每个任务 2-5 个工具调用) +* 源码质量评估 +* 并行工具使用以提高效率 + +
+ +Subagent 可以访问网络搜索、网络抓取和 arxiv 工具。 + +* 🌐 Google 搜索 - 用于网络搜索链接 +* 🗂️ Web Scraper - 用于提取网页内容。这将从 Google 搜索中抓取链接的内容。 +* 📑 ArXiv - 搜索、下载和阅读 arXiv 论文内容 + +
+ +### ✍️ 作家代理 + +充当研究撰稿人,将原始发现转化为清晰、结构化的 Markdown 报告。保留所有上下文和引文。 + +我们发现 Gemini 是这方面的最佳选择,因为它具有较大的上下文窗口,可以有效地综合所有发现。 + +
+ +### ⇄ 条件代理 + +通过生成的报告,我们让 LLM 确定是否需要进行额外的研究或者研究结果是否足够。 + +如果需要更多,规划器代理会审查所有消息,确定需要改进的领域,生成后续研究任务,然后循环继续。 + +如果发现足够,我们只需从写入代理返回最终报告作为输出。 + +
+ +## 高级配置 + +#### 定制研究深度 + +您可以通过修改 Planner 的系统提示词来调整研究深度: + +* 增加复杂主题的子代理数量(最多 10-20 个) +* 调整每个子代理的工具调用预算 +* 修改循环计数以进行更多迭代研究 + +但这也伴随着更多代币消费的额外成本。 + +#### 添加专用工具 + +通过添加特定领域的工具来增强研究能力: + +* 个人工具,如 Gmail、Slack、Google 日历、Teams 等 +* 其他网络爬虫、网络搜索工具,如 Firecrawl、Exa、Apify 等 + +#### 添加 RAG 上下文 + +您可以使用 [RAG](rag.md) 将更多上下文添加到 LLM。这允许 LLM 在需要时从相关的现有知识源中提取信息。 + +## 最佳实践 + +* 由于大量发现导致代币溢出,模型选择和后备选项至关重要。 +* 提示词是关键。 Anthropic 开源了他们的整个提示词结构,涵盖任务委托、并行工具使用和思维过程 - [https://github.com/anthropics/anthropic-cookbook/blob/main/patterns/agents/prompts](https://github.com/anthropics/anthropic-cookbook/blob/main/patterns/agents/prompts) +* 工具需要精心设计,何时使用,如何限制工具执行返回结果的长度。 +* 这与权衡三角非常相似,优化其中两棵树通常会对另一棵树产生负面影响,在本例中是速度、质量、成本。 diff --git a/cn/tutorials/human-in-the-loop.md b/cn/tutorials/human-in-the-loop.md new file mode 100644 index 00000000..931bee08 --- /dev/null +++ b/cn/tutorials/human-in-the-loop.md @@ -0,0 +1,225 @@ +# 人工介入 + +在之前的教程中,我们探讨了代理如何动态地使用工具来回答查询或完成分配的任务。 **人机交互**通过允许代理在继续操作之前请求人工输入、批准或反馈来添加控制层。 + +人类参与循环有两种使用方式: + +* 使用[Human Input](../using-flowise/agentflowv2.md#id-11.-human-input-node)节点来停止执行 +* 为代理工具启用**需要人工输入** + +## 人工输入节点 + +**人工输入**节点允许暂停执行,并且仅在人类提供反馈以批准或拒绝操作后才恢复执行。 + +在本教程中,我们将学习如何创建自动电子邮件回复代理,在发送电子邮件之前询问用户反馈。 + +### 概述 + +此用例的目标是创建一个智能电子邮件回复系统,该系统: + +1. 接收传入的电子邮件查询 +2. 使用人工智能生成专业的电子邮件回复 +3. 发送前请求人工批准 +4. 允许修改和改进 +5.自动发送批准的电子邮件 + +
+ +#### 第 1 步:设置起始节点 + +1. 将 **Start** 节点拖放到画布上。这将是传入电子邮件数据的入口点。 +2. 使用以下设置配置启动节点: + * **输入类型**:选择“表单输入”以捕获结构化电子邮件数据 + * **表格标题**:“电子邮件查询” + * **表格说明**:“传入电子邮件查询” +3. 添加以下表单输入类型: + * **主题**(字符串):捕获电子邮件主题行 + * **Body**(字符串):捕获电子邮件内容 + * **From**(字符串):捕获发件人的电子邮件地址 + +
+ +#### 步骤 2:创建电子邮件回复代理 + +1. 添加 **Agent** 节点并将其连接到 Start 节点。该代理将分析传入的电子邮件并生成适当的响应。 +2.添加系统消息,例如: + + ``` + You are a customer support agent working in Flowise Inc. Write a professional email reply to user's query. Use the web search tools to get more details about the prospect. + + Always reply as Samantha, Customer Support Representative in Flowise. Don't use placeholders. + ``` +3. 添加以下工具来增强代理的能力: + * **Google 自定义搜索**:研究客户信息并提供相关背景 + * **当前日期时间**:在响应中包含准确的时间戳 + +
+ +#### 步骤 3:添加人工输入以供批准 + +1. 添加 **人工输入** 节点并将其连接到电子邮件回复代理。这将创建人机循环检查点。 +2. 配置人工输入节点: + * **描述类型**:“固定” + * **描述**:“您确定要继续吗?” + * **启用反馈**:True(允许人类提供额外的反馈) +3. 该节点将暂停工作流程并将 AI 生成的响应呈现给人工审阅者。审稿人可以: + * **继续**:批准回复并继续发送电子邮件 + * **拒绝**:发送反馈并循环回代理以进行改进 + +
+ +#### 步骤 4:设置环回机制 + +1. 添加 **Loop** 节点来处理拒绝场景。这允许工作流程返回到电子邮件回复代理以进行改进。 +2. 配置Loop节点: + * **循环返回**:从下拉列表中选择“电子邮件回复代理” + * **最大循环计数**:5(防止无限循环) +3. 将“人类输入”节点的“拒绝”输出连接到该循环节点。当人员拒绝响应时,工作流程将返回给代理并提供改进反馈。 + +
+ +#### 步骤 5:创建电子邮件主题和正文生成器 + +1. 添加 **LLM** 节点并将其连接到 Human Input 节点的“proceed”输出。该节点会将批准的响应构建为正确的电子邮件格式。 +2. 设置 JSON 结构化输出: + * **键**:“主题”,**类型**:“字符串”,**描述**:“电子邮件主题” +* **键**:“正文”,**类型**:“字符串”,**描述**:“电子邮件正文” + +
+ +#### 步骤 6:设置电子邮件发送 + +1. 添加 **工具** 节点并将其连接到电子邮件主题和正文 LLM 节点。这将处理实际的电子邮件发送。 +2. 配置工具节点: + * **工具**:从可用工具中选择“Gmail” + * **消息操作**:“sendMessage” +3. 配置工具输入参数: + * **to**:使用变量 `{{ $form.from }}` 回复原始发件人 + * **subject**:使用 `{{ llmAgentflow_0.output.subject }}` 获取第 5 步生成的主题 + * **正文**:使用 `{{ llmAgentflow_0.output.body }}` 获取第 5 步生成的电子邮件正文 + +
+ +### 工作流程如何运作 + +当收到电子邮件询问时,会发生以下情况: + +1. **表单输入**:系统捕获电子邮件主题、正文和发件人信息 +2. **人工智能分析**:电子邮件回复代理分析查询并使用网络搜索获取其他上下文生成专业回复 +3. **人工审核**:工作流程暂停并向人工审核者呈现人工智能生成的响应 +4. **决策点**:人类可以: + * **批准**:响应继续进行电子邮件格式化和发送 + * **拒绝**:响应返回给代理并提供改进反馈 +5. **电子邮件格式**:如果获得批准,响应将被构建为包含主题和正文的正确电子邮件格式 +6. **电子邮件发送**:最终电子邮件将通过 Gmail 自动发送给原始发件人 + +### 测试工作流程 + +1. 通过填写包含示例电子邮件查询的表格来启动工作流程 + +
+ +2. 检查人工输入步骤中代理的响应 + +
+ +3. 拒绝回复并提供更多反馈: + +
+ +4. 查看代理修改后的回复: + +
+ +5. 继续并验证电子邮件是否正确发送: + +
+ +### 完整的流程结构 + +{% file src="../.gitbook/assets/Human In The Loop Agent.json" %} + +## 需要人工输入代理工具 + +当代理决定使用工具时,会发生以下情况: + +1. 给定用户查询,LLM 确定是否需要工具调用。 +2. 如果从 LLM 输出响应中识别出工具调用,Flowise 会找到匹配的工具并执行相应的函数。 +3. 工具执行的结果返回到 LLM。 +4. 然后 LLM 决定是否需要额外的工具调用,或者是否有足够的信息来返回最终响应。 + +
+ +启用“需要人工输入”后,我们会在检测到工具调用后放置一个额外的检查点: + +
+ +这对于敏感的工具调用至关重要,例如下订单、预订、会议、发送电子邮件等,这些地方需要人工确认和审查。 + +我们可以使用上面的示例电子邮件回复系统,但将其简化为只有一个代理。 + +
+ +### 配置 + +1. 添加 **Agent** 节点并将其连接到 Start 节点。这个代理将处理电子邮件分析和人工批准。 +2.向Agent添加系统消息,例如: + + ``` + You are a customer support agent working in Flowise Inc. Create a draft professional email reply to user's query. Use the web search tools to get more details about the prospect. + + Always reply as Samantha, Customer Support Representative in Flowise. Don't use placeholders. + + Today's date is {{ current_date_time }}. + ``` +3. 添加以下工具: + * **Google 自定义搜索**:用于研究客户信息 + * **Gmail**:用于创建经过人工批准的电子邮件草稿 +4.配置Gmail工具: + * **Gmail 类型**:“草稿” + * **草稿操作**:“createDraft” + * **需要人工输入**: ✅ **启用此选项** - 这是创建 HITL 功能的关键功能 + +
+ +### 简化流程如何运作 + +1. **表单输入**:用户提交电子邮件查询详细信息 +2. **人工智能分析**:代理分析电子邮件并使用 Google 搜索获取其他上下文 +3. **草稿创建**:当代理尝试创建 Gmail 草稿时,工作流程会暂停 +4. **人工审核**:系统呈现电子邮件草稿以供人工批准 +5. **决策**:人们可以批准(创建草稿)或拒绝(提供反馈并重试) + +### 测试代理 + +1. 通过填写包含示例电子邮件查询的表格来启动工作流程 + +
+ + +2. 代理在创建 Gmail 草稿之前,会询问用户批准或拒绝。 + +
+ +3. 如果该工具获得批准,代理将继续调用该工具并在 Gmail 中创建草稿。代理足够聪明,可以确定电子邮件的适当主题、正文和收件人。 + +
+ +### 完整的流程结构 + +{% file src="../.gitbook/assets/Email Agent.json" %} + +## 共享执行跟踪以供外部审查和批准 + +1. 在仪表板左侧栏中,单击 **执行。** +2. 找到执行跟踪,然后单击“**共享”。** + +
+ +3. 执行跟踪现在可作为公共链接使用。您可以与其他人分享此链接以供审核。 + +
+ +4. Flowise 之外的用户可以拒绝或批准: + +
diff --git a/cn/tutorials/interacting-with-api.md b/cn/tutorials/interacting-with-api.md new file mode 100644 index 00000000..28e84cb2 --- /dev/null +++ b/cn/tutorials/interacting-with-api.md @@ -0,0 +1,615 @@ +# 与 API 交互 + +几乎所有 Web 应用程序都依赖于 RESTful API。使 LLM 能够与它们交互,扩展了其实用性。 + +本教程展示了如何使用 LLM 通过工具调用来进行 API 调用。 + +## 先决条件 - 示例事件管理服务器 + +我们将使用一个简单的事件管理服务器,并展示如何与其交互。 + +```javascript +const express = require('express'); +const { v4: uuidv4 } = require('uuid'); + +const app = express(); +const PORT = process.env.PORT || 5566; + +// Middleware +app.use(express.json()); + +// Fake database - in-memory storage +let events = [ + { + id: '1', + name: 'Tech Conference 2024', + date: '2024-06-15T09:00:00Z', + location: 'San Francisco, CA' + }, + { + id: '2', + name: 'Music Festival', + date: '2024-07-20T18:00:00Z', + location: 'Austin, TX' + }, + { + id: '3', + name: 'Art Exhibition Opening', + date: '2024-05-10T14:00:00Z', + location: 'New York, NY' + }, + { + id: '4', + name: 'Startup Networking Event', + date: '2024-08-05T17:30:00Z', + location: 'Seattle, WA' + }, + { + id: '5', + name: 'Food & Wine Tasting', + date: '2024-09-12T19:00:00Z', + location: 'Napa Valley, CA' + } +]; + +// Helper function to validate event data +const validateEvent = (eventData) => { + const required = ['name', 'date', 'location']; + const missing = required.filter(field => !eventData[field]); + + if (missing.length > 0) { + return { valid: false, message: `Missing required fields: ${missing.join(', ')}` }; + } + + // Basic date validation + const dateRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/; + if (!dateRegex.test(eventData.date)) { + return { valid: false, message: 'Date must be in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ)' }; + } + + return { valid: true }; +}; + +// GET /events - List all events +app.get('/events', (req, res) => { + res.status(200).json(events); +}); + +// POST /events - Create a new event +app.post('/events', (req, res) => { + const validation = validateEvent(req.body); + + if (!validation.valid) { + return res.status(400).json({ error: validation.message }); + } + + const newEvent = { + id: req.body.id || uuidv4(), + name: req.body.name, + date: req.body.date, + location: req.body.location + }; + + events.push(newEvent); + res.status(201).json(newEvent); +}); + +// GET /events/{id} - Retrieve an event by ID +app.get('/events/:id', (req, res) => { + const event = events.find(e => e.id === req.params.id); + + if (!event) { + return res.status(404).json({ error: 'Event not found' }); + } + + res.status(200).json(event); +}); + +// DELETE /events/{id} - Delete an event by ID +app.delete('/events/:id', (req, res) => { + const eventIndex = events.findIndex(e => e.id === req.params.id); + + if (eventIndex === -1) { + return res.status(404).json({ error: 'Event not found' }); + } + + events.splice(eventIndex, 1); + res.status(204).send(); +}); + +// PATCH /events/{id} - Update an event's details by ID +app.patch('/events/:id', (req, res) => { + const eventIndex = events.findIndex(e => e.id === req.params.id); + + if (eventIndex === -1) { + return res.status(404).json({ error: 'Event not found' }); + } + + const validation = validateEvent(req.body); + + if (!validation.valid) { + return res.status(400).json({ error: validation.message }); + } + + // Update the event + events[eventIndex] = { + ...events[eventIndex], + name: req.body.name, + date: req.body.date, + location: req.body.location + }; + + res.status(200).json(events[eventIndex]); +}); + +// Error handling middleware +app.use((err, req, res, next) => { + console.error(err.stack); + res.status(500).json({ error: 'Something went wrong!' }); +}); + +// 404 handler +app.use((req, res) => { + res.status(404).json({ error: 'Endpoint not found' }); +}); + +// Start the server +app.listen(PORT, () => { + console.log(`Event Management API server is running on port ${PORT}`); + console.log(`Available endpoints:`); + console.log(` GET /events - List all events`); + console.log(` POST /events - Create a new event`); + console.log(` GET /events/{id} - Get event by ID`); + console.log(` PATCH /events/{id} - Update event by ID`); + console.log(` DELETE /events/{id} - Delete event by ID`); +}); + +module.exports = app; +``` + +*** + +## 请求工具 + +有 4 个请求工具可以使用。这允许 LLM 在必要时调用 GET、POST、PUT、DELETE 工具。 + +### 步骤1:添加起始节点 + +开始节点是流程的入口点 + +
+ +### 步骤2:添加代理节点 + +接下来,添加一个 Agent 节点。在此设置中,代理配置有四个主要工具:GET、POST、PUT 和 DELETE。每个工具都设置为执行特定类型的 API 请求。 + +#### 工具 1:GET(检索事件) + +
+ +* **目的:** 从 API 获取事件列表或特定事件。 +* **配置输入:** + * **URL:** `http://localhost:5566/events` + * **名称:** `get_events` + * **描述:** 描述何时使用此工具。例如:`Use this when you need to get events` + * **标头:** (可选)添加任何必需的 HTTP 标头。 + * **查询参数架构:** API 的 JSON 架构,允许 LLM 了解 URL 结构,即要生成的路径和查询参数。例如: + + ```json + { + "id": { + "type": "string", + "in": "path", + "description": "ID of the item to get. /:id" + }, + "limit": { + "type": "string", + "in": "query", + "description": "Limit the number of items to get. ?limit=10" + } + } + ``` + +#### 工具 2:POST(创建事件) + +
+ +* **目的:** 在系统中创建一个新事件。 +* **配置输入:** + * **URL:** `http://localhost:5566/events` + * **名称:** `create_event` + * **描述:** `Use this when you want to create a new event.` + * **标头:** (可选)添加任何必需的 HTTP 标头。 + * **Body**:硬编码的主体对象,将覆盖 LLM 生成的主体 + * **主体架构:** API 请求主体的 JSON 架构,允许 LLM 了解如何自动生成正确的 JSON 主体。例如: + + ```json + { + "name": { + "type": "string", + "required": true, + "description": "Name of the event" + }, + "date": { + "type": "string", + "required": true, + "description": "Date of the event" + }, + "location": { + "type": "string", + "required": true, + "description": "Location of the event" + } + } + ``` + +#### 工具 3:PUT(更新事件) + +
+ +* **目的:** 更新现有活动的详细信息。 +* **配置输入:** + * **URL:** `http://localhost:5566/events` + * **名称:** `update_event` + * **描述:** `Use this when you want to update an event.` + * **标头:** (可选)添加任何必需的 HTTP 标头。 + * **Body**:硬编码的主体对象,将覆盖 LLM 生成的主体 + * **主体架构:** API 请求主体的 JSON 架构,允许 LLM 了解如何自动生成正确的 JSON 主体。例如: + + ```json + { + "name": { + "type": "string", + "required": true, + "description": "Name of the event" + }, + "date": { + "type": "string", + "required": true, + "description": "Date of the event" + }, + "location": { + "type": "string", + "required": true, + "description": "Location of the event" + } + } + ``` + +#### 工具 4:DELETE(删除事件) + +
+ +* **目的:** 从系统中删除事件。 +* **配置输入:** + * **URL:** `http://localhost:5566/events` + * **名称:** `delete_event` + * **描述:** `Use this when you need to delete an event.` + * **标头:** (可选)添加任何必需的 HTTP 标头。 + * **查询参数架构:** API 的 JSON 架构,允许 LLM 了解 URL 结构,即要生成的路径和查询参数。例如: + + ```json + { + "id": { + "type": "string", + "required": true, + "in": "path", + "description": "ID of the item to delete. /:id" + } + } + ``` + +### 代理如何使用这些工具 + +* 代理可以根据用户的请求或流程的逻辑动态选择使用哪个工具。 +* 每个工具都映射到特定的 HTTP 方法和端点,并具有明确定义的输入模式。 +* 代理利用 LLM 解释用户输入,填写所需参数,并进行适当的 API 调用。 + +当然!以下是您的流程的一些**示例交互**,包括示例用户查询和每个查询的预期行为,映射到相应的工具(GET、POST、PUT、DELETE): + +### 交互示例 + +#### 1. 检索事件 (GET) + +**查询示例:** + +>“显示所有即将发生的事件。” + +**预期行为:** + +* 代理选择 **GET** 工具。 +* 它向 `http://localhost:5566/events` 发送 GET 请求。 +* 代理向用户返回所有事件的列表。 + +*** + +**查询示例:** + +>“获取 ID 为 12345 的活动的详细信息。” + +**预期行为:** + +* 代理选择 **GET** 工具。 +* 它向 `http://localhost:5566/events/12345` 发送 GET 请求。 +* 代理返回 ID 为 `12345` 的事件的详细信息。 + +*** + +#### 2. 创建一个新事件 (POST) + +**查询示例:** + +> “于 2024 年 7 月 15 日在 Tech Hall 创建一个名为“AI 会议”的新活动。” + +**预期行为:** + +* 代理选择 **POST** 工具。 +* 它向 `http://localhost:5566/events` 发送 POST 请求,请求体如下: + + ```json + { + "name": "AI Conference", + "date": "2024-07-15", + "location": "Tech Hall" + } + ``` +* 代理确认事件已创建,并可能返回新事件的详细信息。 + +*** + +#### 3. 更新事件 (PUT) + +**查询示例:** + +> “将2024年7月15日举办的‘AI大会’地点改为‘主礼堂’。” + +**预期行为:** + +* 代理选择 **PUT** 工具。 +* 它向 `http://localhost:5566/events` 发送 PUT 请求,其中包含更新的事件详细信息: + + ```json + { + "name": "AI Conference", + "date": "2024-07-15", + "location": "Main Auditorium" + } + ``` +* 代理确认该事件已更新。 + +*** + +#### 4. 删除事件 (DELETE) + +**查询示例:** + +> “删除 ID 为 12345 的事件。” + +**预期行为:** + +* 代理选择 **DELETE** 工具。 +* 它向 `http://localhost:5566/events/12345` 发送 DELETE 请求。 +* 代理确认该事件已被删除。 + +### 完整流程 + +{% file src="../.gitbook/assets/Requests Tool Agent.json" %} + +*** + +## OpenAPI 工具包 + +如果您有几个 API,4 个请求工具会非常有用,但想象一下有数十或数百个 API,这可能会变得难以维护。为了解决这个问题,Flowise 提供了一个 OpenAPI 工具包,它能够接收 OpenAPI YAML 文件,并将每个 API 解析为一个工具。 [OpenAPI 规范 (OAS)](https://swagger.io/specification/) 是一项普遍接受的标准,用于以机器可以读取和解释的格式描述 RESTful API 的详细信息。 + +使用事件管理 API,我们可以生成一个 OpenAPI YAML 文件: + +```yaml +openapi: 3.0.0 +info: + version: 1.0.0 + title: Event Management API + description: An API for managing event data + +servers: + - url: http://localhost:5566 + description: Local development server + +paths: + /events: + get: + summary: List all events + operationId: listEvents + responses: + '200': + description: A list of events + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Event' + + post: + summary: Create a new event + operationId: createEvent + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventInput' + responses: + '201': + description: The event was created + content: + application/json: + schema: + $ref: '#/components/schemas/Event' + '400': + description: Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + /events/{id}: + parameters: + - name: id + in: path + required: true + schema: + type: string + description: The event ID + + get: + summary: Retrieve an event by ID + operationId: getEventById + responses: + '200': + description: The event + content: + application/json: + schema: + $ref: '#/components/schemas/Event' + '404': + description: Event not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + patch: + summary: Update an event's details by ID + operationId: updateEventDetails + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventInput' + responses: + '200': + description: The event's details were updated + content: + application/json: + schema: + $ref: '#/components/schemas/Event' + '400': + description: Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + '404': + description: Event not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + + delete: + summary: Delete an event by ID + operationId: deleteEvent + responses: + '204': + description: The event was deleted + '404': + description: Event not found + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + +components: + schemas: + Event: + type: object + properties: + id: + type: string + description: The unique identifier for the event + name: + type: string + description: The name of the event + date: + type: string + format: date-time + description: The date and time of the event in ISO 8601 format + location: + type: string + description: The location of the event + required: + - name + - date + - location + + EventInput: + type: object + properties: + name: + type: string + description: The name of the event + date: + type: string + format: date-time + description: The date and time of the event in ISO 8601 format + location: + type: string + description: The location of the event + required: + - name + - date + - location + + Error: + type: object + properties: + error: + type: string + description: Error message +``` + +### 步骤1:添加起始节点 + +
+ +### 步骤2:添加代理节点 + +接下来,添加一个 Agent 节点。在此设置中,代理仅配置了 1 个工具 - OpenAPI Toolkit + +#### 工具:OpenAPI 工具包 + +
+ +* **目的:** 从 YAML 文件中获取 API 列表,并将每个 API 转换为工具列表 +* **配置输入:** + * **YAML 文件:** OpenAPI YAML 文件 + * **Return Direct:** 是否直接返回API的响应 + * **标头:** (可选)添加任何必需的 HTTP 标头。 + * **删除空参数:** 从解析的参数中删除所有具有空值的键 + * **自定义代码**:自定义返回响应的方式 + +### 交互示例: + +我们可以使用前面示例中的相同示例查询来测试它: + +
+ +*** + +## 依次调用 API + +从上面的例子中,我们已经看到了Agent如何动态调用工具并与API交互。在某些情况下,可能需要在某些操作之前或之后顺序调用 API。例如,您可以从 CRM 获取客户列表并将其传递给代理。在这种情况下,您可以使用 [HTTP 节点](../using-flowise/agentflowv2.md#id-6.-http-node)。 + +
+ +## 最佳实践 + +* 当您希望代理获取最新信息时,通常会使用与 API 交互。例如,代理可能会检索您的日历可用性、项目状态或其他实时数据。 +* 在系统提示词中明确包含当前时间通常会很有帮助。 Flowise 提供了一个名为 `{{current_date_time}}` 的变量,用于检索当前日期和时间。这使得 LLM 能够了解当前时刻,因此,如果您询问今天的空闲时间,模型可以参考正确的日期。否则,它可能依赖于最后的训练截止日期,这将返回过时的信息。例如: + +``` +You are helpful assistant. + +Todays date time is {{current_date_time }} +``` diff --git a/cn/tutorials/rag.md b/cn/tutorials/rag.md new file mode 100644 index 00000000..4d4754d6 --- /dev/null +++ b/cn/tutorials/rag.md @@ -0,0 +1,50 @@ +# RAG + +大型语言模型 (LLM) 释放了创建高级问答聊天机器人的潜力,能够根据特定内容提供精确的答案。这些系统依赖于一种称为检索增强生成(RAG)的方法,该方法通过将它们扎根于相关源材料来增强它们的响应。 + +在本教程中,您将学习如何创建一个基本的问答应用程序,该应用程序可以从给定的文档源中提取和回答问题。 + +该流程可以分为 2 个子流程: + +* 索引 +* 检索 + +## 索引 + +[文档存储](../using-flowise/document-stores.md) 旨在帮助完成整个索引管道 - 从不同来源检索数据、分块策略、写入更新到矢量数据库、与更新的数据同步。 + +我们支持广泛的文档加载器,从 Pdf、Word、Google Drive 等文件到 Playwright、Firecrawl、Apify 等网络抓取工具。您还可以创建自定义文档加载器。 + +
+ +## 检索 + +根据用户的输入,从向量数据库中获取相关文档块。 LLM 然后使用检索到的上下文来生成响应。 + +1. 拖放 [Agent](../using-flowise/agentflowv2.md#id-3.-agent-node) 节点,并配置要使用的模型。 + +
+ +2. 添加新的知识(文档存储)并定义内容的内容。这有助于 LLM 了解何时以及如何检索相关信息。您还可以使用自动生成按钮来协助完成此过程。 + +{% hint style="success" %} +只能使用写入更新的文档存储 +{% endhint %} + +
+ +3.(可选)如果数据已经存储在矢量数据库中,而无需经过文档存储索引管道,您还可以直接连接到矢量数据库和嵌入模型。 + +
+ +4. 添加系统提示词,或使用**生成**按钮来协助。我们建议使用它,因为它有助于制作更有效和优化的提示词。 + +
+ +
+ +5. 您的 RAG 代理现在可以使用了! + +## 资源 + +{% embed url="https://youtu.be/KHc0ClOIv0A?si=mEZJydM8bT2imKJY" %} diff --git a/cn/tutorials/sql-agent.md b/cn/tutorials/sql-agent.md new file mode 100644 index 00000000..b10d9a1a --- /dev/null +++ b/cn/tutorials/sql-agent.md @@ -0,0 +1,366 @@ +# SQL 代理 + +本教程将指导您构建一个智能 SQL 代理,该代理可以与数据库交互、生成 SQL 查询、验证它们、执行它们,并在发生错误时进行自我纠正。 + +## 概述 + +SQL 智能体流程实现了强大的数据库交互系统,该系统: + +1. 检索数据库模式信息 +2.根据用户问题生成SQL查询 +3. 验证生成的查询是否存在常见错误 +4. 对数据库执行查询 +5. 检查结果是否有错误并在需要时进行自我更正 +6.根据查询结果提供自然语言响应 + +
+ +### 第 1 步:设置起始节点 + +首先向画布添加 **Start** 节点。这是您的 SQL 代理的入口点。 + +
+ +#### 配置: + +* **输入类型**:选择“聊天输入”接受用户问题 +* **流状态**:添加一个带有键“`sqlQuery`”和空值的状态变量 + +Start 节点使用空的 `sqlQuery` 变量初始化流状态,该变量将在整个过程中存储生成的 SQL 查询。 + +### 步骤 2:检索数据库架构 + +添加 **Custom Function** 节点并将其连接到 Start 节点。 + +
+ +#### 配置: + +* **Javascript 函数**:这是一个示例函数,用于连接到数据库并检索完整的架构,包括表结构、列定义和示例数据。 + +```javascript +const { DataSource } = require('typeorm'); + +const HOST = 'localhost'; +const USER = 'testuser'; +const PASSWORD = 'testpwd'; +const DATABASE = 'testdatabase'; +const PORT = 5432; + +let sqlSchemaPrompt = ''; + +const AppDataSource = new DataSource({ + type: 'postgres', + host: HOST, + port: PORT, + username: USER, + password: PASSWORD, + database: DATABASE, + synchronize: false, + logging: false, +}); + +async function getSQLPrompt() { + try { + await AppDataSource.initialize(); + const queryRunner = AppDataSource.createQueryRunner(); + + // Get all user-defined tables + const tablesResult = await queryRunner.query(` + SELECT table_name + FROM information_schema.tables + WHERE table_schema = 'public' AND table_type = 'BASE TABLE' + `); + + for (const tableRow of tablesResult) { + const tableName = tableRow.table_name; + const schemaInfo = await queryRunner.query(` + SELECT column_name, data_type, is_nullable + FROM information_schema.columns + WHERE table_name = '${tableName}' + `); + + const createColumns = []; + const columnNames = []; + + for (const column of schemaInfo) { + const name = column.column_name; + const type = column.data_type.toUpperCase(); + const notNull = column.is_nullable === 'NO' ? 'NOT NULL' : ''; + columnNames.push(name); + createColumns.push(`${name} ${type} ${notNull}`); + } + + const sqlCreateTableQuery = `CREATE TABLE ${tableName} (${createColumns.join(', ')})`; + const sqlSelectTableQuery = `SELECT * FROM ${tableName} LIMIT 3`; + + let allValues = []; + try { + const rows = await queryRunner.query(sqlSelectTableQuery); + allValues = rows.map(row => + columnNames.map(col => row[col]).join(' ') + ); + } catch (err) { + allValues.push('[ERROR FETCHING ROWS]'); + } + + sqlSchemaPrompt += + sqlCreateTableQuery + '\n' + + sqlSelectTableQuery + '\n' + + columnNames.join(' ') + '\n' + + allValues.join('\n') + '\n\n'; + } + + await queryRunner.release(); + } catch (err) { + console.error(err); + throw err; + } +} + +await getSQLPrompt(); +return sqlSchemaPrompt; +``` + +### 步骤 3:生成 SQL 查询 + +添加连接到“获取数据库架构”节点的 **LLM** 节点。 + +
+ +#### 配置: + +* **消息**:添加系统消息: + +``` +You are an agent designed to interact with a SQL database. Given an input question, create a syntactically correct sqlite query to run, then look at the results of the query and return the answer. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most 5 results. You can order the results by a relevant column to return the most interesting examples in the database. Never query for all the columns from a specific table, only ask for the relevant columns given the question. DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database. + +Here is the relevant table info: +{{ customFunctionAgentflow_0 }} + +Note: +- Only generate ONE SQL query +``` + +* **JSON 结构化输出**:这里我们指示模型仅返回结构化输出,以防止 LLM 包含除 SQL 查询之外的其他文本。 + * 键:“`sql_query`” + * 类型:“字符串” + * 描述:“SQL查询” +* **更新流状态**:将键“`sqlQuery`”设置为值 `{{ output.sql_query }}` + +该节点使用数据库架构信息将用户的自然语言问题转换为结构化的 SQL 查询。 + +### 步骤 4:验证 SQL 查询语法 + +添加连接到“生成 SQL 查询”LLM 的 **条件代理** 节点。 + +
+ +#### 配置: + +* **说明**: + +``` +You are a SQL expert with a strong attention to detail. Double check the SQL query for common mistakes, including: +- Using NOT IN with NULL values +- Using UNION when UNION ALL should have been used +- Using BETWEEN for exclusive ranges +- Data type mismatch in predicates +- Properly quoting identifiers +- Using the correct number of arguments for functions +- Casting to the correct data type +- Using the proper columns for joins +``` + +* **输入**:`{{ $flow.state.sqlQuery }}` +* **场景**: + * 场景1:“SQL查询正确且不包含错误” + * 场景 2:“SQL 查询包含错误” + +此验证步骤在执行前捕获常见的 SQL 错误。 + +### 步骤 5:处理查询重新生成(错误路径) + +对于来自先前条件代理节点的错误查询(输出 1),请添加 **Loop** 节点。 + +
+ +#### 配置: + +
+ +* **循环回到**:“生成 SQL 查询” +* **最大循环计数**:设置为 5 + +这会创建一个反馈循环,允许系统在验证失败时重试查询生成。 + +### 步骤 6:执行有效的 SQL 查询 + +为了正确查询(输出 0),请添加 **自定义函数** 节点。 + +
+ +#### 配置: + +
+ +* **输入变量**:这里我们传入生成的 SQL 查询作为要在函数中使用的变量。 + * 变量名称:“sqlQuery” + * 变量值:`{{ $flow.state.sqlQuery }}` +* **Javascript 函数**:此函数对数据库执行经过验证的 SQL 查询并格式化结果。 + +```javascript +const { DataSource } = require('typeorm'); + +const HOST = 'localhost'; +const USER = 'testuser'; +const PASSWORD = 'testpwd'; +const DATABASE = 'testdatabase'; +const PORT = 5432; + +const sqlQuery = $sqlQuery; + +const AppDataSource = new DataSource({ + type: 'postgres', + host: HOST, + port: PORT, + username: USER, + password: PASSWORD, + database: DATABASE, + synchronize: false, + logging: false, +}); + +let formattedResult = ''; + +async function runSQLQuery(query) { + try { + await AppDataSource.initialize(); + const queryRunner = AppDataSource.createQueryRunner(); + + const rows = await queryRunner.query(query); + console.log('rows =', rows); + + if (rows.length === 0) { + formattedResult = '[No results returned]'; + } else { + const columnNames = Object.keys(rows[0]); + const header = columnNames.join(' '); + const values = rows.map(row => + columnNames.map(col => row[col]).join(' ') + ); + + formattedResult = query + '\n' + header + '\n' + values.join('\n'); + } + + await queryRunner.release(); + } catch (err) { + console.error('[ERROR]', err); + formattedResult = `[Error executing query]: ${err}`; + } + + return formattedResult; +} + +await runSQLQuery(sqlQuery); +return formattedResult; +``` + +### 步骤7:检查查询执行结果 + +添加连接到“运行 SQL 查询”功能的 **条件代理** 节点。 + +
+ +#### 配置: + +* **说明**:“您是SQL专家。请检查查询结果是否正确或包含错误。” +* **输入**:`{{ customFunctionAgentflow_1 }}` +* **场景**: + * 场景1:“结果正确且不包含错误” + * 场景2:“结果查询包含错误” + +此步骤验证执行结果并确定是否需要进一步修正。 + +### 步骤 8:生成最终响应(成功路径) + +要获得成功结果(条件代理输出 0),请添加 **LLM** 节点。 + +
+ +#### 配置: + +* **输入消息**:`{{ customFunctionAgentflow_1 }}` + +该节点根据成功的查询结果生成自然语言响应。 + +### 步骤 9:处理查询重新生成(运行时错误路径) + +对于失败的执行(条件代理的输出 1),添加 **LLM** 节点。 + +
+ +#### 配置: + +
+ +* **消息**:添加与步骤3相同的系统消息 +* **输入消息**: + +``` +Given the generated SQL Query: {{ $flow.state.sqlQuery }} +I have the following error: {{ customFunctionAgentflow_1 }} +Regenerate a new SQL Query that will fix the error +``` + +* **JSON 结构化输出**:与步骤 3 相同 +* **更新流状态**:将键“`sqlQuery`”设置为值 `{{ output.sql_query }}` + +该节点分析运行时错误并生成更正的 SQL 查询。 + +### 步骤 10:添加第二个循环 + +添加连接到“重新生成 SQL 查询”LLM 的 **Loop** 节点。 + +
+ +#### 配置: + +* **循环回到**:“检查SQL查询” +* **最大循环计数**:设置为 5 + +这创建了第二个反馈循环,用于运行时纠错。 + +*** + +## 完整的流程结构 + +{% file src="../.gitbook/assets/SQL Agent.json" %} + +*** + +## 总结 + +1. 开始 → 获取数据库架构 +2. 获取数据库架构 → 生成 SQL 查询 +3. 生成 SQL 查询 → 检查 SQL 查询 +4. 检查 SQL 查询(正确)→ 运行 SQL 查询 +5.检查SQL查询(错误)→重新生成查询(环回) +6. 运行SQL查询→检查结果 +7. 检查结果(成功)→返回响应 +8. 检查结果(错误)→重新生成SQL查询 +9. 重新生成 SQL 查询 → 重新检查 SQL 查询(环回) + +*** + +## 测试您的 SQL 代理 + +使用各种类型的数据库问题测试您的代理: + +* 简单查询:“显示所有客户” +* 复杂查询:“销量排名前 5 名的产品是什么?” +* 分析查询:“按月计算平均订单价值” + +
+ +此 SQL 智能体流程为数据库交互提供了一个强大的、自我纠正的系统,可以处理自然语言的 SQL 查询。 diff --git a/cn/tutorials/structured-output.md b/cn/tutorials/structured-output.md new file mode 100644 index 00000000..c05b2656 --- /dev/null +++ b/cn/tutorials/structured-output.md @@ -0,0 +1,181 @@ +# 结构化输出 + +在许多用例中,例如聊天机器人,模型预计会以自然语言回复用户。然而,在某些情况下,自然语言响应并不理想。例如,如果我们需要获取模型的输出,将其作为 HTTP 请求的主体传递,或存储到数据库中,则输出必须与预定义的模式保持一致。这一要求产生了“结构化输出”的概念,其中模型被引导以特定的结构化格式生成响应。 + +在本教程中,我们将了解如何从 LLM 生成结构化输出,并将其作为 HTTP 请求的正文传递。 + +## 先决条件 + +我们将针对 HTTP 请求使用相同的 [事件管理服务器](interacting-with-api.md#prerequisite)。 + +绝对地!这是针对您的**结构化输出流**的教程,其格式与您的“代理作为工具”文档一致,包括分步说明和图像占位符。 + +*** + +## 概述 + +1. 通过 Start 节点接收用户输入。 +2. 使用 LLM 生成结构化 JSON 数组。 +3. 循环遍历数组中的每一项。 +4. 通过 HTTP 将每个项目发送到外部端点。 + +
+ +### 第 1 步:设置起始节点 + +首先向画布添加 **Start** 节点。 + +
+ +**关键输入参数:** + +* **输入类型:** + * `chatInput`(默认):流程以来自用户的聊天消息开始。 + * `formInput`:流程以表单开始(如果您想从用户收集结构化数据)。 +* **短暂记忆:** + * (可选)如果启用,流程不会保留运行之间的聊天历史记录。 +* **流程状态:** + *(可选)预填充状态变量。 + * 示例: + + ```json + [ + { "key": "answers", "value": "" } + ] + ``` +* **持续状态:** + * (可选)如果启用,状态将在同一会话中保留。 + +### 步骤 2:使用 LLM 生成结构化输出 + +添加 LLM 节点并将其连接到 Start 节点。 + +
+ +**用途:** 使用语言模型分析输入并生成结构化的 JSON 数组。 + +**关键输入参数:** + +* **JSON 结构化输出:** + * **关键:** `answers` + * **类型:** `JSON Array` + * **JSON 架构:** + + ```json + { + "name": { "type": "string", "required": true, "description": "Name of the event" }, + "date": { "type": "string", "required": true, "description": "Date of the event" }, + "location": { "type": "string", "required": true, "description": "Location of the event" } + } + ``` + * **描述:**“回答用户查询” +* **更新流程状态:** + * 使用生成的 JSON 输出更新流状态。 + * 示例: + + ```json + [ + { + "key": "answers", + "value": "{{ output.answers }}" + } + ] + ``` + +### 步骤 3:循环遍历 JSON 数组 + +添加迭代节点并将其连接到 LLM 节点的输出。 + +
+ +**用途:** 迭代从 LLM 节点生成的 JSON 数组中的每一项。 + +**关键输入参数:** + +* **数组输入:** + + * 要迭代的数组。设置为已保存状态的答案: + + ```html + {{ $flow.state.answers }} + ``` + + * 这意味着节点将循环遍历answers 数组中的每个事件。 + +### 第 4 步:通过 HTTP 发送每件物品 + +在循环内部,添加 **HTTP** 节点。 + +
+ +**用途:** 对于数组中的每个项目,向指定端点(例如 `http://localhost:5566/events`)发送 HTTP POST 请求。 + +**关键输入参数:** + +* **方法:** + * `POST`(此用例的默认值)。 +* **URL:** + * 发送数据的端点。 + * 示例: + + ``` + http://localhost:5566/events + ``` +* **标题:** + * (可选)添加任何必需的 HTTP 标头(例如,用于身份验证)。 +* **查询参数:** + * (可选)如果需要,添加任何查询参数。 +* **体型:** + * `json`(默认):将正文作为 JSON 发送。 +* **身体:** + * 在请求正文中发送的数据。 + * 设置为循环中的当前项: + + ```html + {{ $iteration }} + ``` +* **响应类型:** +* `json`(默认):期望 JSON 响应。 + +*** + +## 交互示例 + +**用户输入:** + +``` +create 2 events: +1. JS Conference on next Sat in Netherlands +2. GenAI meetup, Sept 19, in Dublin +``` + +**流量:** + +* 起始节点接收输入。 +* LLM 节点生成 JSON 事件数组。 +* 循环节点迭代每个事件。 +* HTTP 节点通过 API 创建每个事件。 + +
+ +
+ +*** + +## 完整的流程结构 + +{% file src="../.gitbook/assets/Structured Output.json" %} + +*** + +## 最佳实践 + +**设计指南:** + +1. **明确输出架构:** 定义 LLM 输出的预期结构,以确保可靠的下游处理。 + +**常见用例:** + +* **事件处理:** 收集事件数据并将其发送到日历或事件管理系统。 +* **批量数据输入:** 生成多条记录并将其提交到数据库或 API。 +* **自动通知:** 为列表中的每个项目发送个性化消息或警报。 diff --git a/cn/tutorials/supervisor-and-workers.md b/cn/tutorials/supervisor-and-workers.md new file mode 100644 index 00000000..db02f319 --- /dev/null +++ b/cn/tutorials/supervisor-and-workers.md @@ -0,0 +1,205 @@ +# 主管和工人 + +主管工作人员模式是一种功能强大的工作流设计,其中主管代理协调多个专门的工作代理来完成复杂的任务。这种模式可以实现更好的任务委派、专业知识和解决方案的迭代细化。 + +## 概述 + +在本教程中,我们将构建一个协作系统: + +* **Supervisor**:一个 LLM 分析任务并决定下一步应该由哪个工人执行 +* **软件工程师**:专门设计和实施软件解决方案 +* **代码审查员**:专注于审查代码质量并提供反馈 +* **最终答案生成器**:将协作工作编译成全面的解决方案 + +
+ +### 步骤1:创建起始节点 + +
+ +该流程以 **Start** 节点开始,该节点捕获用户输入并初始化工作流程状态。 + +1. 在画布上添加 **Start** 节点 +2. 将**输入类型**配置为“聊天输入” +3. 使用这些初始变量设置 **Flow State**: + * `next`:跟踪下一个代理 + * `instruction`:指示下一个代理要做什么 + +
+ +### 步骤 2:添加主管 LLM + +
+ +**Supervisor** 是协调器,决定哪个工作人员应该处理任务的每个部分。 + +1. 在 Start 节点后连接 **LLM** 节点 +2. 将其标记为“主管” +3. 配置系统消息,例如: + +``` +You are a supervisor tasked with managing a conversation between the following workers: +- Software Engineer +- Code Reviewer + +Given the following user request, respond with the worker to act next. +Each worker will perform a task and respond with their results and status. +When finished, respond with FINISH. +Select strategically to minimize the number of steps taken. +``` + +4. 使用以下字段设置 **JSON 结构化输出**: + * `next`:具有值“FINISH、SOFTWARE、REVIEWER”的枚举 + * `instructions`: 下一个worker应该完成的子任务的具体指令 + * `reasoning`:下一个工人被指派去做这项工作的原因 +5. 配置**更新流状态**以存储: + * `next`: `{{ output.next }}` + * `instruction`: `{{ output.instructions }}` +6. 将 **输入消息** 设置为:_“鉴于上述对话,接下来谁应该采取行动?或者我们应该FINISH?选择以下之一:SOFTWARE、REVIEWER。”_ 输入消息将插入到末尾,就好像用户要求主管分配下一个座席一样。 + +
+ +### 步骤 3:创建路由条件 + +
+ +**检查下一个工作人员**条件节点根据主管的决定路由流程。 + +1.在Supervisor后面添加**Condition**节点 +2. 设置两个条件: + * **条件 0**:`{{ $flow.state.next }}` 等于“SOFTWARE” + * **条件 1**:`{{ $flow.state.next }}` 等于“REVIEWER” +3.“Else”分支(条件2)将处理“FINISH”情况 + +这将创建三个输出路径:一个用于每个工作人员,一个用于完成。 + +
+ +### 步骤 4:配置软件工程师代理 + +
+ +**软件工程师**专注于设计和实施软件解决方案。 + +1. 将 **Agent** 节点连接到 Condition 0 输出 +2.配置系统消息: + +``` +As a Senior Software Engineer, you are a pivotal part of our innovative development team. Your expertise and leadership drive the creation of robust, scalable software solutions that meet the needs of our diverse clientele. + +Your goal is to lead the development of high-quality software solutions. + +Design and implement new features for the given task, ensuring it integrates seamlessly with existing systems and meets performance requirements. Use your understanding of React, TailwindCSS, NodeJS to build this feature. Make sure to adhere to coding standards and follow best practices. + +The output should be a fully functional, well-documented feature that enhances our product's capabilities. Include detailed comments in the code. +``` + +4. 将 **输入消息** 设置为: `{{ $flow.state.instruction }}` 。输入消息将插入到末尾,就好像用户正在向软件工程师代理发出指令一样。 + +
+ +
+ +### 步骤 5:配置 Code Reviewer 代理 + +
+ +**代码审查员**专注于质量保证和代码审查。 + +1. 将 **Agent** 节点连接到条件 1 输出 +2.配置系统消息: + +``` +As a Quality Assurance Engineer, you are an integral part of our development team, ensuring that our software products are of the highest quality. Your meticulous attention to detail and expertise in testing methodologies are crucial in identifying defects and ensuring that our code meets the highest standards. + +Your goal is to ensure the delivery of high-quality software through thorough code review and testing. + +Review the codebase for the new feature designed and implemented by the Senior Software Engineer. Provide constructive feedback, guiding contributors towards best practices and fostering a culture of continuous improvement. Your approach ensures the delivery of high-quality software that is robust, scalable, and aligned with strategic goals. +``` + +4. 将 **输入消息** 设置为: `{{ $flow.state.instruction }}` 。输入消息将插入到末尾,就好像用户正在向代码审阅者代理发出指令一样。 + +
+ +### 步骤 6:添加环回连接 + +
+ +两个工作代理都需要环回主管以进行持续协调。 + +1.在Software Engineer后面添加一个**Loop**节点 + * 将 **循环返回** 设置为“主管” + * 将 **最大循环计数** 设置为 5 +2.在Code Reviewer后面添加另一个**Loop**节点 + * 将 **循环返回** 设置为“主管” + * 将 **最大循环计数** 设置为 5 + +这些循环支持代理之间的迭代协作。 + +### 第 7 步:创建最终答案生成器 + +
+ +最终代理将所有协作工作编译成一个全面的解决方案。 + +1. 将 **Agent** 节点连接到条件 2 输出(“Else”分支) +2. 建议像Gemini一样使用较高的上下文大小LLM,因为对话的来回性质会消耗大量令牌。 +3. 设置**输入消息。** 这很重要,因为输入消息将被插入到末尾,就好像用户向最终答案生成器发出指令以查看所有对话并生成最终响应一样。 + +``` +Given the above conversations, generate a detail solution developed by the software engineer and code reviewer. + +Your guiding principles: +1. **Preserve Full Context** + Include all code implementations, improvements and review from the conversation. Do not omit, summarize, or oversimplify key information. + +2. **Markdown Output Only** + Your final output must be in Markdown format. +``` + +## 它是如何工作的 + +Supervisor Worker 模式具有以下几个关键优势: + +**智能任务委派**:主管使用上下文和推理为每个子任务分配最合适的工作人员。 + +**迭代细化**:工作人员可以在彼此的输出的基础上进行构建,软件工程师实现功能,代码审查员提供改进反馈。 + +**状态协调**:流程在迭代中维护状态,允许主管对接下来应该发生的事情做出明智的决策。 + +**专业知识**:每个代理都有一个专注的角色和专门的提示词,从而在其领域内产生更高质量的输出。 + +## 交互示例 + +以下是典型交互的流程: + +1. **User**:“创建一个 React 组件,用于通过表单验证进行用户身份验证” +2. **Supervisor**:决定 SOFTWARE 应首先采取行动来实现组件 +3. **软件工程师**:创建带有验证逻辑的React身份验证组件 +4. **主管**:决定 REVIEWER 应检查实施情况 +5. **代码审查员**:审查代码并提出安全性和用户体验的改进建议 +6. **主管**:决定 SOFTWARE 应实施建议的改进 +7. **软件工程师**:根据反馈更新组件 +8. **Supervisor**:确定任务已完成并路由至 FINISH +9. **最终答案生成器**:编译完整的解决方案以及实施和审查反馈 + +
+ +## 完整的流程结构 + +{% file src="../.gitbook/assets/Supervisor Worker Agents.json" %} + +## 最佳实践 + +* 由于代理之间的来回通信,该架构会消耗大量令牌,因此并不适合所有情况。它对于以下方面特别有效: + * 需要实施和审查的软件开发任务 + * 从多个角度受益的复杂问题解决 + * 质量和迭代很重要的工作流程 + * 需要不同类型专业知识之间协调的任务 +* 确保每个代理都有明确定义的具体角色。避免可能导致混乱或冗余工作的职责重叠。 +* 建立代理如何传达其进展、发现和建议的标准格式。这有助于主管做出更好的路由决策。 +* 适当使用内存设置来维护对话上下文,同时避免令牌限制问题。对于较长的工作流程,请考虑使用“对话摘要缓冲区”等内存优化设置。 + +## 视频教程 + +{% embed url="https://youtu.be/TbZaj5SZcbM?si=E4nxn__HHzJbNwdf" %} diff --git a/cn/tutorials/tools-and-mcp.md b/cn/tutorials/tools-and-mcp.md new file mode 100644 index 00000000..f05e9a3c --- /dev/null +++ b/cn/tutorials/tools-and-mcp.md @@ -0,0 +1,222 @@ +# 工具 & MCP + +在之前的[**与 API**](interacting-with-api.md) 交互教程中,我们探讨了如何使 LLM 能够调用外部 API。为了增强用户体验,Flowise 提供了一系列预构建工具。请参阅[**工具**](../integrations/langchain/tools/) 部分,了解可用集成的完整列表。 + +如果您需要的工具尚不可用,您可以创建一个**自定义工具**来满足您的要求。 + +## 自定义工具 + +我们将使用相同的[事件管理服务器](interacting-with-api.md#prerequisite),并创建一个自定义工具,该工具可以调用 HTTP POST 请求 `/events`。 + +
+ +* **工具名称:** `create_event` +* **工具说明:** `Use this when you want to create a new event.` +* **输入架构:** API 请求正文的 JSON 架构,允许 LLM 了解如何自动生成正确的 JSON 正文。例如: +* **Javascript函数**:调用此工具后要执行的实际函数 + +```javascript +const fetch = require('node-fetch'); +const url = 'http://localhost:5566/events'; +const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + name: $name, + location: $location, + date: $date + }) +}; +try { + const response = await fetch(url, options); + const text = await response.text(); + return text; +} catch (error) { + console.error(error); + return ''; +} +``` + +### 如何使用函数: + +* 您可以使用 Flowise 中导入的任何库。 +* 您可以使用输入架构中指定的属性作为前缀为 `$` 的变量: + * 输入架构的属性 = `name` + * 函数中使用的变量 = `$name` +* 您可以获得默认流配置: + * `$flow.sessionId` + * `$flow.chatId` + * `$flow.chatflowId` + * `$flow.input` + * `$flow.state` +* 您可以获取自定义变量:`$vars.` +* 函数末尾必须返回一个字符串值 + +### 在 Agent 上使用自定义工具 + +创建自定义工具后,您可以在Agent节点上使用它。 + +
+ +从工具下拉列表中,选择自定义工具。如果您想直接返回自定义工具的输出,您还可以打开**Return Direc**t。 + +
+ +### 在 工具 上使用自定义工具 + +它还可以在确定的工作流程场景中用作工具节点。\ +在这种情况下,**工具输入参数必须显式定义并填充值**,因为没有 LLM 来自动确定值。 + +
+ +## MCP + +MCP([模型上下文协议](https://modelcontextprotocol.io/introduction))提供了一种将 AI 模型连接到不同数据源和工具的标准化方法。换句话说,人们可以使用其他人创建的 MCP 服务器,而不是依赖 Flowise 内置工具或创建自定义工具。 MCP 被广泛认为是行业标准,通常由官方提供商支持和维护。例如,GitHub MCP 由 GitHub 团队开发和维护,并为 Atlassian Jira、Brave Search 等提供类似的支持。您可以在[此处](https://modelcontextprotocol.io/examples)找到支持的服务器列表。 + +
+ +## 自定义 MCP + +除了预构建的 MCP 工具外,最强大的功能是 **自定义 MCP**,它允许用户连接到他们选择的任何 MCP 服务器。 + +MCP 遵循客户端-服务器架构,其中: + +* **主机**是发起连接的 LLM 应用程序(如 Flowise) +* **客户端** 在主机应用程序内部与服务器保持 1:1 连接(如自定义 MCP) +* **服务器** 向客户端提供上下文、工具和提示词(例如 [servers](https://modelcontextprotocol.io/examples)) + +处理客户端和服务器之间的实际通信。 MCP 支持多种传输机制: + +1. **Stdio 传输** +* 使用标准输入/输出进行通信 + * 本地流程的理想选择 +2. **可流式 HTTP 传输** + * 使用 HTTP 和可选的服务器发送事件进行流式传输 + * HTTP POST 用于客户端到服务器的消息 + +### 工作室 + +Stdio 传输支持通过标准输入和输出流进行通信。这对于本地集成和命令行工具特别有用。 + +仅在本地使用 Flowise 时使用此选项,而不是在部署到云服务时使用此选项。这是因为运行像 `npx` 这样的命令将在本地安装 MCP 服务器包(例如:`@modelcontextprotocol/server-sequential-thinking`),并且通常需要很长时间。 + +它更适合桌面应用程序,如 Claude Desktop、VS Code 等。 + +#### **NPX 命令** + +```json +{ + "command": "npx", + "args": [ + "-y", + "@modelcontextprotocol/server-sequential-thinking" + ] +} +``` + +
+ +对于 Windows,请参阅此[指南](https://gist.github.com/feveromo/7a340d7795fca1ccd535a5802b976e1f)。 + +#### **Docker 命令** + +当运行 Flowise 的机器也可以访问 Docker 时,Docker 命令适用。但是,它不适合部署在 Docker 访问受限或不可用的云服务上。 + +```json +{ + "command": "docker", + "args": [ + "run", + "-i", + "--rm", + "mcp/sequentialthinking" + ] +} +``` + +
+ +Docker 提供了 MCP 服务器列表,可在[此处](https://hub.docker.com/catalogs/mcp) 找到。它的工作原理如下: + +1. 确保 Docker 正在运行。 +2. 找到 MCP 服务器配置并将其添加到 **自定义 MCP**。例如:[https://hub.docker.com/r/mcp/sequentialthinking](https://hub.docker.com/r/mcp/sequentialthinking) +3. 刷新**可用操作**。如果本地没有找到镜像,Docker会自动拉取最新的镜像。拉取图像后,您将看到可用操作的列表。 + +``` +Unable to find image 'mcp/sequentialthinking:latest' locally +latest: Pulling from mcp/sequentialthinking +f18232174bc9: Already exists +cb2bde55f71f: Pull complete +9d0e0719fbe0: Pull complete +6f063dbd7a5d: Pull complete +93a0fbe48c24: Pull complete +e2e59f8d7891: Pull complete +96ec0bda7033: Pull complete +4f4fb700ef54: Pull complete +d0900e07408c: Pull complete +Digest: sha256:cd3174b2ecf37738654cf7671fb1b719a225c40a78274817da00c4241f465e5f +Status: Downloaded newer image for mcp/sequentialthinking:latest +Sequential Thinking MCP Server running on stdio +``` + +#### 何时使用 + +* 构建命令行工具 +* 实施本地集成 +* 需要简单的进程通信 +* 使用 shell 脚本 + +### 可流式传输 HTTP (推荐) + +我们将使用 Github Remote MCP 作为示例。 [远程 GitHub MCP 服务器](https://github.com/github/github-mcp-server) 的美妙部分,您无需在本地安装或运行它,新更新会自动应用。 + +#### 步骤 1:为 Github 创建变量 PAT + +为了访问 MCP 服务器,我们需要从 Github 创建个人访问令牌。请参阅[指南](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)。创建 PAT 后,创建一个变量来存储令牌。该变量将在自定义 MCP 中使用。 + +
+ +#### 步骤 2:创建自定义 MCP + +创建一个代理节点,并添加一个新的自定义 MCP 工具。对于可流式传输的 HTTP,我们只需放入 URL 和其他必要的标头。您可以在 MCP 服务器配置中使用 [variables](../using-flowise/variables.md),并带有双大括号 `{{ }}` 和前缀 `$vars。`。 + +```json +{ + "url": "https://api.githubcopilot.com/mcp/", + "headers": { + "Authorization": "Bearer {{$vars.githubPAT}}", + } +} +``` + +
+ +#### 第 3 步:选择操作 + +如果 MCP 服务器配置正常工作,您可以刷新 **可用操作**,Flowise 将自动从 MCP 服务器提取所有可用操作。 + +
+ +#### 交互示例: + +> 给我最新一期 + +
+ +代理能够从 MCP 识别适当的操作,并使用它们来回答用户的查询。 + +#### 何时使用 + +在以下情况下使用 Streamable HTTP: + +* 构建基于网络的集成 +* 需要通过 HTTP 进行客户端-服务器通信 +* 需要有状态会话 +* 支持多个并发客户端 +* 实现可恢复连接 + +## 视频教程 + +{% embed url="https://youtu.be/7FClI-QM3tk?si=zBNEShd3NlcrOBrO" %} diff --git a/cn/use-cases/README.md b/cn/use-cases/README.md new file mode 100644 index 00000000..8f63a499 --- /dev/null +++ b/cn/use-cases/README.md @@ -0,0 +1,21 @@ +--- +description: 通过实际示例学习构建您自己的 Flowise 解决方案 +--- + +# 用例 + +*** + +本节提供了一系列实际示例来演示如何使用 Flowise 构建各种解决方案。 + +每个用例将指导您完成使用 Flowise 设计、构建和部署实际应用程序的过程。 + +## 指南 + +* [调用子流程](calling-children-flows.md) +* [调用 Webhook](webhook-tool.md) +* [与 API](interacting-with-api.md) 互动 +* [多个文档问题解答](multiple-documents-qna.md) +* [SQL QnA](sql-qna.md) +* [写入更新数据](upserting-data.md) +* [网络抓取 QnA](web-scrape-qna.md) diff --git a/cn/use-cases/calling-children-flows.md b/cn/use-cases/calling-children-flows.md new file mode 100644 index 00000000..c7797a84 --- /dev/null +++ b/cn/use-cases/calling-children-flows.md @@ -0,0 +1,91 @@ +--- +description: 了解如何有效使用聊天流工具和自定义工具 +--- + +# 调用子流程 + +*** + +Flowise 的强大功能之一是您可以将流程变成工具。例如,有一个主要流程来协调哪些/何时使用必要的工具。每个工具都被设计用来执行一项特定的任务。 + +这提供了一些好处: + +* 每个子流程作为工具将单独执行,并具有单独的内存以允许更清晰的输出 +* 将每个子流的详细输出聚合到最终代理,通常会产生更高质量的输出 + +您可以使用以下工具来实现此目的: + +* 聊天流工具 +* 自定义工具 + +## 聊天流工具 + +1. 准备好聊天流。在本例中,我们创建了一个可以经历多个链接的思想链聊天流。 + +
+ +2. 使用工具代理 + 聊天流工具创建另一个聊天流。选择您想要从工具中调用的聊天流。在本例中,它是思想链聊天流。给它一个名称和适当的描述,让 LLM 知道何时使用此工具: + +
+ +3. 测试一下! + +
+ +4. 从响应中,您可以看到 聊天流 工具 的输入和输出: + +
+ +## 自定义工具 + +使用与上面相同的示例,我们将创建一个自定义工具,它将调用思想链聊天流的 [预测 API](broken-reference)。 + +1. 创建一个新工具: + +
工具名称工具说明
想法流当您需要实现特定目标时使用此工具
+ +输入架构: + +
财产类型描述必填
输入字符串输入问题真实
+ +
+ +Javascript工具功能: + +```javascript +const fetch = require('node-fetch'); +const url = 'http://localhost:3000/api/v1/prediction/'; // replace with specific chatflow id + +const body = { + "question": $input +}; + +const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(body) +}; + +try { + const response = await fetch(url, options); + const resp = await response.json(); + return resp.text; +} catch (error) { + console.error(error); + return ''; +} +``` + +2. 创建工具代理+自定义工具。在自定义工具中指定我们在步骤 1 中创建的工具。 + +
+ +3. 从响应中,您可以看到自定义工具的输入和输出: + +
+ +## 结论 + +在此示例中,我们成功演示了通过聊天流工具和自定义工具将其他聊天流转变为工具的两种方法。两者在底层都使用相同的代码逻辑。 diff --git a/cn/use-cases/interacting-with-api.md b/cn/use-cases/interacting-with-api.md new file mode 100644 index 00000000..16153f2b --- /dev/null +++ b/cn/use-cases/interacting-with-api.md @@ -0,0 +1,191 @@ +--- +description: 了解如何使用 Flowise 的外部 API 集成 +--- + +# 与 API 交互 + +*** + +OpenAPI 规范 (OAS) 定义了 HTTP API 的标准、与语言无关的接口。此用例的目标是让 LLM 自动确定要调用哪个 API,同时仍与用户进行有状态对话。 + +## OpenAPI 链 + +1. 在本教程中,我们将使用 [Klarna OpenAPI](https://gist.github.com/HenryHengZJ/b60f416c42cb9bcd3160fe797421119a) + +{% code overflow="wrap" %} +```json +{ + "openapi": "3.0.1", + "info": { + "version": "v0", + "title": "Open AI Klarna product Api" + }, + "servers": [ + { + "url": "https://www.klarna.com/us/shopping" + } + ], + "tags": [ + { + "name": "open-ai-product-endpoint", + "description": "Open AI Product Endpoint. Query for products." + } + ], + "paths": { + "/public/openai/v0/products": { + "get": { + "tags": [ + "open-ai-product-endpoint" + ], + "summary": "API for fetching Klarna product information", + "operationId": "productsUsingGET", + "parameters": [ + { + "name": "countryCode", + "in": "query", + "description": "ISO 3166 country code with 2 characters based on the user location. Currently, only US, GB, DE, SE and DK are supported.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "description": "A precise query that matches one very small category or product that needs to be searched for to find the products the user is looking for. If the user explicitly stated what they want, use that as a query. The query is as specific as possible to the product name or category mentioned by the user in its singular form, and don't contain any clarifiers like latest, newest, cheapest, budget, premium, expensive or similar. The query is always taken from the latest topic, if there is a new topic a new query is started. If the user speaks another language than English, translate their request into English (example: translate fia med knuff to ludo board game)!", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "size", + "in": "query", + "description": "number of products returned", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "min_price", + "in": "query", + "description": "(Optional) Minimum price in local currency for the product searched for. Either explicitly stated by the user or implicitly inferred from a combination of the user's request and the kind of product searched for.", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "max_price", + "in": "query", + "description": "(Optional) Maximum price in local currency for the product searched for. Either explicitly stated by the user or implicitly inferred from a combination of the user's request and the kind of product searched for.", + "required": false, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Products found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProductResponse" + } + } + } + }, + "503": { + "description": "one or more services are unavailable" + } + }, + "deprecated": false + } + } + }, + "components": { + "schemas": { + "Product": { + "type": "object", + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "price": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "title": "Product" + }, + "ProductResponse": { + "type": "object", + "properties": { + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Product" + } + } + }, + "title": "ProductResponse" + } + } + } +} +``` +{% endcode %} + +2. 您可以使用 [JSON 到 YAML 转换器](https://jsonformatter.org/json-to-yaml) 并将其保存为 `.yaml` 文件,并将其上传到 **OpenAPI Chain**,然后通过提出一些问题进行测试。 **OpenAPI Chain** 会将整个规范发送到 LLM,并让 LLM 自动使用正确的方法和参数进行 API 调用。 + +
+ +3.但是,如果你想进行正常的对话聊天,则不能够这样做。您将看到以下错误。这是因为OpenAPI Chain有如下提示词: + +``` +Use the provided API's to respond to this user query +``` + +由于我们“强制”它始终找到 API 来回答用户查询,因此在与 OpenAPI 无关的正常对话的情况下,它无法这样做。 + +
+ +如果您有较大的 OpenAPI 规范,则使用此方法可能效果不佳。这是因为我们将所有规范作为发送到 LLM 的消息的一部分包含在内。然后,我们依靠 LLM 找出正确的 URL、查询参数、请求正文以及回答用户查询所需的其他必要参数。正如您可以想象的那样,如果您的 OpenAPI 规范很复杂,那么 LLM 产生幻觉的可能性就更高。 + +## 工具代理+OpenAPI工具包 + +为了解决上述错误,我们可以使用Agent。根据 OpenAI 的官方说明书:[使用 OpenAPI 规范调用函数](https://cookbook.openai.com/examples/function_calling_with_an_openapi_spec),建议将每个 API 转换为工具本身,而不是将所有 API 作为单个消息输入到 LLM 中。代理还能够进行类似人类的交互,能够根据用户的查询决定使用哪个工具。 + +OpenAPI Toolkit 会将 YAML 文件中的每个 API 转换为一组工具。这样,用户就不必为每个 API 创建 [自定义工具](../integrations/langchain/tools/custom-tool.md)。 + +1. 将 **ToolAgent** 与 **OpenAPI Toolkit** 连接。在这里,我们上传 OpenAI API 的 YAML 规范。规格文件可以在页面底部找到。 + +
+ +2.我们来试试吧! + +
+ +从聊天中可以看出,座席能够进行正常的对话,并使用适当的工具来回答用户的询问。如果您使用的是分析工具,您可以看到我们从 YAML 文件转换的工具列表: + +
+ +## 结论 + +我们已经成功创建了一个代理,可以在必要时与 API 交互,并且仍然能够处理与用户的有状态对话。以下是本节中使用的模板: + +{% file src="../.gitbook/assets/OpenAPI Chatflow.json" %} + +{% file src="../.gitbook/assets/OpenAPI Toolkit with ToolAgent Chatflow.json" %} + +{% file src="../.gitbook/assets/openai_openapi.yaml" %} diff --git a/cn/use-cases/multiple-documents-qna.md b/cn/use-cases/multiple-documents-qna.md new file mode 100644 index 00000000..ea33a8f9 --- /dev/null +++ b/cn/use-cases/multiple-documents-qna.md @@ -0,0 +1,172 @@ +--- +description: 了解如何正确查询多个文档 +--- + +# 多个文档 QnA + +*** + +从上一个 [Web Scrape QnA](web-scrape-qna.md) 示例中,我们仅写入更新和查询 1 个网站。如果我们有多个网站或多个文档怎么办?让我们看一下如何实现这一目标。 + +在此示例中,我们将对 2 个 PDF 执行 QnA,即 APPLE 和 TESLA 的 FORM-10K。 + +
+ +## 写入更新 + +1. 从市场模板中找到名为 - **Conversational Retrieval QA Chain** 的示例流程。 +2. 我们将使用[PDF 文件加载器](../integrations/langchain/document-loaders/pdf-file.md),并上传相应的文件: + +
+ +3. 单击PDF File Loader 的**附加参数**,并指定元数据对象。例如,上传 Apple FORM-10K 的 PDF 文件可以具有元数据对象 `{source: apple}` ,而上传 Tesla FORM-10K 的 PDF 文件可以具有 `{source: tesla}` 。这样做是为了在检索期间隔离文档。 + +
+ +4. 填写 Pinecone 的凭据后,单击 Upsert: + +
+ +
+ +5. 在[Pinecone 控制台](https://app.pinecone.io) 上,您将能够看到添加的新向量。 + +
+ +## 查询 + +1. 验证数据已更新到 Pinecone 后,我们现在可以开始在聊天中提问! + +
+ +2. 但是,用于返回答案的检索上下文是 APPLE 和 TESLA 文档的混合。从源文件中可以看出: + +
+ +3. 我们可以通过从 Pinecone 节点指定元数据过滤器来解决此问题。例如,如果我们只想从 APPLE FORM-10K 检索上下文,我们可以回顾一下之前在 [#upsert](multiple-documents-qna.md#upsert "mention") 步骤中指定的元数据,然后在下面的元数据过滤器中使用相同的元数据: + +
+ +4. 让我们再次问同样的问题,我们现在应该看到检索到的所有上下文确实来自 APPLE FORM-10K: + +
+ +{% hint style="info" %} +每个矢量数据库提供商都有不同格式的过滤语法,建议阅读各自的矢量数据库文档 +{% endhint %} + +5. 然而,这样做的问题是元数据过滤有点_**“硬编码”**_。理想情况下,我们应该让 LLM 根据问题决定检索哪个文档。 + +## 工具代理 + +我们可以使用[工具代理](../integrations/langchain/agents/tool-agent.md)解决_**“硬编码”**_元数据过滤器问题。 + +通过向智能体提供工具,我们可以让智能体根据问题决定适合使用哪种工具。 + +1. 使用以下名称和说明创建 [检索器 工具](../integrations/langchain/tools/retriever-tool.md): + +
名称描述
搜索_苹果使用此功能回答用户有关 Apple Inc (APPL) 的问题。它包含一份 SEC 10K 表格文件,描述了 Apple Inc (APPL) 2022 年期间的财务状况。
+ +2. 使用元数据过滤器 `{source: apple}` 连接到 Pinecone 节点 + +
+ +3. 对 Tesla 重复相同的操作: + +
名称描述松果元数据过滤器
搜索_tsla使用此函数回答用户有关 Tesla Inc (TSLA) 的问题。它包含一份 SEC 10K 表格文件,描述特斯拉公司 (TSLA) 2022 年期间的财务状况。{source: tesla}
+ +{% hint style="info" %} +指定清晰简洁的描述非常重要。这允许 LLM 更好地决定何时使用哪个工具 +{% endhint %} + +您的流程应如下所示: + +
+ +4. 现在,我们需要为工具代理创建一个通用指令。单击节点的“**其他参数**”,并指定**系统消息**。例如: + +``` +You are an expert financial analyst that always answers questions with the most relevant information using the tools at your disposal. +These tools have information regarding companies that the user has expressed interest in. +Here are some guidelines that you must follow: +* For financial questions, you must use the tools to find the answer and then write a response. +* Even if it seems like your tools won't be able to answer the question, you must still use them to find the most relevant information and insights. Not using them will appear as if you are not doing your job. +* You may assume that the users financial questions are related to the documents they've selected. +* For any user message that isn't related to financial analysis, respectfully decline to respond and suggest that the user ask a relevant question. +* If your tools are unable to find an answer, you should say that you haven't found an answer but still relay any useful information the tools found. +* Dont ask clarifying questions, just return answer. + +The tools at your disposal have access to the following SEC documents that the user has selected to discuss with you: +- Apple Inc (APPL) FORM 10K 2022 +- Tesla Inc (TSLA) FORM 10K 2022 + +The current date is: 2024-01-28 +``` + +5. 保存聊天流,然后开始提问! + +
+ +
+ +6. 跟进特斯拉: + +
+ +7. 现在,我们可以询问有关我们之前写入更新到矢量数据库的任何文档的问题,而无需使用工具+代理对元数据过滤进行“硬编码”。 + +## 元数据检索器 + +使用工具代理方法,用户必须创建多个检索器工具来从不同来源检索文档。如果存在大量具有不同元数据的文档源,这可能会成为问题。仅使用上面的示例(仅针对苹果和特斯拉),我们可能会扩展到其他公司,例如迪士尼、亚马逊等。为每家公司创建一个检索工具将是一项繁琐的任务。 + +元数据检索器开始发挥作用。这个想法是让 LLM 从用户问题中提取元数据,然后在搜索矢量数据库时将其用作过滤器。 + +例如,如果用户询问与 Apple 相关的问题,元数据过滤器 `{source: apple}` 将自动应用于矢量数据库搜索。 + +
+ +在这种情况下,我们可以有一个检索器工具,并将**元数据检索器**放在矢量数据库和检索器工具之间。 + +
+ +## XML 代理 + +对于某些 LLM,不支持函数调用功能。在这种情况下,我们可以使用 XML Agent 以更结构化的格式/语法提示词 LLM,目的是使用提供的工具。 + +它有底层提示词: + +```xml +You are a helpful assistant. Help the user answer any questions. + +You have access to the following tools: + +{tools} + +In order to use a tool, you can use and tags. You will then get back a response in the form +For example, if you have a tool called 'search' that could run a google search, in order to search for the weather in SF you would respond: + +searchweather in SF +64 degrees + +When you are done, respond with a final answer between . For example: + +The weather in SF is 64 degrees + +Begin! + +Previous Conversation: +{chat_history} + +Question: {input} +{agent_scratchpad} +``` + +
+ +## 结论 + +我们介绍了会话检索 QA 链的使用及其在查询多个文档时的局限性。我们通过使用 OpenAI Function Agent/XML Agent + 工具 解决了这个问题。您可以找到以下模板: + +{% file src="../.gitbook/assets/ToolAgent Chatflow.json" %} + +{% file src="../.gitbook/assets/XMLAgent Chatflow.json" %} diff --git a/cn/use-cases/sql-qna.md b/cn/use-cases/sql-qna.md new file mode 100644 index 00000000..fae76c77 --- /dev/null +++ b/cn/use-cases/sql-qna.md @@ -0,0 +1,335 @@ +--- +description: 了解如何查询结构化数据 +--- + +# SQL QnA + +*** + +与前面的示例(例如 [Web Scrape QnA](web-scrape-qna.md) 和 [多文档 QnA](multiple-documents-qna.md))不同,查询结构化数据不需要矢量数据库。在高层,这可以通过以下步骤来实现: + +1. 提供 LLM: + * SQL 数据库模式概述 + * 示例行数据 +2. 返回 SQL 查询,并带有很少的镜头提示词 +3. 使用 [If Else](../integrations/utilities/if-else.md) 节点验证 SQL 查询 +4. 创建自定义函数来执行 SQL 查询,并获取响应 +5. 从执行的 SQL 响应返回自然响应 + +
+ +在此示例中,我们将创建一个 QnA 聊天机器人,它可以与存储在 SingleStore 中的 SQL 数据库进行交互 + +
+ +## 长篇大论;博士 + +您可以找到聊天流模板: + +{% file src="../.gitbook/assets/SQL Chatflow.json" %} + +## 1. SQL 数据库架构 + 示例行 + +使用自定义 JS 函数节点连接到 SingleStore,检索数据库架构和前 3 行。 + +根据[研究论文](https://arxiv.org/abs/2204.00498),建议生成具有以下示例格式的提示词: + +``` +CREATE TABLE samples (firstName varchar NOT NULL, lastName varchar) +SELECT * FROM samples LIMIT 3 +firstName lastName +Stephen Tyler +Jack McGinnis +Steven Repici +``` + +
+ +
+ +完整的 JavaScript 代码 + +```javascript +const HOST = 'singlestore-host.com'; +const USER = 'admin'; +const PASSWORD = 'mypassword'; +const DATABASE = 'mydb'; +const TABLE = 'samples'; +const mysql = require('mysql2/promise'); + +let sqlSchemaPrompt; + +function getSQLPrompt() { + return new Promise(async (resolve, reject) => { + try { + const singleStoreConnection = mysql.createPool({ + host: HOST, + user: USER, + password: PASSWORD, + database: DATABASE, + }); + + // Get schema info + const [schemaInfo] = await singleStoreConnection.execute( + `SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = "${TABLE}"` + ); + + const createColumns = []; + const columnNames = []; + + for (const schemaData of schemaInfo) { + columnNames.push(`${schemaData['COLUMN_NAME']}`); + createColumns.push(`${schemaData['COLUMN_NAME']} ${schemaData['COLUMN_TYPE']} ${schemaData['IS_NULLABLE'] === 'NO' ? 'NOT NULL' : ''}`); + } + + const sqlCreateTableQuery = `CREATE TABLE samples (${createColumns.join(', ')})`; + const sqlSelectTableQuery = `SELECT * FROM samples LIMIT 3`; + + // Get first 3 rows + const [rows] = await singleStoreConnection.execute( + sqlSelectTableQuery, + ); + + const allValues = []; + for (const row of rows) { + const rowValues = []; + for (const colName in row) { + rowValues.push(row[colName]); + } + allValues.push(rowValues.join(' ')); + } + + sqlSchemaPrompt = sqlCreateTableQuery + '\n' + sqlSelectTableQuery + '\n' + columnNames.join(' ') + '\n' + allValues.join('\n'); + + resolve(); + } catch (e) { + console.error(e); + return reject(e); + } + }); +} + +async function main() { + await getSQLPrompt(); +} + +await main(); + +return sqlSchemaPrompt; +``` + +
+ +您可以从此[指南](broken-reference/)中找到有关如何获取`HOST`、`USER`、`PASSWORD`的更多信息。完成后,点击执行: + +
+ +我们现在可以看到已经生成了正确的格式。下一步是将其带入提示词模板。 + +## 2. 返回一个带有很少镜头提示词的 SQL 查询 + +创建新的聊天模型+提示词模板+LLMChain + +
+ +在提示词模板中指定以下提示词: + +``` +Based on the provided SQL table schema and question below, return a SQL SELECT ALL query that would answer the user's question. For example: SELECT * FROM table WHERE id = '1'. +------------ +SCHEMA: {schema} +------------ +QUESTION: {question} +------------ +SQL QUERY: +``` + +由于我们使用 2 个变量:{schema} 和 {question},请在 **Format Prompt Values** 中指定它们的值: + +
+ +{% hint style="info" %} +您可以为提示词提供更多示例(即少量提示词),让 LLM 学得更好。或者参考[方言特定提示词](https://js.langchain.com/docs/use\_cases/sql/prompting#dialect-specific-prompting) +{% endhint %} + +## 3. 使用 [If Else](../integrations/utilities/if-else.md) 节点验证 SQL 查询 + +有时 SQL 查询无效,我们不想浪费资源来执行无效的 SQL 查询。例如,如果用户询问与 SQL 数据库无关的一般性问题。我们可以使用 `If Else` 节点来路由到不同的路径。 + +例如,我们可以执行基本检查以查看 SELECT 和 WHERE 是否包含在 LLM 给出的 SQL 查询中。 + +{% tabs %} +{% tab title="If Function" %} +```javascript +const sqlQuery = $sqlQuery.trim(); + +const regex = /SELECT\s.*?(?:\n|$)/gi; + +// Extracting the SQL part +const matches = sqlQuery.match(regex); +const cleanSql = matches ? matches[0].trim() : ""; + +if (cleanSql.includes("SELECT") && cleanSql.includes("WHERE")) { + return cleanSql; +} +``` +{% endtab %} + +{% tab title="Else Function" %} +```javascript +return $sqlQuery; +``` +{% endtab %} +{% endtabs %} + +
+ +在 Else 函数中,我们将路由到提示词模板 + LLMChain,它基本上告诉 LLM 它无法回答用户查询: + +
+ +## 4. 自定义函数执行 SQL 查询,并获取响应 + +如果它是有效的 SQL 查询,我们需要执行该查询。将 **If Else** 节点的 _**True**_ 输出连接到 **Custom JS Function** 节点: + +
+ +
+ +完整的 JavaScript 代码 + +```javascript +const HOST = 'singlestore-host.com'; +const USER = 'admin'; +const PASSWORD = 'mypassword'; +const DATABASE = 'mydb'; +const TABLE = 'samples'; +const mysql = require('mysql2/promise'); + +let result; + +function getSQLResult() { + return new Promise(async (resolve, reject) => { + try { + const singleStoreConnection = mysql.createPool({ + host: HOST, + user: USER, + password: PASSWORD, + database: DATABASE, + }); + + const [rows] = await singleStoreConnection.execute( + $sqlQuery + ); + + result = JSON.stringify(rows) + + resolve(); + } catch (e) { + console.error(e); + return reject(e); + } + }); +} + +async function main() { + await getSQLResult(); +} + +await main(); + +return result; +``` + +
+ +## 5. 从执行的 SQL 响应返回自然响应 + +创建新的聊天模型+提示词模板+LLMChain + +
+ +在提示词模板中写入以下提示词: + +``` +Based on the question, and SQL response, write a natural language response, be details as possible: +------------ +QUESTION: {question} +------------ +SQL RESPONSE: {sqlResponse} +------------ +NATURAL LANGUAGE RESPONSE: +``` + +在**格式提示词值**中指定变量: + +
+ +瞧!您的 SQL 聊天机器人现已准备好进行测试! + +## 查询 + +首先我们先问一些与数据库相关的事情。 + +
+ +查看日志,我们可以看到第一个 LLMChain 能够为我们提供 SQL 查询: + +**输入:** + +{% code overflow="wrap" %} +``` +Based on the provided SQL table schema and question below, return a SQL SELECT ALL query that would answer the user's question. For example: SELECT * FROM table WHERE id = '1'.\n------------\nSCHEMA: CREATE TABLE samples (id bigint(20) NOT NULL, firstName varchar(300) NOT NULL, lastName varchar(300) NOT NULL, userAddress varchar(300) NOT NULL, userState varchar(300) NOT NULL, userCode varchar(300) NOT NULL, userPostal varchar(300) NOT NULL, createdate timestamp(6) NOT NULL)\nSELECT * FROM samples LIMIT 3\nid firstName lastName userAddress userState userCode userPostal createdate\n1125899906842627 Steven Repici 14 Kingston St. Oregon NJ 5578 Thu Dec 14 2023 13:06:17 GMT+0800 (Singapore Standard Time)\n1125899906842625 John Doe 120 jefferson st. Riverside NJ 8075 Thu Dec 14 2023 13:04:32 GMT+0800 (Singapore Standard Time)\n1125899906842629 Bert Jet 9th, at Terrace plc Desert City CO 8576 Thu Dec 14 2023 13:07:11 GMT+0800 (Singapore Standard Time)\n------------\nQUESTION: what is the address of John\n------------\nSQL QUERY: +``` +{% endcode %} + +**输出** + +
SELECT userAddress FROM samples WHERE firstName = 'John'
+
+ +执行 SQL 查询后,结果被传递到第二个 LLMChain: + +**输入** + +{% code overflow="wrap" %} +``` +Based on the question, and SQL response, write a natural language response, be details as possible:\n------------\nQUESTION: what is the address of John\n------------\nSQL RESPONSE: [{\"userAddress\":\"120 jefferson st.\"}]\n------------\nNATURAL LANGUAGE RESPONSE: +``` +{% endcode %} + +**输出** + +``` +The address of John is 120 Jefferson St. +``` + +现在,如果我们询问与 SQL 数据库无关的问题,则采用 Else 路线。 + +
+ +对于第一个 LLMChain,生成 SQL 查询,如下所示: + +```sql +SELECT * FROM samples LIMIT 3 +``` + +但是,它未通过 `If Else` 检查,因为它不包含 `SELECT` 和 `WHERE`,因此进入 Else 路由,提示词如下: + +``` +Politely say "I'm not able to answer query" +``` + +最终的输出是: + +``` +I apologize, but I'm not able to answer your query at the moment. +``` + +## 结论 + +在此示例中,我们成功创建了一个 SQL 聊天机器人,它可以与您的数据库交互,并且还能够处理与数据库无关的问题。进一步的改进包括添加内存以提供对话历史记录。 + +您可以在下面找到聊天流: + +{% file src="../.gitbook/assets/SQL Chatflow (1).json" %} diff --git a/cn/use-cases/upserting-data.md b/cn/use-cases/upserting-data.md new file mode 100644 index 00000000..31389ac0 --- /dev/null +++ b/cn/use-cases/upserting-data.md @@ -0,0 +1,159 @@ +--- +description: 了解如何使用 Flowise 将数据写入更新到矢量存储 +--- + +# 更新数据 + +*** + +使用 Flowise 将数据写入更新到 [向量存储](../integrations/langchain/vector-stores/) 有两种基本方法:通过 [API 调用](broken-reference) 或使用我们为此目的准备的一组专用节点。 + +在本指南中,尽管**强烈建议**您在写入更新到矢量存储之前使用[文档存储](../using-flowise/document-stores.md)准备数据,但我们将使用为此目的所需的特定节点来完成整个过程,概述此方法的步骤、优点以及高效数据处理的优化策略。 + +## 了解写入更新过程 + +我们需要了解的第一件事是,将数据写入更新到[向量存储](../integrations/langchain/vector-stores/)是形成[检索增强生成(RAG)](multiple-documents-qna.md)系统的基本部分。然而,一旦该过程完成,RAG 就可以独立执行。 + +换句话说,在 Flowise 中,您可以在没有完整 RAG 设置的情况下写入更新数据,并且可以在没有写入更新过程中使用的特定节点的情况下运行 RAG ,这意味着虽然填充良好的向量存储对于 RAG 的运行至关重要,但实际的检索和生成过程不需要连续写入更新。 + +

写入更新与 RAG

+ +## 设置 + +假设我们有一个 PDF 格式的长数据集,需要将其写入更新到 [Upstash 向量存储](../integrations/langchain/vector-stores/upstash-vector.md) 中,以便我们可以指示 LLM 从该文档中检索特定信息。 + +为了做到这一点,并为了说明本教程,我们需要创建一个具有 5 个不同节点的 **写入更新流程**: + +

写入更新流程

+ +## 1. 文档加载器 + +第一步是使用 [文档加载器节点](../integrations/langchain/document-loaders/) **将我们的 PDF 数据上传到 Flowise 实例**。文档加载器是处理各种文档格式的摄取的专用节点,包括 **PDF**、**TXT**、**CSV**、Notion 页面等。 + +值得一提的是,每个文档加载器都带有两个重要的**附加参数**,它们允许我们随意添加和省略数据集中的元数据。 + +

附加参数

+ +{% hint style="info" %} +**提示词**:添加/省略元数据参数虽然是可选的,但对于在向量存储中写入更新数据集后定位我们的数据集或从中删除不必要的元数据非常有用。 +{% endhint %} + +## 2. 文本分割器 + +一旦我们上传了 PDF 或数据集,我们需要**将其分割成更小的片段、文档或块**。这是一个至关重要的预处理步骤,主要原因有两个: + +* **检索速度和相关性:** 将大型文档作为单个实体存储和查询矢量数据库中可能会导致检索时间变慢,并可能导致相关结果降低。将文档分割成更小的块可以实现更有针对性的检索。通过查询更小、更集中的信息单元,我们可以实现更快的响应时间并提高检索结果的精度。 +* **成本效益:** 由于我们只检索相关块而不是整个文档,因此 LLM 处理的令牌数量显着减少。这种有针对性的检索方法直接降低了 LLM 的使用成本,因为计费通常基于令牌消耗。通过最大限度地减少发送到 LLM 的不相关信息量,我们还优化了成本。 + +### 节点 + +在 Flowise 中,此拆分过程是使用[文本分割器节点](../integrations/langchain/text-splitters/) 完成的。这些节点提供了一系列文本分割策略,包括: + +* **字符文本分割:** 将文本分割成固定数量字符的块。这种方法很简单,但可能会将单词或短语分割成多个块,从而可能破坏上下文。 +* **标记文本分割:** 根据特定于所选嵌入模型的单词边界或标记化方案来分割文本。这种方法通常会产生语义上更连贯的块,因为它保留了单词边界并考虑了文本的底层语言结构。 +* **递归字符文本拆分:** 该策略旨在将文本划分为多个块,在保持指定大小限制的同时保持语义连贯性。它特别适合具有嵌套部分或标题的分层文档。它不是在字符限制下盲目分割,而是递归地分析文本以查找逻辑断点,例如句子结尾或分节符。这种方法确保每个块代表一个有意义的信息单元,即使它稍微超出目标大小。 +* **Markdown 文本分割器:** 专为 Markdown 格式文档设计,该拆分器根据 Markdown 标题和结构元素对文本进行逻辑分段,创建与文档中的逻辑部分相对应的块。 +* **代码文本分割器:** 专为拆分代码文件而设计,该策略考虑代码结构、函数定义和其他特定于编程语言的元素,以创建适合代码搜索和文档等任务的有意义的块。 +* **HTML-to-Markdown 文本分割器:** 此专用拆分器首先将 HTML 内容转换为 Markdown,然后应用 Markdown 文本分割器,从而允许对网页和其他 HTML 文档进行结构化分段。 + +文本分割器节点提供对文本分割的精细控制,允许自定义参数,例如: + +* **块大小:** 每个块所需的最大大小,通常以字符或标记定义。 +* **块重叠:** 连续块之间重叠的字符或标记的数量,对于维护跨块的上下文流很有用。 + +{% hint style="info" %} +**提示词:** 请注意,块大小和块重叠值不是相加的。选择 `chunk_size=1200` 和 `chunk_overlap=400` 不会导致总块大小为 1600。重叠值确定当前块中包含的前一个块中用于维护上下文的标记数。它不会增加总体块大小。 +{% endhint %} + +### 了解块重叠 + +在基于向量的检索和 LLM 查询的上下文中,块重叠在保持上下文连续性**和**提高响应准确性**方面发挥着重要作用,特别是在处理有限的检索深度或 **top K** 时,该参数确定从 [向量存储](../integrations/langchain/vector-stores/) 检索以响应查询的最相似块的最大数量。 + +在查询处理期间,LLM 对向量存储执行相似性搜索,以检索与给定查询在语义上最相关的块。如果由顶部 K 参数表示的检索深度设置为一个较小的值(默认为 4),则 LLM 最初仅使用来自这 4 个块的信息来生成其响应。 + +这种情况给我们带来了一个问题,因为仅依赖有限数量的没有重叠的块可能会导致答案不完整或不准确,特别是在处理需要跨越多个块的信息的查询时。 + +块重叠通过确保连续块之间共享文本上下文的一部分来帮助解决此问题,**增加给定查询的所有相关信息包含在检索到的块中的可能性**。 + +换句话说,这种重叠充当块之间的桥梁,使 LLM 能够访问更宽的上下文窗口,即使仅限于一小部分检索到的块(前 K 个)。如果查询涉及超出单个块的概念或信息,则重叠区域会增加捕获所有必要上下文的可能性。 + +因此,通过在文本分割阶段引入块重叠,我们增强了 LLM 的能力: + +1. **保持上下文连续性:** 重叠块提供连续片段之间的信息更平滑的过渡,使模型能够保持对文本的更连贯的理解。 +2. **提高检索准确性:** 通过增加捕获目标前 K 个检索块内所有相关信息的概率,重叠有助于实现更准确和上下文适当的响应。 + +### 准确性与成本 + +因此,为了进一步优化检索精度和成本之间的权衡,可以使用两种主要策略: + +1. **增加/减少块重叠:** 在文本分割期间调整重叠百分比可以对块之间共享上下文的数量进行细粒度控制。较高的重叠百分比通常会改善上下文保留,但也可能会增加成本,因为您需要使用更多块来包含整个文档。相反,较低的重叠百分比可以降低成本,但可能会丢失块之间的关键上下文信息,从而可能导致 LLM 的答案不太准确或不完整。 +2. **增加/减少 Top K:** 提高默认的 top K 值 (4) 可扩展考虑用于生成响应的块的数量。虽然这可以提高准确性,但也会增加成本。 + +{% hint style="info" %} +**提示词:**最佳**overlap**和**top K**值的选择取决于文档复杂性、嵌入模型特征以及准确性和成本之间所需的平衡等因素。对这些值进行试验对于找到满足特定需求的理想配置非常重要。 +{% endhint %} + +## 3. 嵌入 + +现在,我们已上传数据集并配置了数据在写入更新到 [向量存储](../integrations/langchain/vector-stores/) 之前的分割方式。此时,[嵌入节点](../integrations/langchain/embeddings/)开始发挥作用,**将所有这些块转换为LLM可以轻松理解的“语言”**。 + +在当前上下文中,嵌入是将文本转换为捕获其含义的数字表示的过程。这种数字表示也称为嵌入向量,是一个多维数字数组,其中每个维度代表文本含义的特定方面。 + +这些向量允许法学硕士通过测量多维空间中文本之间的距离或相似性来比较和搜索向量存储中的相似文本。 + +### 了解嵌入/向量存储维度 + +矢量存储索引中的维数由我们写入更新数据时使用的嵌入模型决定,反之亦然。每个维度代表数据中的特定特征或概念。例如,**维度**可能**代表文本的特定主题、情绪或其他方面**。 + +我们用来嵌入数据的维度越多,从文本中捕捉微妙含义的潜力就越大。然而,这种增加是以每个查询的计算要求更高为代价的。 + +一般来说,维度越多,需要更多的资源来存储、处理和比较生成的嵌入向量。因此,理论上,像 Google `embedding-001` 这样使用 768 维的嵌入模型比 OpenAI `text-embedding-3-large` 这样使用 3072 维的嵌入模型更便宜。 + +值得注意的是,**维度和意义捕获之间的关系并不是严格线性的**;存在一个收益递减点,即增加更多维度所带来的好处可以忽略不计,而增加的不必要的成本却可以忽略不计。 + +{% hint style="info" %} +**提示词:** 为了确保嵌入模型和向量存储索引之间的兼容性,维度对齐至关重要。 **模型和索引必须使用相同的维数来表示向量**。维度不匹配将导致插入错误,因为矢量存储旨在处理由所选嵌入模型确定的特定大小的矢量。 +{% endhint %} + +## 4.矢量存储 + +[向量存储 节点](../integrations/langchain/vector-stores/) 是我们写入更新流程的**结束节点。它充当 Flowise 实例和矢量数据库之间的桥梁,使我们能够将生成的嵌入以及任何关联的元数据发送到我们的目标矢量存储索引,以进行持久存储和后续检索。 + +正是在这个节点中,我们可以设置诸如“**top K**”之类的参数,正如我们之前所说,该参数确定从向量存储中检索以响应查询的最相似块的最大数量。 + +
+ +{% hint style="info" %} +**提示词:** 较低的 top K 值将产生较少但可能更相关的结果,而较高的值将返回更广泛的结果,可能捕获更多信息。 +{% endhint %} + +## 5. 记录管理器 + +[记录管理器节点](../integrations/langchain/record-managers.md)是我们的写入更新流程中的一个可选但非常有用的补充。它允许我们维护已写入更新矢量存储的所有块的记录,使我们能够根据需要有效地添加或删除块。 + +如需更深入的指南,我们建议您参阅[本指南](../integrations/langchain/record-managers.md)。 + +
+ +## 6. 完整概述 + +最后,让我们检查从初始文档加载到最终矢量表示的每个阶段,突出显示关键组件及其在写入更新过程中的作用。 + +
+ +1. **文档摄取**: + * 我们首先使用适合您的数据格式的 **文档加载器节点** 将原始数据输入 Flowise。 +2. **战略拆分** + * 接下来,**文本分割器节点** 将我们的文档划分为更小、更易于管理的块。这对于高效检索和成本控制至关重要。 + * 通过选择适当的文本分割器节点,并且重要的是,通过微调块大小和块重叠来平衡上下文保留与效率,我们可以灵活地进行这种分割。 +3. **有意义的嵌入** + * 现在,就在我们的数据将被记录到向量存储中之前,**嵌入节点**介入。它将每个文本块及其含义转换为我们的 LLM 可以理解的数字表示形式。 +4. **矢量存储索引** + * 最后,**向量存储 节点**充当 Flowise 和我们的数据库之间的桥梁。它将我们的嵌入以及任何相关元数据发送到指定的向量存储索引。 +* 在此节点中,我们可以通过设置 **top K** 参数来控制检索行为,该参数会影响回答查询时考虑的块数。 +5. **数据就绪** + * 写入更新后,我们的数据现在在向量存储中表示为向量,准备进行相似性搜索和检索。 +6. **记录保存(可选)** + * 为了增强控制和管理数据,**记录管理器**节点会跟踪所有写入更新的块。随着您的数据或需求的变化,这有助于轻松更新或删除。 + +本质上,写入更新过程将我们的原始数据转换为 LLM 就绪格式,并针对快速且经济高效的检索进行了优化。 diff --git a/cn/use-cases/web-scrape-qna.md b/cn/use-cases/web-scrape-qna.md new file mode 100644 index 00000000..87e2b840 --- /dev/null +++ b/cn/use-cases/web-scrape-qna.md @@ -0,0 +1,93 @@ +--- +description: 了解如何抓取、写入更新和查询网站 +--- + +# 网页抓取 QnA + +*** + +假设您有一个网站(可以是商店、电子商务网站、博客),并且您想要废弃该网站的所有相关链接并让 LLM 回答您网站上的任何问题。在本教程中,我们将介绍如何实现这一目标。 + +您可以从市场模板中找到名为 - **WebPage QnA** 的示例流程。 + +## 设置 + +我们将使用 **Cheerio Web Scraper** 节点从给定的 URL 抓取链接,并使用 **HtmlToMarkdown 文本分割器** 将抓取的内容分割成更小的部分。 + +
+ +如果您未指定任何内容,则默认情况下只会抓取给定的 URL 页面。如果要爬取其余相关链接,请单击 Cheerio Web Scraper 的“**其他参数**”。 + +## 1. 抓取多个页面 + +1. 在**获取相对链接方法**中选择`Web Crawl` 或`Scrape XML Sitemap`。 +2. 在**获取相对链接限制**中输入`0`,以检索提供的URL中的所有可用链接。 + +
+ +### 管理链接(可选) + +1. 输入需要抓取的URL。 +2. 单击“**获取链接**”,根据**获取相对链接方法**和**附加参数**中的**获取相对链接限制**的输入来检索链接。 +3. 在 **已爬网链接** 部分中,通过单击 **红色垃圾桶图标** 删除不需要的链接。 +4. 最后,单击“**保存**”。 + +
+ +## 2. 写入更新 + +1. 在右上角,您会看到一个绿色按钮: + +
+ +2. 将显示一个对话框,允许用户将数据更新到 Pinecone: + +
+ +**注意:** 在幕后,将执行以下操作: + +* 使用 Cheerio Web Scraper 抓取所有 HTML 数据 +* 将所有抓取的数据从 HTML 转换为 Markdown,然后拆分 +* 分割的数据将被循环,并使用 OpenAI Embeddings 转换为向量嵌入 +* 矢量嵌入将被更新到 Pinecone + +3. 在[Pinecone 控制台](https://app.pinecone.io) 上,您将能够看到添加的新向量。 + +
+ +## 3.查询 + +查询相对简单。验证数据已更新到矢量数据库后,您可以开始在聊天中提问: + +
+ +在会话检索QA链的附加参数中,您可以指定2个提示词: + +* **重新表述提示词:** 用于根据过去的对话历史重新表述问题 +* **响应提示词:** 使用改写的问题,从向量数据库中检索上下文,并返回最终响应 + +
+ +{% hint style="info" %} +建议指定详细的响应提示词信息。例如,您可以指定AI的名称、回答的语言、未找到答案时的响应(以防止产生幻觉)。 +{% endhint %} + +您还可以打开“返回源文档”选项以返回 AI 响应来源的文档块列表。 + +
+ +## 额外的网页抓取 + +除了 Cheerio Web Scraper 之外,还有其他节点也可以执行网页抓取: + +* **Puppeteer:** Puppeteer 是一个 Node.js 库,它提供了一个高级 API 用于控制无头 Chrome 或 Chromium。您可以使用 Puppeteer 自动化网页交互,包括从需要 JavaScript 呈现的动态网页中提取数据。 +* **Playwright:** Playwright 是一个 Node.js 库,提供高级 API 用于控制多个浏览器引擎,包括 Chromium、Firefox 和 WebKit。您可以使用 Playwright 自动化网页交互,包括从需要 JavaScript 呈现的动态网页中提取数据。 +* **Apify:** [Apify](https://apify.com/) 是一个用于网页抓取和数据提取的云平台,它提供了一个 [生态系统](https://apify.com/store),其中包含一千多个名为 _Actors_ 的现成应用程序,用于各种网页抓取、爬行和数据提取用例。 + +
+ +{% hint style="info" %} +相同的逻辑可以应用于任何文档用例,而不仅限于网页抓取! +{% endhint %} + +如果您对如何提高性能有任何建议,欢迎您[贡献](broken-reference)! diff --git a/cn/use-cases/webhook-tool.md b/cn/use-cases/webhook-tool.md new file mode 100644 index 00000000..989efa71 --- /dev/null +++ b/cn/use-cases/webhook-tool.md @@ -0,0 +1,144 @@ +--- +description: 了解如何在 Make 上调用 Webhook +--- + +# 调用Webhook + +*** + +本教程将引导您在 FlowiseAI 中创建一个自定义工具,该工具调用 webhook 端点,并在请求正文中传递必要的参数。我们将使用 [Make.com](https://www.make.com/en) 设置将消息发送到 Discord 频道的 Webhook 工作流程。 + +## 在 Make.com 中设置 Webhook + +1. 注册或登录 [Make.com](https://www.make.com/en)。 +2. 创建一个包含 **Webhook** 模块和 **Discord** 模块的新工作流,如下所示: + +
Workflow example
+ +3. 从 **Webhook** 模块,复制 webhook URL: + +
Webhook URL
+ +4. 在 **Discord** 模块中,将其配置为将 `message` 从 webhook 正文传递为发送到 Discord 通道的消息: + +
Discord module setup
+ +5. 单击“**运行一次**”开始侦听传入请求。 +6. 发送带有以下 JSON 主体的测试 POST 请求: + + ```json + { + "message": "Hello Discord!" + } + ``` + +
Sending POST request
+ +7. 如果成功,您将看到该消息出现在您的 Discord 频道中: + +
Discord message
+ +恭喜!您已成功设置将消息发送到 Discord 的 Webhook 工作流程。 🎉 + +## 在 FlowiseAI 中创建 Webhook 工具 + +接下来,我们将在 FlowiseAI 中创建一个自定义工具来发送 webhook 请求。 + +### 第 1 步:添加新工具 + +1. 打开 **FlowiseAI** 仪表板。 +2. 单击“**工具**”,然后选择“**创建**”。 + +
Creating tool in FlowiseAI
+ +3. 填写以下字段: + + |领域 |价值| + |-------|-------| + | **工具名称** | `make_webhook`(必须位于 Snake_case 中)| + | **工具说明** |当您需要向 Discord 发送消息时很有用 | + | **工具图标源** | [Flowise 工具图标](https://github.com/FlowiseAI/Flowise/assets/26460777/517fdab2-8a6e-4781-b3c8-fb92cc78aa0b) | + +4. 定义**输入架构**: + +
Input schema example
+ +### 步骤 2:添加 Webhook 请求逻辑 + +输入以下 JavaScript 函数: + +```javascript +const fetch = require('node-fetch'); +const webhookUrl = 'https://hook.eu1.make.com/abcdef'; +const body = { + "message": $message +}; +const options = { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(body) +}; +try { + const response = await fetch(webhookUrl, options); + const text = await response.text(); + return text; +} catch (error) { + console.error(error); + return ''; +} +``` + +5. 单击“**添加**”保存您的自定义工具。 + +
Tool added confirmation
+ +### 步骤 3:使用 Webhook 集成构建聊天流 + +1. 创建一个新画布并添加以下节点: + - **缓冲内存** + - **ChatOpenAI** + - **自定义工具**(选择 `make_webhook`) + - **OpenAI功能代理** + +2. 如图所示连接它们: + +
Chatflow setup
+ +3. 保存聊天流并开始测试。 + +### 步骤 4:通过 Webhook 发送消息 + +尝试向聊天机器人询问如下问题: + +> _“如何煮鸡蛋?”_ + +然后,请求代理将此信息发送到 Discord: + +
Sending message via agent
+ +您应该会看到该消息出现在您的 Discord 频道中: + +
Final message in Discord
+ +### 替代 Webhook 测试工具 + +如果您想在没有 Make.com 的情况下测试 webhook,请考虑使用: + +- [Beeceptor](https://beeceptor.com) – 快速设置模拟 API 端点。 +- [Webhook.site](https://webhook.site) – 实时检查和调试 HTTP 请求。 +- [Pipedream RequestBin](https://pipedream.com/requestbin) – 捕获并分析传入的 webhook。 + +## 更多教程 + +- 观看有关通过 Flowise 自定义工具使用 Webhook 的分步指南: + {% embed url="https://youtu.be/_K9xJqEgnrU" %} + +- 了解如何使用 webhooks 将 Flowise 连接到 Google 表格: + {% embed url="https://youtu.be/fehXLdRLJFo" %} + +- 了解如何使用 webhooks 将 Flowise 连接到 Microsoft Excel: + {% embed url="https://youtu.be/cB2GC8JznJc" %} + +通过遵循本指南,您可以动态触发 Webhook 工作流程并将自动化扩展到 Gmail、Google Sheets 等各种服务。 diff --git a/cn/using-flowise/README.md b/cn/using-flowise/README.md new file mode 100644 index 00000000..57657f05 --- /dev/null +++ b/cn/using-flowise/README.md @@ -0,0 +1,27 @@ +--- +description: 了解 Flowise 内置的一些核心功能 +--- + +# 使用 Flowise + +*** + +本部分提供有关 Flowise 核心功能的深入指南。 + +## 指南 + +* [智能体流程 V2](agentflowv2.md) +* [智能体流程 V1(弃用)](agentflowv1/) + * [多智能体](agentflowv1/multi-agents.md) + * [顺序智能体](agentflowv1/sequential-agents/) +* [预测](prediction.md) +* [流式传输](streaming.md) +* [文档存储](document-stores.md) +* [写入更新](upsertion.md) +* [分析](broken-reference/) +* [监控](monitoring.md) +* [嵌入](embed.md) +* [上传](uploads.md) +* [变量](variables.md) +* [工作区](workspaces.md) +* [评估](evaluations.md) diff --git a/cn/using-flowise/agentflowv1/README.md b/cn/using-flowise/agentflowv1/README.md new file mode 100644 index 00000000..f75b95f6 --- /dev/null +++ b/cn/using-flowise/agentflowv1/README.md @@ -0,0 +1,21 @@ +--- +description: 了解如何在 Flowise 中构建代理系统 +--- + +# 智能体流程 + +## Introducing Agentic Systems in Flowise + +Flowise 的 智能体流程 部分提供了一个平台,用于构建基于代理的系统,该系统可以与外部工具和数据源交互。 + +目前,Flowise 提供两种设计这些系统的方法:[**多智能体**](#user-content-fn-1)[^1] 和 [**顺序智能体**](#user-content-fn-2)[^2]。这些方法提供不同级别的控制和复杂性,使您可以选择最适合您需求的方法。 + +

流动 APP

+ +{% hint style="success" %} +本文档将探讨顺序智能体和多智能体方法,解释它们的功能以及如何使用它们来构建不同类型的会话工作流。 +{% endhint %} + +[^1]: **Multi-Agents**, built on top of the Sequential Agent architecture, simplify the process of building and managing teams of agents by pre-configuring core elements and providing a higher-level abstraction. + +[^2]: **Sequential Agents** provide developers with direct access to the underlying workflow structure, enabling granular control over every step of the conversation flow and offering maximum flexibility for building highly customized conversational applications. diff --git a/cn/using-flowise/agentflowv1/multi-agents.md b/cn/using-flowise/agentflowv1/multi-agents.md new file mode 100644 index 00000000..0442b7b7 --- /dev/null +++ b/cn/using-flowise/agentflowv1/multi-agents.md @@ -0,0 +1,150 @@ +--- +description: 了解如何在 Flowise 中使用多智能体,作者:@toi500 +--- + +# 多智能体 + +本指南旨在介绍 Flowise 中的多智能体 AI 系统架构,详细介绍其组件、操作限制和工作流程。 + +## 概念 + +类似于在复杂项目上协作的领域专家团队,多智能体系统使用人工智能中的专业化原则。 + +这种多智能体系统采用分层、顺序工作流程,最大限度地提高效率和专业化。 + +### 1.系统架构 + +我们可以将多智能体人工智能架构定义为一个可扩展的人工智能系统,能够通过将复杂项目分解为可管理的子任务来处理复杂的项目。 + +在 Flowise 中,多智能体系统由两个主节点或代理类型和一个用户组成,在分层图中进行交互以处理请求并提供目标结果: + +1. **用户:**用户充当**系统的起点**,提供初始输入或请求。虽然多智能体系统可以设计为处理广泛的请求,但重要的是这些用户请求与系统的预期目的保持一致。任何超出此范围的请求都可能导致结果不准确、意外循环甚至系统错误。因此,用户交互虽然灵活,但应始终与系统的核心功能保持一致,以获得最佳性能。 +2. **Supervisor AI:** Supervisor 充当**系统的协调者**,监督整个工作流程。它分析用户请求,将其分解为一系列子任务,将这些子任务分配给专门的工作代理,聚合结果,并最终将处理后的输出呈现给用户。 +3. **Worker AI 团队:** 该团队由专门的 AI 智能体或 Worker 组成,每个代理都通过提示词消息指示处理工作流程中的特定任务。这些工人独立操作,接收主管的指令和数据,**执行其专门功能**,根据需要使用工具,并将结果返回给主管。 + +
+ +### 2. 操作限制 + +为了保持秩序和简单性,这个多智能体系统在两个重要的约束下运行: + +* **一次一项任务:** Supervisor 的设计目的是一次专注于一项任务。它等待活动的 Worker 完成其任务并返回结果,然后再分析下一步并委托后续任务。这可确保每个步骤在继续之前成功完成,从而防止过于复杂。 +* **每个流程一个主管:** 虽然理论上可以实现一组嵌套的多智能体系统,为高度复杂的工作流程形成更复杂的层次结构,LangChain 定义为“[分层代理团队](https://github.com/langchain-ai/langgraph/blob/main/examples/multi\_agent/hierarchical\_agent\_teams.ipynb)”,由顶级主管和中层主管管理工作人员团队,但 Flowise 的多智能体系统目前由单个主管运行。 + +{% hint style="info" %} +在**规划应用程序的工作流程**时,这两个约束非常重要。如果您尝试设计一个工作流程,其中主管需要同时、并行地委派多个任务,系统将无法处理它,您将遇到错误。 +{% endhint %} + +## 主管 + +Supervisor 作为管理整个工作流程的代理并负责将任务委派给适当的 Worker,需要一组组件才能正常运行: + +* **聊天模型能够进行函数调用**来管理任务分解、委托和结果聚合的复杂性。 +* **代理内存(可选)**:虽然 Supervisor 可以在没有代理内存的情况下运行,但此节点可以显着增强需要访问过去 Supervisor 状态的工作流程。这种**状态保存**可以允许主管从特定点恢复工作或利用过去的数据来改进决策。 + +
+ +### 主管提示词 + +默认情况下,主管提示词的措辞方式指示主管分析用户请求,将其分解为一系列子任务,并将这些子任务分配给专门的工作代理。 + +虽然主管提示词可以自定义以满足特定应用程序的需求,但它始终需要以下两个关键元素: + +* **{team\_members} 变量:** 该变量对于主管了解可用劳动力至关重要,因为它为主管提供了工人姓名列表。这使得主管能够根据他们的专业知识,勤奋地将任务委派给最合适的工人。 +* **“FINISH”关键字:** 该关键字用作管理员提示词中的信号。它指示主管何时应认为任务完成并向用户呈现最终输出。如果没有明确的“FINISH”指令,Supervisor 可能会继续不必要地委派任务,或者无法向用户提供连贯且最终的结果。它表明所有必要的子任务已被执行并且用户的请求已得到满足。 + +
+ +{% hint style="info" %} +重要的是要理解主管扮演着与工人截然不同的角色。与可以使用高度具体的指令进行定制的 Workers 不同,**Supervisor 通过一般指令进行最有效的操作,这使得它可以根据需要计划和委派任务。**如果您是多智能体系统的新手,我们建议您坚持使用默认的 Supervisor 提示词 +{% endhint %} + +### 了解 Supervisor 节点中的递归限制: + +此参数限制应用程序中嵌套函数调用的最大深度。在我们当前的环境中,**它限制了 Supervisor 在单个工作流程执行中可以触发自身的次数**。这对于防止无限递归和确保资源的有效利用非常重要。 + +
+ +### 主管如何工作 + +收到用户查询后,主管通过分析请求并辨别用户的预期结果来启动工作流程。 + +然后,利用 Supervisor 提示词中的 `{team_members}` 变量(该变量仅提供可用 Worker AI 名称的列表),Supervisor 推断每个 Worker 的专业,并策略性地为工作流程中的每个任务选择最合适的 Worker。 + +{% hint style="info" %} +由于主管只有工作人员的姓名来推断他们在工作流程中的功能,因此相应地设置这些名称非常重要。 **准确反映工作人员角色或专业领域的清晰、简洁和描述性名称对于主管在委派任务时做出明智的决策至关重要。**这可确保为正确的工作选择正确的工作人员,从而最大限度地提高系统满足用户请求的准确性。 +{% endhint %} + +*** + +## **工人** + +Worker 作为受指示处理系统内特定任务的专门代理,需要两个基本组件才能正常运行: + +* **主管:** 每个工作人员必须连接到主管,以便在需要委派​​任务时可以调用它。这种连接在多智能体系统内建立了必要的层次关系,确保主管可以有效地将工作分配给适当的专业工作人员。 +* **能够进行函数调用的聊天模型节点**:默认情况下,除非直接分配,否则工作人员会继承主管的聊天模型节点。这种函数调用功能使工作人员能够与为其专门任务设计的工具进行交互。 + +
+ +{% hint style="info" %} +为每个工作人员分配**不同的聊天模型**的能力为我们的应用程序提供了显着的灵活性和优化机会。通过选择针对特定任务量身定制的[聊天模型](../../integrations/langchain/chat-models/),我们可以利用更具成本效益的解决方案来完成更简单的任务,并在真正需要时保留专门的、可能更昂贵的模型。 +{% endhint %} + +### 了解 Workers 中的最大迭代参数 + +[LangChain](https://python.langchain.com/v0.1/docs/modules/agents/how\_to/max\_iterations/) 指的是 `Max Iterations Cap` 作为防止代理系统内失控的重要控制机制。在我们当前的背景下,它充当了我们的护栏,防止主管和工人之间过度的、可能无限的互动。 + +与 Supervisor 节点的 `Recursion Limit` 限制 Supervisor 可以调用自身的次数不同,Worker 节点的 `Max Iteration` 参数限制 Supervisor 可以迭代或查询特定 Worker 的次数。 + +通过限制最大迭代次数,我们可以确保即使在系统出现意外行为的情况下,成本仍处于控制之中。 + +*** + +## 示例:一个实际的用户案例 + +现在我们已经对多智能体系统如何在 Flowise 中工作有了基本的了解,让我们探索一下实际应用。 + +想象一下一个 **Lead Outreach 多智能体系统**(可在 Marketplace 中找到),旨在自动执行识别、资格审查和与潜在潜在客户互动的过程。该系统将利用 Supervisor 来协调以下两个 Worker: + +* **首席研究员:** 该工作人员使用 Google 搜索工具,负责根据用户定义的标准收集潜在线索。 +* **首席销售生成器:** 该工作人员将利用首席研究员收集的信息为销售团队创建个性化电子邮件草稿。 + +
+ +**背景:** 在 Solterra Renewables 工作的一位用户希望收集有关 Evergreen Energy Group(一家位于英国的信誉良好的可再生能源公司)的可用信息,并将其 CEO Amelia Croft 作为潜在的领导者。 + +**用户请求:** Solterra Renewables 员工向多智能体系统提供以下查询:“_我需要有关 Evergreen Energy Group 和 Amelia Croft 作为我们业务的潜在新客户的信息。_” + +1. **主管:** + * 主管收到用户请求并将“领导研究”任务委托给`Lead Researcher Worker`。 +2. **首席研究员:** + * 首席研究员使用 Google 搜索工具收集有关长青能源集团的信息,重点关注: + * 公司背景、行业、规模和地点。 + * 最近的新闻和动态。 + * 主要管理人员,包括确认 Amelia Croft 的 CEO 角色。 + * 首席研究员将收集到的信息发送回 `Supervisor`。 +3. **主管:** +* 主管收到首席研究员工作者的研究数据,并确认 Amelia Croft 是相关负责人。 + * 主管将“生成销售电子邮件”任务委托给 `Lead Sales Generator Worker`,并提供: + *长荣能源集团研究资料。 + * 阿米莉亚·克罗夫特的电子邮件。 + * 有关 Solterra 可再生能源的背景。 +4. **首席销售发电机工人:** + * 首席销售生成人员为 Amelia Croft 量身定制个性化电子邮件草稿,考虑到: + * 她作为 CEO 的角色以及 Solterra Renewables 服务与她的公司的相关性。 + * 来自长青能源集团当前重点或项目研究的信息。 + * 首席销售生成器工作人员将完成的电子邮件草稿发送回 `Supervisor`。 +5. **主管:** + * 主管收到生成的电子邮件草稿并发出“FINISH”指令。 + * 主管将电子邮件草稿输出回用户 `Solterra Renewables employee`。 +6. **用户收到输出:** Solterra Renewables 员工收到一份个性化的电子邮件草稿,可供审核并发送给 Amelia Croft。 + +## 视频教程 + +在这里,您可以找到来自 [Leon 的 YouTube 频道](https://www.youtube.com/@leonvanzyl) 的视频教程列表,展示如何使用无代码在 Flowise 中构建多智能体应用程序。 + +{% embed url="https://www.youtube.com/watch?ab_channel=LeonvanZyl&v=284Z8k7yJRE" %} + +{% embed url="https://www.youtube.com/watch?ab_channel=LeonvanZyl&v=MaqcO15y-Vs" %} + +{% embed url="https://www.youtube.com/watch?ab_channel=LeonvanZyl&v=eAH7LDGMVEs" %} diff --git a/cn/using-flowise/agentflowv1/sequential-agents/README.md b/cn/using-flowise/agentflowv1/sequential-agents/README.md new file mode 100644 index 00000000..23d931a4 --- /dev/null +++ b/cn/using-flowise/agentflowv1/sequential-agents/README.md @@ -0,0 +1,1214 @@ +--- +description: 了解 Flowise 中的顺序智能体基础知识,作者:@toi500 +--- + +# 顺序智能体 + +本指南全面概述了 Flowise 中的 Sequential Agent AI 系统架构,探索其核心组件和工作流程设计原则。 + +{% hint style="warning" %} +**免责声明**:本文档旨在帮助 Flowise 用户理解并使用 Sequential Agent 系统架构构建会话工作流程。它无意成为 LangGraph 框架的全面技术参考,也不应被解释为定义行业标准或核心 LangGraph 概念。 +{% endhint %} + +## 概念 + +Flowise 的顺序智能体架构建立在 [LangGraph](https://www.langchain.com/langgraph) 之上,通过将工作流程构建为有向循环图 (DCG)**,允许受控循环和迭代过程,从而促进**对话代理系统的开发。 + +该图由互连的节点组成,定义了信息和操作的顺序流,使代理能够以结构化方式处理输入、执行任务并生成响应。 + +
+ +### 了解顺序智能体的 DCG 架构 + +该架构通过其 DCG 结构定义了清晰易懂的操作序列,从而简化了复杂会话工作流程的管理。 + +让我们探讨一下这种方法的一些关键要素: + +{% tabs %} +{% tab title="Core Principles" %} +* **基于节点的处理:** 图中的每个节点代表一个离散的处理单元,封装其自己的功能,如语言处理、工具执行或条件逻辑。 +* **作为连接的数据流:** 图中的边代表节点之间的数据流,其中一个节点的输出成为后续节点的输入,从而实现一系列处理步骤。 +* **状态管理:** 状态作为共享对象进行管理,在整个对话过程中持续存在。这允许节点随着工作流程的进展访问相关信息。 +{% endtab %} + +{% tab title="Terminology" %} +* **流程:** 工作流程中数据的移动或方向。它描述了会话期间信息如何在节点之间传递。 +* **工作流程:** 系统的整体设计和结构。它是定义节点序列、节点连接以及编排对话流的逻辑的蓝图。 +* **状态:** 表示会话当前快照的共享数据结构。它包括对话历史记录 `state.messages` 和用户定义的任何自定义状态变量。 +* **自定义状态:** 添加到状态对象的用户定义的键值对,用于存储与工作流程相关的附加信息。 +* **工具:** 可以由工作流访问和执行以执行特定任务(例如检索信息、处理数据或与其他应用程序交互)的外部系统 API 或服务。 +* **人在环 (HITL):** 允许人为干预工作流程(主要是在工具执行期间)的功能。它使人工审阅者能够在执行工具调用之前批准或拒绝工具调用。 +* **并行节点执行:** 是指通过使用分支机制,在一个工作流程内同时执行多个节点的能力。这意味着工作流的不同分支可以同时处理信息或与工具交互,即使整体执行流程保持顺序。 +{% endtab %} +{% endtabs %} + +*** + +## 顺序智能体与多智能体 + +虽然 Flowise 中的多智能体和顺序智能体系统均基于 LangGraph 框架构建并具有相同的基本原理,但顺序智能体架构提供了[较低的抽象级别](#user-content-fn-1)[^1],从而对工作流程的每个步骤提供更精细的控制。 + +**多智能体系统**,其特点是分层结构,中央主管代理将任务委托给专门的工作代理,**擅长通过将复杂的工作流程分解为可管理的子任务来处理复杂的工作流程**。通过在后台预先配置核心系统元素(例如条件节点),可以实现对子任务的分解,这需要在顺序智能体系统中进行手动设置。因此,用户可以更轻松地构建和管理代理团队。 + +相比之下,**顺序智能体系统**像简化的装配线一样运行,其中数据按顺序流经节点链,使其成为需要精确操作顺序和增量数据细化的任务的理想选择。与多智能体系统相比,它对底层工作流结构的较低级别访问使其从根本上更加灵活和可定制,提供并行节点执行和对系统逻辑的完全控制,将条件、状态和循环节点合并到工作流中,允许创建新的动态分支功能。 + +### 状态、循环和条件节点简介 + +Flowise 的顺序智能体提供了创建对话系统的新功能,该系统可以适应用户输入、根据上下文做出决策并执行迭代任务。 + +这些功能是通过引入四个新核心节点而实现的;状态节点、循环节点和两个条件节点。 + +
+ +* **状态节点:** 我们将状态定义为共享数据结构,表示应用程序或工作流程的当前快照。状态节点允许我们从对话开始就将自定义状态添加到我们的工作流程中。工作流中的其他节点可以访问和修改此自定义状态,从而实现动态行为和数据共享。 +* **循环节点:**此节点**在顺序智能体工作流程中引入受控循环**,从而实现迭代过程,其中可以根据特定条件重复节点序列。这允许代理优化输出、从用户收集附加信息或多次执行任务。 +* **条件节点:** 条件和条件代理节点提供必要的控制来**创建具有分支路径的复杂对话流**。条件节点直接评估条件,而条件代理节点使用代理的推理来确定分支逻辑。这使我们能够根据用户输入、自定义状态或其他节点采取的操作结果动态引导流的行为。 + +### 选择正确的系统 + +为您的应用选择理想的系统取决于对您特定工作流程需求的了解。任务复杂性、并行处理的需求以及您所需的数据流控制级别等因素都是关键考虑因素。 + +* **为了简单起见:** 如果您的工作流程相对简单,任务可以一个接一个地完成,因此不需要并行节点执行或人机循环 (HITL),则多智能体方法提供了易用性和快速设置。 +* **为了灵活性:** 如果您的工作流程需要并行执行、动态对话、自定义状态管理以及合并 HITL 的能力,**顺序智能体** 方法提供必要的灵活性和控制。 + +下表比较了 Flowise 中的多智能体和顺序智能体实现,突出显示了关键差异和设计注意事项: + +
多Agent顺序智能体
结构分层的;主管委派给专业工人。线性、循环和/或 分支;节点按顺序连接,并具有分支的条件逻辑。
工作流程灵活;旨在将复杂的任务分解为 子任务的顺序,陆续完成。高度灵活; 支持并行节点执行、复杂的对话流、分支逻辑以及单个对话轮中的循环。
并行节点执行;主管一次处理一项任务。是的;可以在一次运行中并行触发多个操作。
状态管理隐含的;状态已就位,但开发人员并未明确管理。显式的;状态就位,开发人员可以使用状态节点和各个节点中的“更新状态”字段来定义和管理初始或自定义状态。
工具使用工人 可以根据需要访问和使用工具。工具通过以下方式访问和执行 代理节点工具节点
人机交互 (HITL)HITL 是 不支持。支持 通过代理节点和工具节点的“需要批准”功能,允许人工审核并批准或拒绝工具执行。
复杂性更高层次的抽象; 简化工作流程设计。较低的抽象级别; 更复杂的工作流程设计,需要仔细规划节点交互、自定义状态管理和条件逻辑。
理想的用例
  • 自动化线性流程(例如数据提取、潜在客户生成)。
  • 需要依次完成子任务的情况。
  • 构建具有动态流的会话系统。
  • 需要并行节点执行或分支逻辑的复杂工作流程。
  • 需要在对话中的多个点做出决策的情况。
+ +{% hint style="info" %} +**注意**:尽管多智能体系统在技术上是基于顺序智能体架构构建的更高级别的层,但它们提供了独特的用户体验和工作流设计方法。上面的比较将它们视为单独的系统,以帮助您选择适合您特定需求的最佳选项。 +{% endhint %} + +*** + +## 顺序智能体节点 + +顺序智能体为 Flowise 带来了全新的维度,**引入了 10 个专用节点**,每个节点都有特定的用途,为我们的对话代理如何与用户交互、处理信息、做出决策和执行操作提供更多控制。 + +以下部分旨在全面了解每个节点的功能、输入、输出和最佳实践,最终使您能够为各种应用程序设计复杂的对话工作流程。 + +
+ +*** + +## 1.启动节点 + +顾名思义,启动节点是 **顺序智能体架构中所有工作流的入口点**。它接收初始用户查询,初始化对话状态,并启动流程。 + +
+ +### 了解起始节点 + +启动节点确保我们的对话工作流程具有正确运行所需的设置和上下文。 **它负责设置将在整个工作流程的其余部分中使用的关键功能**: + +* **定义默认的LLM:** 启动节点要求我们指定一个与函数调用兼容的聊天模型(LLM),使工作流中的代理能够与工具和外部系统进行交互。这将是工作流程中使用的默认 LLM。 +* **初始化内存:** 我们可以选择连接代理内存节点来存储和检索对话历史记录,从而实现更多上下文感知响应。 +* **设置自定义状态:** 默认情况下,状态包含一个不可变的 `state.messages` 数组,它充当用户和代理之间对话的记录或历史记录。启动节点允许您将自定义状态连接到添加状态节点的工作流程,从而能够存储与工作流程相关的其他信息 +* **启用审核:** 我们可以选择连接输入审核来分析用户的输入并防止可能有害的内容发送到 LLM。 + +### 输入 + +
必填描述
聊天模型是的默认的 LLM 将为对话提供支持。仅兼容 能够进行函数调用的模型
代理内存节点将代理内存节点连接到 启用持久性和上下文保存
状态节点将状态节点连接到 设置自定义状态,可以由工作流中的其他节点访问和修改的共享上下文。
输入调节将审核节点连接到 过滤内容 通过检测可能生成有害输出的文本,防止其发送到 LLM。
+ +### 输出 + +起始节点可以连接到以下节点作为输出: + +* **代理节点:** 将对话流路由到代理节点,然后代理节点可以根据对话的上下文执行操作或访问工具。 +* **LLM 节点:** 将对话流路由到 LLM 节点以进行处理和响应生成。 +* **条件代理节点:** 连接到条件代理节点,以根据代理对对话的评估来实现分支逻辑。 +* **条件节点:** 连接到条件节点,根据预定义的条件实现分支逻辑。 + +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**选择正确的聊天模式** + +确保您选择的 LLM 支持函数调用,这是启用代理工具交互的关键功能。此外,请选择符合您应用程序的复杂性和要求的 LLM。必要时,您可以通过在 Agent/LLM/Condition Agent 节点级别设置来覆盖默认的 LLM。 + +**考虑上下文和持久性** + +如果您的用例需要,请利用代理内存节点来维护上下文并个性化交互。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**聊天模型 (LLM) 选择不正确** + +* **问题:** 在开始节点中选择的聊天模型不适合工作流的预期任务或功能,导致性能不佳或响应不准确。 +* **示例:** 某个工作流需要具有较强摘要能力的聊天模型,但启动节点选择了针对代码生成进行优化的模型,导致摘要不充分。 +* **解决方案:** 选择符合您工作流程特定要求的聊天模型。考虑模型的优点、缺点以及它擅长的任务类型。请参阅文档并尝试不同的模型以找到最合适的。 + +**俯瞰代理内存节点配置** + +* **问题:** 代理内存节点未正确连接或配置,导致会话之间的对话历史数据丢失。 +* **示例:** 您打算使用持久内存来存储用户首选项,但代理内存节点未连接到启动节点,导致在每个新对话上重置首选项。 +* **解决方案:** 确保代理内存节点已连接到启动节点并配置了适当的数据库 (SQLite)。对于大多数用例,默认的 SQLite 数据库就足够了。 + +**输入调节不足** + +* **问题:** 未正确启用或配置“输入审核”,从而允许潜在有害或不适当的用户输入到达 LLM 并生成不良响应。 +* **示例:** 用户提交攻击性语言,但输入审核未能检测到或根本未设置,从而允许查询到达 LLM。 +* **解决方案:** 在启动节点中添加并配置输入审核节点,以过滤掉潜在有害或不当的语言。自定义审核设置以符合您的特定要求和用例。 +{% endtab %} +{% endtabs %} + +## 2.代理内存节点 + +代理内存节点 **提供持久内存存储机制**,允许顺序智能体工作流程保留对话历史记录 `state.messages` 以及先前跨多个交互定义的任何自定义状态 + +这种长期记忆对于代理从之前的交互中学习、在扩展对话中保持上下文以及提供更相关的响应至关重要。 + +
+ +### 数据记录的地方 + +默认情况下,Flowise 利用其**内置 SQLite 数据库**来存储对话历史记录和自定义状态数据,创建一个“**检查点**”表来管理这些持久信息。 + +####了解“检查点”表结构和数据格式 + +该表**存储对话期间各个点的系统状态快照**,从而实现对话历史记录的持久化和检索。每行代表工作流程执行中的一个特定点或“检查点”。 + +
+ +#### 表结构 + +* **thread\_id:** 代表特定对话会话的唯一标识符,**我们的会话 ID**。它将与单个工作流程执行相关的所有检查点组合在一起。 +* **checkpoint\_id:** 工作流中每个执行步骤(节点执行)的唯一标识符。它有助于跟踪操作顺序并识别每个步骤的状态。 +* **parent\_id:** 表示导致当前检查点的前一个执行步骤的检查点\_id。这在检查点之间建立了层次关系,允许重建工作流的执行流程。 +* **检查点:** 包含 JSON 字符串,表示该特定检查点处工作流的当前状态。这包括变量的值、交换的消息以及在执行过程中该点捕获的任何其他相关数据。 +* **元数据:** 提供有关检查点的附加上下文,特别是与节点操作相关的上下文。 + +#### 它是如何工作的 + +当顺序智能体工作流程执行时,系统会在此表中记录每个重要步骤的检查点。这种机制有几个好处: + +* **执行跟踪:** 检查点使系统能够了解工作流程中的执行路径和操作顺序。 +* **状态管理:** 检查点存储每个步骤的工作流状态,包括变量值、对话历史记录和任何其他相关数据。这使得系统能够保持上下文意识并根据当前状态做出明智的决策。 +* **工作流程恢复:** 如果工作流程暂停或中断(例如,由于系统错误或用户请求),系统可以使用存储的检查点从上次记录的状态恢复执行。这可确保对话或任务从中断处继续,保留用户的进度并防止数据丢失。 + +### **输入** + +代理内存节点**没有特定的输入连接**。 + +### 节点设置 + +
必填描述
数据库是的用于存储对话历史记录的数据库类型。目前, 仅支持 SQLite
+ +### 附加参数 + +
必填描述
数据库文件路径SQLite 数据库文件的文件路径。 如果没有提供,系统将使用默认位置
+ +### **输出** + +代理内存节点仅与**启动节点**交互,从而使对话历史记录从工作流程的一开始就可用。 + +### **最佳实践** + +{% tabs %} +{% tab title="Pro Tips" %} +**战略用途** + +仅在必要时才使用代理内存。对于简单的、无状态的交互来说,这可能有点矫枉过正。将其保留用于需要跨回合或会话保留信息的场景。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**不必要的开销** + +* **问题:** 对每次交互使用代理内存,即使不需要,也会带来不必要的存储和处理开销。这会减慢响应时间并增加资源消耗。 +* **示例:** 基于单个用户请求提供信息的简单天气聊天机器人不需要存储对话历史记录。 +* **解决方案:** 分析系统的要求,仅当持久数据存储对于功能或用户体验至关重要时才使用代理内存。 +{% endtab %} +{% endtabs %} + +*** + +## 3. 状态节点 + +状态节点只能连接到开始节点,**提供了一种从对话开始就将用户定义或自定义状态**设置到我们的工作流程中的机制。此自定义状态是一个 JSON 对象,该对象是共享的,可以由图中的节点更新,随着流程的进展从一个节点传递到另一个节点。 + +
+ +### 了解状态节点 + +默认情况下,状态包含一个 `state.messages` 数组,它充当我们的对话历史记录。该数组存储用户和代理或工作流中任何其他参与者之间交换的所有消息,并在整个工作流执行过程中保留它。 + +由于根据定义,此 `state.messages` 数组是不可变的且无法修改,**状态节点的目的是允许我们定义自定义键值对**,扩展状态对象以保存与我们的工作流程相关的任何其他信息。 + +{% hint style="info" %} +当不使用**代理内存节点**时,状态在内存中运行,并且不会保留以供将来使用。 +{% endhint %} + +### 输入 + +状态节点**没有特定的输入连接**。 + +### 输出 + +状态节点只能连接到**开始节点**,允许从工作流开始时设置自定义状态,并允许其他节点访问并可能修改此共享的自定义状态。 + +### 附加参数 + +
必填描述
自定义状态是的代表 JSON 对象 工作流程的初始自定义状态。该对象可以包含与应用程序相关的任何键值对。
+ +### 如何设置自定义状态 + +指定状态对象的**键**、**操作类型**和**默认值**。操作类型可以是“替换”或“追加”。 + +* **更换** + 1. 将现有值替换为新值。 + 2. 如果新值为null,则保留现有值。 +* **追加** + 1. 将新值附加到现有值。 + 2. 默认值可以为空或数组。例如:\[“a”,“b”] + 3. 最终值是一个数组。 + +#### 使用 JS 的示例 + +{% code overflow="wrap" %} +```javascript +{ + aggregate: { + value: (x, y) => x.concat(y), // here we append the new message to the existing messages + default: () => [] + } +} +``` +{% endcode %} + +#### 使用表格的示例 + +要使用状态节点中的表接口定义自定义状态,请执行以下步骤: + +1. **添加项目:** 单击“+添加项目”按钮向表中添加行。每行代表您的自定义状态中的一个键值对。 +2. **指定键:** 在“键”列中,输入要在状态对象中定义的每个键的名称。例如,您可能有“userName”、“userLocation”等键。 +3. **选择操作:** 在“操作”栏中,为每个按键选择所需的操作。您有两个选择: + * **替换:** 这会将键的现有值替换为节点提供的新值。如果新值为 null,则保留现有值。 + * **附加:** 这会将新值附加到键的现有值中。最终值将是一个数组。 +4. **设置默认值:** 在“默认值”栏中,输入每个键的初始值。如果没有其他节点为该键提供值,则将使用该值。默认值可以为空或数组。 + +#### 示例表 + +|关键|运营|默认值 | +| -------- | --------- | ------------- | +|用户名 |更换|空 | + +
+ +1. 该表定义了自定义State中的一个键:`userName`。 +2. `userName` 键将使用“替换”操作,这意味着只要节点提供新值,其值就会更新。 +3. `userName` 键有一个默认值_null,_ 表示它没有初始值。 + +{% hint style="info" %} +请记住,这种基于表的方法是使用 JavaScript 定义自定义状态的替代方法。两种方法都达到相同的结果。 +{% endhint %} + +#### 使用 API 的示例 + +```json +{ + "question": "hello", + "overrideConfig": { + "stateMemory": [ + { + "Key": "userName", + "Operation": "Replace", + "Default Value": "somevalue" + } + ] + } +} +``` + +### 最佳实践 + +{% tabs %} +{% tab title="Pro-Tips" %} +**规划您的自定义状态结构** + +在构建工作流程之前,设计自定义状态的结构。组织良好的自定义状态将使您的工作流程更易于理解、管理和调试。 + +**使用有意义的键名** + +选择具有描述性且一致的键名称,以清楚地表明其所保存数据的用途。这将提高代码的可读性,并使其他人(或将来的您)更容易理解自定义状态的使用方式。 + +**保持自定义状态最少** + +仅将对于工作流逻辑和决策至关重要的信息存储在自定义状态中。 + +**考虑状态持久性** + +如果您需要在多个对话会话中保留状态(例如,用于用户首选项、订单历史记录等),请使用代理内存节点将状态存储在持久数据库中。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**状态更新不一致** + +* **问题:** 在没有明确策略的情况下更新多个节点中的自定义状态可能会导致不一致和意外行为。 +* **示例** + 1. 代理 1 将 `orderStatus` 更新为“付款已确认”。 + 2. 代理 2 在不同的分支中将 `orderStatus` 更新为“订单完成”,而不检查之前的状态。 +* **解决方案:** 使用条件节点来控制自定义状态更新的流程,并确保自定义状态转换以逻辑且一致的方式发生。 +{% endtab %} +{% endtabs %} + +*** + +## 4.代理节点 + +代理节点是**顺序智能体架构的核心组件。**它在我们的工作流程中充当决策者和协调者。 + +
+ +### 了解代理节点 + +从前面的节点接收到输入(始终包括完整的对话历史记录 `state.messages` 和执行中该点的任何自定义状态)后,代理节点使用其定义的“角色”(由系统提示词建立)来确定是否需要外部工具来满足用户的请求。 + +* 如果需要工具,代理节点会自主选择并执行适当的工具。此执行可以是自动的,或者对于敏感任务,需要人工批准 (HITL) 才能继续。一旦工具完成其操作,代理节点就会接收结果,使用指定的聊天模型 (LLM) 对其进行处理,并生成全面的响应。 +* 在不需要工具的情况下,代理节点直接利用聊天模型 (LLM) 根据当前对话上下文制定响应。 + +### 输入 + +
必填描述
外部工具为代理节点提供 访问一套外部工具,使其能够执行操作并检索信息。
聊天模型添加新的聊天模型 覆盖默认的聊天模型 工作流程的 (LLM)。仅与能够调用函数的模型兼容。
启动节点是的收到 初始用户输入,以及自定义状态(如果已设置)和其余默认值 state.messages 从起始节点开始的数组。
条件节点是的从前面的条件节点接收输入,使代理节点能够 根据条件节点评估的结果采取行动或指导对话
条件代理节点是的从前面的条件代理节点接收输入,使代理节点能够 根据条件代理节点的评估结果采取行动或指导对话
代理节点是的从前面的代理节点接收输入, 启用链式代理操作 并维持对话情境
LLM 节点是的接收来自 LLM 节点的输出,使代理节点能够 处理 LLM 的响应
工具节点是的接收来自工具节点的输出,使代理节点能够 处理工具的输出并将其集成到其响应中
+ +{% hint style="info" %} +**代理节点至少需要来自以下节点的一个连接**:启动节点、代理节点、条件节点、条件代理节点、LLM 节点或工具节点。 +{% endhint %} + +### 输出 + +代理节点可以连接到以下节点作为输出: + +* **代理节点:** 将控制权传递给后续代理节点,从而实现工作流程中多个代理操作的链接。这允许更复杂的对话流程和任务编排。 +* **LLM 节点:** 将代理的输出传递到 LLM 节点,从而能够根据代理的操作和见解进行进一步的语言处理、响应生成或决策。 +* **条件代理节点:** 将流程定向到条件代理节点。该节点评估代理节点的输出及其预定义条件,以确定工作流程中适当的下一步。 +* **条件节点:** 与条件代理节点类似,条件节点使用预定义的条件来评估代理节点的输出,根据结果引导流程沿不同的分支流动。 +* **结束节点:** 结束对话流程。 +* **循环节点:** 将流程重定向回前一个节点,从而在工作流程中启用迭代或循环过程。这对于需要多个步骤或涉及基于先前交互来细化结果的任务非常有用。例如,您可以循环回到较早的代理节点或 LLM 节点,以收集其他信息或根据当前代理节点的输出优化对话流。 + +### 节点设置 + +
必填描述
代理名称是的为代理节点添加描述性名称,以增强工作流可读性并轻松 使用循环时将其重新定位 在工作流程内。
系统提示词定义 智能体的“角色”指导其行为。例如,“您是专门从事技术支持的客户服务代理 [...]。”
需要批准激活人机交互 (HITL) 功能。如果设置为 '真实,”代理节点在执行任何工具之前将请求人工批准。这对于敏感操作或需要人工监督时特别有价值。默认为 '错误,'允许代理节点自主执行工具。
+ +### 附加参数 + +
必填描述
人工提示词此提示词附加到 state.messages 数组作为人类消息。它使我们能够 将类似人类的消息注入对话流中 在代理节点处理其输入之后和下一个节点接收代理节点的输出之前。
批准提示词当 HITL 功能处于活动状态时,向人工审阅者呈现的可自定义提示词。此提示词提供有关工具执行的上下文,包括工具的名称和用途。变量 {tools} 提示词中的内容将动态替换为代理建议的实际工具列表,确保人工审核者拥有做出明智决定所需的所有信息。
批准按钮文本定制 批准工具执行按钮上显示的文本 在 HITL 界面中。这允许根据特定上下文定制语言并确保人工审阅者的清晰度。
拒绝按钮文本定制 按钮上显示的用于拒绝工具执行的文本 在 HITL 界面中。与“批准按钮文本”一样,此自定义功能增强了清晰度,并为审核人员认为工具执行不必要或可能有害时提供了明确的操作。
更新状态提供了一个 修改工作流程中共享的自定义状态对象的机制。这对于存储代理收集的信息或影响后续节点的行为非常有用。
最大迭代次数限制了 迭代次数 代理节点可以在单个工作流程中执行。
+ +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**清除系统提示词** + +制作简洁、明确的系统提示词,准确反映座席的角色和能力。这指导代理的决策并确保其在定义的范围内行动。 + +**战略工具选择** + +选择并配置代理节点可用的工具,确保它们符合代理的目的和工作流程的总体目标。 + +**HITL 适用于敏感任务** + +对于涉及敏感数据、需要人工判断或存在意外后果风险的任务,请使用“需要批准”选项。 + +**利用自定义状态更新** + +有策略地更新自定义 State 对象以存储收集的信息或影响下游节点的行为。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**由于工具过载,代理不采取行动** + +* **问题:** 当代理节点在单个工作流程执行中可以访问大量工具时,即使某个工具显然是必要的,它也可能很难决定哪个工具最适合使用。这可能会导致代理根本无法调用任何工具,从而导致响应不完整或不准确。 +* **示例:** 想象一个客户支持代理旨在处理各种查询。您已为其配备了用于订单跟踪、账单信息、产品退货、技术支持等的工具。用户询问:“我的订单状态如何?”但是,代理因潜在工具的数量而不知所措,只给出了一个笼统的答案,例如“我可以帮助您。您的订单号是多少?”无需实际使用订单跟踪工具。 +* **解决方案** + 1. **完善系统提示词:** 在代理节点的系统提示词中提供更清晰的说明和示例,以指导其正确选择工具。如果需要,请强调每个工具的具体功能以及应使用它们的情况。 + 2. **限制每个节点的工具选择:** 如果可能,将复杂的工作流程分解为更小、更易于管理的部分,每个部分都有一组更有针对性的工具。这可以帮助减少代理的认知负担并提高其工具选择的准确性。 + +**忽略敏感任务的 HITL** + +* **问题:** 对于涉及敏感信息、关键决策或具有潜在现实世界后果的行动的任务,未能利用代理节点的“需要批准”(HITL) 功能可能会导致意外结果或损害用户信任。 +* **示例:** 您的旅行预订代理可以访问用户的付款信息,并可以自动预订航班和酒店。如果没有 HITL,对用户意图的误解或客服人员的理解错误可能会导致错误预订或未经授权使用用户的付款详细信息。 +* **解决方案** + 1. **识别敏感操作:** 分析您的工作流程并识别涉及访问或处理敏感数据(例如付款信息、个人详细信息)的任何操作。 + 2. **实施“需要批准”:** 对于这些敏感操作,请在代理节点中启用“需要批准”选项。这确保了在访问任何敏感数据或采取任何不可逆转的操作之前,人员会审查代理建议的操作和相关上下文。 + 3. **设计清晰的审批提示词:** 为人工审核者提供清晰简洁的提示词,总结智能体的意图、建议的行动以及审核者做出明智决定所需的相关信息。 + +**系统提示词不清楚或不完整** + +* **问题:** 提供给代理节点的系统提示词缺乏必要的特异性和上下文来指导代理有效地执行其预期任务。模糊或过于笼统的提示词可能会导致不相关的响应、难以理解用户意图以及无法适当地利用工具或数据。 +* **示例:** 您正在构建一个旅行预订代理,您的系统提示词只是简单地指出“_您是一位有用的人工智能助手。_”这缺乏代理有效指导用户完成航班搜索、酒店预订和行程规划所需的具体说明和上下文。 +* **解决方案:** 制作详细且上下文感知的系统提示词: + +{% code overflow="wrap" %} +``` +You are a travel booking agent. Your primary goal is to assist users in planning and booking their trips. +- Guide them through searching for flights, finding accommodations, and exploring destinations. +- Be polite, patient, and offer travel recommendations based on their preferences. +- Utilize available tools to access flight data, hotel availability, and destination information. +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +*** + +## 5. LLM 节点 + +与代理节点一样,LLM 节点是 **顺序智能体架构的核心组件**。默认情况下,两个节点都使用相同的聊天模型 (LLM),提供相同的基本语言处理功能,但 LLM 节点在这些关键领域中脱颖而出。 + +
+ +### LLM 节点的主要优势 + +虽然LLM 节点和代理节点之间的详细比较可在[本节](./#agent-node-vs.-llm-node-selecting-the-optimal-node-for-conversational-tasks) 中找到,但这里简要概述了 **LLM 节点的主要优势**: + +* **结构化数据:** LLM 节点提供了专用功能来为其输出定义 JSON 模式。这使得从 LLM 的响应中提取结构化信息并将该数据传递到工作流中的后续节点变得异常容易。代理节点没有此内置 JSON 架构功能 +* **HITL:** 虽然两个节点都支持 HITL 进行工具执行,但 LLM 节点将此控制权推迟到工具节点本身,从而在工作流程设计中提供更大的灵活性。 + +### 输入 + +
必填描述
聊天模型添加新的聊天模型 覆盖默认的聊天模型 工作流程的 (LLM)。仅与能够调用函数的模型兼容。
启动节点是的收到 初始用户输入,以及自定义状态(如果已设置)和其余默认值 state.messages 从起始节点开始的数组。
代理节点是的接收来自代理节点的输出,其中可能包括工具执行结果或代理生成的响应。
条件节点是的从前面的条件节点接收输入,使 LLM 节点能够 根据条件节点评估的结果采取行动或指导对话
条件代理节点是的从前面的条件代理节点接收输入,使 LLM 节点能够 根据条件代理节点的评估结果采取行动或指导对话
LLM 节点是的接收来自另一个 LLM 节点的输出, 启用链式推理 或跨多个 LLM 节点的信息处理。
工具节点是的接收来自工具节点的输出, 提供工具执行的结果以供进一步处理 或响应生成。
+ +{% hint style="info" %} +**LLM 节点至少需要来自以下节点的一个连接**:启动节点、代理节点、条件节点、条件代理节点、LLM 节点或工具节点。 +{% endhint %} + +### **节点设置** + +
必填描述
LLM 节点名称是的向 LLM 节点添加描述性名称,以增强工作流可读性并轻松使用循环时将其重新定位 在工作流程内。
+ +### 输出 + +LLM 节点可以连接到以下节点作为输出: + +* **代理节点:** 将 LLM 的输出传递给代理节点,然后代理节点可以使用该信息来决定操作、执行工具或指导对话流。 +* **LLM 节点:** 将输出传递到后续 LLM 节点,从而启用多个 LLM 操作的链接。这对于完善文本生成、执行多重分析或将复杂的语言处理分解为多个阶段等任务非常有用。 +* **工具节点**:将输出传递到工具节点,从而能够根据 LLM 节点的指令执行特定工具。 +* **条件代理节点:** 将流程定向到条件代理节点。该节点评估 LLM 节点的输出及其预定义条件,以确定工作流中适当的下一步。 +* **条件节点:** 与条件代理节点类似,条件节点使用预定义的条件来评估 LLM 节点的输出,根据结果引导流沿不同的分支。 +* **结束节点:** 结束对话流程。 +* **循环节点:** 将流程重定向回前一个节点,从而在工作流程中启用迭代或循环过程。这可用于在多次迭代中优化 LLM 的输出。 + +### 附加参数 + +
必填描述
系统提示词定义 代理的“角色”并指导其行为。例如,“您是专门从事技术支持的客户服务代理 [...]。”
人工提示词此提示词附加到 state.messages 数组作为人类消息。它使我们能够 将类似人类的消息注入对话流中 在 LLM 节点处理其输入之后且在下一个节点接收 LLM 节点的输出之前。
JSON 结构化输出指示 LLM(聊天模型) 以 JSON 结构模式提供输出 (键、类型、枚举值、描述)。
更新状态提供了一个 修改工作流程中共享的自定义状态对象的机制。这对于存储 LLM 节点收集的信息或影响后续节点的行为非常有用。
+ +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**清除系统提示词** + +制作简洁且明确的系统提示词,准确反映 LLM 节点的角色和功能。这指导 LLM 节点的决策并确保其在其定义的范围内运行。 + +**优化结构化输出** + +让您的 JSON 架构尽可能简单,重点关注基本数据元素。仅当您需要从 LLM 的响应中提取特定数据点或下游节点需要 JSON 输入时,才启用 JSON 结构化输出。 + +**战略工具选择** + +选择并配置 LLM 节点可用的工具(通过工具节点),确保它们符合应用程序目的和工作流程的总体目标。 + +**HITL 适用于敏感任务** + +对于涉及敏感数据、需要人工判断或存在意外后果风险的任务,请使用“需要批准”选项。 + +**利用状态更新** + +有策略地更新自定义 State 对象以存储收集的信息或影响下游节点的行为。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**由于 HITL 设置不正确而导致工具意外执行** + +* **问题:** 虽然 LLM 节点可以触发工具节点,但它依赖于工具节点的配置来进行人机交互 (HITL) 批准。未能为敏感操作正确配置 HITL 可能会导致工具在未经人工审核的情况下执行,从而可能导致意外后果。 +* **示例:** 您的 LLM 节点旨在与更改用户数据的工具进行交互。您打算在执行之前让人工检查这些更改,但连接的工具节点的“需要批准”选项未启用。这可能会导致该工具仅根据 LLM 的输出自动修改用户数据,而无需任何人为监督。 +* **解决方案** + 1. **仔细检查工具节点设置:** 始终确保在处理敏感操作的任何工具节点的设置中启用“需要批准”选项。 + 2. **彻底测试 HITL:** 在部署工作流程之前,测试 HITL 流程,以确保按预期触发人工审核步骤,并且批准/拒绝机制正常运行。 + +**过度使用或误解 JSON 结构化输出** + +* **问题:** 虽然 LLM 节点的 JSON 结构化输出功能很强大,但误用它或不完全理解其含义可能会导致数据错误。 +* **示例:** 您为 LLM 节点的输出定义了复杂的 JSON 模式,即使下游任务仅需要简单的文本响应。这增加了不必要的复杂性,并使您的工作流程更难以理解和维护。此外,如果 LLM 的输出不符合定义的架构,则可能会导致后续节点出现错误。 +* **解决方案** + 1. **有策略地使用 JSON 输出:** 仅当您明确需要从 LLM 的响应中提取特定数据点或下游工具节点需要 JSON 输入时,才启用 JSON 结构化输出。 + 2. **保持架构简单:** 将 JSON 架构设计得尽可能简单明了,仅关注任务绝对必需的数据元素。 +{% endtab %} +{% endtabs %} + +*** + +## 6. 工具节点 + +工具节点是 Flowise 顺序智能体系统的重要组件,**支持在对话工作流程中集成和执行外部工具**。它充当 LLM 节点基于语言的处理与外部工具、API 或服务的专门功能之间的桥梁。 + +
+ +### 了解工具节点 + +工具节点的主要功能是根据从 LLM 节点接收的指令**执行外部工具**,并**为工具执行过程中的人机交互 (HITL)** 干预提供灵活性。 + +#### 这是其工作原理的分步说明 + +1. **工具调用接收:** 工具节点接收来自 LLM 节点的输入。如果 LLM 的输出包含 `tool_calls` 属性,则工具节点将继续执行工具。 +2. **执行:**工具节点直接将LLM的`tool_calls`(包括工具名称和任何所需参数)传递给指定的外部工具。否则,工具节点不会在该特定工作流程执行中执行任何工具。它不会以任何方式处理或解释 LLM 的输出。 +3. **人在环 (HITL):** 工具节点允许可选的 HITL,从而可以在工具执行发生之前进行人工审查和批准或拒绝。 +4. **输出传递:** 工具执行后(自动或在 HITL 批准后),工具节点接收工具的输出并将其传递到工作流中的下一个节点。如果工具节点的输出未连接到后续节点,则工具的输出将返回到原始 LLM 节点以进行进一步处理。 + +### 输入 + +
必填描述
LLM 节点是的接收来自 LLM 节点的输出,该节点可能包含也可能不包含 tool_calls 财产。如果存在,工具节点将使用它们来执行指定的工具。
外部工具为工具节点提供访问一套外部工具,使其能够执行操作并检索信息。
+ +### 节点设置 + +
必填描述
工具节点名称是的向工具节点添加描述性名称以增强工作流程的可读性。
需要批准 (HITL)激活人机交互 (HITL) 功能。如果设置为 '真实,”工具节点在执行任何工具之前将请求人工批准。这对于敏感操作或需要人工监督时特别有价值。默认为 '错误,'允许工具节点自主执行工具。
+ +### 输出 + +工具节点可以连接到以下节点作为输出: + +* **代理节点:** 将工具节点的输出(执行工具的结果)传递给代理节点。然后,代理节点可以使用此信息来决定操作、执行进一步的工具或指导对话流程。 +* **LLM 节点:** 将输出传递到后续 LLM 节点。这样可以将工具结果集成到 LLM 的处理中,从而可以根据工具的输出进一步分析或细化对话流。 +* **条件代理节点:** 将流程定向到条件工具节点。该节点评估工具节点的输出及其预定义条件,以确定工作流程中适当的下一步。 +* **条件节点:** 与条件代理节点类似,条件节点使用预定义的条件来评估工具节点的输出,根据结果引导流程沿不同的分支流动。 +* **结束节点:** 结束对话流程。 +* **循环节点:** 将流程重定向回前一个节点,从而在工作流程中启用迭代或循环过程。这可用于需要多个工具执行或涉及根据工具结果细化对话的任务。 + +### 附加参数 + +
必填描述
批准提示词当 HITL 功能处于活动状态时,向人工审阅者呈现的可自定义提示词。此提示词提供有关工具执行的上下文,包括工具的名称和用途。变量 {tools}提示词中的 将会动态替换为 LLM 节点建议的实际工具列表,确保人工审核者拥有做出明智决策所需的所有必要信息。
批准按钮文本定制 批准工具执行按钮上显示的文本 在 HITL 界面中。这允许根据特定上下文定制语言并确保人工审阅者的清晰度。
拒绝按钮文本定制 按钮上显示的用于拒绝工具执行的文本 在 HITL 界面中。与“批准按钮文本”一样,此自定义功能增强了清晰度,并为审核人员认为工具执行不必要或可能有害时提供了明确的操作。
更新状态提供了一个 修改工作流程中自定义状态对象的机制。这对于存储工具节点收集的信息(工具执行后)或影响后续节点的行为非常有用。
+ +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**战略性 HITL 布局** + +考虑哪些工具需要人工监督 (HITL) 并相应地启用“需要批准”选项。 + +**信息批准提示词** + +使用 HITL 时,为人工审阅者设计清晰且信息丰富的提示词。从对话中提供足够的上下文并总结该工具的预期操作。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**未处理的工具输出格式** + +* **问题:** 工具节点以工作流中后续节点不期望或不处理的格式输出数据,从而导致错误或不正确的处理。 +* **示例:** 工具节点以 JSON 格式从 API 检索数据,但以下 LLM 节点需要文本输入,从而导致解析错误。 +* **解决方案:** 确保外部工具的输出格式与连接到工具节点输出的节点的输入要求兼容。 +{% endtab %} +{% endtabs %} + +*** + +## 7. 条件节点 + +条件节点充当顺序智能体工作流程中的决策点,评估一组预定义条件以确定流程的下一个路径。 + +
+ +### 理解条件节点 + +条件节点对于构建适应不同情况和用户输入的工作流程至关重要。它检查对话的当前状态,其中包括交换的所有消息和先前定义的任何自定义状态变量。然后,根据对节点设置中指定的条件的评估,条件节点将流程引导至其输出之一。 + +例如,在代理或 LLM 节点提供响应后,条件节点可以检查响应是否包含特定关键字或自定义状态中是否满足特定条件。如果是,该流可能会被定向到代理节点以执行进一步操作。如果没有,它可能会导致不同的路径,可能会结束对话或提示词用户提出其他问题。 + +这使我们能够**在工作流程中创建分支**,其中所采取的路径取决于流经系统的数据。 + +#### 这是其工作原理的分步说明 + +1. 条件节点接收来自任何先前节点的输入:启动节点、代理节点、LLM 节点或工具节点。 +2. 它可以访问完整的对话历史记录和自定义状态(如果有),为其提供充足的上下文来使用。 +3. 我们定义节点将评估的条件。这可以是检查关键字、比较状态中的值,或者我们可以通过 JavaScript 实现的任何其他逻辑。 +4. 根据条件评估为 **true** 或 **false**,条件节点将流沿其预定义输出路径之一发送。这为我们的工作流程创建了一个“岔路口”或分支。 + +### 如何设置条件 + +条件节点允许我们通过选择 **基于表格的界面** 或 **JavaScript 代码编辑器** 来定义控制对话流的条件,从而在工作流程中定义动态分支逻辑。 + +
+ +
+ +使用 CODE 的条件 + +**条件节点使用 JavaScript** 来评估对话流中的特定条件。 + +我们可以根据关键字、状态变化或其他因素设置条件,以根据对话的上下文动态地将工作流引导到不同的分支。以下是一些示例: + +**关键字条件** + +这会检查对话历史记录中是否存在特定单词或短语。 + +* **示例:** 我们想要检查用户在上一条消息中是否说“是”。 + +{% code overflow="wrap" %} +```javascript +const lastMessage = $flow.state.messages[$flow.state.messages.length - 1].content; +return lastMessage.includes("yes") ? "Output 1" : "Output 2"; +``` +{% endcode %} + +1. 此代码从 state.messages 获取最后一条消息并检查它是否包含“yes”。 +2. 如果发现“是”,则流程转到“输出1”;否则,转到“输出 2”。 + +**状态改变条件** + +这会检查自定义状态中的特定值是否已更改为所需值。 + +* **示例:** 我们正在跟踪自定义状态的 orderStatus 变量,并且我们想要检查它是否已变为“已确认”。 + +{% code overflow="wrap" %} +```javascript +return $flow.state.orderStatus === "confirmed" ? "Output 1" : "Output 2"; +``` +{% endcode %} + +1.这段代码直接将我们自定义State中的orderStatus值与“confirmed”进行比较。 +2. 如果匹配,则流程转到“输出1”;否则,转到“输出 2”。 + +
+ +
+ +使用 TABLE 的条件 + +条件节点允许我们使用**用户友好的表格界面**定义条件,从而无需编写 JavaScript 代码即可轻松创建动态工作流程。 + +您可以根据关键字、状态变化或其他因素设置条件,以引导对话流沿着不同的分支流动。以下是一些示例: + +**关键字条件** + +这会检查对话历史记录中是否存在特定单词或短语。 + +* **示例:** 我们想要检查用户在上一条消息中是否说“是”。 +* **设置** + +
变量操作价值输出名称
$flow.state.messages[-1].content是的输出1
+ + 1. 该表条目检查 `state.messages` 中最后一条消息 (\[-1]) 的内容 (.content) 是否等于“Yes”。 + 2. 如果满足条件,则流程转至“输出 1”。否则,工作流将定向到默认的“结束”输出。 + +**状态改变条件** + +这会检查我们的自定义状态中的特定值是否已更改为所需的值。 + +* **示例:** 我们正在自定义状态中跟踪 orderStatus 变量,并且我们想要检查它是否已变为“已确认”。 +* **设置** + +
变量操作价值输出名称
$flow.state.orderStatus已确认输出1
+ + 1. 该表项检查自定义 State 中 orderStatus 的值是否等于“已确认”。 + 2. 如果满足条件,则流程转至“输出 1”。否则,工作流将定向到默认的“结束”输出。 + +
+ +### 使用表接口定义条件 + +这种可视化方法使您可以根据用户输入、对话的当前状态或其他节点采取的操作结果等因素轻松设置规则来确定对话流的路径。 + +
+ +基于表:条件节点 + +* **更新于 09/08/2024** + +
描述选项/语法
变量要在条件中评估的变量或数据元素。- $flow.state.messages.length (留言总数)
- $flow.state.messages[0].con (第一条留言内容)
- $flow.state.messages[-1].con (最后留言内容)
- $vars.<variable-name> (全局变量)
操作对变量执行的比较或逻辑运算。- 包含
- 不包含
- 开始于
- 结束于
- 是
- 不是
- 为空
- 不为空
- 大于
- 小于
- 等于
- 不等于
- 大于或等于
- 小于或等于
价值与变量进行比较的值。- 取决于变量的数据类型和所选操作。
- 示例:“是”、10、“你好”
输出名称如果条件评估为,则遵循的输出路径的名称 true- 用户定义的名称(例如“Agent1”、“End”、“Loop”)
+ +
+ +### 输入 + +
必填描述
启动节点是的从起始节点接收状态。这允许条件节点 根据对话的初始上下文评估条件,包括任何自定义状态。
代理节点是的接收代理节点的输出。这使得条件节点能够 根据智能体的行动做出决定 以及对话历史记录,包括任何自定义状态。
LLM 节点是的接收 LLM 节点的输出。这允许条件节点 根据 LLM 的响应评估条件 以及对话历史记录,包括任何自定义状态。
工具节点是的接收工具节点的输出。这使得条件节点能够 根据工具执行的结果做出决策 以及对话历史记录,包括任何自定义状态。
+ +{% hint style="info" %} +**条件节点至少需要来自以下节点的一个连接**:启动节点、代理节点、LLM 节点或工具节点。 +{% endhint %} + +### 输出 + +条件节点**使用基于表的界面或 JavaScript 根据预定义条件**动态确定其输出路径。这为根据条件评估指导工作流程提供了灵活性。 + +#### 条件评估逻辑 + +* **基于表的条件:** 表中的条件按从上到下的顺序进行评估。第一个值为 true 的条件会触发其相应的输出。如果没有满足任何预定义条件,工作流将定向到默认的“结束”输出。 +* **基于代码的条件:** 使用 JavaScript 时,我们必须显式返回所需输出路径的名称,包括默认“End”输出的名称。 +* **单一输出路径:** 一次仅激活一个输出路径。即使多个条件可能为真,也只有第一个匹配条件决定流程。 + +#### 连接输出 + +每个预定义的输出(包括默认的“End”输出)都可以连接到以下任何节点: + +* **代理节点:** 继续与代理进行对话,可能根据条件的结果采取行动。 +* **LLM 节点:** 使用 LLM 处理当前状态和对话历史记录,生成响应或做出进一步决策。 +* **结束节点:** 终止对话流。如果任何输出(包括默认的“结束”输出)连接到结束节点,则条件节点将输出前一个节点的最后响应并结束工作流。 +* **循环节点:** 将流程重定向回先前的顺序节点,从而根据条件的结果启用迭代过程。 + +### 节点设置 + +
必填描述
条件节点名称可选的, 人类可读的名称 对于正在评估的条件。这有助于一目了然地了解工作流程。
条件是的这就是我们 定义将被评估以确定输出路径的逻辑
+ +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**清晰的条件命名** + +对您的条件使用描述性名称(例如,“如果用户未满 18 岁,则使用策略顾问代理”、“如果订单已确认,则使用终端节点”),以使您的工作流程更易于理解和调试。 + +**优先考虑简单条件** + +从简单的条件开始,然后根据需要逐渐增加复杂性。这使您的工作流程更易于管理并降低错误风险。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**条件逻辑和工作流程设计不匹配** + +* **问题:** 您在条件节点中定义的条件不能准确反映工作流程的预期逻辑,导致意外分支或不正确的执行路径。 +* **示例:** 您设置了一个条件来检查用户的年龄是否大于 18 岁,但该条件的输出路径指向为 18 岁以下用户设计的部分。 +* **解决方案:** 检查您的条件并确保与每个条件关联的输出路径与预期的工作流逻辑匹配。为输出使用清晰且具有描述性的名称以避免混淆。 + +**状态管理不足** + +* **问题:** 条件节点依赖于未正确更新的自定义状态变量,导致条件评估不准确和分支不正确。 +* **示例:** 您正在自定义状态中跟踪“userLocation”变量,但当用户提供其位置时该变量不会更新。条件节点根据过时的值评估条件,导致路径不正确。 +* **解决方案:** 确保在整个工作流程中正确更新条件中使用的任何自定义状态变量。 +{% endtab %} +{% endtabs %} + +*** + +## 8.条件代理节点 + +条件代理节点在顺序智能体流程中提供**动态和智能路由**。它结合了 **LLM 节点**(LLM 和 JSON 结构化输出)和 **条件节点**(用户定义条件)的功能,使我们能够在单个节点内利用基于代理的推理和条件逻辑。 + +
+ +### 关键功能 + +* **基于代理的统一路由:** 将代理推理、结构化输出和条件逻辑结合在单个节点中,简化工作流设计。 +* **上下文感知:** 代理在评估条件时会考虑整个对话历史记录和任何自定义状态。 +* **灵活性:** 提供基于表格和基于代码的选项来定义条件,以满足不同的用户偏好和技能水平。 + +### 设置条件代理节点 + +条件代理节点充当专用代理,可以**处理信息并做出路由决策**。配置方法如下: + +1. **定义智能体的角色** + * 在“系统提示词”字段中,提供对代理角色及其需要为条件路由执行的任务的清晰简洁的描述。该提示词将指导座席对对话及其决策过程的理解。 +2. **构建代理的输出(可选)** + * 如果您希望代理生成结构化输出,请使用“JSON 结构化输出”功能。定义所需的输出架构,指定键、数据类型和任何枚举值。代理在评估条件时将使用此结构化输出。 +3. **定义条件** + * 选择基于表的界面或 JavaScript 代码编辑器来定义决定路由行为的条件。 + * **基于表的接口:** 将行添加到表中,指定要检查的变量、比较操作、要比较的值以及满足条件时要遵循的输出名称。 + * **JavaScript 代码:** 编写自定义 JavaScript 片段来评估条件。使用 `return` 语句根据条件结果指定要遵循的输出路径的名称。 +4. **连接输出** + * 将每个预定义的输出(包括默认的“结束”输出)连接到工作流中相应的后续节点。这可以是代理节点、LLM 节点、循环节点或终端节点。 + +### 如何设置条件 + +条件代理节点允许我们在工作流程中定义动态分支逻辑,方法是选择 **基于表格的界面** 或 **JavaScript 代码编辑器** 来定义控制对话流的条件。 + +
+ +
+ +使用 CODE 的条件 + +条件代理节点与条件节点一样,**使用 JavaScript 代码来评估对话流中的特定条件**。 + +但是,条件代理节点可以根据更广泛的因素评估条件,包括关键字、状态变化及其自身输出的内容(作为自由格式文本或结构化 JSON 数据)。这允许做出更细致和上下文感知的路由决策。以下是一些示例: + +**关键字条件** + +这会检查对话历史记录中是否存在特定单词或短语。 + +* **示例:** 我们想要检查用户在上一条消息中是否说“是”。 + +{% code overflow="wrap" %} +```javascript +const lastMessage = $flow.state.messages[$flow.state.messages.length - 1].content; +return lastMessage.includes("yes") ? "Output 1" : "Output 2"; +``` +{% endcode %} + +1. 此代码从 state.messages 获取最后一条消息并检查它是否包含“yes”。 +2. 如果发现“是”,则流程转到“输出1”;否则,转到“输出 2”。 + +**状态改变条件** + +这会检查自定义状态中的特定值是否已更改为所需值。 + +* **示例:** 我们正在跟踪自定义状态的 orderStatus 变量,并且我们想要检查它是否已变为“已确认”。 + +{% code overflow="wrap" %} +```javascript +return $flow.state.orderStatus === "confirmed" ? "Output 1" : "Output 2"; +``` +{% endcode %} + +1.这段代码直接将我们自定义State中的orderStatus值与“confirmed”进行比较。 +2. 如果匹配,则流程转到“输出1”;否则,转到“输出 2”。 + +
+ +
+ +使用 TABLE 的条件 + +条件代理节点还提供了一个**用户友好的表格界面来定义条件**,与条件节点类似。您可以根据关键字、状态更改或代理自己的输出设置条件,从而无需编写 JavaScript 代码即可创建动态工作流程。 + +这种基于表格的方法简化了条件管理,并且更容易可视化分支逻辑。以下是一些示例: + +**关键字条件** + +这会检查对话历史记录中是否存在特定单词或短语。 + +* **示例:** 我们想要检查用户在上一条消息中是否说“是”。 +* **设置** + +
变量操作价值输出名称
$flow.state.messages[-1].content是的输出1
+ + 1. 该表条目检查 `state.messages` 中最后一条消息 (\[-1]) 的内容 (.content) 是否等于“Yes”。 + 2. 如果满足条件,则流程转至“输出 1”。否则,工作流将定向到默认的“结束”输出。 + +**状态改变条件** + +这会检查我们的自定义状态中的特定值是否已更改为所需的值。 + +* **示例:** 我们正在自定义状态中跟踪 orderStatus 变量,并且我们想要检查它是否已变为“已确认”。 +* **设置** + +
变量操作价值输出名称
$flow.state.orderStatus已确认输出1
+ + 1. 该表项检查自定义 State 中 orderStatus 的值是否等于“已确认”。 + 2. 如果满足条件,则流程转至“输出 1”。否则,工作流将定向到默认的“结束”输出。 + +
+ +### 使用表接口定义条件 + +这种可视化方法使您可以根据用户输入、对话的当前状态或其他节点采取的操作结果等因素轻松设置规则来确定对话流的路径。 + +
+ +基于表:条件代理节点 + +* **更新于 09/08/2024** + +
描述选项/语法
变量要在条件中评估的变量或数据元素。这可以包括来自代理输出的数据。- $flow.output.content (代理输出 - 字符串)
- $flow.output.<replace-with-key> (代理的 JSON 键输出 - 字符串/数字)
- $flow.state.messages.length (留言总数)
- $flow.state.messages[0].con (第一条留言内容)
- $flow.state.messages[-1].con (最后留言内容)
- $vars.<variable-name> (全局变量)
操作对变量执行的比较或逻辑运算。- 包含
- 不包含
- 开始于
- 结束于
- 是
- 不是
- 为空
- 不为空
- 大于
- 小于
- 等于
- 不等于
- 大于或等于
- 小于或等于
价值与变量进行比较的值。- 取决于变量的数据类型和所选操作。
- 示例:“是”、10、“你好”
输出名称如果条件评估为,则遵循的输出路径的名称 true- 用户定义的名称(例如“Agent1”、“End”、“Loop”)
+ +
+ +### 输入 + +
必填描述
启动节点是的从起始节点接收状态。这允许条件代理节点 根据初始上下文评估条件 对话的内容,包括任何自定义状态。
代理节点是的接收代理节点的输出。这使得条件代理节点能够 根据智能体的行动做出决定 以及对话历史记录,包括任何自定义状态。
LLM 节点是的接收 LLM 节点的输出。这允许条件代理节点 根据 LLM 的响应评估条件 以及对话历史记录,包括任何自定义状态。
工具节点是的接收工具节点的输出。这使得条件代理节点能够根据工具执行的结果做出决策 以及对话历史记录,包括任何自定义状态。
+ +{% hint style="info" %} +**条件代理节点至少需要来自以下节点的一个连接**:启动节点、代理节点、LLM 节点或工具节点。 +{% endhint %} + +### 节点设置 + +
参数必填描述
名称向条件代理节点添加描述性名称,以增强工作流程的可读性和轻松性。
条件是的这就是我们 定义将被评估以确定输出路径的逻辑
+ +### 输出 + +条件代理节点与条件节点一样,**使用基于表的界面或 JavaScript 根据定义的条件**动态确定其输出路径。这为根据条件评估指导工作流程提供了灵活性。 + +#### 条件评估逻辑 + +* **基于表的条件:** 表中的条件按从上到下的顺序进行评估。第一个值为 true 的条件会触发其相应的输出。如果没有满足任何预定义条件,工作流将定向到默认的“结束”输出。 +* **基于代码的条件:** 使用 JavaScript 时,我们必须显式返回所需输出路径的名称,包括默认“End”输出的名称。 +* **单一输出路径:** 一次仅激活一个输出路径。即使多个条件可能为真,也只有第一个匹配条件决定流程。 + +#### 连接输出 + +每个预定义的输出(包括默认的“End”输出)都可以连接到以下任何节点: + +* **代理节点:** 继续与代理进行对话,可能根据条件的结果采取行动。 +* **LLM 节点:** 使用 LLM 处理当前状态和对话历史记录,生成响应或做出进一步决策。 +* **结束节点:** 终止对话流。如果默认的“结束”输出连接到结束节点,则条件节点将输出前一个节点的最后一个响应并结束对话。 +* **循环节点:** 将流程重定向回先前的顺序节点,从而根据条件的结果启用迭代过程。 + +#### 与条件节点的主要区别 + +* 条件**代理节点将代理的推理**和结构化输出合并到条件评估过程中。 +* 它为基于代理的条件路由提供了一种更加集成的方法。 + +### 附加参数 + +
必填描述
系统提示词定义条件代理的“角色”并指导其做出路由决策的行为。 例如:“您是专门从事技术支持的客户服务代理。您的目标是帮助客户解决与我们产品相关的技术问题。根据用户的查询,确定具体的技术问题(例如,连接问题、软件错误、硬件故障)。”
人工提示词此提示词附加到 state.messages 数组作为人类消息。它使我们能够 将类似人类的消息注入对话流中 在条件代理节点处理完其输入之后且在下一个节点接收条件代理节点的输出之前。
JSON 结构化输出指示条件代理节点以 JSON 结构模式提供输出 (键、类型、枚举值、描述)。
+ +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**制作清晰且重点突出的系统提示词** + +在系统提示词中向客服人员提供明确的角色和清晰的指示。这将指导其推理并帮助其生成条件逻辑的相关输出。 + +**可靠条件下的结构输出** + +使用 JSON 结构化输出功能定义条件代理输出的架构。这将确保输出一致且易于解析,使其在条件评估中使用更加可靠。 +{% endtab %} + +{% tab title="Potential Pitfalls" %} +**由于非结构化输出导致路由不可靠** + +* **问题:** 条件代理节点未配置为输出结构化 JSON 数据,导致不可预测的输出格式,从而难以定义可靠的条件。 +* **示例:** 条件代理节点被要求确定用户情绪(积极、消极、中立),但将其评估输出为自由格式的文本字符串。代理语言的可变性使得在条件表或代码中创建准确的条件变得具有挑战性。 +* **解决方案:** 使用 JSON 结构化输出功能来定义代理输出的架构。例如,使用枚举“积极”、“消极”和“中性”指定“情绪”键。这将确保代理的输出结构一致,从而更容易创建可靠的条件。 +{% endtab %} +{% endtabs %} + +*** + +## 9. 循环节点 + +循环节点允许我们在对话流中创建循环,**将对话重定向回特定点**。这对于我们需要根据用户输入或特定条件重复特定序列的操作或问题的场景非常有用。 + +
+ +### 了解循环节点 + +循环节点充当连接器,将流程重定向回图中的特定点,从而允许我们在对话流程中创建循环。 **它将当前状态传递给我们的目标节点,其中包括循环节点之前的节点的输出。**此数据传输允许我们的目标节点处理来自循环的上一次迭代的信息并相应地调整其行为。 + +例如,假设我们正在构建一个帮助用户预订航班的聊天机器人。我们可以使用循环根据用户反馈迭代地细化搜索条件。 + +#### 这是循环节点的使用方法 + +1. **LLM 节点(初始搜索):** LLM 节点接收用户的初始航班请求(例如,“查找 7 月从马德里飞往纽约的航班”)。它查询航班搜索 API 并返回可能的航班列表。 +2. **代理节点(当前选项):** 代理节点向用户呈现航班选项,并询问他们是否想要优化搜索(例如,“您想要按价格、航空公司或出发时间进行过滤吗?”)。 +3. **条件代理节点:** 条件代理节点检查用户的响应并有两个输出: + * **如果用户想要细化:** 流程转到“细化搜索”LLM 节点。 + * **如果用户对结果感到满意:** 流程将继续进行预订流程。 +4. **LLM 节点(细化搜索):** 此 LLM 节点收集用户的细化标准(例如,“仅显示低于 500 美元的航班”)并使用新的搜索参数更新状态。 +5. **循环节点:** 循环节点将流重定向回初始 LLM 节点(“初始搜索”)。它传递了更新后的状态,其中现在包含精炼的搜索条件。 +6. **迭代:** 初始 LLM 节点使用细化标准执行新搜索,并从步骤 2 开始重复该过程。 + +**在此示例中,循环节点启用迭代搜索细化过程。**系统可以继续循环并细化搜索结果,直到用户对所呈现的选项感到满意。 + +### 输入 + +
必填描述
代理节点是的接收前一个代理节点的输出。然后,该数据被发送回“循环到”参数中指定的目标节点。
LLM 节点是的接收前一个 LLM 节点的输出。然后,该数据被发送回“循环到”参数中指定的目标节点。
工具节点是的接收前一个工具节点的输出。然后,该数据被发送回“循环到”参数中指定的目标节点。
条件节点是的接收前一个条件节点的输出。然后,该数据被发送回“循环到”参数中指定的目标节点。
条件代理节点是的接收前一个条件代理节点的输出。然后,该数据被发送回“循环到”参数中指定的目标节点。
+ +{% hint style="info" %} +**循环节点至少需要来自以下节点的一个连接**:代理节点、LLM 节点、工具节点、条件节点或条件代理节点。 +{% endhint %} + +### 节点设置 + +
必填描述
循环至是的循环节点要求我们 指定目标节点 (“循环到”)对话流应重定向到的位置。该目标节点必须是代理节点LLM 节点
+ +### 输出 + +**循环节点没有任何直接输出连接**。它将流程重定向回图中的特定顺序节点。 + +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**明确循环目的** + +为工作流程中的每个循环定义明确的目的。如果可能的话,用便签记录您想要通过循环实现的目标。 +{% endtab %} + +{% tab title="Potencial Pitfalls" %} +**令人困惑的工作流程结构** + +* **问题:** 过多或设计不当的循环使工作流程难以理解和维护。 +* **示例:** 您使用多个嵌套循环,没有明确的目的或标签,使得很难遵循对话的流程。 +* **解决方案:** 谨慎使用循环,仅在必要时使用。清楚地记录您的循环节点及其连接的节点。 + +**由于缺少或不正确的退出条件而导致无限循环** + +* **问题:** 循环永远不会终止,因为触发循环退出的条件缺失或定义不正确。 +* **示例:** 循环节点用于迭代收集用户信息。但是,工作流缺少条件代理节点来检查是否已收集所有必需的信息。结果,循环无限期地继续,反复询问用户相同的信息。 +* **解决方案:** 始终为循环定义清晰且准确的退出条件。使用条件节点检查状态变量、用户输入或指示循环何时应终止的其他因素。 +{% endtab %} +{% endtabs %} + +*** + +## 10. 结束节点 + +结束节点标志着顺序智能体工作流程中最终的**对话终止点**。它表示不需要进一步的处理、操作或交互。 + +
+ +### 了解终端节点 + +终端节点充当 Flowise 顺序智能体架构中的信号,**表明对话已达到预期结论**。到达最终节点后,系统“理解”会话目标已得到满足,并且流程中不需要进一步的操作或交互。 + +### 输入 + +
必填描述
代理节点是的接收来自前一个代理节点的最终输出,指示代理处理的结束。
LLM 节点是的接收来自前一个 LLM 节点的最终输出,指示 LLM 节点处理的结束。
工具节点是的接收前一个工具节点的最终输出,指示工具节点执行的完成。
条件节点是的接收前一个条件节点的最终输出,指示条件节点执行的结束。
条件代理节点是的接收来自前一个条件节点的最终输出,指示条件代理节点的处理完成。
+ +{% hint style="info" %} +**端节点至少需要来自以下节点的一个连接**:代理节点、LLM 节点或工具节点。 +{% endhint %} + +### 输出 + +**结束节点没有任何输出**连接,因为它表示信息流的终止。 + +### 最佳实践 + +{% tabs %} +{% tab title="Pro Tips" %} +**提供最终答复** + +如果合适,将终端节点连接到专用 LLM 或代理节点,为用户生成最终消息或摘要,从而结束对话。 +{% endtab %} + +{% tab title="Potencial Pitfalls" %} +**提前终止对话** + +* **问题:** 结束节点在工作流程中放置得太早,导致对话在完成所有必要步骤或完全解决用户请求之前结束。 +* **示例:** 旨在收集用户反馈的聊天机器人会在用户提供第一条评论后结束对话,而不给他们提供其他反馈或提出问题的机会。 +* **解决方案:** 检查您的工作流程逻辑,并确保仅在完成所有必要步骤或用户明确表明其结束对话的意图后才放置结束节点。 + +**用户缺乏封闭性** + +* **问题:** 对话突然结束,没有向用户发出明确的信号,也没有提供结束感的最终消息。 +* **示例:** 客户支持聊天机器人在解决问题后立即结束对话,而不与用户确认解决方案或提供进一步的帮助。 +* **解决方案:** 将终端节点连接到专用 LLM 或代理节点,以生成最终响应,总结对话、确认所采取的任何操作,并为用户提供一种结束感。 +{% endtab %} +{% endtabs %} + +*** + +## 条件节点与条件代理节点 + +条件和条件代理节点在 Flowise 的顺序智能体架构中对于创建动态对话体验至关重要。 + +这些节点支持自适应工作流程,响应用户输入、上下文和复杂决策,但其条件评估和复杂程度的方法有所不同。 + +
+ +条件节点 + +**目的** + +根据简单的预定义逻辑条件创建分支。 + +**状况评估** + +使用基于表格的界面或 JavaScript 代码编辑器来定义根据自定义状态和/或完整对话历史记录进行检查的条件。 + +**输出行为** + +* 支持多个输出路径,每个路径与特定条件相关联。 +* 条件按顺序评估。第一个匹配条件决定输出。 +* 如果不满足任何条件,流程将遵循默认的“结束”输出。 + +**最适合** + +* 基于易于定义的条件的直接路由决策。 +* 可以使用简单比较、关键字检查或自定义状态变量值来表达逻辑的工作流程。 + +
+ +
+ +条件代理节点 + +**目的** + +根据代理对对话及其结构化输出的分析来创建动态路由。 + +**状况评估** + +* 如果没有连接聊天模型,它将使用默认系统 LLM (来自起始节点)来处理对话历史记录和任何自定义状态。 +* 它可以生成结构化输出,然后用于条件评估。 +* 使用基于表格的界面或 JavaScript 代码编辑器来定义根据代理自己的输出(结构化或非结构化)进行检查的条件。 + +**输出行为** + +与条件节点相同: + +* 支持多个输出路径,每个路径与特定条件相关联。 +* 条件按顺序评估。第一个匹配条件决定输出。 +* 如果不满足任何条件,则流程遵循默认的“End”输出。 + +**最适合** + +* 更复杂的路由决策,需要了解对话上下文、用户意图或细微差别的因素。 +* 简单的逻辑条件不足以捕获所需的路由逻辑的场景。 +* **示例:** 聊天机器人需要确定用户的问题是否与特定产品类别相关。条件代理节点可用于分析用户的查询并输出带有“类别”字段的 JSON 对象。然后,条件代理节点可以使用此结构化输出将用户路由到适当的产品专家。 + +
+ +### 总结 + +
条件节点条件代理节点
决策逻辑基于预定义的逻辑条件。基于代理的推理和结构化输出。
代理参与没有智能体参与状况评估。使用代理处理上下文并生成条件输出。
结构化输出不可能。可能并鼓励进行可靠的状况评估。
状态评估仅定义根据完整对话历史记录检查的条件。可以定义根据代理自己的输出(结构化或非结构化)进行检查的条件。
复杂性适合简单的分支逻辑。处理更细致和上下文感知的路由。
理想的用例
  • 根据用户的年龄或对话中的关键字进行路由。
  • 基于用户情绪、意图或复杂上下文因素的路由。
+ +### 选择正确的节点 + +* **条件节点:** 当您的路由逻辑涉及基于易于定义的条件的简单决策时,请使用条件节点。例如,它非常适合检查特定关键字、比较 State 中的值或评估其他简单的逻辑表达式。 +* **条件代理节点:** 但是,当您的路由需要更深入地了解对话的细微差别时,条件代理节点是更好的选择。该节点充当您的智能路由助手,利用 LLM 来分析对话,根据上下文做出判断,并提供结构化输出来驱动更复杂和动态的路由。 + +*** + +## 代理节点与 LLM 节点 + +重要的是要了解 **LLM 节点和代理节点都可以被视为我们系统中的代理实体**,因为它们都利用大型语言模型 (LLM) 或聊天模型的功能。 + +然而,虽然两个节点都可以处理语言并与工具交互,但它们是为工作流程中的不同目的而设计的。 + +
+ +代理节点 + +**焦点** + +代理节点的主要焦点是在对话上下文中模拟人类代理的操作和决策。 + +它充当工作流程中的高级协调员,将语言理解、工具执行和决策结合在一起,以创建更加人性化的对话体验。 + +**优势** + +* 有效管理多个工具的执行并整合其结果。 +* 为人机交互 (HITL) 提供内置支持,从而实现敏感操作的人工审核和批准。 + +**最适合** + +* 代理需要指导用户、收集信息、做出选择和管理整个对话流程的工作流程。 +* 需要与多种外部工具集成的场景。 +* 涉及敏感数据或人类监督有益的行动的任务,例如批准金融交易 + +
+ +
+ +LLM 节点 + +**焦点** + +与代理节点类似,但它在通过工具节点使用工具和人机交互 (HITL) 时提供了更大的灵活性。 + +**优势** + +* 启用 JSON 模式的定义来构造 LLM 的输出,从而更容易提取特定信息。 +* 提供工具集成的灵活性,允许更复杂的 LLM 和工具调用序列,并提供对 HITL 功能的细粒度控制。 + +**最适合** + +* 需要从 LLM 的响应中提取结构化数据的场景。 +* 需要混合使用自动化和人工审核工具执行的工作流程。例如,LLM 节点可能调用一个工具来检索产品信息(自动),然后调用另一个工具来处理付款,这需要 HITL 批准。 + +
+ +### 总结 + +
代理节点LLM 节点
工具交互直接调用和管理多个工具,内置HITL。通过工具节点触发工具,在工具级别进行精细的 HITL 控制。
人机交互 (HITL)HITL 在代理节点级别控制(所有连接的工具均受影响)。HITL 在单个工具节点级别进行管理(更灵活)。
结构化输出依赖于 LLM 的自然输出格式。依赖于 LLM 的自然输出格式,但如果需要,提供 JSON 架构定义来构造 LLM 输出。
理想的用例
  • 具有复杂工具编排的工作流程。
  • 在代理级别简化了 HITL。
  • 从 LLM 输出中提取结构化数据
  • 具有复杂 LLM 和工具交互的工作流程,需要混合 HITL 级别。
+ +### 选择正确的节点 + +* **选择代理节点:** 当您需要创建一个可以管理多个工具执行的对话系统时,请使用代理节点,所有工具共享相同的 HITL 设置(对整个代理节点启用或禁用)。代理节点还非常适合处理需要一致的类似代理行为的复杂多步骤对话。 +* **选择 LLM 节点:** 另一方面,当您需要使用 JSON 架构功能(代理节点中不提供此功能)从 LLM 的输出中提取结构化数据时,请使用 LLM 节点。 LLM 节点还擅长在单个工具级别对 HITL 进行细粒度控制来编排工具执行,允许您通过使用连接到 LLM 节点的多个工具节点来混合自动和人工审核的工具执行。 + +[^1]: In our current context, a lower level of abstraction refers to a system that exposes a greater degree of implementation detail to the developer. diff --git a/cn/using-flowise/agentflowv1/sequential-agents/video-tutorials.md b/cn/using-flowise/agentflowv1/sequential-agents/video-tutorials.md new file mode 100644 index 00000000..849678ca --- /dev/null +++ b/cn/using-flowise/agentflowv1/sequential-agents/video-tutorials.md @@ -0,0 +1,35 @@ +--- +description: 从社区学习顺序智能体 +--- + +# 视频教程 + +### 构建多阶段 RAG 代理 + +在本视频中,[Leon](https://youtube.com/@leonvanzyl) 提供了有关创建包含路由、回退和自我纠正技术的高级 RAG 代理的分步教程。 + +{% embed url="https://youtu.be/OejuvdyN_U8" %} + +### 掌握顺序智能体:使用 Flowise 构建复杂的 AI 应用程序 + +在本视频中,[Leon](https://youtube.com/@leonvanzyl) 提供了 **对顺序智能体** 架构的全面介绍,并演示了如何管理自定义状态以构建更加动态的应用程序。 + +{% embed url="https://www.youtube.com/watch?v=6LbvgTbS0BE" %} + +### 顺序与多智能体:哪种 Flowise 功能适合您? + +在此视频中,[Leon](https://youtube.com/@leonvanzyl) 介绍了 Flowise 中用于创建多智能体项目的两种不同解决方案。他通过使用两种技术重新创建相同的项目来比较顺序智能体和多智能体之间的差异**。 + +{% embed url="https://www.youtube.com/watch?v=3ZmBq8_4vCs" %} + +### 在几分钟内构建生产就绪的应用程序:**Flowise 的 Sequential** 代理和 n8n + +在此视频中,[Wntrmute AI](https://www.youtube.com/@WntrmuteAI) 演示了如何通过结合 **Flowise 的 Sequential Agents** 和 **n8n** 在 30 分钟内快速构建 **生产就绪的应用程序**。 + +{% embed url="https://www.youtube.com/watch?v=DA_0eOTYnmc" %} + +### 如何使用 Agentic RAG 和 Flowise 构建自我改进的 AI + +在本视频中,[Leon](https://youtube.com/@leonvanzyl) 将向您展示如何使用 FlowiseAI 的顺序智能体构建自我纠正的 RAG 应用程序。 Agentic RAG 是创建 AI 解决方案的强大方法,可以随着时间的推移学习和改进其响应。 + +{% embed url="https://www.youtube.com/watch?v=SL77Ojbgy6U" %} diff --git a/cn/using-flowise/agentflowv2.md b/cn/using-flowise/agentflowv2.md new file mode 100644 index 00000000..24bc281b --- /dev/null +++ b/cn/using-flowise/agentflowv2.md @@ -0,0 +1,395 @@ +--- +description: 了解如何使用 智能体流程 V2 构建多智能体系统,作者:@toi500 +--- + +# 智能体流程 V2 + +本指南探讨了 AgentFlow V2 架构,详细介绍了其核心概念、用例、流程状态和综合节点参考。 + +{% hint style="warning" %} +**免责声明:** 本文档描述了当前官方版本的 AgentFlow V2。特性、功能和节点参数可能会在 Flowise 的未来更新和版本中发生变化。请参阅最新的官方发行说明或应用内信息以获取最新详细信息。 +{% endhint %} + +{% embed url="https://youtu.be/-h4WQuzRHhI?si=jKkhueFIw06aO6Ge" %} + +## 核心理念 + +AgentFlow V2 代表了重大的架构演变,在 Flowise 中引入了新的范例,重点关注显式工作流程编排和增强的灵活性。与 V1 主要依赖外部框架来实现其核心代理图逻辑不同,V2 将重点转移到使用一组作为核心 Flowise 原生开发的专用独立节点来设计整个工作流程。 + +在这个V2架构中,每个节点作为一个独立的单元,根据其特定的设计和配置执行离散的操作。画布上节点之间的可视连接明确定义了工作流的路径和控制顺序,数据可以通过引用当前流程中任何先前执行的节点的输出在节点之间传递,并且流状态提供了用于管理和共享整个工作流中的数据的显式机制。 + +V2 架构实现了全面的节点依赖性和执行队列系统,该系统精确地遵循这些定义的路径,同时保持组件之间的明确分离,从而使工作流程变得更加复杂且更易于设计。这使得诸如循环、条件分支、人机交互等复杂模式成为可能。这使得它更能适应不同的用例,同时保持更具可维护性和可扩展性。 + +
+ +## 智能体流程 和自动化平台之间的区别 + +最常被问到的问题之一:智能体流程 和 n8n、Make 或 Zapier 等自动化平台有什么区别? + +### 💬 **代理间通信** + +支持代理之间的多模式通信。主管代理可以制定任务并将其委派给多个工作代理,工作代理的输出随后返回给主管。 + +在每个步骤中,代理都可以访问完整的对话历史记录,使主管能够确定下一个任务,而工作代理能够解释任务、选择适当的工具并相应地执行操作。 + +这种架构支持跨多个代理的**协作、委派和共享任务管理**,传统自动化工具通常不提供此类功能。 + +
+ +### 🙋‍♂ 人机交互 + +在等待人工输入时暂停执行,不会阻塞正在运行的线程。每个检查点都会被保存,即使在应用程序重新启动后,工作流程也可以从同一点恢复。 + +使用检查点可以实现**长时间运行、有状态的代理**。 + +代理还可以配置为 **在执行工具之前请求权限**,类似于 Claude 在使用 MCP 工具之前请求用户批准的方式。这有助于防止在没有明确用户批准的情况下自主执行敏感操作。 + +
+ +### 📖 共享状态 + +共享状态支持代理之间的数据交换,对于跨分支或流程中的非相邻步骤传递数据特别有用。请参阅[#了解流状态](agentflowv2.md#understanding-flow-state "mention") + +### ⚡ 流式输出 + +支持服务器发送事件 (SSE),以实时传输 LLM 或代理响应。随着工作流程的进展,流式传输还可以订阅执行更新。 + +
+ +### 🌐 MCP 工具 + +虽然传统自动化平台通常具有广泛的预构建集成库,但 智能体流程 允许将 MCP([模型上下文协议](https://github.com/modelcontextprotocol))工具作为工作流程的一部分进行连接,而不是单独充当代理工具。 + +自定义 MCP 也可以独立创建,无需依赖平台提供的集成。 MCP 被广泛认为是行业标准,通常由官方提供商支持和维护。例如,GitHub MCP 由 GitHub 团队开发和维护,并为 Atlassian Jira、Brave Search 等提供类似的支持。 + +
+ +## 智能体流程 V2 节点参考 + +本节提供每个可用节点的详细参考,概述其特定用途、关键配置参数、预期输入、生成的输出及其在 AgentFlow V2 架构中的作用。 + +
+ +*** + +### **1。启动节点** + +用于启动任何 AgentFlow V2 工作流执行的指定入口点。每个流都必须从此节点开始。 + +* **功能:** 定义如何触发工作流程并设置初始条件。它可以直接从聊天界面接受输入,也可以通过呈现给用户的可定制表单接受输入。它还允许在执行开始时初始化 `Flow State` 变量,并可以管理如何处理运行的会话内存。 +* **配置参数** + * **输入类型**:确定如何启动工作流执行,可以通过用户的 `Chat Input` 启动,也可以通过提交的 `Form Input` 启动。 + * **表单标题、表单描述、表单输入类型**:如果选择 `Form Input`,这些字段将配置呈现给用户的表单外观,允许使用定义的标签和变量名称的各种输入字段类型。 + * **临时内存**:如果启用,则指示工作流开始执行,而不考虑对话线程中的任何过去的消息,从而有效地从干净的内存板开始。 + * **流程状态**:定义工作流运行时状态 `$flow.state` 的完整初始键值对集。后续节点将使用或更新的所有状态密钥必须在此处声明和初始化。 +* **输入:** 接收触发工作流的初始数据,该数据可以是聊天消息或通过表单提交的数据。 +* **输出:** 提供单个输出锚点连接到第一个操作节点,传递初始输入数据和初始化的流状态。 + +
+ +*** + +### **2。 LLM 节点** + +提供对配置的大型语言模型 (LLM) 的直接访问以执行 AI 任务,使工作流程能够在需要时执行结构化数据提取。 + +* **功能:** 该节点根据提供的指令(消息)和上下文向 LLM 发送请求。它可用于文本生成、摘要、翻译、分析、回答问题以及根据定义的模式生成结构化 JSON 输出。它可以访问对话线程的内存,并且可以读/写 `Flow State`。 +* **配置参数** + * **模型**:指定所选服务的 AI 模型,例如 OpenAI 的 GPT-4o 或 Google Gemini。 + * **消息**:定义 LLM 的对话输入,将其构建为一系列角色 - 系统、用户、助理、开发人员 - 以指导 AI 的响应。可以使用 `{{ variable }}` 插入动态数据。 + * **内存**:如果启用,则确定 LLM 在生成响应时是否应考虑当前对话线程的历史记录。 + * **内存类型、窗口大小、最大令牌限制**:如果使用内存,这些设置会细化对话历史记录的管理方式并将其呈现给 LLM — 例如,是否包含所有消息、仅包含最近的轮次窗口或汇总版本。 + * **输入消息**:指定在由 LLM/Agent 处理之前将作为最新用户消息附加到现有对话上下文(包括初始上下文和内存)末尾的变量或文本。 + * **返回响应为**:配置 LLM 的输出如何分类 - 作为 `User Message` 或 `助手 Message` - 这可能会影响后续内存系统或日志记录的处理方式。 + * **JSON 结构化输出**:指示 LLM 根据特定的 JSON 模式格式化其输出 - 包括键、数据类型和描述 - 确保数据可预测、机器可读。 + * **更新流程状态**:允许节点在执行期间通过更新预定义键来修改工作流程的运行时状态 `$flow.state`。例如,这使得可以将此 LLM 节点的输出存储在这样的键下,使其可供后续节点访问。 +* **输入:** 该节点利用来自工作流初始触发器或之前节点输出的数据,并将这些数据合并到 `Messages` 或 `Input Message` 字段中。当输入变量引用它时,它还可以从 `$flow.state` 检索值。 +* **输出:** 产生 LLM 的响应,该响应可以是纯文本或结构化 JSON 对象。此输出的分类(用户或助理)由 `Return Response` 设置确定。 + +
+ +*** + +### **3。代理节点** + +代表一个自主的人工智能实体,能够推理、规划以及与工具或知识源交互以实现给定的目标。 + +* **功能:** 该节点使用 LLM 动态决定一系列操作。根据用户的目标(通过消息/输入提供),它可以选择使用可用的工具或查询文档存储来收集信息或执行操作。它管理自己的推理周期,并可以利用对话线程和 `Flow State` 的内存。适用于需要多步骤推理或与外部系统或工具动态交互的任务。 +* **配置参数** + * **模型**:指定所选服务的 AI 模型(例如 OpenAI 的 GPT-4o 或 Google Gemini),这将驱动代理的推理和决策过程。 +* **消息**:定义代理的初始对话输入、目标或上下文,将其构建为一系列角色(系统、用户、助理、开发人员),以指导代理的理解和后续操作。可以使用 `{{ variable }}` 插入动态数据。 + * **工具**:指定代理有权使用哪些预定义的 Flowise 工具来实现其目标。 + * 对于每个选定的工具,可选的 **需要人工输入标志** 指示工具的操作是否可能会暂停以请求人工干预。 + * **知识/文档存储**:配置对 Flowise 管理的文档存储中的信息的访问。 + * **文档存储**:选择代理可以从中检索信息的预配置文档存储。这些商店必须提前设置并填充。 + * **描述知识**:提供此文档存储的内容和用途的自然语言描述。此描述指导代理了解商店包含什么类型的信息以及何时适合查询它。 + * **知识/向量嵌入**:配置对外部预先存在的向量存储的访问,作为代理的附加知识源。 + * **矢量存储**:选择代理可以查询的特定预配置矢量数据库。 + * **嵌入模型**:指定与所选矢量存储关联的嵌入模型,确保查询的兼容性。 + * **知识名称**:为这个基于向量的知识源分配一个简短的描述性名称,代理可以使用该名称作为参考。 + * **描述知识**:提供此向量存储的内容和用途的自然语言描述,指导代理何时以及如何利用此特定知识源。 + * **返回源文档**:如果启用,则指示代理将源文档信息包含在从矢量存储检索的数据中。 + * **内存**:如果启用,则确定代理在做出决策和生成响应时是否应考虑当前对话线程的历史记录。 + * **内存类型、窗口大小、最大令牌限制**:如果使用内存,这些设置会优化对话历史记录的管理和呈现给客服人员的方式 - 例如,是否包含所有消息、仅包含最近的轮次窗口或汇总版本。 + * **输入消息**:指定在由 LLM/Agent 处理之前将作为最新用户消息附加到现有对话上下文(包括初始上下文和内存)末尾的变量或文本。 + * **返回响应**:配置代理的最终输出或消息的分类方式(用户消息或助理消息),这可能会影响后续内存系统或日志记录的处理方式。 + * **更新流程状态**:允许节点在执行期间通过更新预定义键来修改工作流程的运行时状态 `$flow.state`。例如,这使得可以将该代理节点的输出存储在这样的键下,从而使其可供后续节点访问。 +* **输入:** 该节点利用来自工作流初始触发器或来自先前节点输出的数据,通常合并到 `Messages` 或 `Input Message` 字段中。它根据需要访问配置的工具和知识源。 +* **输出:** 在完成推理、规划以及与工具或知识源的任何交互后,生成代理生成的最终结果或响应。 + +
+ +*** + +### **4。工具节点** + +提供一种在工作流程序列中直接、确定性地执行特定的、预定义的 Flowise 工具的机制。与代理节点不同,LLM 根据推理动态选择工具,而工具节点则完全执行工作流设计者在配置期间选择的工具。 + +* **功能:** 当工作流需要在定义点执行已知的特定功能并具有可用的输入时,使用此节点。它确保确定性操作,而不涉及工具选择的 LLM 推理。 +* **它是如何工作的** + 1. **触发:** 当工作流执行到达工具节点时,它就会激活。 + 2. **工具标识:** 它标识在其配置中选择的特定 Flowise 工具。 + 3. **输入参数解析:** 它查看工具输入参数配置。对于所选工具的每个所需输入参数。 + 4. **执行:** 它调用与所选 Flowise 工具关联的底层代码或 API 调用,传递已解析的输入参数。 + 5. **输出生成:** 它接收工具执行返回的结果。 + 6. **输出传播:** 它通过其输出锚点提供此结果以供后续节点使用。 +* **配置参数** + * **工具选择**:选择该节点将从下拉列表中执行的特定的已注册 Flowise 工具。 + * **输入参数**:定义如何将工作流程中的数据提供给所选工具。此部分根据所选工具动态调整,呈现其特定的所需输入参数: + * **映射参数名称**:对于所选工具所需的每个输入(例如,计算器的 `input`),此字段将显示工具本身定义的预期参数名称。 + * **提供参数值**:使用 `{{ previousNode.output }}`、`{{ $flow.state.someKey }}` 等动态变量或输入静态文本来设置相应参数的值。 + * **更新流程状态**:允许节点在执行期间通过更新预定义键来修改工作流程的运行时状态 `$flow.state`。例如,这使得可以将此工具节点的输出存储在这样的键下,使其可供后续节点访问。 +* **输入:** 通过 `Input Arguments` 映射、从先前节点输出、`$flow.state` 或静态配置获取值,接收工具参数的必要数据。 +* **输出:** 生成由执行工具生成的原始输出 - 例如,来自 API 的 JSON 字符串、文本结果或数值。 + +
+ +*** + +### **5。检索器节点** + +从配置的文档存储中执行有针对性的信息检索。 + +* **功能:** 该节点查询一个或多个指定的文档存储,根据语义相似性获取相关文档块。当唯一需要的操作是检索并且不需要 LLM 进行动态工具选择时,它是使用代理节点的集中替代方案。 +* **配置参数** + * **知识/文档存储**:指定此节点应查询哪些预配置和填充的文档存储以查找相关信息。 + * **检索器查询**:定义将用于搜索所选文档存储的文本查询。可以使用 `{{ variables }}` 插入动态数据。 + * **输出格式**:选择如何呈现检索到的信息 - 可以是普通的 `Text` 或 `Text with Metadata`,其中可能包括源文档名称或位置等详细信息。 +* **更新流程状态**:允许节点在执行期间通过更新预定义键来修改工作流程的运行时状态 `$flow.state`。例如,这使得可以将此 检索器 节点的输出存储在这样的键下,使其可供后续节点访问。 +* **输入:** 需要一个查询字符串 - 通常作为上一步或用户输入的变量提供 - 并访问选定的文档存储以获取信息。 +* **输出:** 生成从知识库检索的文档块,根据所选的 `Output Format` 进行格式化。 + +
+ +*** + +### 6. HTTP 节点 + +通过超文本传输协议 (HTTP) 促进与外部 Web 服务和 API 的直接通信。 + +* **功能:** 该节点使工作流程能够与可通过 HTTP 访问的任何外部系统进行交互。它可以向指定的 URL 发送各种类型的请求(GET、POST、PUT、DELETE、PATCH),允许与第三方 API 集成、从 Web 资源获取数据或触发外部 Webhook。该节点支持配置身份验证方法、自定义标头、查询参数和不同的请求正文类型,以适应不同的 API 要求。 +* **配置参数** + * **HTTP 凭据**:可以选择预先配置的凭据(例如基本身份验证、承载令牌或 API 密钥)来验证对目标服务的请求。 + * **请求方法**:指定用于请求的 HTTP 方法 - 例如,`GET`、`POST`、`PUT`、`DELETE`、`PATCH`。 + * **目标 URL**:定义请求将发送到的外部端点的完整 URL。 + * **请求标头**:将任何必要的 HTTP 标头设置为要包含在请求中的键值对。 + * **URL 查询参数**:定义将作为查询参数附加到 URL 的键值对。 + * **请求正文类型**:如果发送数据,请选择请求负载的格式 - 选项包括 `JSON`、`Raw text`、`Form Data` 或 `x-www-form-urlencoded`。 + * **请求正文**:为 POST 或 PUT 等方法提供实际数据负载。格式应与所选的 `Body Type` 匹配,并且可以使用 `{{ variables }}` 插入动态数据。 + * **响应类型**:指定工作流应如何解释从服务器收到的响应 - 选项包括 `JSON`、`Text`、`Array Buffer` 或 `Base64` (适用于二进制数据)。 +* **输入:** 接收配置数据,例如 URL、方法、标头和正文,通常包含来自先前工作流程步骤或 `$flow.state` 的动态值。 +* **输出:** 生成从外部服务器接收到的响应,并根据所选的 `Response Type` 进行解析。 + +
+ +*** + +### **7。条件节点** + +根据定义的规则在工作流程中实现确定性分支逻辑。 + +* **功能:** 该节点充当决策点,评估一个或多个指定条件以引导工作流沿着不同的路径前进。它使用各种逻辑运算符(例如等于、包含、大于或为空)来比较输入值(可以是字符串、数字或布尔值)。根据这些条件评估为真还是假,工作流执行将沿着连接到该节点的不同输出分支之一继续进行。 +* **配置参数** + * **条件**:配置节点将评估的逻辑规则集。 + * **类型**:指定此规则要比较的数据类型 - `String`、`Number` 或 `Boolean`。 + * **值 1**:定义用于比较的第一个值。可以使用 `{{ variables }}` 插入动态数据。 + * **操作**:选择要在值 1 和值 2 之间应用的逻辑运算符 — 例如,`equal`、`notEqual`、`contains`、`larger`、`isEmpty`。 + * **值 2**:如果所选操作需要,定义用于比较的第二个值。动态数据也可以使用 `{{ variables }}` 插入此处。 +* **输入:** 需要评估每个条件的 `Value 1` 和 `Value 2` 数据。这些值由先前的节点输出提供或从 `$flow.state` 检索。 +* **输出:** 提供多个输出锚点,对应于评估条件的布尔结果(真/假)。工作流沿着连接到与结果匹配的输出锚点的特定路径继续。 + +
+ +*** + +### **8。条件代理节点** + +提供基于自然语言指令和上下文的人工智能驱动的动态分支。 + +* **功能:** 该节点使用大型语言模型 (LLM) 来路由工作流。它根据定义决策任务的高级自然语言“指令”指导,根据一组用户定义的“场景”(潜在结果或类别)分析提供的输入数据。然后 LLM 确定哪种场景最适合当前输入上下文。基于这种人工智能驱动的分类,工作流执行沿着与所选场景相对应的特定输出路径进行。该节点对于用户意图识别、复杂条件路由或微妙的情境决策等任务特别有用,在这些任务中,简单的预定义规则(如条件节点中的规则)是不够的。 +* **配置参数** + * **模型**:指定所选服务中将执行分析和场景分类的 AI 模型。 + * **说明**:用自然语言定义 LLM 的总体目标或任务 - 例如,“确定用户的请求是否与销售、支持或一般查询有关。” + * **输入**:使用 `{{ variables }}` 指定数据,通常是来自上一步或用户输入的文本,LLM 将分析该数据以做出路由决策。 + * **场景**:配置一个数组,定义工作流程可能采取的可能结果或不同路径。每个场景都用自然语言描述 - 例如,“销售查询”、“支持请求”、“一般问题” - 每个场景都对应于节点上的唯一输出锚点。 +* **输入:** 需要 `Input` 数据进行分析,并需要 `Instructions` 来指导 LLM。 +* **输出:** 提供多个输出锚点,每个定义的 `Scenario` 一个。工作流沿着连接到 LLM 确定与输入最匹配的输出锚点的特定路径继续。 + +
+ +*** + +### **9。迭代节点** + +为输入数组中的每个项目执行定义的“子流”(嵌套在其中的一系列节点),实现“for-each”循环。 + +* **功能:** 该节点设计用于处理数据集合。它采用直接提供或通过变量引用的数组作为其输入。对于该数组中的每个单独元素,迭代节点顺序执行视觉上放置在画布上其边界内的其他节点的序列。 +* **配置参数** + * **数组输入**:指定节点将迭代的输入数组。这是通过引用一个变量来提供的,该变量保存来自前一个节点的输出或来自 `$flow.state` 的数组——例如 `{{ $flow.state.itemList }}`。 +* **输入:** 需要为其 `Array Input` 参数提供一个数组。 +* **输出:** 提供单个输出锚点,该锚点仅在嵌套子流完成输入数组中所有项目的执行后才变为活动状态。通过此输出传递的数据可以包括聚合结果或循环内修改的变量的最终状态,具体取决于子流的设计。放置在迭代块内的节点具有自己独特的输入和输出连接,这些连接定义了每个项目的操作顺序。 + +
+ +*** + +### **10。循环节点** + +将工作流执行显式重定向回先前执行的节点。 + +* **功能:** 该节点允许在工作流程中创建循环或迭代重试。当执行流程到达循环节点时,不会继续前进到新的节点;相反,它“跳”回到当前工作流运行中先前已执行过的指定目标节点。此操作会导致重新执行该目标节点以及流的该部分中的任何后续节点。 +* **配置参数** + * **循环返回**:选择执行应返回到的当前工作流中先前执行的节点的唯一 ID。 + * **最大循环计数**:定义在单个工作流执行中可以执行此循环操作的最大次数,防止无限循环。默认值为 5。 +* **输入:** 接收执行信号以激活。它在内部跟踪当前执行中循环发生的次数。 +* **输出:** 该节点没有标准的前向输出锚点,因为其主要功能是将执行流向后重定向到 `Loop Back To` 目标节点,然后工作流从该节点继续。 + +
+ +*** + +### **11。人工输入节点** + +暂停工作流执行以请求人类用户的显式输入、批准或反馈 - 人在环 (HITL) 流程的关键组件。 + +* **功能:** 该节点停止工作流程的自动进展,并通过聊天界面向人类用户呈现信息或问题。显示给用户的内容可以是预定义的静态文本,也可以是由 LLM 基于当前工作流程上下文动态生成的。向用户提供不同的操作选择——例如“继续”、“拒绝”——如果启用,还会有一个提供文本反馈的字段。一旦用户做出选择并提交响应,工作流就会沿着与其选择的操作相对应的特定输出路径恢复执行。 +* **配置参数** + * **描述类型**:确定如何生成向用户呈现的消息或问题 - `Fixed`(静态文本)或 `Dynamic`(由 LLM 生成)。 + * **如果描述类型为 `Fixed`** +* **描述**:此字段包含要向用户显示的确切文本。它支持使用 `{{ variables }}` 插入动态数据 + * **如果 `Description Type` 是 `Dynamic`** + * **模型**:从所选服务中选择将生成面向用户的消息的 AI 模型。 + * **提示词**:为选定的 LLM 提供说明或提示词,以生成向用户显示的消息。 + * **反馈:** 如果启用,将通过反馈窗口提示词用户留下反馈,并且此反馈将附加到节点的输出中。 +* **输入:** 接收执行信号以暂停工作流程。如果配置为动态内容,它可以通过 `Description` 或 `Prompt` 字段中的变量利用先前步骤中的数据或 `$flow.state` 。 +* **输出:** 提供两个输出锚点,每个输出锚点对应一个不同的用户操作 - 一个锚点用于“继续”,另一个锚点用于“拒绝”。工作流程沿着连接到与用户选择匹配的锚点的路径继续。 + +
+ +*** + +### **12。直接回复节点** + +向用户发送最终消息并终止当前执行路径。 + +* **功能:** 该节点充当特定分支或整个工作流程的端点。它采用配置的消息(可以是静态文本或变量中的动态内容)并通过聊天界面将其直接传递给最终用户。发送此消息后,工作流沿此特定路径的执行结束;从该点连接的其他节点将不会被处理。 +* **配置参数** + * **消息**:定义文本或变量 `{{ variable }}`,保存要作为最终回复发送给用户的内容。 +* **输入:** 接收消息内容,该消息内容源自前一个节点的输出或存储在 `$flow.state` 中的值。 +* **输出:** 该节点没有输出锚点,因为它的功能是在发送回复后终止执行路径。 + +
+ +*** + +### **13。自定义函数节点** + +提供一种在工作流程中执行自定义服务器端 Javascript 代码的机制。 + +* **功能:** 该节点允许编写和运行任意 Javascript 片段,提供了一种有效的方法来实现复杂的数据转换、定制业务逻辑或与其他标准节点不直接支持的资源的交互。执行的代码在 Node.js 环境中运行,并具有访问数据的特定方式: + * **输入变量:** 通过 `Input 变量` 配置传递的值可在函数内访问,通常以 `$` 为前缀 - 例如,如果定义了输入变量 `userid`,则可以将其作为 `$userid` 进行访问。 + * **流上下文:** 默认流配置变量可用,例如 `$flow.sessionId`、`$flow.chatId`、`$flow.chatflowId`、`$flow.input`(启动工作流的初始输入)以及整个 `$flow.state` 对象。 +* **自定义变量:** Flowise 中设置的任何自定义变量 — 例如,`$vars。`。 + * **库:** 该函数可以利用已导入并在 Flowise 后端环境中可用的任何库。**该函数必须在执行结束时返回一个字符串值**。 +* **配置参数** + * **输入变量**:配置输入定义数组,这些定义将作为变量传递到 Javascript 函数的范围内。对于您想要定义的每个变量,您将指定: +* **变量名称**:您将用来在 Javascript 代码中引用此变量的名称,通常以 `$` 为前缀 - 例如,如果您在此处输入 `myValue`,您可以在脚本中将其作为 `$myValue` 访问,这与输入架构属性的映射方式相对应。 + * **变量值**:分配给该变量的实际数据,可以是静态文本,或更常见的是来自工作流程的动态值,例如 `{{ previousNode.output }}` 或 `{{ $flow.state.someKey }}`。 + * **Javascript 函数**:编写服务器端 Javascript 函数的代码编辑器字段。该函数最终必须返回一个字符串值。 + * **更新流程状态**:允许节点在执行期间通过更新预定义键来修改工作流程的运行时状态 `$flow.state`。例如,这使得可以将此自定义函数节点的字符串输出存储在这样的键下,以便后续节点可以访问它。 +* **输入:** 通过 `Input 变量` 中配置的变量接收数据。还可以隐式访问 `$flow` 上下文和 `$vars` 的元素。 +* **输出:** 生成执行的 Javascript 函数返回的字符串值。 + +
+ +*** + +### **14。执行流程节点** + +允许从当前工作流程中调用和执行另一个完整的 Flowise 聊天流 或 AgentFlow。 + +* **功能性:** 该节点作为子工作流调用者,促进了逻辑的模块化设计和可重用性。它允许当前工作流程触发一个单独的、预先存在的工作流程(由 Flowise 实例中的名称或 ID 标识),将初始输入传递给它,可选择覆盖该特定运行的目标流程的特定配置,然后将其最终输出接收回调用工作流程以继续处理。 +* **配置参数** + * **连接凭据**:如果调用的目标流需要特定的身份验证或执行权限,则可以选择提供 聊天流 API 凭据。 + * **选择流**:指定此节点将从 Flowise 实例中的可用流列表中执行的特定 聊天流 或 AgentFlow。 + * **输入**:定义数据 - 静态文本或 `{{ variable }}` - 将在调用目标工作流时作为主要输入传递到目标工作流。 + * **覆盖配置**:可以选择提供一个 JSON 对象,其中包含参数,这些参数将专门针对此执行实例覆盖目标工作流的默​​认配置 - 例如,临时更改子流程中使用的模型或提示词。 + * **基础 URL**:可以选择为托管目标流的 Flowise 实例指定替代基础 URL。这在分布式设置中或当通过不同路由访问流时非常有用,如果未设置,则默认为当前实例的 URL 。 + * **返回响应为**:确定执行子流程的最终输出在返回到当前工作流程时应如何分类 - 作为 `User Message` 或 `助手 Message`。 + * **更新流程状态**:允许节点在执行期间通过更新预定义键来修改工作流程的运行时状态 `$flow.state`。例如,这使得可以将此执行流节点的输出存储在这样的键下,从而使其可供后续节点访问。 +* **输入:** 需要选择目标流量及其 `Input` 数据。 +* **输出:** 生成执行的目标工作流返回的最终输出,根据 `Return Response As` 设置进行格式化。 + +
+ +## 理解流状态 + +**流状态**是实现 AgentFlow V2 灵活性和数据管理功能的关键架构功能。此机制提供了一种在单个工作流实例的执行过程中动态管理和共享数据的方法。 + +### **什么是心流状态?** + +* 流状态 (`$flow.state`) 是一个**运行时键值存储**,在单次执行中的节点之间共享。 +* 它充当临时内存或共享上下文,仅在特定运行/执行期间存在。 + +### **心流状态的目的** + +`$flow.state` 的主要目的是实现节点之间的**显式数据共享和通信,特别是那些在工作流图中可能未直接连接的**,或者当数据需要在多个步骤中有意持久化和修改时。它解决了几个常见的编排挑战: + +1. **跨分支传递数据:** 如果工作流分成条件路径,则一个分支中生成或更新的数据可以存储在 `$flow.state` 中,以便稍后在路径合并或其他分支需要该信息时访问。 +2. **跨非相邻步骤访问数据:** 由早期节点初始化或更新的信息可以由较晚的节点检索,而无需将其显式传递通过每个中间节点的输入和输出。 + +### **心流状态如何工作** + +1. **密钥的初始化/声明** + * 将在整个工作流程中使用的所有状态键**必须使用**启动节点**中的 `Flow State` 参数使用其默认值(即使为空)进行初始化**。此步骤有效地声明了该工作流程的 `$flow.state` 的架构或结构。您可以在此处定义初始键值对。 + +
+ +2. **更新状态/修改现有密钥** + +* 许多操作节点 — 例如 `LLM`、`Agent`、`工具`、`HTTP`、`检索器`、`Custom Function` — 在其配置中包含 `Update Flow State` 参数。 +* 此参数允许节点**修改 `$flow.state` 内预先存在的键的值**。 +* 值可以是静态文本、当前节点的直接输出、上一个节点的输出以及许多其他变量。类型 `{{` 将显示所有可用变量。 +* 当节点成功执行时,它会使用新值**更新** `$flow.state` 中的指定键。 **运行节点无法创建新密钥;只能更新预定义的密钥。** + +
+ +3. **从状态读取** + +* 任何接受变量的节点输入参数都可以从 Flow State 中读取值。 +* 使用特定语法:`{{ $flow.state.yourKey }}` — 将 `yourKey` 替换为在启动节点中初始化的实际键名称。 +* 例如,LLM 节点的提示词可能包括 `"...based on the user status: {{ $flow.state.customerStatus }}"`。 + +
+ +### **范围和持久性:** + +* 它在工作流执行开始时创建并初始化,并在特定执行结束时销毁。 +* 它**不会**在不同的用户会话或同一工作流程的单独运行中持续存在。 +* 工作流的每个并发执行都维护自己独立的`$flow.state`。 + +## 视频资源 + +{% embed url="https://youtu.be/SLVVDUIbIBE?si=VU1m_btfDzVNl-PP" %} + +{% embed url="https://youtu.be/h9N9wCrP9u4?si=8-9a9fktpxAykXXH" %} diff --git a/cn/using-flowise/analytics/README.md b/cn/using-flowise/analytics/README.md new file mode 100644 index 00000000..4b0e3185 --- /dev/null +++ b/cn/using-flowise/analytics/README.md @@ -0,0 +1,57 @@ +--- +description: 了解如何分析聊天流和座席流并对其进行故障排除 +--- + +# 解析 + +*** + +Flowise 为 [智能体流程 V2](../agentflowv2.md) 提供逐步跟踪: + +
+ +此外,Flowise 还集成了多个分析提供商: + +* [LunaryAI](https://lunary.ai/) +* [朗史密斯](https://smith.langchain.com/) +* [Langfuse](https://langfuse.com/) +* [LangWatch](https://langwatch.ai/) +* [Arize](https://arize.com/) +* [菲尼克斯](https://phoenix.arize.com/) +* [Opik](https://www.comet.com/site/products/opik/) + +## 设置 + +1. 在 聊天流 或 智能体流程 的右上角,单击 **设置** > **配置** + +
Screenshot of user clicking in the configuration menu
+ +2. 然后进入分析聊天流部分 + +
Screenshot of the Analyse Chatflow section with the different Analytics providers
+ +3.您将看到提供者列表及其配置字段 + +
Screenshot of an analytics provider with credentials fields expanded
+ +4. 填写凭据和其他配置详细信息,然后打开提供商**开启**。单击“保存”。 + +
Screenshot of analytics providers enabled
+ +## API + +从 UI 打开分析后,您可以在 [预测 API](api.md#prediction-api) 主体中覆盖或提供其他配置: + +```json +{ + "question": "hi there", + "overrideConfig": { + "analytics": { + "langFuse": { + // langSmith, langFuse, lunary, langWatch, opik + "userId": "user1" + } + } + } +} +``` diff --git a/cn/using-flowise/analytics/arize.md b/cn/using-flowise/analytics/arize.md new file mode 100644 index 00000000..f2c99654 --- /dev/null +++ b/cn/using-flowise/analytics/arize.md @@ -0,0 +1,31 @@ +--- +description: 了解如何设置 Arize 来分析您的聊天流和座席流并对其进行故障排除 +--- + +#阿里兹 + +*** + +[Arize AI](https://docs.arize.com/arize) 是一个生产级可观测性平台,用于大规模监控、调试和改进 LLM 应用程序和 AI 智能体。如需免费的开源替代方案,请探索[Phoenix](https://docs.flowiseai.com/using-flowise/analytics/phoenix)。 + +## 设置 + +1. 在 聊天流 或 智能体流程 的右上角,单击 **设置** > **配置** + +
Screenshot of user clicking in the configuration menu
+ +2. 然后进入分析聊天流部分 + +
Screenshot of the Analyse Chatflow section with the different Analytics providers
+ +3. 您将看到提供程序列表及其配置字段。单击阿里兹。 + +
Screenshot of an analytics provider with credentials fields expanded
+ +4. 为 Arize 创建凭据。请参阅[官方指南](https://docs.arize.com/arize/llm-tracing/quickstart-llm#get-your-api-keys),了解如何获取 Arize API 密钥。 + +
Screenshot of analytics providers enabled
+ +5.填写其他配置详细信息,然后打开提供商**ON** + +
Screenshot of analytics providers enabled
diff --git a/cn/using-flowise/analytics/langfuse.md b/cn/using-flowise/analytics/langfuse.md new file mode 100644 index 00000000..09bef80e --- /dev/null +++ b/cn/using-flowise/analytics/langfuse.md @@ -0,0 +1,11 @@ +#朗弗斯 + +[Langfuse](https://langfuse.com) 是一个开源 LLM 工程平台,可帮助团队跟踪 API 调用、监控性能并调试 AI 应用程序中的问题。 + +通过本机集成,您可以使用 Flowise 以无代码方式快速创建复杂的 LLM 应用程序,然后使用 Langfuse 来监控和改进它们。 + +该集成支持 Flowise 的所有用例,包括:UI 中的交互式、API 和嵌入。 + +{% embed url="https://youtu.be/iFsSW6HHoa0" %} + +您可以选择添加 `release` 来标记流的当前版本。您通常不需要更改其他选项。 diff --git a/cn/using-flowise/analytics/langwatch.md b/cn/using-flowise/analytics/langwatch.md new file mode 100644 index 00000000..d80dac9c --- /dev/null +++ b/cn/using-flowise/analytics/langwatch.md @@ -0,0 +1,26 @@ +--- +description: >- + 了解如何设置 LangWatch 来分析您的聊天流并进行故障排除 + 智能体流程 +--- + +# 朗观察 + +*** + +[Langwatch](https://langwatch.ai) 是一个生产级可观测性和 LLMOps 平台,旨在大规模监控、调试和增强 LLM 应用程序和 AI 智能体。 + +## 设置 + +1. 在 聊天流 或 智能体流程 的右上角,单击 **设置** > **配置** + +
Screenshot of user clicking in the configuration menu
+ +2. 然后进入分析聊天流部分 + +
Screenshot of the Analyse Chatflow section with the different Analytics providers
+ +3. 您将看到提供程序列表及其配置字段。单击“LangWatch”。 +4. 如果您还没有注册一个免费帐户,请在[此处](https://app.langwatch.ai)注册一个免费帐户,以获取您的API密钥。 +5. 填写配置详细信息,然后打开提供商**开启**并单击**保存** +6. 现在,您可以使用 LangWatch 来分析聊天流和座席流并进行故障排除。请参阅[官方指南](https://docs.langwatch.ai)了解更多详情。 diff --git a/cn/using-flowise/analytics/lunary.md b/cn/using-flowise/analytics/lunary.md new file mode 100644 index 00000000..08c248da --- /dev/null +++ b/cn/using-flowise/analytics/lunary.md @@ -0,0 +1,9 @@ +# 农历 + +[Lunary](https://lunary.ai/) 是 LLM 聊天机器人的监控和分析平台。 + +Flowise 与 Lunary 合作提供完整的集成,支持用户跟踪、反馈跟踪、对话重播和详细的 LLM 分析。 + +Flowise 用户可以在结帐时使用代码 `FLOWISEFRIENDS` 获得 Teams 计划 30% 的折扣。 + +请在[此处](https://lunary.ai/docs/integrations/flowise)详细了解如何使用 Flowise 设置 Lunary。 diff --git a/cn/using-flowise/analytics/opik.md b/cn/using-flowise/analytics/opik.md new file mode 100644 index 00000000..9e39195a --- /dev/null +++ b/cn/using-flowise/analytics/opik.md @@ -0,0 +1,34 @@ +--- +description: 了解如何设置 Opik 来分析您的聊天流和座席流并进行故障排除 +--- + +# 奥皮克 + +*** + +## 设置 + +1. 在 聊天流 或 智能体流程 的右上角,单击 **设置** > **配置** + +
Screenshot of user clicking in the configuration menu
+ +2. 然后进入分析聊天流部分 + +
Screenshot of the Analyse Chatflow section with the different Analytics providers
+ +3. 您将看到提供程序列表及其配置字段。单击“奥皮克”。 + +
Screenshot of an analytics provider with credentials fields expanded
+ +4. 为 Opik 创建凭据。请参阅[官方指南](https://www.comet.com/docs/opik/tracing/sdk_configuration),了解如何获取 Opik API 密钥。 + +
Screenshot of analytics providers enabled
+ +5.填写其他配置详细信息,然后打开提供商**ON** + +
Screenshot of analytics providers enabled
+ + +现在您可以使用 Opik UI 分析您的聊天流和智能体流程: + +
Screenshot of Opik UI
\ No newline at end of file diff --git a/cn/using-flowise/analytics/phoenix.md b/cn/using-flowise/analytics/phoenix.md new file mode 100644 index 00000000..29abe669 --- /dev/null +++ b/cn/using-flowise/analytics/phoenix.md @@ -0,0 +1,31 @@ +--- +description: 了解如何设置 Phoenix 来分析您的聊天流和座席流并对其进行故障排除 +--- + +# 凤凰城 + +*** + +[Phoenix](https://docs.arize.com/phoenix/self-hosting) 是一款开源可观察性工具,专为 AI 和 LLM 应用程序的实验、评估和故障排除而设计。它可以以 [Cloud](https://app.phoenix.arize.com/login) 形式在线访问,也可以自行托管并在您自己的计算机或服务器上运行。 + +## 设置 + +1. 在 聊天流 或 智能体流程 的右上角,单击 **设置** > **配置** + +
Screenshot of user clicking in the configuration menu
+ +2. 然后进入分析聊天流部分 + +
Screenshot of the Analyse Chatflow section with the different Analytics providers
+ +3. 您将看到提供程序列表及其配置字段。点击凤凰。 + +
Screenshot of an analytics provider with credentials fields expanded
+ +4. 为 Phoenix 创建凭据。请参阅[官方指南](https://docs.arize.com/phoenix/environments),了解如何获取 Phoenix API 密钥。 + +
Screenshot of analytics providers enabled
+ +5. 填写其他配置详细信息,然后打开提供商**开启**。单击“保存”。 + +
Screenshot of analytics providers enabled
diff --git a/cn/using-flowise/document-stores.md b/cn/using-flowise/document-stores.md new file mode 100644 index 00000000..9fc3168b --- /dev/null +++ b/cn/using-flowise/document-stores.md @@ -0,0 +1,1034 @@ +--- +description: 了解如何使用由 @toi500 编写的 Flowise 文档存储 +--- + +# 文档存储 + +*** + +Flowise 的文档存储提供了一种多功能的数据管理方法,使您能够上传、拆分和准备数据集并将其写入更新到单个位置。 + +这种集中式方法简化了数据处理,并允许有效管理各种数据格式,从而更轻松地在 Flowise 应用程序中组织和访问数据。 + +## 设置 + +在本教程中,我们将设置一个 [检索增强一代 (RAG)](broken-reference/) 系统来检索有关 _LibertyGuard Deluxe Homeowners Policy_ 的信息,这是法学硕士未接受过广泛培训的主题。 + +使用 **Flowise 文档存储**,我们将准备并写入更新有关 LibertyGuard 及其家庭保险单集的数据。这将使我们的 RAG 系统能够准确回答用户有关 LibertyGuard 家庭保险产品的查询。 + +## 1. 添加文档存储 + +首先添加文档存储并为其命名。在我们的例子中,“LibertyGuard 豪华房主政策”。 + +
+ +## 2. 选择文档加载器 + +进入您刚刚创建的文档存储,然后选择您要使用的[文档加载器](../integrations/langchain/document-loaders/)。在我们的例子中,由于我们的数据集采用 PDF 格式,因此我们将使用 [PDF Loader](../integrations/langchain/document-loaders/pdf-file.md)。 + +文档加载器是处理各种文档格式的摄取的专用节点。 + +
+ +
+ +## 3. 准备数据 + +### 第 1 步:文档加载器 + +* 首先,我们首先上传 PDF 文件。 +* 然后,我们添加一个**唯一的元数据密钥**。这是可选的,但这是一个很好的做法,因为它允许我们在以后需要时定位和过滤相同的数据集。 +* 每个加载器都带有预配置的元数据,在某些情况下您可以使用省略元数据键来删除不必要的元数据。 + +
+ +### 步骤 2:文本分割器 + +* 选择您要用于分块数据的[文本分割器](../integrations/langchain/text-splitters/)。在我们的特定情况下,我们将使用[递归字符文本分割器](../integrations/langchain/text-splitters/recursive-character-text-splitter.md)。 +* 文本分割器用于将加载的文档分割成更小的片段、文档或块。这是一个至关重要的预处理步骤,主要原因有两个: + + * **检索速度和相关性:** 将大型文档作为单个实体存储和查询矢量数据库中可能会导致检索时间变慢,并可能导致相关结果降低。将文档分割成更小的块可以实现更有针对性的检索。通过查询更小、更集中的信息单元,我们可以实现更快的响应时间并提高检索结果的精度。 + * **成本效益:** 由于我们只检索相关块而不是整个文档,因此 LLM 处理的令牌数量显着减少。这种有针对性的检索方法直接降低了 LLM 的使用成本,因为计费通常基于令牌消耗。通过最大限度地减少发送到 LLM 的不相关信息量,我们还优化了成本。 + + 有不同的文本分块策略,包括: + + * **字符文本分割:** 将文本分割成固定数量字符的块。这种方法很简单,但可能会将单词或短语分割成多个块,从而可能破坏上下文。 +* **标记文本分割:** 根据特定于所选嵌入模型的单词边界或标记化方案来分割文本。这种方法通常会产生语义上更连贯的块,因为它保留了单词边界并考虑了文本的底层语言结构。 + * **递归字符文本拆分:** 该策略旨在将文本划分为多个块,在保持指定大小限制的同时保持语义连贯性。它特别适合具有嵌套部分或标题的分层文档。它不是在字符限制下盲目分割,而是递归地分析文本以查找逻辑断点,例如句子结尾或分节符。这种方法确保每个块代表一个有意义的信息单元,即使它稍微超出目标大小。 + * **Markdown 文本分割器:** 专为 Markdown 格式文档设计,该拆分器根据 Markdown 标题和结构元素对文本进行逻辑分段,创建与文档中的逻辑部分相对应的块。 + * **代码文本分割器:** 专为拆分代码文件而设计,该策略考虑代码结构、函数定义和其他特定于编程语言的元素,以创建适合代码搜索和文档等任务的有意义的块。 + * **HTML-to-Markdown 文本分割器:** 此专用拆分器首先将 HTML 内容转换为 Markdown,然后应用 Markdown 文本分割器,从而允许对网页和其他 HTML 文档进行结构化分段。 + + 您还可以自定义参数,例如: + + * **块大小:** 每个块所需的最大大小,通常以字符或标记定义。 + * **块重叠:** 连续块之间重叠的字符或标记的数量,对于维护跨块的上下文流很有用。 + +{% hint style="info" %} +在本指南中,我们添加了慷慨的 **块重叠** 大小,以确保块之间不会丢失相关数据。但是,最佳重叠大小取决于数据的复杂性。您可能需要根据您的特定数据集和要提取的信息的性质来调整此值。 +{% endhint %} + +
+ +## 4.预览您的数据 + +现在,我们可以预览如何使用当前的 [文本分割器](../integrations/langchain/text-splitters/) 配置对数据进行分块; `chunk_size=1500` 和 `chunk_overlap=750`。 + +
+ +请务必尝试不同的[文本分割器](../integrations/langchain/text-splitters/)、块大小和重叠值,以找到适合您的特定数据集的最佳配置。此预览允许您优化分块过程并确保生成的块适合您的 RAG 系统。 + +
+ +{% hint style="info" %} +请注意,我们的自定义元数据 `company: "liberty"` 已插入到每个块中。即使我们对其他数据集使用相同的向量存储索引,此元数据也使我们能够稍后轻松地从该特定数据集中过滤和检索信息。 +{% endhint %} + +### 理解块重叠 + +在基于向量的检索和 LLM 查询的上下文中,块重叠在保持上下文连续性**和**提高响应准确性**方面发挥着重要作用,特别是在处理有限的检索深度或 **top K** 时,该参数确定从 [向量存储](https://docs.flowiseai.com/integrations/langchain/vector-stores) 检索以响应查询的最相似块的最大数量。 + +在查询处理期间,LLM 对向量存储执行相似性搜索,以检索与给定查询在语义上最相关的块。如果由顶部 K 参数表示的检索深度设置为一个较小的值(默认为 4),则 LLM 最初仅使用来自这 4 个块的信息来生成其响应。 + +这种情况给我们带来了一个问题,因为仅依赖有限数量的没有重叠的块可能会导致答案不完整或不准确,特别是在处理需要跨越多个块的信息的查询时。 + +块重叠通过确保连续块之间共享文本上下文的一部分来帮助解决此问题,**增加给定查询的所有相关信息包含在检索到的块中的可能性**。 + +换句话说,这种重叠充当块之间的桥梁,使 LLM 能够访问更宽的上下文窗口,即使仅限于一小部分检索到的块(前 K 个)。如果查询涉及超出单个块的概念或信息,则重叠区域会增加捕获所有必要上下文的可能性。 + +因此,通过在文本分割阶段引入块重叠,我们增强了 LLM 的能力: + +1. **保持上下文连续性:** 重叠块提供连续片段之间的信息更平滑的过渡,使模型能够保持对文本的更连贯的理解。 +2. **提高检索准确性:** 通过增加捕获目标前 K 个检索块内所有相关信息的概率,重叠有助于实现更准确和上下文适当的响应。 + +### 准确性与成本 + +因此,为了进一步优化检索精度和成本之间的权衡,可以使用两种主要策略: + +1. **增加/减少块重叠:** 在文本分割期间调整重叠百分比可以对块之间共享上下文的数量进行细粒度控制。较高的重叠百分比通常会改善上下文保留,但也可能会增加成本,因为您需要使用更多块来包含整个文档。相反,较低的重叠百分比可以降低成本,但可能会丢失块之间的关键上下文信息,从而可能导致 LLM 的答案不太准确或不完整。 +2. **增加/减少 Top K:** 提高默认的 top K 值 (4) 可扩展考虑用于生成响应的块的数量。虽然这可以提高准确性,但也会增加成本。 + +**提示词:**最佳**overlap**和**top K**值的选择取决于文档复杂性、嵌入模型特征以及准确性和成本之间所需的平衡等因素。对这些值进行试验对于找到满足特定需求的理想配置非常重要。 + +## 5. 处理您的数据 + +一旦您对分块过程感到满意,就可以处理数据了。 + +
+ +处理数据后,您仍然可以通过删除或添加内容来优化各个数据块。这种精细控制具有以下几个优点: + +* **提高准确性:** 识别并纠正原始数据中存在的不准确或不一致之处,确保您的应用程序中使用的信息可靠。 +* **提高相关性:** 细化块内容以强调关键信息并删除不相关的部分,从而提高检索过程的精度和有效性。 +* **查询优化:** 定制块以更好地与预期的用户查询保持一致,使它们更有针对性并改善整体用户体验。 + +## 6. 配置写入更新过程 + +通过正确处理我们的数据(通过文档加载器加载并适当分块),我们现在可以继续配置 upsert 过程。 + +
+ +upsert 过程包括三个基本步骤: + +* **嵌入:** 我们首先选择适当的嵌入模型来编码我们的数据集。该模型会将我们的数据转换为数值向量表示。 +* **矢量存储:** 接下来,我们确定数据集所在的矢量存储。 +* **记录管理器(可选):** 最后,我们可以选择实现记录管理器。该组件提供了在数据集存储在矢量存储中后管理数据集的功能。 + +
+ +### 第 1 步:选择嵌入 + +点击“选择嵌入”卡并选择您首选的[嵌入模型](../integrations/langchain/embeddings/)。在我们的示例中,我们将选择 OpenAI 作为嵌入提供程序,并使用具有 `1536` 维度的 `text-embedding-ada-002` 模型。 + +嵌入是将文本转换为捕获其含义的数字表示的过程。这种数字表示也称为嵌入向量,是一个多维数字数组,其中每个维度代表文本含义的特定方面。 + +这些向量允许法学硕士通过测量多维空间中文本之间的距离或相似性来比较和搜索向量存储中的相似文本。 + +#### 了解嵌入/向量存储维度 + +矢量存储索引中的维数由我们写入更新数据时使用的嵌入模型决定,反之亦然。每个维度代表数据中的特定特征或概念。例如,**维度**可能**代表文本的特定主题、情绪或其他方面**。 + +我们用来嵌入数据的维度越多,从文本中捕捉微妙含义的潜力就越大。然而,这种增加是以每个查询的计算要求更高为代价的。 + +一般来说,维度越多,需要更多的资源来存储、处理和比较生成的嵌入向量。因此,理论上,像 Google `embedding-001` 这样使用 768 维的嵌入模型比 OpenAI `text-embedding-3-large` 这样使用 3072 维的嵌入模型更便宜。 + +值得注意的是,**维度和意义捕获之间的关系并不是严格线性的**;存在一个收益递减点,即增加更多维度所带来的好处可以忽略不计,而增加的不必要的成本却可以忽略不计。 + +{% hint style="warning" %} +为了确保嵌入模型和向量存储索引之间的兼容性,维度对齐至关重要。 **嵌入模型和向量存储索引必须具有相同的维度数**。维度不匹配将导致插入错误,因为矢量存储旨在处理由所选嵌入模型确定的特定大小的矢量。 +{% endhint %} + +
+ +### 第 2 步:选择矢量存储 + +点击“选择向量存储”卡,然后选择您喜欢的[向量存储](../integrations/langchain/vector-stores/)。在我们的例子中,由于我们需要一个生产就绪选项,因此我们将选择 Upstash。 + +矢量存储是一种特殊类型的数据库,用于存储矢量嵌入。我们可以微调诸如“**top K**”之类的参数,这些参数确定从向量存储中检索以响应查询的最相似块的最大数量。 + +{% hint style="info" %} +较低的 top K 值将产生较少但可能更相关的结果,而较高的值将返回更广泛的结果,可能捕获更多信息。 +{% endhint %} + +
+ +### 步骤 3:选择记录管理器 + +记录管理器是我们的写入更新流程中的一个可选但非常有用的补充。它允许我们维护已写入更新矢量存储的所有块的记录,使我们能够根据需要有效地添加或删除块。 + +换句话说,在新的写入更新期间对文档进行的任何更改都不会导致向量存储中存储重复的向量嵌入。 + +有关如何设置和使用此功能的详细说明,请参阅专用的[指南](../integrations/langchain/record-managers.md)。 + +
+ +## 7. 将您的数据更新到矢量存储 + +要开始写入更新过程并将数据传输到矢量存储,请单击“写入更新”按钮。 + +
+ +如下图所示,我们的数据已成功插入到 Upstash 矢量数据库中。数据被分为 85 个块,以优化写入更新过程并确保高效的存储和检索。 + +
+ +## 8. 测试您的数据集 + +要快速测试数据集的功能而无需离开文档存储,只需使用“检索查询”按钮即可。这将启动测试查询,使您能够验证数据检索过程的准确性和有效性。 + +
+ +在我们的案例中,我们看到在查询保单中有关厨房地板承保范围的信息时,我们从 Upstash(我们指定的 向量存储)检索了 4 个相关块。根据定义的“top k”参数,此检索仅限于 4 个块,确保我们收到最相关的信息,而没有不必要的冗余。 + +
+ +## 9. 测试您的 RAG + +最后,我们的检索增强生成 (RAG) 系统投入运行。值得注意的是 LLM 如何有效地解释查询并成功地利用分块数据中的相关信息来构建全面的响应。 + +#### 智能体流程 + +使用代理节点,您可以添加文档存储: + +
+ +
+ +或者直接连接向量数据库和嵌入模式: + +
+ +#### 聊天流 + +您可以使用之前配置的矢量存储: + +
+ +或者,使用文档存储(矢量): + +
+ +## 10.API + +还有用于创建、更新和删除文档存储的 API 支持。在本节中,我们将重点介绍 2 个最常用的 API: + +* 写入更新 +* 刷新 + +有关详细信息,请参阅[文档存储API参考](../api-reference/document-store.md)。 + +### 写入更新 API + +写入更新过程有几种不同的场景,每种场景都有不同的结果。 + +#### 场景 1:在同一文档存储中,使用现有文档加载器配置,写入更新为新文档加载器。 + +
+ +{% hint style="success" %} +**`docId`** 表示现有文档加载器 ID。此场景的请求正文中需要它。 +{% endhint %} + +{% tabs %} +{% tab title="Python" %} +```python +import requests +import json + +DOC_STORE_ID = "your_doc_store_id" +DOC_LOADER_ID = "your_doc_loader_id" +API_URL = f"http://localhost:3000/api/v1/document-store/upsert/{DOC_STORE_ID}" +API_KEY = "your_api_key_here" + +form_data = { + "files": ('my-another-file.pdf', open('my-another-file.pdf', 'rb')) +} + +body_data = { + "docId": DOC_LOADER_ID +} + +headers = { + "Authorization": f"Bearer {BEARER_TOKEN}" +} + +def query(form_data): + response = requests.post(API_URL, files=form_data, data=body_data, headers=headers) + print(response) + return response.json() + +output = query(form_data) +print(output) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +const DOC_STORE_ID = "your_doc_store_id" +const DOC_LOADER_ID = "your_doc_loader_id" + +let formData = new FormData(); +formData.append("files", input.files[0]); +formData.append("docId", DOC_LOADER_ID) + +async function query(formData) { + const response = await fetch( + `http://localhost:3000/api/v1/document-store/upsert/${DOC_STORE_ID}`, + { + method: "POST", + headers: { + "Authorization": "Bearer " + }, + body: formData + } + ); + const result = await response.json(); + return result; +} + +query(formData).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +#### 场景 2:在同一文档存储中,用新文件替换现有文档加载器。 + +
+ +{% hint style="success" %} +此场景的请求正文中都需要 **`docId`** 和 **`replaceExisting`** 。 +{% endhint %} + +{% tabs %} +{% tab title="Python" %} +```python +import requests +import json + +DOC_STORE_ID = "your_doc_store_id" +DOC_LOADER_ID = "your_doc_loader_id" +API_URL = f"http://localhost:3000/api/v1/document-store/upsert/{DOC_STORE_ID}" +API_KEY = "your_api_key_here" + +form_data = { + "files": ('my-another-file.pdf', open('my-another-file.pdf', 'rb')) +} + +body_data = { + "docId": DOC_LOADER_ID, + "replaceExisting": True +} + +headers = { + "Authorization": f"Bearer {BEARER_TOKEN}" +} + +def query(form_data): + response = requests.post(API_URL, files=form_data, data=body_data, headers=headers) + print(response) + return response.json() + +output = query(form_data) +print(output) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +const DOC_STORE_ID = "your_doc_store_id"; +const DOC_LOADER_ID = "your_doc_loader_id"; + +let formData = new FormData(); +formData.append("files", input.files[0]); +formData.append("docId", DOC_LOADER_ID); +formData.append("replaceExisting", true); + +async function query(formData) { + const response = await fetch( + `http://localhost:3000/api/v1/document-store/upsert/${DOC_STORE_ID}`, + { + method: "POST", + headers: { + "Authorization": "Bearer " + }, + body: formData + } + ); + const result = await response.json(); + return result; +} + +query(formData).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +#### 场景 3:在同一文档存储中,从头开始写入更新为新文档加载器。 + +
+ +{% hint style="success" %} +此场景的请求正文中都需要 **`loader`、`splitter`、`embedding`、`vectorStore`**。 **`recordManager`** 是可选的。 +{% endhint %} + +{% tabs %} +{% tab title="Python" %} +```python +import requests +import json + +DOC_STORE_ID = "your_doc_store_id" +API_URL = f"http://localhost:3000/api/v1/document-store/upsert/{DOC_STORE_ID}" +API_KEY = "your_api_key_here" + +form_data = { + "files": ('my-another-file.pdf', open('my-another-file.pdf', 'rb')) +} + +loader = { + "name": "pdfFile", + "config": {} # you can leave empty to use default config +} + +splitter = { + "name": "recursiveCharacterTextSplitter", + "config": { + "chunkSize": 1400, + "chunkOverlap": 100 + } +} + +embedding = { + "name": "openAIEmbeddings", + "config": { + "modelName": "text-embedding-ada-002", + "credential": + } +} + +vectorStore = { + "name": "pinecone", + "config": { + "pineconeIndex": "exampleindex", + "pineconeNamespace": "examplenamespace", + "credential":
+ +{% hint style="success" %} +此场景的请求正文中都需要 **`createNewDocStore`** 和 **`docStore`** 。 +{% endhint %} + +{% tabs %} +{% tab title="Python" %} +```python +import requests +import json + +DOC_STORE_ID = "your_doc_store_id" +DOC_LOADER_ID = "your_doc_loader_id" +API_URL = f"http://localhost:3000/api/v1/document-store/upsert/{DOC_STORE_ID}" +API_KEY = "your_api_key_here" + +form_data = { + "files": ('my-another-file.pdf', open('my-another-file.pdf', 'rb')) +} + +body_data = { + "docId": DOC_LOADER_ID, + "createNewDocStore": True, + "docStore": json.dumps({"name":"My NEW Doc Store"}) +} + +headers = { + "Authorization": f"Bearer {BEARER_TOKEN}" +} + +def query(form_data): + response = requests.post(API_URL, files=form_data, data=body_data, headers=headers) + print(response) + return response.json() + +output = query(form_data) +print(output) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +const DOC_STORE_ID = "your_doc_store_id"; +const DOC_LOADER_ID = "your_doc_loader_id"; + +let formData = new FormData(); +formData.append("files", input.files[0]); +formData.append("docId", DOC_LOADER_ID); +formData.append("createNewDocStore", true); +formData.append("docStore", JSON.stringify({ "name": "My NEW Doc Store" })); + +async function query(formData) { + const response = await fetch( + `http://localhost:3000/api/v1/document-store/upsert/${DOC_STORE_ID}`, + { + method: "POST", + headers: { + "Authorization": "Bearer " + }, + body: formData + } + ); + const result = await response.json(); + return result; +} + +query(formData).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +#### 问:在哪里可以找到文档存储 ID 和文档加载器 ID? + +答:您可以从 URL 中找到相应的 ID。 + +
+ +#### 问:在哪里可以找到要覆盖的可用配置? + +答:您可以通过每个文档加载器上的 **View API** 按钮找到可用的配置: + +
+ +
+ +对于每个 upsert,涉及 5 个元素: + +* **`loader`** +* **`splitter`** +* **`embedding`** +* **`vectorStore`** +* **`recordManager`** + +您可以使用元素的 **`config`** 主体覆盖现有配置。例如,使用上面的屏幕截图,您可以使用新的 **`url`** 创建一个新的文档加载器: + +{% tabs %} +{% tab title="Python" %} +```python +import requests + +API_URL = "http://localhost:3000/api/v1/document-store/upsert/" + +def query(payload): + response = requests.post(API_URL, json=payload) + return response.json() + +output = query({ + "docId": , + # override existing configuration + "loader": { + "config": { + "url": "https://new-url.com" + } + } +}) +print(output) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/document-store/upsert/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "docId": , + // override existing configuration + "loader": { + "config": { + "url": "https://new-url.com" + } + } +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +如果loader有文件上传怎么办?是的,你猜对了,我们必须使用表单数据作为正文! + +使用下图作为示例,我们可以覆盖 PDF 文件加载器的 **`usage`** 参数,如下所示: + +
+ +{% tabs %} +{% tab title="Python" %} +```python +import requests +import json + +API_URL = "http://localhost:3000/api/v1/document-store/upsert/" +API_KEY = "your_api_key_here" + +form_data = { + "files": ('my-another-file.pdf', open('my-another-file.pdf', 'rb')) +} + +override_loader_config = { + "config": { + "usage": "perPage" + } +} + +body_data = { + "docId": , + "loader": json.dumps(override_loader_config) # Override existing configuration +} + +headers = { + "Authorization": f"Bearer {BEARER_TOKEN}" +} + +def query(form_data): + response = requests.post(API_URL, files=form_data, data=body_data, headers=headers) + print(response) + return response.json() + +output = query(form_data) +print(output) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +const DOC_STORE_ID = "your_doc_store_id"; +const DOC_LOADER_ID = "your_doc_loader_id"; + +const overrideLoaderConfig = { + "config": { + "usage": "perPage" + } +} + +let formData = new FormData(); +formData.append("files", input.files[0]); +formData.append("docId", DOC_LOADER_ID); +formData.append("loader", JSON.stringify(overrideLoaderConfig)); + +async function query(formData) { + const response = await fetch( + `http://localhost:3000/api/v1/document-store/upsert/${DOC_STORE_ID}`, + { + method: "POST", + headers: { + "Authorization": "Bearer " + }, + body: formData + } + ) + const result = await response.json(); + return result; +} + +query(formData).then((response) => { + console.log(response); +});e +``` +{% endtab %} +{% endtabs %} + +#### 问:何时使用表单数据与 JSON 作为 API 请求的正文? + +答:对于具有文件上传功能的[文档加载器](../integrations/langchain/document-loaders/),例如PDF、DOCX、TXT等,正文必须作为表单数据发送。 + +{% hint style="warning" %} +确保发送的文件类型与文档加载器期望的文件类型兼容。 + +例如,如果正在使用 [PDF 文件加载器](../integrations/langchain/document-loaders/pdf-file.md),则您应该仅发送 **.pdf** 文件。 + +为了避免针对不同的文件类型使用单独的加载器,我们建议使用 [文件加载器](../integrations/langchain/document-loaders/file-loader.md) +{% endhint %} + +{% tabs %} +{% tab title="Python API" %} +```python +import requests +import json + +API_URL = "http://localhost:3000/api/v1/document-store/upsert/" + +# use form data to upload files +form_data = { + "files": ('my-another-file.pdf', open('my-another-file.pdf', 'rb')) +} + +body_data = { + "docId": +} + +def query(form_data): + response = requests.post(API_URL, files=form_data, data=body_data) + print(response) + return response.json() + +output = query(form_data) +print(output) +``` +{% endtab %} + +{% tab title="Javascript API" %} +```javascript +// use FormData to upload files +let formData = new FormData(); +formData.append("files", input.files[0]); +formData.append("docId", ); + +async function query(formData) { + const response = await fetch( + "http://localhost:3000/api/v1/document-store/upsert/", + { + method: "POST", + body: formData + } + ); + const result = await response.json(); + return result; +} + +query(formData).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +对于不具有上传文件功能的其他 [文档加载器](https://docs.flowiseai.com/integrations/langchain/document-loaders) 节点,API 正文采用 **JSON** 格式: + +{% tabs %} +{% tab title="Python API" %} +```python +import requests + +API_URL = "http://localhost:3000/api/v1/document-store/upsert/" + +def query(payload): + response = requests.post(API_URL, json=payload) + return response.json() + +output = query({ + "docId": +}) +print(output) +``` +{% endtab %} + +{% tab title="Javascript API" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/document-store/upsert/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "docId": +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +#### 问:我可以添加新的元数据吗? + +答:您可以通过在正文请求中传递 **`metadata`** 来提供新的元数据: + +```json +{ + "docId": , + "metadata": { + "source: "abc" + } +} +``` + +### 刷新 API + +通常,您可能希望重新处理文档存储中的每个文档加载器以获取最新数据,并写入更新到矢量存储,以保持所有内容同步。这可以通过刷新 API 来完成: + +{% tabs %} +{% tab title="Python API" %} +```python +import requests + +API_URL = "http://localhost:3000/api/v1/document-store/refresh/" + +def query(): + response = requests.post(API_URL) + return response.json() + +output = query() +print(output) +``` +{% endtab %} + +{% tab title="Javascript API" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/document-store/refresh/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + } + } + ); + const result = await response.json(); + return result; +} + +query().then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +您还可以覆盖特定文档加载器的现有配置: + +{% tabs %} +{% tab title="Python API" %} +```python +import requests + +API_URL = "http://localhost:3000/api/v1/document-store/refresh/" + +def query(payload): + response = requests.post(API_URL, json=payload) + return response.json() + +output = query( +{ + "items": [ + { + "docId": , + "splitter": { + "name": "recursiveCharacterTextSplitter", + "config": { + "chunkSize": 2000, + "chunkOverlap": 100 + } + } + } + ] +} +) +print(output) +``` +{% endtab %} + +{% tab title="Javascript API" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/document-store/refresh/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "items": [ + { + "docId": , + "splitter": { + "name": "recursiveCharacterTextSplitter", + "config": { + "chunkSize": 2000, + "chunkOverlap": 100 + } + } + } + ] +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +## 11. 总结 + +我们首先创建一个文档存储来组织 LibertyGuard Deluxe 房主策略数据。然后通过上传、分块、处理和写入更新来准备这些数据,使其为我们的 RAG 系统做好准备。 + +**文档存储的优点:** + +文档存储为检索增强生成 (RAG) 系统的数据管理和准备提供了多种优势: + +* **组织和管理:** 它们提供用于存储、管理和准备数据的中央位置。 +* **数据质量:** 分块过程有助于构建数据以进行准确的检索和分析。 +* **灵活性:** 文档存储允许根据需要细化和调整数据,从而提高 RAG 系统的准确性和相关性。 + +## 12. 视频教程 + +### RAG 像老板一样 - Flowise 文档存储教程 + +在此视频中,[Leon](https://youtube.com/@leonvanzyl) 提供了有关使用文档存储轻松管理 FlowiseAI 中的 RAG 知识库的分步教程。 + +{% embed url="https://youtu.be/PLuSfAkOHOA" %} diff --git a/cn/using-flowise/embed.md b/cn/using-flowise/embed.md new file mode 100644 index 00000000..aa7506f0 --- /dev/null +++ b/cn/using-flowise/embed.md @@ -0,0 +1,304 @@ +--- +description: 了解如何自定义和嵌入我们的聊天小部件 +--- + +# 嵌入 + +*** + +您可以轻松地将聊天小部件添加到您的网站。只需复制提供的小部件脚本并将其粘贴到 `` and `` HTML 文件的标签。 + +
+ +## 小部件设置 + +以下视频演示了如何将小部件脚本注入任何网页。 + +{% embed url="https://github.com/FlowiseAI/Flowise/assets/26460777/c128829a-2d08-4d60-b821-1e41a9e677d0" %} + +## 使用特定版本 + +您可以指定要使用的 flowise-embed 的 `web.js` 版本。有关版本的完整列表:[https://www.npmjs.com/package/flowise-embed](https://www.npmjs.com/package/flowise-embed) + +```html + +``` + +{% hint style="warning" %} +在 Flowise **v2.1.0** 中,我们修改了流式传输的工作方式。如果您的 Flowise 版本低于该版本,您可能会发现嵌入式聊天机器人无法接收消息。 + +您可以将 Flowise 更新到 **v2.1.0** 及更高版本 + +或者,如果由于某种原因您不想更新 Flowise,您可以指定 [Flowise-嵌入](https://www.npmjs.com/package/flowise-embed?activeTab=versions) 的最新 **v1.x.x** 版本。最后维护的 `web.js` 版本是 **v1.3.14.** + +例如: + +`https://cdn.jsdelivr.net/npm/flowise-embed@1.3.14/dist/web.js` +{% endhint %} + +## 聊天流配置 + +您可以传递 `chatflowConfig` JSON 对象来覆盖现有配置。这与 API 中的[损坏的链接](broken-reference "mention")相同。 + +```html + +``` + +## 观察者配置 + +这允许您根据聊天机器人内的信号观察在父级中执行代码。 + +```html + +``` + +## 主题 + +您可以使用主题属性更改嵌入式聊天机器人的完整外观并启用工具提示词、免责声明、自定义欢迎消息等功能。这允许您深度自定义小部件的外观和感觉,包括: + +* **按钮:** 位置、大小、颜色、图标、拖放行为和自动打开。 +* **工具提示词:** 可见性、消息文本、背景颜色、文本颜色和字体大小。 +* **免责声明:** 标题、消息、文本颜色、按钮和背景,包括模糊覆盖选项。 +* **聊天窗口:** 标题、代理/用户消息显示、欢迎/错误消息、背景颜色/图像、尺寸、字体大小、启动提示词、HTML 渲染、消息样式(颜色、头像)、文本输入行为(占位符、颜色、字符限制、声音)、反馈选项、日期/时间显示和页脚自定义。 +* **自定义 CSS:** 直接注入 CSS 代码,以更好地控制外观,根据需要覆盖默认样式([请参阅下面的说明指南](embed.md#custom-css-modification)) + +```html + +``` + +**注意:** 查看完整的[配置列表](https://github.com/FlowiseAI/FlowiseChatEmbed#configuration) + +## 自定义代码修改 + +要修改嵌入式聊天小部件的完整源代码,请按照以下步骤操作: + +1. 分叉 [Flowise Chat 嵌入](https://github.com/FlowiseAI/FlowiseChatEmbed) 存储库 +2. 运行 `yarn install` 安装必要的依赖项 +3.然后您可以进行任何代码更改 +4. 运行 `yarn build` 以获取更改 +5. 将更改推送到分叉存储库 +6. 然后,您可以使用自定义 `web.js` 作为嵌入式聊天,如下所示: + +将 `username` 替换为您的 Github 用户名,并将 `forked-repo` 替换为您的分叉存储库。 + +
<script type="module">
+从“https://cdn.jsdelivr.net/gh/username/forked-repo/dist/web.js”导入聊天机器人
+      聊天机器人.init({
+          chatflowid: "您的chatflowid-这里",
+          apiHost: "您的 apihost-这里",
+      })
+
+
+ +
+ +```html + +``` + +{% hint style="info" %} +jsdelivr 的替代方案是 unpkg。这是一个例子: + +
https://unpkg.com/flowise-embed/dist/web.js
+
+{% endhint %} + +## 自定义CSS修改 + +您现在可以直接添加自定义 CSS 来设计嵌入式聊天小部件的样式,从而无需自定义 `web.js` 文件(需要 v2.0.8 或更高版本)。这使您能够: + +* 为每个嵌入式聊天机器人提供独特的外观和感觉 +* 使用官方 `web.js` — 样式不再需要自定义构建或托管 +* 即时更新样式 + +使用方法如下: + +```html + + +``` + +## CORS + +使用嵌入式聊天小部件时,您可能会遇到 CORS 问题,例如: + +{% hint style="danger" %} +访问“https://\”处的获取/api/v1/prediction/' 来自原点 'https://\' 已被 CORS 策略阻止:请求的资源上不存在“Access-Control-Allow-Origin”标头。 +{% endhint %} + +要修复它,请指定以下环境变量: + +``` +CORS_ORIGINS=* +IFRAME_ORIGINS=* +``` + +例如,如果您使用 `npx flowise start` + +``` +npx flowise start --CORS_ORIGINS=* --IFRAME_ORIGINS=* +``` + +如果使用 Docker,请将环境变量放置在 `Flowise/docker/.env` 内 + +如果使用本地 Git 克隆,请将环境变量放在 `Flowise/packages/server/.env` 内 + +## 视频教程 + +这两个视频将教您如何将 Flowise 小部件嵌入到网站中。 + +{% embed url="https://youtu.be/4paQ2wObDQ4" %} + +{% embed url="https://youtu.be/XOeCV1xyN48" %} diff --git a/cn/using-flowise/evaluations.md b/cn/using-flowise/evaluations.md new file mode 100644 index 00000000..6a612215 --- /dev/null +++ b/cn/using-flowise/evaluations.md @@ -0,0 +1,104 @@ +# 评价 + +{% hint style="info" %} +评估仅适用于云和企业计划 +{% endhint %} + +评估可帮助您监控和了解 聊天流/智能体流程 应用程序的性能。从高层次来看,评估是一个从 聊天流/智能体流程 获取一组输入和相应输出并生成分数的过程。这些分数可以通过将输出与参考结果进行比较来得出,例如通过字符串匹配、数字比较,甚至利用 LLM 作为判断。这些评估是使用数据集和评估器进行的。 + +## 数据集 + +数据集是用于运行 聊天流/智能体流程 的输入,以及用于比较的相应输出。用户可以手动添加输入和预期输出,或上传包含 2 列的 CSV 文件:输入和输出。 + +
+ +|输入|输出| +| --------------------------------- | ---------------------------- | +|英国的首都是哪里 |英国首都是伦敦 | +|一年有多少天 |一年有365天 | + +## 评估者 + +评估器就像单元测试。在评估期间,来自数据集的输入在选定的流上运行,并使用选定的评估器评估输出。评估者有 3 种类型: + +* **基于文本**:基于字符串的检查: + * 包含任何 + * 包含全部 + * 不包含任何 + * 不包含全部 + * 开头为 + * 不开头于 + +
+ +* **基于数字:** 数字类型检查: + * 代币总数 + * 提示词令牌 + * 完成标记 + * API 延迟 + * LLM 延迟 + * 聊天流延迟 + * 智能体流程 延迟(即将推出) + * 输出字符长度 + +
+ +* **LLM 基于**:使用另一个 LLM 对输出进行分级 + * 幻觉 + * 正确性 + +
+ +## 评价 + +现在我们已经准备好了数据集和评估器,我们可以开始运行评估。 + +1.) 选择要评估的数据集和聊天流。您可以选择多个数据集和聊天流。使用下面的示例,来自 Dataset1 的每个输入都将针对 2 个聊天流运行。由于 Dataset1 有 2 个输入,因此将生成和评估总共 4 个输出。 + +
+ +2.) 选择评估者。在此阶段只能选择基于字符串和基于数字的求值器。 + +
+ +3.) (可选)选择基于 LLM 的评估器。开始评估: + +
+ +4.) 等待评估完成: + +
+ +5.) 评估完成后,点击右侧图表图标可查看详细信息: + +
+ +上面的三张图表显示了评估的摘要: + +* 通过/失败率 +* 使用的平均提示词和完成标记 +* 请求的平均延迟 + +图表下方的表格显示了每次执行的详细信息。 + +
+ +
+ +### 重新运行评估 + +当评估中使用的流程被更新/修改时,将显示一条警告消息: + +
+ +您可以使用右上角的重新运行评估按钮重新运行相同的评估。您将能够看到不同的版本: + +
+ +您还可以查看并比较不同版本的结果: + +
+ +## 视频教程 + +{% embed url="https://youtu.be/kgUttHMkGFg?si=3rLplEp_0TI0p6UV&t=486" %} diff --git a/cn/using-flowise/monitoring.md b/cn/using-flowise/monitoring.md new file mode 100644 index 00000000..d0149259 --- /dev/null +++ b/cn/using-flowise/monitoring.md @@ -0,0 +1,118 @@ +# 监控 + +Flowise 通过 Grafana 和 OpenTelemetry 对 Prometheus 提供本机支持。但是,仅跟踪高级指标,例如 API 请求、流量/预测计数。有关计数器指标列表,请参阅[此处](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/Interface.Metrics.ts#L13)。有关逐个节点可观察性的详细信息,我们建议使用 [分析](/broken/pages/z1V6RsbL6q6hrrswC3e9)。 + +## 普罗米修斯 + +[Prometheus](https://prometheus.io/) 是一种开源监控和警报解决方案。 + +在设置 Prometheus 之前,请在 Flowise 中配置以下环境变量: + +```properties +ENABLE_METRICS=true +METRICS_PROVIDER=prometheus +METRICS_INCLUDE_NODE_METRICS=true +``` + +### 身份验证设置 + +`/api/v1/metrics` 端点需要 API 密钥身份验证。您需要: + +1. 按照[此处](https://docs.flowiseai.com/configuration/authorization/chatflow-level#api-key)的说明生成API密钥 +2. 将 API 密钥保存到 Prometheus 可访问的文件中(例如 `/etc/prometheus/api_key.txt`) +3. 配置 Prometheus 使用不记名令牌身份验证 + +### 普罗米修斯配置 + +Prometheus 安装后,使用配置文件运行它。 Flowise 提供了一个默认配置文件,您可以在[此处](https://github.com/FlowiseAI/Flowise/blob/main/metrics/prometheus/prometheus.config.yml)找到该文件。 + +您需要将身份验证配置添加到 Prometheus 配置文件中: + +```yaml +scrape_configs: + - job_name: 'flowise' + static_configs: + - targets: ['localhost:3000'] + metrics_path: '/api/v1/metrics' + authorization: + type: Bearer + credentials_file: '/etc/prometheus/api_key.txt' +``` + +请记住同时运行 Flowise 实例。您可以打开浏览器并导航到端口 9090。从仪表板中,您应该能够看到指标端点 - `/api/v1/metrics` 现已启用身份验证。 + +
+ +`/api/v1/metrics` 端点可供 Prometheus 从中提取指标,但需要 API 密钥身份验证(如上面配置)。 + +## 格拉法纳 + +Prometheus 收集丰富的指标并提供强大的查询语言; Grafana 将指标转化为有意义的可视化。 + +Grafana 可以通过多种方式安装。请参阅[指南](https://grafana.com/docs/grafana/latest/setup-grafana/installation/)。 + +Grafana 默认情况下会公开端口 9091: + +
+ +在左侧栏单击“添加新连接”,然后选择“Prometheus”: + +
+ +由于我们的 Prometheus 服务于端口 9090: + +
+ +滚动到底部并测试连接: + +
+ +记下工具栏中显示的数据源 ID,我们需要它来创建仪表板: + +
+ +现在连接已成功添加,我们可以开始添加仪表板。在左侧栏中,单击仪表板,然后单击创建仪表板。 + +Flowise 提供 2 个模板仪表板: + +* [grafana.dashboard.app.json.txt](https://github.com/FlowiseAI/Flowise/blob/main/metrics/grafana/grafana.dashboard.app.json.txt):API 指标,例如聊天流/智能体流程的数量、预测计数、工具、助手、写入更新的向量等。 +* [grafana.dashboard.server.json.txt](https://github.com/FlowiseAI/Flowise/blob/main/metrics/grafana/grafana.dashboard.server.json.txt):Flowise Node.js 实例的指标,例如堆、CPU、RAM 使用情况 + +如果您使用上述模板,请查找所有出现的 `cds4j1ybfuhogb` 并将其替换为您之前创建并保存的数据源 ID。 + +
+ +您还可以选择先导入,然后再编辑 JSON: + +
+ +现在,尝试在 Flowise 上执行一些操作,您应该能够看到显示的指标: + +
+ +
+ +## 开放遥测 + +[OpenTelemetry](https://opentelemetry.io/) 是一个用于创建和管理遥测数据的开源框架。要启用 OTel,请在 Flowise 中配置以下环境变量: + +```properties +ENABLE_METRICS=true +METRICS_PROVIDER=open_telemetry +METRICS_INCLUDE_NODE_METRICS=true +METRICS_OPEN_TELEMETRY_METRIC_ENDPOINT=http://localhost:4318/v1/metrics +METRICS_OPEN_TELEMETRY_PROTOCOL=http # http | grpc | proto (default is http) +METRICS_OPEN_TELEMETRY_DEBUG=true +``` + +接下来,我们需要 OpenTelemetry Collector 来接收、处理和导出遥测数据。 Flowise 提供了 [docker compose 文件](https://github.com/FlowiseAI/Flowise/blob/main/metrics/otel/compose.yaml),可用于启动收集器容器。 + +```bash +cd Flowise +cd metrics && cd otel +docker compose up -d +``` + +收集器将使用同一目录下的 [otel.config.yml](https://github.com/FlowiseAI/Flowise/blob/main/metrics/otel/otel.config.yml) 文件进行配置。目前仅支持[Datadog](https://www.datadoghq.com/)和Prometheus,请参阅[Open Telemetry](https://opentelemetry.io/)文档来配置不同的APM工具,例如Zipkin、Jeager、New Relic、Splunk等。 + +确保替换为 yml 文件中导出器所需的 API 键。 diff --git a/cn/using-flowise/prediction.md b/cn/using-flowise/prediction.md new file mode 100644 index 00000000..7260429e --- /dev/null +++ b/cn/using-flowise/prediction.md @@ -0,0 +1,1887 @@ +# 预言 + +预测 API 是与 Flowise 流和助手交互的主要端点。它允许您向所选流发送消息并接收回复。该 API 处理核心聊天功能,包括: + +* **聊天互动**:向您的流程发送问题或消息并接收人工智能生成的回复 +* **流式输出响应**:获取实时流式输出响应以获得更好的用户体验 +* **对话记忆**:维护会话中多个消息的上下文 +* **文件处理**:作为查询的一部分上传和处理图像、音频和其他文件 +* **动态配置**:覆盖聊天流设置并在运行时传递变量 + +有关详细信息,请参阅[预测端点API参考](../api-reference/prediction.md)。 + +## 基础 URL 和身份验证 + +**基础 URL**:`http://localhost:3000`(或您的 Flowise 实例 URL) + +**端点**:`POST /api/v1/prediction/:id` + +**身份验证**:请参阅[流身份验证](../configuration/authorization/chatflow-level.md) + +## 请求格式 + +#### 基本请求结构 + +```json +{ + "question": "Your message here", + "streaming": false, + "overrideConfig": {}, + "history": [], + "uploads": [], + "form": {} +} +``` + +#### 参数 + +|参数|类型 |必填 |描述 | +| ---------------- | ------- | --------------------------- | ------------------------------------------- | +| `question` |字符串|是的 |要发送到流程的消息/问题 | +| `form` |对象| `question` 或 `form` |要发送到流程的表单对象 | +| `streaming` |布尔 |没有 |启用流响应(默认值:false)| +| `overrideConfig` |对象|没有 |覆盖流配置 | +| `history` |数组|没有 |以前的对话消息 | +| `uploads` |数组|没有 |要上传的文件(图像、音频等)| +| `humanInput` |对象|没有 |返回人类反馈并恢复执行 | + +## SDK 库 + +Flowise 提供 Python 和 TypeScript/JavaScript 的官方 SDK: + +####安装 + +**Python**:`pip install flowise` + +**TypeScript/JavaScript**:`npm install flowise-sdk` + +#### Python SDK 用法 + +{% tabs %} +{% tab title="Basic Usage" %} +```python +from flowise import Flowise, PredictionData + +# Initialize client +client = Flowise(base_url="http://localhost:3000") + +# Non-streaming prediction +try: + response = client.create_prediction( + PredictionData( + chatflowId="your-chatflow-id", + question="What is machine learning?", + streaming=False + ) + ) + + # Handle response + for result in response: + print("Response:", result) + +except Exception as e: + print(f"Error: {e}") +``` +{% endtab %} + +{% tab title="Streaming" %} +```python +from flowise import Flowise, PredictionData + +client = Flowise(base_url="http://localhost:3000") + +# Streaming prediction +try: + response = client.create_prediction( + PredictionData( + chatflowId="your-chatflow-id", + question="Tell me a long story about AI", + streaming=True + ) + ) + + # Process streaming chunks + print("Streaming response:") + for chunk in response: + print(chunk, end="", flush=True) + +except Exception as e: + print(f"Error: {e}") +``` +{% endtab %} + +{% tab title="With Configuration" %} +```python +from flowise import Flowise, PredictionData + +client = Flowise(base_url="http://localhost:3000") + +# Advanced configuration +try: + response = client.create_prediction( + PredictionData( + chatflowId="your-chatflow-id", + question="Analyze this data", + streaming=False, + overrideConfig={ + "sessionId": "user-session-123", + "temperature": 0.7, + "maxTokens": 500, + "returnSourceDocuments": True + } + ) + ) + + for result in response: + print("Response:", result) + +except Exception as e: + print(f"Error: {e}") +``` +{% endtab %} +{% endtabs %} + +#### TypeScript/JavaScript SDK 用法 + +{% tabs %} +{% tab title="Basic Usage" %} +```typescript +import { FlowiseClient } from 'flowise-sdk'; + +// Initialize client +const client = new FlowiseClient({ + baseUrl: 'http://localhost:3000' +}); + +// Non-streaming prediction +async function chatWithFlow() { + try { + const response = await client.createPrediction({ + chatflowId: 'your-chatflow-id', + question: 'What is machine learning?', + streaming: false + }); + + console.log('Response:', response); + + } catch (error) { + console.error('Error:', error); + } +} + +chatWithFlow(); +``` +{% endtab %} + +{% tab title="Streaming" %} +```typescript +import { FlowiseClient } from 'flowise-sdk'; + +const client = new FlowiseClient({ + baseUrl: 'http://localhost:3000' +}); + +// Streaming prediction +async function streamingChat() { + try { + const stream = await client.createPrediction({ + chatflowId: 'your-chatflow-id', + question: 'Tell me a long story about AI', + streaming: true + }); + + console.log('Streaming response:'); + for await (const chunk of stream) { + process.stdout.write(chunk); + } + + } catch (error) { + console.error('Error:', error); + } +} + +streamingChat(); +``` +{% endtab %} + +{% tab title="With Configuration" %} +```typescript +import { FlowiseClient } from 'flowise-sdk'; + +const client = new FlowiseClient({ + baseUrl: 'http://localhost:3000' +}); + +// Advanced configuration +async function advancedChat() { + try { + const response = await client.createPrediction({ + chatflowId: 'your-chatflow-id', + question: 'Analyze this data', + streaming: false, + overrideConfig: { + sessionId: 'user-session-123', + temperature: 0.7, + maxTokens: 500, + returnSourceDocuments: true + } + }); + + console.log('Response:', response); + + } catch (error) { + console.error('Error:', error); + } +} + +advancedChat(); +``` +{% endtab %} +{% endtabs %} + +## 直接 HTTP API 用法 + +如果您更喜欢直接使用 REST API 而不使用 SDK: + +#### 基本请求 + +{% tabs %} +{% tab title="Python (requests)" %} +```python +import requests +import json + +def send_message(chatflow_id, question, streaming=False): + url = f"http://localhost:3000/api/v1/prediction/{chatflow_id}" + + payload = { + "question": question, + "streaming": streaming + } + + headers = { + "Content-Type": "application/json" + } + + try: + response = requests.post(url, json=payload, headers=headers) + response.raise_for_status() # Raise exception for bad status codes + + return response.json() + + except requests.exceptions.RequestException as e: + print(f"Request failed: {e}") + return None + +# Usage +result = send_message( + chatflow_id="your-chatflow-id", + question="What is artificial intelligence?", + streaming=False +) + +if result: + print("Response:", result) +``` +{% endtab %} + +{% tab title="JavaScript (fetch)" %} +```javascript +async function sendMessage(chatflowId, question, streaming = false) { + const url = `http://localhost:3000/api/v1/prediction/${chatflowId}`; + + const payload = { + question: question, + streaming: streaming + }; + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const result = await response.json(); + return result; + + } catch (error) { + console.error('Request failed:', error); + return null; + } +} + +// Usage +sendMessage( + 'your-chatflow-id', + 'What is artificial intelligence?', + false +).then(result => { + if (result) { + console.log('Response:', result); + } +}); +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl -X POST "http://localhost:3000/api/v1/prediction/your-chatflow-id" \ + -H "Content-Type: application/json" \ + -d '{ + "question": "What is artificial intelligence?", + "streaming": false + }' +``` +{% endtab %} +{% endtabs %} + +## 高级功能 + +### 表单输入 + +在 智能体流程 V2 中,您可以选择 `form` 作为输入类型。 + +
+ +您可以通过表单输入的变量名称覆盖该值 + +```json +{ + "form": { + "title": "Example", + "count": 1, + ... + } +} +``` + +{% tabs %} +{% tab title="Python" %} +```python +import requests + +def prediction(flow_id, form): + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + payload = { + "form": form + } + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +result = prediction( + flow_id="your-flow-id", + form={ + "title": "ABC", + "choices": "A" + } +) + +print(result) +``` +{% endtab %} + +{% tab title="JavaScript" %} +```javascript +async function prediction(flowId, form) { + const url = `http://localhost:3000/api/v1/prediction/${flowId}`; + + const payload = { + form: form + }; + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } +} + +prediction( + 'your-flow-id', + { + "title": "ABC", + "choices": "A" + } +).then(result => { + console.log(result); +}); +``` +{% endtab %} +{% endtabs %} + +### 配置覆盖 + +动态覆盖聊天流设置。 + +出于安全原因,默认情况下,覆盖配置是**禁用**的。从右上角启用它: **设置** → **配置** → **安全** 选项卡: + +
+ +{% tabs %} +{% tab title="Python" %} +```python +import requests + +def query_with_config(flow_id, question, config): + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + payload = { + "question": question, + "overrideConfig": config + } + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Example: Override session and return source documents +result = query_with_config( + flow_id="your-flow-id", + question="How does machine learning work?", + config={ + "sessionId": "user-123", + "temperature": 0.5, + "maxTokens": 1000 + } +) + +print(result) +``` +{% endtab %} + +{% tab title="JavaScript" %} +```javascript +async function queryWithConfig(flowId, question, config) { + const url = `http://localhost:3000/api/v1/prediction/${flowId}`; + + const payload = { + question: question, + overrideConfig: config + }; + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } +} + +// Example: Override session and return source documents +queryWithConfig( + 'your-flow-id', + 'How does machine learning work?', + { + sessionId: 'user-123', + temperature: 0.5, + maxTokens: 1000 + } +).then(result => { + console.log(result); +}); +``` +{% endtab %} +{% endtabs %} + +对于 `array` 类型,将鼠标悬停在信息图标上将显示可以覆盖的架构。 + +overrideConfig 中的数组值将与现有数组值连接。例如,如果现有 `startState` 具有: + +```json +{ + "key": "key1", + "value": "value1" +} +``` + +如果我们启用覆盖: + +
+ +```json +"overrideConfig": { + "startState": [ + { + "key": "foo", + "value": "bar" + } + ], + "llmMessages": [ + { + "role": "system", + "content": "You are helpful assistant" + } + ] +} +``` + +最终的 `startState` 将是: + +```json +[ + { + "key": "key1", + "value": "value1" + }, + { + "key": "foo", + "value": "bar" + }, +] +``` + +### 覆盖特定节点 + +默认情况下,如果多个节点共享相同类型并且未指定节点 ID,则覆盖属性将在所有匹配节点上更新该属性。 + +例如,有 2 个 LLM 节点,我想覆盖系统消息: + +
+ +启用覆盖功能后: + +
+ +我可以覆盖两个 LLM 的系统消息,如下所示: + +```json +"overrideConfig": { + "llmMessages": [ + { + "role": "system", + "content": "You are sarcastic" + } + ] +} +``` + +从执行中,您可以看到覆盖的系统消息: + +
+ +
+ +在某些情况下,您可能只想覆盖特定节点的配置。您可以通过在要覆盖的属性**内部**指定节点 ID 来实现此目的。 + +例如: + +```json +"overrideConfig": { + "llmMessages": { + "llmAgentflow_0": [ + { + "role": "system", + "content": "You are sweet" + } + ], + "llmAgentflow_1": [ + { + "role": "system", + "content": "You are smart" + } + ] + } +} +``` + +如果返回执行,您可以看到每个 LLM 都有正确的覆盖值: + +
+ +
+ +### 对话历史记录 + +通过在历史数组中包含以前的消息来提供对话上下文。 + +**历史消息格式** + +```json +{ + "role": "apiMessage" | "userMessage", + "content": "Message content" +} +``` + +{% tabs %} +{% tab title="Python" %} +```python +import requests + +def chat_with_history(flow_id, question, history): + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + payload = { + "question": question, + "history": history + } + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Example conversation with context +conversation_history = [ + { + "role": "apiMessage", + "content": "Hello! I'm an AI assistant. How can I help you today?" + }, + { + "role": "userMessage", + "content": "Hi, my name is Sarah and I'm learning about AI" + }, + { + "role": "apiMessage", + "content": "Nice to meet you, Sarah! I'd be happy to help you learn about AI. What specific aspects interest you?" + } +] + +result = chat_with_history( + flow_id="your-flow-id", + question="Can you explain neural networks in simple terms?", + history=conversation_history +) + +print(result) +``` +{% endtab %} + +{% tab title="JavaScript" %} +```javascript +async function chatWithHistory(flowId, question, history) { + const url = `http://localhost:3000/api/v1/prediction/${flowId}`; + + const payload = { + question: question, + history: history + }; + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } +} + +// Example conversation with context +const conversationHistory = [ + { + role: "apiMessage", + content: "Hello! I'm an AI assistant. How can I help you today?" + }, + { + role: "userMessage", + content: "Hi, my name is Sarah and I'm learning about AI" + }, + { + role: "apiMessage", + content: "Nice to meet you, Sarah! I'd be happy to help you learn about AI. What specific aspects interest you?" + } +]; + +chatWithHistory( + 'your-flow-id', + 'Can you explain neural networks in simple terms?', + conversationHistory +).then(result => { + console.log(result); +}); +``` +{% endtab %} +{% endtabs %} + +### 会话管理 + +使用 `sessionId` 在多个 API 调用之间维护对话状态。每个会话都维护自己的对话上下文和内存。 + +{% tabs %} +{% tab title="Python" %} +```python +import requests + +class FlowiseSession: + def __init__(self, flow_id, session_id, base_url="http://localhost:3000"): + self.flow_id= flow_id + self.session_id = session_id + self.base_url = base_url + self.url = f"{base_url}/api/v1/prediction/{flow_id}" + + def send_message(self, question, **kwargs): + payload = { + "question": question, + "overrideConfig": { + "sessionId": self.session_id, + **kwargs.get("overrideConfig", {}) + } + } + + # Add any additional parameters + for key, value in kwargs.items(): + if key != "overrideConfig": + payload[key] = value + + try: + response = requests.post(self.url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Usage +session = FlowiseSession( + flow_id="your-flow-id", + session_id="user-session-123" +) + +# First message +response1 = session.send_message("Hello, my name is John") +print("Response 1:", response1) + +# Second message - will remember the previous context +response2 = session.send_message("What's my name?") +print("Response 2:", response2) +``` +{% endtab %} + +{% tab title="JavaScript" %} +```javascript +class FlowiseSession { + constructor(flowId, sessionId, baseUrl = 'http://localhost:3000') { + this.flowId= flowId; + this.sessionId = sessionId; + this.baseUrl = baseUrl; + this.url = `${baseUrl}/api/v1/prediction/${flowId}`; + } + + async sendMessage(question) { + const payload = { + question: question, + overrideConfig: { + sessionId: this.sessionId + } + }; + + try { + const response = await fetch(this.url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } + } +} + +// Usage +const session = new FlowiseSession( + 'your-flow-id', + 'user-session-123' +); + +async function conversationExample() { + // First message + const response1 = await session.sendMessage("Hello, my name is John"); + console.log("Response 1:", response1); + + // Second message - will remember the previous context + const response2 = await session.sendMessage("What's my name?"); + console.log("Response 2:", response2); +} + +conversationExample(); +``` +{% endtab %} +{% endtabs %} + +### 变量 + +使用 `overrideConfig` 中的 `vars` 属性将动态变量传递到流。可以在流程中使用变量来注入动态内容。 + +{% hint style="warning" %} +必须先创建变量,然后才能覆盖它。请参阅[变量](variables.md) +{% endhint %} + +{% tabs %} +{% tab title="Python" %} +```python +import requests + +def send_with_variables(flow_id, question, variables): + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + payload = { + "question": question, + "overrideConfig": { + "vars": variables + } + } + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Example: Pass user information and preferences +result = send_with_variables( + flow_id="your-flow-id", + question="Create a personalized workout plan", + variables={ + "user_name": "Alice", + "fitness_level": "intermediate", + "preferred_duration": "30 minutes", + "equipment": "dumbbells, resistance bands", + "goals": "strength training, flexibility" + } +) + +print(result) +``` +{% endtab %} + +{% tab title="JavaScript" %} +```javascript +async function sendWithVariables(flowId, question, variables) { + const url = `http://localhost:3000/api/v1/prediction/${flowId}`; + + const payload = { + question: question, + overrideConfig: { + vars: variables + } + }; + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } +} + +// Example: Pass user information and preferences +sendWithVariables( + 'your-flow-id', + 'Create a personalized workout plan', + { + user_name: 'Alice', + fitness_level: 'intermediate', + preferred_duration: '30 minutes', + equipment: 'dumbbells, resistance bands', + goals: 'strength training, flexibility' + } +).then(result => { + console.log(result); +}); +``` +{% endtab %} +{% endtabs %} + +### 图片上传 + +当您的流程支持图像处理时,上传图像以进行视觉分析。请参阅[图片](uploads.md#image)以获取更多参考。 + +**上传结构:** + +```json +{ + "data": "", + "type": "", + "name": ", + "mime": " +} +``` + +**数据:** 图像的 Base64 或 URL + +**类型**:`url` 或 `file` + +**名称:** 图片名称 + +**哑剧**:`image/png`、`image/jpeg`、`image/jpg` + +{% tabs %} +{% tab title="Python (Base64)" %} +```python +import requests +import base64 +import os + +def upload_image(flow_id, question, image_path): + # Read and encode image + with open(image_path, 'rb') as image_file: + encoded_image = base64.b64encode(image_file.read()).decode('utf-8') + + # Determine MIME type based on file extension + mime_types = { + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg', + '.gif': 'image/gif', + '.webp': 'image/webp' + } + + file_ext = os.path.splitext(image_path)[1].lower() + mime_type = mime_types.get(file_ext, 'image/png') + + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + payload = { + "question": question, + "uploads": [ + { + "data": f"data:{mime_type};base64,{encoded_image}", + "type": "file", + "name": os.path.basename(image_path), + "mime": mime_type + } + ] + } + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Example usage +result = upload_image( + flow_id="your-flow-id", + question="Can you describe what you see in this image?", + image_path="path/to/your/image.png" +) + +print(result) +``` +{% endtab %} + +{% tab title="Python (URL)" %} +```python +import requests +import os + +def upload_image_url(flow_id, question, image_url, image_name=None): + """ + Upload an image using a URL instead of base64 encoding. + This is more efficient for images that are already hosted online. + """ + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + # Extract filename from URL if not provided + if not image_name: + image_name = image_url.split('/')[-1] + if '?' in image_name: + image_name = image_name.split('?')[0] + + # Determine MIME type from URL extension + mime_types = { + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg', + '.gif': 'image/gif', + '.webp': 'image/webp' + } + + file_ext = os.path.splitext(image_name)[1].lower() + mime_type = mime_types.get(file_ext, 'image/jpeg') + + payload = { + "question": question, + "uploads": [ + { + "data": image_url, + "type": "url", + "name": image_name, + "mime": mime_type + } + ] + } + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Example usage with public image URL +result = upload_image_url( + flow_id="your-flow-id", + question="What's in this image? Analyze it in detail.", + image_url="https://example.com/path/to/image.jpg", + image_name="example_image.jpg" +) + +print(result) + +# Example with direct URL (no custom name) +result2 = upload_image_url( + chatflow_id="your-chatflow-id", + question="Describe this screenshot", + image_url="https://i.imgur.com/sample.png" +) + +print(result2) +``` +{% endtab %} + +{% tab title="JavaScript (File Upload)" %} +```javascript +async function uploadImage(flowId, question, imageFile) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + + reader.onload = async function(e) { + const base64Data = e.target.result; + + const payload = { + question: question, + uploads: [ + { + data: base64Data, + type: 'file', + name: imageFile.name, + mime: imageFile.type + } + ] + }; + + try { + const response = await fetch(`http://localhost:3000/api/v1/prediction/${flowId}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const result = await response.json(); + resolve(result); + + } catch (error) { + reject(error); + } + }; + + reader.onerror = function() { + reject(new Error('Failed to read file')); + }; + + reader.readAsDataURL(imageFile); + }); +} + +// Example usage in browser +document.getElementById('imageInput').addEventListener('change', async function(e) { + const file = e.target.files[0]; + if (file) { + try { + const result = await uploadImage( + 'your-flow-id', + 'Can you describe what you see in this image?', + file + ); + console.log('Analysis result:', result); + } catch (error) { + console.error('Upload failed:', error); + } + } +}); +``` +{% endtab %} + +{% tab title="JavaScript (URL)" %} +```javascript +async function uploadImageUrl(flowId, question, imageUrl, imageName = null) { + /** + * Upload an image using a URL instead of base64 encoding. + * This is more efficient for images that are already hosted online. + */ + + // Extract filename from URL if not provided + if (!imageName) { + imageName = imageUrl.split('/').pop(); + if (imageName.includes('?')) { + imageName = imageName.split('?')[0]; + } + } + + // Determine MIME type from URL extension + const mimeTypes = { + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg', + '.gif': 'image/gif', + '.webp': 'image/webp' + }; + + const fileExt = imageName.toLowerCase().substring(imageName.lastIndexOf('.')); + const mimeType = mimeTypes[fileExt] || 'image/jpeg'; + + const payload = { + question: question, + uploads: [ + { + data: imageUrl, + type: 'url', + name: imageName, + mime: mimeType + } + ] + }; + + try { + const response = await fetch(`http://localhost:3000/api/v1/prediction/${flowId}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } +} + +// Example usage with public image URL +async function analyzeImageFromUrl() { + try { + const result = await uploadImageUrl( + 'your-flow-id', + 'What is in this image? Analyze it in detail.', + 'https://example.com/path/to/image.jpg', + 'example_image.jpg' + ); + + console.log('Analysis result:', result); + } catch (error) { + console.error('Upload failed:', error); + } +} + +// Example with direct URL (no custom name) +uploadImageUrl( + 'your-flow-id', + 'Describe this screenshot', + 'https://i.imgur.com/sample.png' +).then(result => { + if (result) { + console.log('Analysis result:', result); + } +}); + +// Example with multiple image URLs +async function analyzeMultipleImages() { + const imageUrls = [ + 'https://example.com/image1.jpg', + 'https://example.com/image2.png', + 'https://example.com/image3.gif' + ]; + + const results = await Promise.all( + imageUrls.map(url => + uploadImageUrl( + 'your-flow-id', + `Analyze this image: ${url}`, + url + ) + ) + ); + + results.forEach((result, index) => { + console.log(`Image ${index + 1} analysis:`, result); + }); +} +``` +{% endtab %} + +{% tab title="JavaScript (Node.js)" %} +```javascript +const fs = require('fs'); +const path = require('path'); + +async function uploadImage(flowId, question, imagePath) { + // Read image file + const imageBuffer = fs.readFileSync(imagePath); + const base64Image = imageBuffer.toString('base64'); + + // Determine MIME type + const ext = path.extname(imagePath).toLowerCase(); + const mimeTypes = { + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg', + '.gif': 'image/gif', + '.webp': 'image/webp' + }; + const mimeType = mimeTypes[ext] || 'image/png'; + + const payload = { + question: question, + uploads: [ + { + data: `data:${mimeType};base64,${base64Image}`, + type: 'file', + name: path.basename(imagePath), + mime: mimeType + } + ] + }; + + try { + const response = await fetch(`http://localhost:3000/api/v1/prediction/${flowId}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } +} + +// Example usage +uploadImage( + 'your-flow-id', + 'Can you describe what you see in this image?', + 'path/to/your/image.png' +).then(result => { + console.log('Analysis result:', result); +}); +``` +{% endtab %} +{% endtabs %} + +### 音频上传(语音转文本) + +上传音频文件以进行语音转文本处理。有关更多参考,请参阅[音频](uploads.md#audio)。 + +**上传结构:** + +```json +{ + "data": "", + "type": "", + "name": ", + "mime": " +} +``` + +**数据:** 音频的 Base64 或 URL + +**类型**:`url` 或 `file` + +**名称:** 音频名称 + +**哑剧**:`audio/mp4`、`audio/webm`、`audio/wav`、`audio/mpeg` + +{% tabs %} +{% tab title="Python (Base64)" %} +```python +import requests +import base64 +import os + +def upload_audio(flow_id, audio_path, question=None): + # Read and encode audio + with open(audio_path, 'rb') as audio_file: + encoded_audio = base64.b64encode(audio_file.read()).decode('utf-8') + + # Determine MIME type based on file extension + mime_types = { + '.webm': 'audio/webm', + '.wav': 'audio/wav', + '.mp3': 'audio/mpeg', + '.m4a': 'audio/mp4' + } + + file_ext = os.path.splitext(audio_path)[1].lower() + mime_type = mime_types.get(file_ext, 'audio/webm') + + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + payload = { + "uploads": [ + { + "data": f"data:{mime_type};base64,{encoded_audio}", + "type": "audio", + "name": os.path.basename(audio_path), + "mime": mime_type + } + ] + } + + # Add question if provided + if question: + payload["question"] = question + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Example usage +result = upload_audio( + flow_id="your-flow-id", + audio_path="path/to/your/audio.wav", + question="Please transcribe this audio and summarize the content" +) + +print(result) +``` +{% endtab %} + +{% tab title="Python (URL)" %} +```python +import requests +import os + +def upload_audio_url(flow_id, audio_url, question=None, audio_name=None): + """ + Upload an audio file using a URL instead of base64 encoding. + This is more efficient for audio files that are already hosted online. + """ + url = f"http://localhost:3000/api/v1/prediction/{flow_id}" + + # Extract filename from URL if not provided + if not audio_name: + audio_name = audio_url.split('/')[-1] + if '?' in audio_name: + audio_name = audio_name.split('?')[0] + + # Determine MIME type from URL extension + mime_types = { + '.webm': 'audio/webm', + '.wav': 'audio/wav', + '.mp3': 'audio/mpeg', + '.m4a': 'audio/mp4', + '.ogg': 'audio/ogg', + '.aac': 'audio/aac' + } + + file_ext = os.path.splitext(audio_name)[1].lower() + mime_type = mime_types.get(file_ext, 'audio/wav') + + payload = { + "uploads": [ + { + "data": audio_url, + "type": "url", + "name": audio_name, + "mime": mime_type + } + ] + } + + # Add question if provided + if question: + payload["question"] = question + + try: + response = requests.post(url, json=payload) + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + +# Example usage with public audio URL +result = upload_audio_url( + flow_id="your-flow-id", + audio_url="https://example.com/path/to/speech.mp3", + question="Please transcribe this audio and provide a summary", + audio_name="speech_recording.mp3" +) + +print(result) + +# Example with direct URL (no custom name or question) +result2 = upload_audio_url( + flow_id="your-flow-id", + audio_url="https://storage.googleapis.com/sample-audio/speech.wav" +) + +print(result2) + +# Example for meeting transcription +result3 = upload_audio_url( + flow_id="your-flow-id", + audio_url="https://meetings.example.com/recording-123.m4a", + question="Transcribe this meeting recording and extract key action items and decisions made", + audio_name="team_meeting_jan15.m4a" +) + +print(result3) +``` +{% endtab %} + +{% tab title="JavaScript (File Upload)" %} +```javascript +async function uploadAudio(flowId, audioFile, question = null) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + + reader.onload = async function(e) { + const base64Data = e.target.result; + + const payload = { + uploads: [ + { + data: base64Data, + type: 'audio', + name: audioFile.name, + mime: audioFile.type + } + ] + }; + + // Add question if provided + if (question) { + payload.question = question; + } + + try { + const response = await fetch(`http://localhost:3000/api/v1/prediction/${flowId}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const result = await response.json(); + resolve(result); + + } catch (error) { + reject(error); + } + }; + + reader.onerror = function() { + reject(new Error('Failed to read file')); + }; + + reader.readAsDataURL(audioFile); + }); +} + +// Example usage with file input +document.getElementById('audioInput').addEventListener('change', async function(e) { + const file = e.target.files[0]; + if (file) { + try { + const result = await uploadAudio( + 'your-flow-id', + file, + 'Please transcribe this audio and summarize the content' + ); + console.log('Transcription result:', result); + } catch (error) { + console.error('Upload failed:', error); + } + } +}); +``` +{% endtab %} + +{% tab title="JavaScript (URL)" %} +```javascript +async function uploadAudioUrl(flowId, audioUrl, question = null, audioName = null) { + /** + * Upload an audio file using a URL instead of base64 encoding. + * This is more efficient for audio files that are already hosted online. + */ + + // Extract filename from URL if not provided + if (!audioName) { + audioName = audioUrl.split('/').pop(); + if (audioName.includes('?')) { + audioName = audioName.split('?')[0]; + } + } + + // Determine MIME type from URL extension + const mimeTypes = { + '.webm': 'audio/webm', + '.wav': 'audio/wav', + '.mp3': 'audio/mpeg', + '.m4a': 'audio/mp4', + '.ogg': 'audio/ogg', + '.aac': 'audio/aac' + }; + + const fileExt = audioName.toLowerCase().substring(audioName.lastIndexOf('.')); + const mimeType = mimeTypes[fileExt] || 'audio/wav'; + + const payload = { + uploads: [ + { + data: audioUrl, + type: 'url', + name: audioName, + mime: mimeType + } + ] + }; + + // Add question if provided + if (question) { + payload.question = question; + } + + try { + const response = await fetch(`http://localhost:3000/api/v1/prediction/${flowId}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Error:', error); + return null; + } +} + +// Example usage with public audio URL +async function transcribeAudioFromUrl() { + try { + const result = await uploadAudioUrl( + 'your-flow-id', + 'https://example.com/path/to/speech.mp3', + 'Please transcribe this audio and provide a summary', + 'speech_recording.mp3' + ); + + console.log('Transcription result:', result); + } catch (error) { + console.error('Upload failed:', error); + } +} + +// Example with direct URL (no custom name or question) +uploadAudioUrl( + 'your-flow-id', + 'https://storage.googleapis.com/sample-audio/speech.wav' +).then(result => { + if (result) { + console.log('Transcription result:', result); + } +}); + +// Example for meeting transcription +uploadAudioUrl( + 'your-flow-id', + 'https://meetings.example.com/recording-123.m4a', + 'Transcribe this meeting recording and extract key action items and decisions made', + 'team_meeting_jan15.m4a' +).then(result => { + if (result) { + console.log('Meeting analysis:', result); + } +}); + +// Example with multiple audio URLs for batch processing +async function transcribeMultipleAudios() { + const audioUrls = [ + { + url: 'https://example.com/interview1.wav', + question: 'Transcribe this interview and summarize key points', + name: 'interview_candidate_1.wav' + }, + { + url: 'https://example.com/interview2.mp3', + question: 'Transcribe this interview and summarize key points', + name: 'interview_candidate_2.mp3' + }, + { + url: 'https://example.com/lecture.m4a', + question: 'Transcribe this lecture and create bullet-point notes', + name: 'cs101_lecture.m4a' + } + ]; + + const results = await Promise.all( + audioUrls.map(audio => + uploadAudioUrl( + 'your-flow-id', + audio.url, + audio.question, + audio.name + ) + ) + ); + + results.forEach((result, index) => { + console.log(`Audio ${index + 1} transcription:`, result); + }); +} +``` +{% endtab %} +{% endtabs %} + +### 文件上传 + +上传文件以使 LLM 处理文件并回答与文件相关的查询。请参阅[文件](uploads.md#files)以获取更多参考。 + +### 人工输入 + +当执行/对话停止并需要 [人的输入](../tutorials/human-in-the-loop.md)时,响应正文将返回 `action` 数据。用户可以使用它来呈现 UI 中的特定操作。 + +{% hint style="warning" %} +请记住保存 `chatId`,因为需要它来恢复执行/对话。 +{% endhint %} + +```json +{ + "text": "I'm just a computer program, but I'm here and ready to help you! How can I assist you today?\n\nProceed?", + "question": "Hey, how are you?", + "chatId": "c5a49fa0-3609-448c-bb36-b9937a34390e", + "chatMessageId": "04fdaea7-276a-455c-9d18-479653b76c13", + "executionId": "2cee26fa-5d6d-472b-a82d-fe1a5e2cafeb", + "agentFlowExecutedData": [ + ... + ], + "action": { + "id": "fcadd7ad-f5e0-4ca8-b11d-e2463aa20d0c", + "mapping": { + "approve": "Proceed", + "reject": "Reject" + }, + "elements": [ + { + "type": "agentflowv2-approve-button", + "label": "Proceed" + }, + { + "type": "agentflowv2-reject-button", + "label": "Reject" + } + ], + "data": { + "nodeId": "humanInputAgentflow_0", + "nodeLabel": "Human Input 0", + "input": { + "messages": [ + { + "role": "user", + "content": "Hey, how are you?" + }, + { + "role": "user", + "content": "I'm just a computer program, but I'm here and ready to help you! How can I assist you today?", + "name": "agent_0" + } + ], + "humanInputEnableFeedback": true + } + } + } +} +``` + +#### UI 如何呈现批准/拒绝/反馈 + +Flowise Chat UI 读取 `action.elements` 并根据元素 `type` 呈现按钮: + +* **`agentflowv2-approve-button`** — 带有复选标记图标的绿色轮廓按钮 +* **`agentflowv2-reject-button`**— 带有 X 图标的红色轮廓按钮 + +单击时,如果 `action.data.input.humanInputEnableFeedback` 是 `true`,则在提交之前会显示反馈对话框(文本区域)。否则立即提交。 + +对于您自己的聊天 UI,呈现如下所示的操作: + +```javascript +// Pseudo-code for a custom UI +if (response.action) { + const { elements, data } = response.action + const showFeedback = data?.input?.humanInputEnableFeedback + + elements.forEach(elem => { + if (elem.type === 'agentflowv2-approve-button') { + // Render a green "Proceed" button + } + if (elem.type === 'agentflowv2-reject-button') { + // Render a red "Reject" button + } + }) + + // On button click: + // - If showFeedback is true, show a text input for feedback first + // - Then call the prediction API to resume (see below) +} +``` + +#### 如何恢复对话 + +当用户单击批准或拒绝时,发送另一个带有 `humanInput` 字段的 `POST /api/v1/prediction/{chatflowId}` : + +```json +{ + "chatId": "c5a49fa0-3609-448c-bb36-b9937a34390e", + "humanInput": { + "type": "proceed", + "startNodeId": "humanInputAgentflow_0", + "feedback": "" + } +} +``` + +`humanInput` 中的三个关键字段: + +|领域 |价值|描述 | +| ------------- | ------------------------- | -------------------------------------------------------------------------- | +| `type` | `"proceed"` 或 `"reject"` |按钮类型的映射 — `approve` → `"proceed"`、`reject` → `"reject"` | +| `startNodeId` | |来自 `action.data.nodeId` — 告诉服务器恢复哪个节点 | +| `feedback` | |如果 `humanInputEnableFeedback` 为 true,则可选反馈文本 | + +**示例 - 拒绝并反馈:** + +```json +{ + "chatId": "c5a49fa0-3609-448c-bb36-b9937a34390e", + "humanInput": { + "type": "reject", + "startNodeId": "humanInputAgentflow_0", + "feedback": "I think we should use a different approach" + } +} +``` + +服务器将找到待处理的操作,将其清除,并根据用户的决定从 `startNodeId` 恢复智能体流程。 + +## 故障排除 + +1. **404 Not Found**:验证流ID是否正确且流存在 +2. **401 Unauthorized Access**:验证流是否受 API 密钥保护 +3. **400 Bad Request**:检查请求格式和必填字段 +4. **413 Payload Too Large**:减小文件大小或拆分大请求 +5. **500 内部服务器错误:** 检查流程中的节点是否存在任何配置错误 diff --git a/cn/using-flowise/streaming.md b/cn/using-flowise/streaming.md new file mode 100644 index 00000000..fbb7eeea --- /dev/null +++ b/cn/using-flowise/streaming.md @@ -0,0 +1,106 @@ +--- +description: 了解 Flowise 流式传输的工作原理 +--- + +# 流式输出 + +如果在进行预测时设置了流式传输,则令牌将在可用时作为纯数据[服务器发送事件](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format)发送。 + +### 使用 Python/TS 库 + +Flowise 提供 2 个库: + +* [Python](https://pypi.org/project/flowise/):`pip install flowise` +* [打字稿](https://www.npmjs.com/package/flowise-sdk):`npm install flowise-sdk` + +{% tabs %} +{% tab title="Python" %} +```python +from flowise import Flowise, PredictionData + +def test_streaming(): + client = Flowise() + + # Test streaming prediction + completion = client.create_prediction( + PredictionData( + chatflowId="", + question="Tell me a joke!", + streaming=True + ) + ) + + # Process and print each streamed chunk + print("Streaming response:") + for chunk in completion: + # {event: "token", data: "hello"} + print(chunk) + + +if __name__ == "__main__": + test_streaming() +``` +{% endtab %} + +{% tab title="Typescript" %} +```javascript +import { FlowiseClient } from 'flowise-sdk' + +async function test_streaming() { + const client = new FlowiseClient({ baseUrl: 'http://localhost:3000' }); + + try { + // For streaming prediction + const prediction = await client.createPrediction({ + chatflowId: '', + question: 'What is the capital of France?', + streaming: true, + }); + + for await (const chunk of prediction) { + // {event: "token", data: "hello"} + console.log(chunk); + } + + } catch (error) { + console.error('Error:', error); + } +} + +// Run streaming test +test_streaming() +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +curl https://localhost:3000/api/v1/predictions/{flow-id} \ + -H "Content-Type: application/json" \ + -d '{ + "question": "Hello world!", + "streaming": true + }' +``` +{% endtab %} +{% endtabs %} + +```html +event: token +data: Once upon a time... +``` + +预测的事件流由以下事件类型组成: + +|活动 |描述 | +| --------------- | ----------------------------------------------------------------------------------------------------------------------------------- | +|开始 |流式输出开始 | +|代币|当预测流式传输新令牌输出时发出 | +|错误 |当预测返回错误时发出 | +|结束 |预测完成时发出 | +|元数据 |相关流的所有元数据,例如 chatId、messageId。在所有令牌完成流式传输之后、结束事件之前发出 | +|来源文档 |当流从向量存储返回源时发出 | +|使用工具 |流量使用时发出的工具| + +### Streamlit 应用程序 + +[https://github.com/HenryHengZJ/flowise-streamlit](https://github.com/HenryHengZJ/flowise-streamlit) diff --git a/cn/using-flowise/uploads.md b/cn/using-flowise/uploads.md new file mode 100644 index 00000000..fb97ad82 --- /dev/null +++ b/cn/using-flowise/uploads.md @@ -0,0 +1,413 @@ +--- +description: 了解如何使用上传图像、音频和其他文件 +--- + +# 上传 + +Flowise 允许您从聊天中上传图像、音频和其他文件。在本节中,您将了解如何启用和使用这些功能。 + +## 图片 + +某些聊天模型允许您输入图像。请务必参考 LLM 的官方文档来确认模型是否支持图像输入。 + +* [ChatOpenAI](../integrations/llamaindex/chat-models/chatopenai.md) +* [AzureChatOpenAI](../integrations/llamaindex/chat-models/azurechatopenai.md) +* [ChatAnthropic](../integrations/langchain/chat-models/chatanthropic.md) +* [AWSChatBedrock](../integrations/langchain/chat-models/aws-chatbedrock.md) +* [ChatGoogleGenerativeAI](../integrations/langchain/chat-models/google-ai.md) +* [ChatOllama](../integrations/llamaindex/chat-models/chatollama.md) +* [Google Vertex AI](../integrations/langchain/llms/googlevertex-ai.md) + +{% hint style="warning" %} +图像处理仅适用于 聊天流 中的某些链/代理。 + +[LLMChain](../integrations/langchain/chains/llm-chain.md)、[对话链](../integrations/langchain/chains/conversation-chain.md)、[ReAct 代理](../integrations/langchain/agents/react-agent-chat.md)、[对话代理](../integrations/langchain/agents/conversational-agent.md)、 [工具代理](../integrations/langchain/agents/tool-agent.md) +{% endhint %} + +如果您启用**允许图像上传**,您可以从聊天界面上传图像。 + +
+ +要使用 API 上传图像: + +{% tabs %} +{% tab title="Python" %} +```python +import requests +API_URL = "http://localhost:3000/api/v1/prediction/" + +def query(payload): + response = requests.post(API_URL, json=payload) + return response.json() + +output = query({ + "question": "Can you describe the image?", + "uploads": [ + { + "data": "data:image/png;base64,iVBORw0KGgdM2uN0", # base64 string or url + "type": "file", # file | url + "name": "Flowise.png", + "mime": "image/png" + } + ] +}) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/prediction/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "question": "Can you describe the image?", + "uploads": [ + { + "data": "data:image/png;base64,iVBORw0KGgdM2uN0", //base64 string or url + "type": "file", // file | url + "name": "Flowise.png", + "mime": "image/png" + } + ] +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +## 音频 + +在 聊天流 配置中,您可以选择语音转文本模块。支持的集成包括: + +* 开放人工智能 +* 装配人工智能 +* [LocalAI](../integrations/langchain/chat-models/chatlocalai.md) + +启用此功能后,用户可以直接对着麦克风讲话。他们的讲话被转录成文本。 + +
+ +要使用 API 上传音频: + +{% tabs %} +{% tab title="Python" %} +```python +import requests +API_URL = "http://localhost:3000/api/v1/prediction/" + +def query(payload): + response = requests.post(API_URL, json=payload) + return response.json() + +output = query({ + "uploads": [ + { + "data": "data:audio/webm;codecs=opus;base64,GkXf", # base64 string + "type": "audio", + "name": "audio.wav", + "mime": "audio/webm" + } + ] +}) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/prediction/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "uploads": [ + { + "data": "data:audio/webm;codecs=opus;base64,GkXf", // base64 string + "type": "audio", + "name": "audio.wav", + "mime": "audio/webm" + } + ] +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +## 文件 + +您可以通过两种方式上传文件: + +* 检索增强生成(RAG)文件上传 +* 完整文件上传 + +当两个选项都打开时,完整文件上传优先。 + +### RAG 文件上传 + +您可以将上传的文件即时写入更新到矢量存储中。要启用文件上传,请确保满足以下先决条件: + +* 您必须在聊天流中包含支持文件上传的矢量存储。 + * [松果](../integrations/langchain/vector-stores/pinecone.md) + * [Milvus](../integrations/langchain/vector-stores/milvus.md) + * [Postgres](../integrations/langchain/vector-stores/postgres.md) + * [Qdrant](../integrations/langchain/vector-stores/qdrant.md) + * [Upstash](../integrations/langchain/vector-stores/upstash-vector.md) +* 如果您在聊天流中有多个矢量存储,则一次只能为一个矢量存储打开文件上传。 +* 您必须将至少一个文档加载器节点连接到矢量存储的文档输入。 +* 支持的文档加载器: + * [CSV 文件](../integrations/langchain/document-loaders/csv-file.md) + * [Docx 文件](../integrations/langchain/document-loaders/docx-file.md) + * [Json 文件](../integrations/langchain/document-loaders/json-file.md) + * [Json 行文件](/broken/pages/5Yx4z3cCteIRfL5w2Ihp) + * [PDF 文件](../integrations/langchain/document-loaders/pdf-file.md) + * [文本文件](../integrations/langchain/document-loaders/text-file.md) + * [非结构化文件](../integrations/langchain/document-loaders/unstructured-file-loader.md) + +
+ +您可以在聊天中上传一个或多个文件: + +
+ +它的工作原理如下: + +1. 使用chatId更新上传文件的元数据。 +2. 这会将文件与 chatId 关联起来。 +3. 查询时,应用 **OR** 过滤器: + +* 元数据包含`flowise_chatId`,值为当前聊天会话ID +* 元数据不包含 `flowise_chatId` + +在 Pinecone 上插入向量嵌入的示例: + +
+ +要使用 API 执行此操作,请执行以下两个步骤: + +1. 将 [Vector 写入更新 API](/broken/pages/F2AfRpI7qYixNiBWpmIe#vector-upsert-api) 与 `formData` 和 `chatId` 结合使用: + +{% tabs %} +{% tab title="Python" %} +```python +import requests + +API_URL = "http://localhost:3000/api/v1/vector/upsert/" + +# Use form data to upload files +form_data = { + "files": ("state_of_the_union.txt", open("state_of_the_union.txt", "rb")) +} + +body_data = { + "chatId": "some-session-id" +} + +def query(form_data): + response = requests.post(API_URL, files=form_data, data=body_data) + print(response) + return response.json() + +output = query(form_data) +print(output) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +// Use FormData to upload files +let formData = new FormData(); +formData.append("files", input.files[0]); +formData.append("chatId", "some-session-id"); + +async function query(formData) { + const response = await fetch( + "http://localhost:3000/api/v1/vector/upsert/", + { + method: "POST", + body: formData + } + ); + const result = await response.json(); + return result; +} + +query(formData).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +2. 将 [预测 API](/broken/pages/F2AfRpI7qYixNiBWpmIe#prediction) 与步骤 1 中的 `uploads` 和 `chatId` 结合使用: + +{% tabs %} +{% tab title="Python" %} +```python +import requests +API_URL = "http://localhost:3000/api/v1/prediction/" + +def query(payload): + response = requests.post(API_URL, json=payload) + return response.json() + +output = query({ + "question": "What is the speech about?", + "chatId": "same-session-id-from-step-1", + "uploads": [ + { + "data": "data:text/plain;base64,TWFkYWwcy4=", + "type": "file:rag", + "name": "state_of_the_union.txt", + "mime": "text/plain" + } + ] +}) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/prediction/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "question": "What is the speech about?", + "chatId": "same-session-id-from-step-1", + "uploads": [ + { + "data": "data:text/plain;base64,TWFkYWwcy4=", + "type": "file:rag", + "name": "state_of_the_union.txt", + "mime": "text/plain" + } + ] +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +### 完整文件上传 + +通过 RAG 文件上传,您无法使用电子表格或表格等结构化数据,并且由于缺乏完整上下文而无法执行完整摘要。在某些情况下,您可能希望将所有文件内容直接包含在 LLM 的提示词中,尤其是对于具有较长上下文窗口的 Gemini 和 Claude 等模型。 [这篇研究论文](https://arxiv.org/html/2407.16833v1)是将RAG与更长的上下文窗口进行比较的众多研究论文之一。 + +要启用完整文件上传,请转到 **聊天流 Configuration**,打开 **File Upload** 选项卡,然后单击开关: + +
+ +您可以在聊天中看到**文件附件**按钮,您可以在其中上传一个或多个文件。在底层,[文件加载器](../integrations/langchain/document-loaders/file-loader.md) 处理每个文件并将其转换为文本。 + +
+ +请注意,如果您的聊天流使用聊天提示词模板节点,则必须从 **格式化提示词值** 创建输入以传递文件数据。指定的输入名称(例如 {file})应包含在 **人工消息** 字段中。 + +
+ +要使用 API 上传文件: + +{% tabs %} +{% tab title="Python" %} +```python +import requests +API_URL = "http://localhost:3000/api/v1/prediction/" + +def query(payload): + response = requests.post(API_URL, json=payload) + return response.json() + +output = query({ + "question": "What is the data about?", + "chatId": "some-session-id", + "uploads": [ + { + "data": "data:text/plain;base64,TWFkYWwcy4=", + "type": "file:full", + "name": "state_of_the_union.txt", + "mime": "text/plain" + } + ] +}) +``` +{% endtab %} + +{% tab title="Javascript" %} +```javascript +async function query(data) { + const response = await fetch( + "http://localhost:3000/api/v1/prediction/", + { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(data) + } + ); + const result = await response.json(); + return result; +} + +query({ + "question": "What is the data about?", + "chatId": "some-session-id", + "uploads": [ + { + "data": "data:text/plain;base64,TWFkYWwcy4=", + "type": "file:full", + "name": "state_of_the_union.txt", + "mime": "text/plain" + } + ] +}).then((response) => { + console.log(response); +}); +``` +{% endtab %} +{% endtabs %} + +正如您在示例中所看到的,上传需要 Base64 字符串。要获取文件的 Base64 字符串,请使用 [创建附件 API](../api-reference/attachments.md)。 + +### 完整上传和 RAG 上传之间的区别 + +完整文件上传和 RAG(检索增强生成)文件上传都有不同的用途。 + +* **完整文件上传**:此方法将整个文件解析为字符串并将其发送到 LLM (大语言模型)。它有利于总结文档或提取关键信息。但是,对于非常大的文件,由于令牌限制,模型可能会产生不准确的结果或“幻觉”。 +* **RAG 文件上传**:如果您的目标是通过不将整个文本发送到 LLM 来降低令牌成本,则推荐使用。这种方法适用于文档的问答任务,但不适合摘要,因为它缺乏完整的文档上下文。由于写入更新过程,此方法可能需要更长的时间。 diff --git a/cn/using-flowise/upsertion.md b/cn/using-flowise/upsertion.md new file mode 100644 index 00000000..a51f9f8d --- /dev/null +++ b/cn/using-flowise/upsertion.md @@ -0,0 +1,677 @@ +# 写入更新 + +Upsert 是指将文档上传并处理到矢量存储的过程,形成检索增强生成 (RAG) 系统的基础。 + +将数据写入更新向量存储有两种基本方法: + +* [文档存储(推荐)](document-stores.md) +* 聊天流写入更新 + +我们强烈建议使用文档存储,因为它提供了一个统一的界面来帮助 RAG 管道 - 从不同来源检索数据、分块策略、写入更新到矢量数据库、与更新的数据同步。 + +在本指南中,我们将介绍另一种方法 - 聊天流 Upsert。这是文档存储之前的较旧方法。 + +有关详细信息,请参阅[矢量写入更新端点API 参考](../api-reference/vector-upsert.md)。 + +## 了解写入更新过程 + +聊天流 允许您创建一个既可以执行写入更新又可以执行 RAG 查询过程的流程,两者都可以独立运行。 + +

写入更新与 RAG

+ +## 设置 + +为了使写入更新流程正常工作,我们需要创建一个具有 5 个不同节点的 **写入更新流程**: + +1. 文档加载器 +2. 文本分割器 +3. 嵌入模型 +4.向量存储 +5. 记录管理器(可选) + +[文档存储](document-stores.md) 中涵盖了所有元素,请参阅此处了解更多详细信息。 + +正确设置流程后,右上角将有一个绿色按钮,允许用户启动写入更新过程。 + +
+ +
+ +还可以通过 API 执行写入更新过程: + +
+ +## 基础 URL 和身份验证 + +**基础 URL**:`http://localhost:3000`(或您的 Flowise 实例 URL) + +**端点**:`POST /api/v1/vector/upsert/:id` + +**身份验证**:请参阅[流身份验证](../configuration/authorization/chatflow-level.md) + +## 请求方法 + +API 支持两种不同的请求方法,具体取决于您的聊天流配置: + +#### 1.表单数据(文件上传) + +当您的聊天流包含具有文件上传功能的文档加载器时使用。 + +#### 2. JSON 正文(无文件上传) + +当您的聊天流使用不需要文件上传的文档加载器(例如网络抓取工具、数据库连接器)时使用。 + +{% hint style="warning" %} +要覆盖任何节点配置(例如文件、元数据等),您必须显式启用该选项。 +{% endhint %} + +
+ +### 带文件上传功能的文档加载器 + +#### 支持的文档类型 + +|文档加载器|文件类型 | +| ----------------- | ---------- | +| CSV 文件 | `.csv` | +| Docx/Word 文件 | `.docx` | +| JSON 文件 | `.json` | +| JSON 行文件 | `.jsonl` | +| PDF 文件 | `.pdf` | +|文本文件 | `.txt` | +| Excel 文件 | `.xlsx` | +|幻灯片文件 | `.pptx` | +|文件加载器 |多个| +|非结构化文件|多个| + +{% hint style="info" %} +**重要**:确保文件类型与您的文档加载器配置匹配。为了获得最大的灵活性,请考虑使用支持多种文件类型的文件加载器。 +{% endhint %} + +#### 请求格式(表单数据) + +上传文件时,使用 `multipart/form-data` 而不是 JSON: + +#### 示例 + +{% tabs %} +{% tab title="Python" %} +```python +import requests +import os + +def upsert_document(chatflow_id, file_path, config=None): + """ + Upsert a single document to a vector store. + + Args: + chatflow_id (str): The chatflow ID configured for vector upserting + file_path (str): Path to the file to upload + return_source_docs (bool): Whether to return source documents in response + config (dict): Optional configuration overrides + + Returns: + dict: API response containing upsert results + """ + url = f"http://localhost:3000/api/v1/vector/upsert/{chatflow_id}" + + # Prepare file data + files = { + 'files': (os.path.basename(file_path), open(file_path, 'rb')) + } + + # Prepare form data + data = {} + + # Add configuration overrides if provided + if config: + data['overrideConfig'] = str(config).replace("'", '"') # Convert to JSON string + + try: + response = requests.post(url, files=files, data=data) + response.raise_for_status() + + return response.json() + + except requests.exceptions.RequestException as e: + print(f"Upload failed: {e}") + return None + finally: + # Always close the file + files['files'][1].close() + +# Example usage +result = upsert_document( + chatflow_id="your-chatflow-id", + file_path="documents/knowledge_base.pdf", + config={ + "chunkSize": 1000, + "chunkOverlap": 200 + } +) + +if result: + print(f"Successfully upserted {result.get('numAdded', 0)} chunks") + if result.get('sourceDocuments'): + print(f"Source documents: {len(result['sourceDocuments'])}") +else: + print("Upload failed") +``` +{% endtab %} + +{% tab title="Javascript (Browser)" %} +```javascript +class VectorUploader { + constructor(baseUrl = 'http://localhost:3000') { + this.baseUrl = baseUrl; + } + + async upsertDocument(chatflowId, file, config = {}) { + /** + * Upload a file to vector store from browser + * @param {string} chatflowId - The chatflow ID + * @param {File} file - File object from input element + * @param {Object} config - Optional configuration + */ + + const formData = new FormData(); + formData.append('files', file); + + if (config.overrideConfig) { + formData.append('overrideConfig', JSON.stringify(config.overrideConfig)); + } + + try { + const response = await fetch(`${this.baseUrl}/api/v1/vector/upsert/${chatflowId}`, { + method: 'POST', + body: formData + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const result = await response.json(); + return result; + + } catch (error) { + console.error('Upload failed:', error); + throw error; + } + } + + +} + +// Example usage in browser +const uploader = new VectorUploader(); + +// Single file upload +document.getElementById('fileInput').addEventListener('change', async function(e) { + const file = e.target.files[0]; + if (file) { + try { + const result = await uploader.upsertDocument( + 'your-chatflow-id', + file, + { + overrideConfig: { + chunkSize: 1000, + chunkOverlap: 200 + } + } + ); + + console.log('Upload successful:', result); + alert(`Successfully processed ${result.numAdded || 0} chunks`); + + } catch (error) { + console.error('Upload failed:', error); + alert('Upload failed: ' + error.message); + } + } +}); +``` +{% endtab %} + +{% tab title="Javascript (Node.js)" %} +```javascript +const fs = require('fs'); +const path = require('path'); +const FormData = require('form-data'); +const fetch = require('node-fetch'); + +class NodeVectorUploader { + constructor(baseUrl = 'http://localhost:3000') { + this.baseUrl = baseUrl; + } + + async upsertDocument(chatflowId, filePath, config = {}) { + /** + * Upload a file to vector store from Node.js + * @param {string} chatflowId - The chatflow ID + * @param {string} filePath - Path to the file + * @param {Object} config - Optional configuration + */ + + if (!fs.existsSync(filePath)) { + throw new Error(`File not found: ${filePath}`); + } + + const formData = new FormData(); + const fileStream = fs.createReadStream(filePath); + + formData.append('files', fileStream, { + filename: path.basename(filePath), + contentType: this.getMimeType(filePath) + }); + + if (config.overrideConfig) { + formData.append('overrideConfig', JSON.stringify(config.overrideConfig)); + } + + try { + const response = await fetch(`${this.baseUrl}/api/v1/vector/upsert/${chatflowId}`, { + method: 'POST', + body: formData, + headers: formData.getHeaders() + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`HTTP ${response.status}: ${errorText}`); + } + + return await response.json(); + + } catch (error) { + console.error('Upload failed:', error); + throw error; + } + } + + getMimeType(filePath) { + const ext = path.extname(filePath).toLowerCase(); + const mimeTypes = { + '.pdf': 'application/pdf', + '.txt': 'text/plain', + '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + '.csv': 'text/csv', + '.json': 'application/json' + }; + return mimeTypes[ext] || 'application/octet-stream'; + } +} + +// Example usage +async function main() { + const uploader = new NodeVectorUploader(); + + try { + // Single file upload + const result = await uploader.upsertDocument( + 'your-chatflow-id', + './documents/manual.pdf', + { + overrideConfig: { + chunkSize: 1200, + chunkOverlap: 100 + } + } + ); + + console.log('Single file upload result:', result); + } catch (error) { + console.error('Process failed:', error); + } +} + +// Run if this file is executed directly +if (require.main === module) { + main(); +} + +module.exports = { NodeVectorUploader }; +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +# Basic file upload with cURL +curl -X POST "http://localhost:3000/api/v1/vector/upsert/your-chatflow-id" \ + -F "files=@documents/knowledge_base.pdf" + +# File upload with configuration override +curl -X POST "http://localhost:3000/api/v1/vector/upsert/your-chatflow-id" \ + -F "files=@documents/manual.pdf" \ + -F 'overrideConfig={"chunkSize": 1000, "chunkOverlap": 200}' + +# Upload with custom headers for authentication (if configured) +curl -X POST "http://localhost:3000/api/v1/vector/upsert/your-chatflow-id" \ + -H "Authorization: Bearer your-api-token" \ + -F "files=@documents/faq.txt" \ + -F 'overrideConfig={"chunkSize": 800, "chunkOverlap": 150}' +``` +{% endtab %} +{% endtabs %} + +### 不带文件上传的文档加载器 + +对于不需要文件上传的文档加载器(例如网络抓取工具、数据库连接器、API 集成),请使用类似于预测 API 的 JSON 格式。 + +#### 示例 + +{% tabs %} +{% tab title="Python" %} +```python +import requests +from typing import Dict, Any, Optional + +def upsert(chatflow_id: str, config: Optional[Dict[str, Any]] = None) -> Optional[Dict[str, Any]]: + """ + Trigger vector upserting for chatflows that don't require file uploads. + + Args: + chatflow_id: The chatflow ID configured for vector upserting + config: Optional configuration overrides + + Returns: + API response containing upsert results + """ + url = f"http://localhost:3000/api/v1/vector/upsert/{chatflow_id}" + + payload = { + "overrideConfig": config + } + + headers = { + "Content-Type": "application/json" + } + + try: + response = requests.post(url, json=payload, headers=headers, timeout=300) + response.raise_for_status() + + return response.json() + + except requests.exceptions.RequestException as e: + print(f"Upsert failed: {e}") + return None + +result = upsert( + chatflow_id="chatflow-id", + config={ + "chunkSize": 800, + "chunkOverlap": 100, + } +) + +if result: + print(f"Upsert completed: {result.get('numAdded', 0)} chunks added") +``` +{% endtab %} + +{% tab title="JavaScript" %} +```javascript +class NoFileUploader { + constructor(baseUrl = 'http://localhost:3000') { + this.baseUrl = baseUrl; + } + + async upsertWithoutFiles(chatflowId, config = {}) { + /** + * Trigger vector upserting for flows that don't need file uploads + * @param {string} chatflowId - The chatflow ID + * @param {Object} config - Configuration overrides + */ + + const payload = { + overrideConfig: config + }; + + try { + const response = await fetch(`${this.baseUrl}/api/v1/vector/upsert/${chatflowId}`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + return await response.json(); + + } catch (error) { + console.error('Upsert failed:', error); + throw error; + } + } + + async scheduledUpsert(chatflowId, interval = 3600000) { + /** + * Set up scheduled upserting for dynamic content sources + * @param {string} chatflowId - The chatflow ID + * @param {number} interval - Interval in milliseconds (default: 1 hour) + */ + + console.log(`Starting scheduled upsert every ${interval/1000} seconds`); + + const performUpsert = async () => { + try { + console.log('Performing scheduled upsert...'); + + const result = await this.upsertWithoutFiles(chatflowId, { + addMetadata: { + scheduledUpdate: true, + timestamp: new Date().toISOString() + } + }); + + console.log(`Scheduled upsert completed: ${result.numAdded || 0} chunks processed`); + + } catch (error) { + console.error('Scheduled upsert failed:', error); + } + }; + + // Perform initial upsert + await performUpsert(); + + // Set up recurring upserts + return setInterval(performUpsert, interval); + } +} + +// Example usage +const uploader = new NoFileUploader(); + +async function performUpsert() { + try { + const result = await uploader.upsertWithoutFiles( + 'chatflow-id', + { + chunkSize: 800, + chunkOverlap: 100 + } + ); + + console.log('Upsert result:', result); + + } catch (error) { + console.error('Upsert failed:', error); + } +} + +// One time upsert +await performUpsert(); + +// Set up scheduled updates (every 30 minutes) +const schedulerHandle = await uploader.scheduledUpsert( + 'dynamic-content-chatflow-id', + 30 * 60 * 1000 +); + +// To stop scheduled updates later: +// clearInterval(schedulerHandle); +``` +{% endtab %} + +{% tab title="cURL" %} +```bash +# Basic upsert with cURL +curl -X POST "http://localhost:3000/api/v1/vector/upsert/your-chatflow-id" \ + -H "Content-Type: application/json" + +# Upsert with configuration override +curl -X POST "http://localhost:3000/api/v1/vector/upsert/your-chatflow-id" \ + -H "Content-Type: application/json" \ + -d '{ + "overrideConfig": { + "returnSourceDocuments": true + } + }' + +# Upsert with custom headers for authentication (if configured) +curl -X POST "http://localhost:3000/api/v1/vector/upsert/your-chatflow-id" \ + -H "Authorization: Bearer your-api-token" \ + -H "Content-Type: application/json" +``` +{% endtab %} +{% endtabs %} + +## 响应字段 + +|领域|类型 |描述 | +| ------------ | ------ | ----------------------------------------------------------- | +| `numAdded` |数量 |添加到矢量存储的新块的数量 | +| `numDeleted` |数量 |删除的块数(如果使用记录管理器)| +| `numSkipped` |数量 |跳过的块数(如果使用记录管理器)| +| `numUpdated` |数量 |已更新的现有块数(如果使用记录管理器)| + +## 优化策略 + +### 1. 批处理策略 + +```python +def intelligent_batch_processing(files: List[str], chatflow_id: str) -> Dict[str, Any]: + """Process files in optimized batches based on size and type.""" + + # Group files by size and type + small_files = [] + large_files = [] + + for file_path in files: + file_size = os.path.getsize(file_path) + if file_size > 5_000_000: # 5MB + large_files.append(file_path) + else: + small_files.append(file_path) + + results = {'successful': [], 'failed': [], 'totalChunks': 0} + + # Process large files individually + for file_path in large_files: + print(f"Processing large file: {file_path}") + # Individual processing with custom config + # ... implementation + + # Process small files in batches + batch_size = 5 + for i in range(0, len(small_files), batch_size): + batch = small_files[i:i + batch_size] + print(f"Processing batch of {len(batch)} small files") + # Batch processing + # ... implementation + + return results +``` + +### 2.元数据优化 + +```python +import requests +import os +from datetime import datetime +from typing import Dict, Any + +def upsert_with_optimized_metadata(chatflow_id: str, file_path: str, + department: str = None, category: str = None) -> Dict[str, Any]: + """ + Upsert document with automatically optimized metadata. + """ + url = f"http://localhost:3000/api/v1/vector/upsert/{chatflow_id}" + + # Generate optimized metadata + custom_metadata = { + 'department': department or 'general', + 'category': category or 'documentation', + 'indexed_date': datetime.now().strftime('%Y-%m-%d'), + 'version': '1.0' + } + + optimized_metadata = optimize_metadata(file_path, custom_metadata) + + # Prepare request + files = {'files': (os.path.basename(file_path), open(file_path, 'rb'))} + data = { + 'overrideConfig': str({ + 'metadata': optimized_metadata + }).replace("'", '"') + } + + try: + response = requests.post(url, files=files, data=data) + response.raise_for_status() + return response.json() + finally: + files['files'][1].close() + +# Example usage with different document types +results = [] + +# Technical documentation +tech_result = upsert_with_optimized_metadata( + chatflow_id="tech-docs-chatflow", + file_path="docs/api_reference.pdf", + department="engineering", + category="technical_docs" +) +results.append(tech_result) + +# HR policies +hr_result = upsert_with_optimized_metadata( + chatflow_id="hr-docs-chatflow", + file_path="policies/employee_handbook.pdf", + department="human_resources", + category="policies" +) +results.append(hr_result) + +# Marketing materials +marketing_result = upsert_with_optimized_metadata( + chatflow_id="marketing-chatflow", + file_path="marketing/product_brochure.pdf", + department="marketing", + category="promotional" +) +results.append(marketing_result) + +for i, result in enumerate(results): + print(f"Upload {i+1}: {result.get('numAdded', 0)} chunks added") +``` + +## 故障排除 + +1. **文件上传失败** + * 检查文件格式兼容性 + * 验证文件大小限制 +2. **处理超时** + * 增加请求超时时间 + * 将大文件分成更小的部分 + * 优化块大小 +3. **矢量存储错误** + * 检查矢量存储连接性 + * 验证嵌入模型尺寸兼容性 diff --git a/cn/using-flowise/variables.md b/cn/using-flowise/variables.md new file mode 100644 index 00000000..8b81c631 --- /dev/null +++ b/cn/using-flowise/variables.md @@ -0,0 +1,74 @@ +--- +description: 了解如何在 Flowise 中使用变量 +--- + +# 变量 + +*** + +Flowise 允许用户创建可在节点中使用的变量。变量可以是静态的或运行时的。 + +### 静态 + +静态变量将使用指定的值保存,并按原样检索。 + +
+ +### 运行时 + +变量的值将使用 `process.env` 从 **.env** 文件中获取 + +
+ +### 通过 API 覆盖或设置变量 + +为了覆盖变量值,用户必须从右上角的按钮显式启用它: + +**设置** -> **配置** -> **安全** 选项卡: + +
+ +如果创建了现有变量,API 中提供的变量值将覆盖现有值。 + +```json +{ + "question": "hello", + "overrideConfig": { + "vars": { + "var": "some-override-value" + } + } +} +``` + +### 使用变量 + +Flowise 中的节点可以使用变量。例如,创建一个名为 **`character`** 的变量: + +
+ +然后我们可以使用这个变量作为 **`$vars。`** 在以下节点的 Function 中: + +* [自定义工具](../integrations/langchain/tools/custom-tool.md) +* [自定义函数](../integrations/utilities/custom-js-function.md) +* [自定义加载程序](../integrations/langchain/document-loaders/custom-document-loader.md) +* [如果否则](../integrations/utilities/if-else.md) +* 自定义 MCP + +
+ +此外,用户还可以在任意节点的文本输入中使用该变量,格式如下: + +**`{{$vars。}}`** + +例如,在代理系统消息中: + +
+ +在提示词模板中: + +
+ +## 资源 + +* [将变量传递给函数](../integrations/langchain/tools/custom-tool.md#pass-variables-to-function) diff --git a/cn/using-flowise/workspaces.md b/cn/using-flowise/workspaces.md new file mode 100644 index 00000000..1df30533 --- /dev/null +++ b/cn/using-flowise/workspaces.md @@ -0,0 +1,167 @@ +# 工作区 + +{% hint style="info" %} +工作区仅适用于云计划和企业计划 +{% endhint %} + +首次登录后,系统会自动为您生成默认工作区。工作区用于在不同团队或业务部门之间划分资源。在每个工作区中,基于角色的访问控制 (RBAC) 用于管理权限和访问,确保用户只能访问其角色所需的资源和设置。 + +
+ +## 设置管理员帐户 + +
+ +对于自托管企业,必须设置以下环境变量 + +``` +JWT_AUTH_TOKEN_SECRET +JWT_REFRESH_TOKEN_SECRET +JWT_ISSUER +JWT_AUDIENCE +JWT_TOKEN_EXPIRY_IN_MINUTES +JWT_REFRESH_TOKEN_EXPIRY_IN_MINUTES +PASSWORD_RESET_TOKEN_EXPIRY_IN_MINS +PASSWORD_SALT_HASH_ROUNDS +TOKEN_HASH_SECRET +``` + +
+ +默认情况下,新安装的 Flowise 将需要管理员设置,类似于您最初为数据库设置根用户的方式。 + +
+ +设置后,用户将被带到 Flowise 仪表板。从左侧栏中,您将看到“用户和工作区管理”部分。默认工作区已自动创建。 + +
+ +## 创建工作区 + +要创建新的工作区,请单击“添加新的”: + +
+ +您将看到自己在您创建的工作区中添加为组织管理员。 + +
+ +要邀请新用户加入工作区,您需要先创建角色。 + +## 创建角色 + +导航到左侧栏中的“角色”,然后单击“添加角色”: + +
+ +用户可以指定对每个资源的权限的精细控制。唯一的例外是**用户和工作区管理**中的资源(角色、用户、工作区、登录活动)。这些目前仅适用于帐户管理员。 + +在这里,我们创建一个可以访问所有内容的编辑者角色。另一个角色具有仅查看权限。 + +
+ +## 邀请用户 + +
+ +对于自托管企业,必须设置以下环境变量 + +``` +INVITE_TOKEN_EXPIRY_IN_HOURS +SMTP_HOST +SMTP_PORT +SMTP_USER +SMTP_PASSWORD +``` + +
+ +导航到左侧栏中的“用户”,您将看到自己是帐户管理员。这由带星号的人物图标表示: + +
+ +单击“邀请用户”,输入要邀请的电子邮件、要分配的工作区和角色。 + +
+ +单击发送邀请。受邀邮箱将收到邀请: + +
+ +单击邀请链接后,受邀用户将进入注册页面。 + +
+ +注册并以受邀用户身份登录后,您将进入分配的工作区,并且不会有“用户和工作区管理”部分: + +
+ +如果您被邀请进入多个工作区,您可以通过右上角的下拉按钮切换到不同的工作区。在这里,我们被分配给工作区 2,并具有 **仅查看** 权限。您可以注意到 聊天流 的“添加新项”按钮不再可见。这确保用户只能查看,不能创建、更新或删除。相同的 RBAC 规则也适用于 API。 + +
+ +现在,返回帐户管理,您将能够看到受邀请的用户、他们的状态、角色和活动工作区: + +
+ +帐户管理员还可以修改其他用户的设置: + +
+ +## 登录活动 + +管理员将能够看到所有用户的每次登录和注销: + +
+ +## 在工作区中创建项目 + +在工作区中创建的每个项目都与另一个工作区隔离。工作区是一种对组织内的用户和资源进行逻辑分组的方法,确保资源管理和访问控制的信任边界分开。建议为每个团队创建不同的工作区。 + +在这里,我们在 **Workspace1** 中创建一个名为 **Chatflow1** 的 聊天流: + +
+ +当我们切换到**Workspace2**时,**Chatflow1**将不可见。这适用于所有资源,例如智能体流程、工具、助手等。 + +
+ +下图说明了组织、工作区以及与工作区关联并包含在工作区中的各种资源之间的关系。 + +
+ +## 共享凭据 + +您可以将凭据共享给其他工作区。这允许用户在不同的工作区中重复使用同一组凭据。 + +创建凭据后,帐户管理员或具有 RBAC 共享凭据权限的用户将能够单击共享: + +
+ +用户可以选择与其共享凭据的工作区: + +
+ +现在,切换到共享凭据的工作区,您将看到共享凭据。用户无法编辑共享凭据。 + +
+ +## 删除工作区 + +目前只有帐户管理员可以删除工作区。默认情况下,如果工作区中仍有用户,您将无法删除该工作区。 + +
+ +您需要首先取消所有受邀用户的链接。如果您只想从工作区中删除某些用户,这可以提供灵活性。请注意,创建工作区的组织所有者无法取消与工作区的链接。 + +
+ +取消链接受邀用户后,工作区中剩下的唯一用户是组织所有者,现在可以单击删除按钮: + +
+ +删除工作区是不可逆的操作,并且将级联删除该工作区中的所有项目。您将看到一个警告框: + +
+ +删除工作区后,用户将回退到默认工作区。启动时自动创建的默认工作区无法删除。