皖信智能对话 copy
    皖信智能对话 copy
    • 二进制文件
      POST
    • 知识库召回测试
      POST
    • 文件解析接口
      POST
    • 语料库文件添加
      POST
    • 问答库文件添加
      POST
    • 问答库以及语料库内容删除
      POST
    • 工作流运行
      POST
    • 工作流保存接口
      POST
    • 知识库初始化
      POST

      工作流保存接口

      正式环境
      http://121.229.177.64:8088/wanxin_ai/
      正式环境
      http://121.229.177.64:8088/wanxin_ai/
      POST
      /zhixin_agent/workflows/draft

      请求参数

      Body 参数application/json
      app_id
      string 
      应用id
      必需
      应用id,由后端生成
      graph
      object 
      图结构
      必需
      见http://192.168.50.206:30080/kdgc-ai/ai_platform/-/blob/master/doc/%E5%89%8D%E7%AB%AF%E6%95%B0%E6%8D%AE%E6%B1%87%E6%80%BB.md
      nodes
      array [object {14}] 
      必需
      edges
      array [object {8}] 
      边
      必需
      viewport
      object 
      必需
      features
      object 
      功能
      必需
      使用默认数据
      opening_statement
      string 
      必需
      suggested_questions
      array[string]
      必需
      suggested_questions_after_answer
      object 
      必需
      text_to_speech
      object 
      必需
      speech_to_text
      object 
      必需
      retriever_resource
      object 
      必需
      sensitive_word_avoidance
      object 
      必需
      file_upload
      object 
      必需
      user_id
      string 
      必需
      hash
      string 
      hash值
      必需
      用来保证两个人同时改变工作流
      environment_variables
      array[string]
      环境变量
      必需
      默认为空
      conversation_variables
      array[string]
      会话变量
      必需
      默认为空
      示例
      {
          "app_id": "test2",
          "graph": {
              "nodes": [
                  {
                      "id": "1745481595747",
                      "type": "custom",
                      "data": {
                          "type": "start",
                          "title": "开始",
                          "desc": "",
                          "variables": [
                              {
                                  "variable": "input_query",
                                  "label": "input_query",
                                  "type": "text-input",
                                  "max_length": 48,
                                  "required": false,
                                  "options": []
                              },
                              {
                                  "variable": "input_file",
                                  "label": "input_file",
                                  "type": "file",
                                  "max_length": 48,
                                  "required": false,
                                  "options": [],
                                  "allowed_file_upload_methods": [
                                      "local_file",
                                      "remote_url"
                                  ],
                                  "allowed_file_types": [
                                      "document"
                                  ],
                                  "allowed_file_extensions": []
                              }
                          ],
                          "selected": false
                      },
                      "position": {
                          "x": -345.7258848176418,
                          "y": 151.1348447447716
                      },
                      "targetPosition": "left",
                      "sourcePosition": "right",
                      "positionAbsolute": {
                          "x": -345.7258848176418,
                          "y": 151.1348447447716
                      },
                      "width": 244,
                      "height": 115,
                      "selected": false
                  },
                  {
                      "id": "1745564631704",
                      "type": "custom",
                      "data": {
                          "type": "end",
                          "title": "结束",
                          "desc": "",
                          "outputs": [
                              {
                                  "variable": "text",
                                  "value_selector": [
                                      "1745995555099",
                                      "text"
                                  ]
                              }
                          ],
                          "selected": false
                      },
                      "position": {
                          "x": 379.88710281680426,
                          "y": 151.1348447447716
                      },
                      "targetPosition": "left",
                      "sourcePosition": "right",
                      "positionAbsolute": {
                          "x": 379.88710281680426,
                          "y": 151.1348447447716
                      },
                      "width": 244,
                      "height": 89,
                      "selected": false
                  },
                  {
                      "id": "1746494930925",
                      "type": "custom",
                      "data": {
                          "type": "document-extractor",
                          "title": "文档提取器",
                          "desc": "",
                          "variable_selector": [
                              "1745481595747",
                              "input_file"
                          ],
                          "is_array_file": false,
                          "selected": true
                      },
                      "position": {
                          "x": 17.90886947588004,
                          "y": 151.1348447447716
                      },
                      "targetPosition": "left",
                      "sourcePosition": "right",
                      "positionAbsolute": {
                          "x": 17.90886947588004,
                          "y": 151.1348447447716
                      },
                      "width": 244,
                      "height": 91,
                      "selected": true
                  }
              ],
              "edges": [
                  {
                      "id": "1745481595747-source-1746494930925-target",
                      "type": "custom",
                      "source": "1745481595747",
                      "sourceHandle": "source",
                      "target": "1746494930925",
                      "targetHandle": "target",
                      "data": {
                          "sourceType": "start",
                          "targetType": "document-extractor",
                          "isInIteration": false,
                          "isInLoop": false
                      },
                      "zIndex": 0
                  },
                  {
                      "id": "1746494930925-source-1745564631704-target",
                      "type": "custom",
                      "source": "1746494930925",
                      "target": "1745564631704",
                      "sourceHandle": "source",
                      "targetHandle": "target",
                      "data": {
                          "sourceType": "document-extractor",
                          "targetType": "end",
                          "isInLoop": false
                      },
                      "zIndex": 0
                  }
              ],
              "viewport": {
                  "x": 681.0233898764018,
                  "y": 322.5983314686214,
                  "zoom": 0.6036748273130844
              }
          },
          "features": {
              "opening_statement": "",
              "suggested_questions": [],
              "suggested_questions_after_answer": {
                  "enabled": false
              },
              "text_to_speech": {
                  "enabled": false,
                  "voice": "",
                  "language": ""
              },
              "speech_to_text": {
                  "enabled": false
              },
              "retriever_resource": {
                  "enabled": true
              },
              "sensitive_word_avoidance": {
                  "enabled": false
              },
              "file_upload": {
                  "image": {
                      "enabled": false,
                      "number_limits": 3,
                      "transfer_methods": [
                          "local_file",
                          "remote_url"
                      ]
                  },
                  "enabled": true,
                  "allowed_file_types": [
                      "image"
                  ],
                  "allowed_file_extensions": [],
                  "allowed_file_upload_methods": [
                      "remote_url",
                      "local_file"
                  ],
                  "number_limits": 1,
                  "fileUploadConfig": {
                      "file_size_limit": 15,
                      "batch_count_limit": 5,
                      "image_file_size_limit": 10,
                      "video_file_size_limit": 100,
                      "audio_file_size_limit": 50,
                      "workflow_file_upload_limit": 10
                  }
              }
          },
          "user_id": "test01",
          "hash": "ed26be547c305b48b72d8242273f9ee05a67a8888e225437aa364709e23aae2f",
          "environment_variables": [],
          "conversation_variables": []
      }

      示例代码

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      请求示例请求示例
      Shell
      JavaScript
      Java
      Swift
      cURL
      curl --location --request POST 'http://121.229.177.64:8088/wanxin_ai//zhixin_agent/workflows/draft' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "app_id": "test2",
          "graph": {
              "nodes": [
                  {
                      "id": "1745481595747",
                      "type": "custom",
                      "data": {
                          "type": "start",
                          "title": "开始",
                          "desc": "",
                          "variables": [
                              {
                                  "variable": "input_query",
                                  "label": "input_query",
                                  "type": "text-input",
                                  "max_length": 48,
                                  "required": false,
                                  "options": []
                              },
                              {
                                  "variable": "input_file",
                                  "label": "input_file",
                                  "type": "file",
                                  "max_length": 48,
                                  "required": false,
                                  "options": [],
                                  "allowed_file_upload_methods": [
                                      "local_file",
                                      "remote_url"
                                  ],
                                  "allowed_file_types": [
                                      "document"
                                  ],
                                  "allowed_file_extensions": []
                              }
                          ],
                          "selected": false
                      },
                      "position": {
                          "x": -345.7258848176418,
                          "y": 151.1348447447716
                      },
                      "targetPosition": "left",
                      "sourcePosition": "right",
                      "positionAbsolute": {
                          "x": -345.7258848176418,
                          "y": 151.1348447447716
                      },
                      "width": 244,
                      "height": 115,
                      "selected": false
                  },
                  {
                      "id": "1745564631704",
                      "type": "custom",
                      "data": {
                          "type": "end",
                          "title": "结束",
                          "desc": "",
                          "outputs": [
                              {
                                  "variable": "text",
                                  "value_selector": [
                                      "1745995555099",
                                      "text"
                                  ]
                              }
                          ],
                          "selected": false
                      },
                      "position": {
                          "x": 379.88710281680426,
                          "y": 151.1348447447716
                      },
                      "targetPosition": "left",
                      "sourcePosition": "right",
                      "positionAbsolute": {
                          "x": 379.88710281680426,
                          "y": 151.1348447447716
                      },
                      "width": 244,
                      "height": 89,
                      "selected": false
                  },
                  {
                      "id": "1746494930925",
                      "type": "custom",
                      "data": {
                          "type": "document-extractor",
                          "title": "文档提取器",
                          "desc": "",
                          "variable_selector": [
                              "1745481595747",
                              "input_file"
                          ],
                          "is_array_file": false,
                          "selected": true
                      },
                      "position": {
                          "x": 17.90886947588004,
                          "y": 151.1348447447716
                      },
                      "targetPosition": "left",
                      "sourcePosition": "right",
                      "positionAbsolute": {
                          "x": 17.90886947588004,
                          "y": 151.1348447447716
                      },
                      "width": 244,
                      "height": 91,
                      "selected": true
                  }
              ],
              "edges": [
                  {
                      "id": "1745481595747-source-1746494930925-target",
                      "type": "custom",
                      "source": "1745481595747",
                      "sourceHandle": "source",
                      "target": "1746494930925",
                      "targetHandle": "target",
                      "data": {
                          "sourceType": "start",
                          "targetType": "document-extractor",
                          "isInIteration": false,
                          "isInLoop": false
                      },
                      "zIndex": 0
                  },
                  {
                      "id": "1746494930925-source-1745564631704-target",
                      "type": "custom",
                      "source": "1746494930925",
                      "target": "1745564631704",
                      "sourceHandle": "source",
                      "targetHandle": "target",
                      "data": {
                          "sourceType": "document-extractor",
                          "targetType": "end",
                          "isInLoop": false
                      },
                      "zIndex": 0
                  }
              ],
              "viewport": {
                  "x": 681.0233898764018,
                  "y": 322.5983314686214,
                  "zoom": 0.6036748273130844
              }
          },
          "features": {
              "opening_statement": "",
              "suggested_questions": [],
              "suggested_questions_after_answer": {
                  "enabled": false
              },
              "text_to_speech": {
                  "enabled": false,
                  "voice": "",
                  "language": ""
              },
              "speech_to_text": {
                  "enabled": false
              },
              "retriever_resource": {
                  "enabled": true
              },
              "sensitive_word_avoidance": {
                  "enabled": false
              },
              "file_upload": {
                  "image": {
                      "enabled": false,
                      "number_limits": 3,
                      "transfer_methods": [
                          "local_file",
                          "remote_url"
                      ]
                  },
                  "enabled": true,
                  "allowed_file_types": [
                      "image"
                  ],
                  "allowed_file_extensions": [],
                  "allowed_file_upload_methods": [
                      "remote_url",
                      "local_file"
                  ],
                  "number_limits": 1,
                  "fileUploadConfig": {
                      "file_size_limit": 15,
                      "batch_count_limit": 5,
                      "image_file_size_limit": 10,
                      "video_file_size_limit": 100,
                      "audio_file_size_limit": 50,
                      "workflow_file_upload_limit": 10
                  }
              }
          },
          "user_id": "test01",
          "hash": "ed26be547c305b48b72d8242273f9ee05a67a8888e225437aa364709e23aae2f",
          "environment_variables": [],
          "conversation_variables": []
      }'

      返回响应

      🟢200成功
      application/json
      Body
      result
      string 
      必需
      hash
      string 
      必需
      updated_at
      integer 
      必需
      workflow_id
      string 
      必需
      示例
      {
          "result": "success",
          "hash": "63405da6858a4a1fb04f995c60faef25133b94a3455e8ee9c6125bfe5b8e8cb0",
          "updated_at": 1748198288,
          "workflow_id": "644ebb79-0c74-4522-a6b6-3200d5d7b97c"
      }
      修改于 2025-06-16 03:01:41
      上一页
      工作流运行
      下一页
      知识库初始化
      Built with