app: description: "用于查询各公司基本信息\ 和信用信息的助手:基本信息\ 来自知识库文档,信用信息来\ 自信用视界。\n如果查询不在知\ 识库内的公司,回复不支持。\ \n如果不是查询公司信息,转到\ AI 通用对话问答。" icon: icon_04 icon_background: '#E4FBCC' mode: advanced-chat name: "公司信息助手" workflow: features: file_upload: image: enabled: false number_limits: 3 transfer_methods: - local_file - remote_url opening_statement: '' retriever_resource: enabled: false sensitive_word_avoidance: enabled: false speech_to_text: enabled: false suggested_questions: [] suggested_questions_after_answer: enabled: false text_to_speech: enabled: false language: '' voice: '' graph: edges: - data: sourceType: start targetType: llm id: 1724319412809-llm source: '1724319412809' sourceHandle: source target: llm targetHandle: target type: custom - data: sourceType: llm targetType: if-else id: llm-1724319718191 source: llm sourceHandle: source target: '1724319718191' targetHandle: target type: custom - data: sourceType: if-else targetType: llm id: 1724319718191-1724319828199 source: '1724319718191' sourceHandle: 'false' target: '1724319828199' targetHandle: target type: custom - data: sourceType: llm targetType: answer id: 1724319828199-1724320381358 source: '1724319828199' sourceHandle: source target: '1724320381358' targetHandle: target type: custom - data: sourceType: if-else targetType: code id: 1724319718191-1724320483669 source: '1724319718191' sourceHandle: 'true' target: '1724320483669' targetHandle: target type: custom - data: sourceType: llm targetType: if-else id: 1724321166260-1724321352125 source: '1724321166260' sourceHandle: source target: '1724321352125' targetHandle: target type: custom - data: sourceType: http-request targetType: llm id: 1724323898989-1724383174669 source: '1724323898989' sourceHandle: source target: '1724383174669' targetHandle: target type: custom - data: sourceType: llm targetType: answer id: 1724383174669-1724323442412 source: '1724383174669' sourceHandle: source target: '1724323442412' targetHandle: target type: custom - data: sourceType: if-else targetType: answer id: 1724321352125-answer source: '1724321352125' sourceHandle: 'true' target: answer targetHandle: target type: custom - data: sourceType: if-else targetType: http-request id: 1724321352125-1724323898989 source: '1724321352125' sourceHandle: 'false' target: '1724323898989' targetHandle: target type: custom - data: sourceType: code targetType: knowledge-retrieval id: 1724320483669-1724727809359 source: '1724320483669' sourceHandle: source target: '1724727809359' targetHandle: target type: custom - data: sourceType: knowledge-retrieval targetType: llm id: 1724727809359-1724321166260 source: '1724727809359' sourceHandle: source target: '1724321166260' targetHandle: target type: custom nodes: - data: desc: '' selected: false title: "开始" type: start variables: [] height: 53 id: '1724319412809' position: x: 61 y: 152 positionAbsolute: x: 61 y: 152 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: context: enabled: false variable_selector: [] desc: "信息分类" memory: role_prefix: assistant: '' user: '' window: enabled: true size: 5 model: completion_params: temperature: 0.7 mode: chat name: qwen2-instruct provider: xinference prompt_template: - id: cab68323-bf42-410d-94d5-55edccead498 role: system text: "你判断用户输入,如果是\ 查询公司信息的,提取返回\ json格式字符串:包括两个参\ 数next和entity,其中next参数的值是\ query,entity的值是公司名称。如\ 果不是查询公司信息的,返\ 回json格式字符串:包括两个\ 参数next和entity,其中next参数的值\ 是common,entity的值是空字符串。" selected: false title: "LLM-信息分类" type: llm variables: [] vision: enabled: false height: 127 id: llm position: x: 349 y: 152 positionAbsolute: x: 349 y: 152 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: answer: "抱歉,我还不支持查询该\ 公司:{{#1724320483669.entity_name#}}" desc: '' selected: false title: "直接回复-不支持的公司" type: answer variables: [] height: 122 id: answer position: x: 2116.1994026110765 y: 216.4818519056615 positionAbsolute: x: 2116.1994026110765 y: 216.4818519056615 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: conditions: - comparison_operator: contains id: '1724319719557' value: query variable_selector: - llm - text desc: "判断是否公司信息查询" logical_operator: and selected: false title: "条件分支-判断是否公司信\ 息查询" type: if-else height: 155 id: '1724319718191' position: x: 635 y: 152 positionAbsolute: x: 635 y: 152 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: context: enabled: true variable_selector: - sys - query desc: "通用对话支持" memory: role_prefix: assistant: '' user: '' window: enabled: true size: 5 model: completion_params: temperature: 0.7 mode: chat name: qwen2-instruct provider: xinference prompt_template: - id: 97ff63eb-45e6-471c-b684-483ac808814d role: system text: "这是输入:{{#context#}}\n请回答。" selected: false title: "LLM-通用对话支持" type: llm variables: [] vision: enabled: false height: 127 id: '1724319828199' position: x: 635 y: 344 positionAbsolute: x: 635 y: 344 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: answer: '{{#1724319828199.text#}}' desc: '' selected: false title: "直接回复-通用对话" type: answer variables: [] height: 106 id: '1724320381358' position: x: 635 y: 515 positionAbsolute: x: 635 y: 515 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: code: "import json\nimport re\n# 主运行函数\ndef main(arg1:\ \ str) -> dict:\n # 从输入字符串中提取\ JSON块内容\n # 输入可能是两种\ 格式之一:```json\\s({\"next\":\"query\", \"entity\"\ : \"公司名称\"})```,或者{\"next\":\"query\"\ , \"entity\": \"公司名称\"}\n # 先按第一\ 种格式对待,用正则表达式\ 提取\n content = re.search(r'```json\\s(.*?)```', arg1.replace('\_\ ', ' '), re.DOTALL)\n if content:\n data = json.loads(content.group(1))\n\ \ else:\n # 第二种格式\n content =\ \ arg1.replace('\_', ' ')\n data = data = json.loads(content)\n\n\ \ if 'entity' in data:\n entity_name = data['entity']\n else:\n\ \ entity_name = ''\n\n return {\n \"entity_name\" : entity_name\n\ \ }\n" code_language: python3 dependencies: [] desc: "提取公司名" outputs: entity_name: children: null type: string selected: false title: "代码执行-提取公司名" type: code variables: - value_selector: - llm - text variable: arg1 height: 83 id: '1724320483669' position: x: 932.4002986944615 y: 183 positionAbsolute: x: 932.4002986944615 y: 183 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: context: enabled: true variable_selector: - '1724727809359' - result desc: "从知识库查询公司信息" model: completion_params: temperature: 0.7 mode: chat name: qwen2-instruct provider: xinference prompt_template: - id: f15c81ff-47e0-48d3-ae9d-7bb9a70fb7fe role: system text: "这是上下文检索结果:{{#context#}}\n\ \n如果上下文检索结果是空的\ ,返回\"不支持该公司\"。\n如\ 果不空,将检索结果输出。" selected: false title: "LLM-从知识库查询公司信息" type: llm variables: [] vision: enabled: false height: 127 id: '1724321166260' position: x: 1515.1193428721845 y: 183 positionAbsolute: x: 1515.1193428721845 y: 183 selected: true sourcePosition: right targetPosition: left type: custom width: 244 - data: conditions: - comparison_operator: contains id: '1724321353692' value: "不支持该公司" variable_selector: - '1724321166260' - text desc: '' logical_operator: and selected: false title: "条件分支-判断是否在支持\ 清单内" type: if-else height: 125 id: '1724321352125' position: x: 1809.7190441777234 y: 183 positionAbsolute: x: 1809.7190441777234 y: 183 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: answer: "{{#1724320483669.entity_name#}}的基本信息:\ {{#1724321166260.text#}}\n信用信息:{{#1724383174669.text#}}" desc: '' selected: false title: "直接回复-整合结果输出" type: answer variables: [] height: 143 id: '1724323442412' position: x: 2738.367442303694 y: 391.72352459464594 positionAbsolute: x: 2738.367442303694 y: 391.72352459464594 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: authorization: config: null type: no-auth body: data: '' type: none desc: '' headers: '' method: get params: '' selected: false timeout: connect: 10 max_connect_timeout: 300 max_read_timeout: 600 max_write_timeout: 600 read: 60 write: 20 title: "HTTP 请求-提交到信用视界搜\ 索" type: http-request url: https://www.x315.com/search?k="{{#1724320483669.entity_name#}}" variables: [] height: 124 id: '1724323898989' position: x: 2116.1994026110765 y: 391.72352459464594 positionAbsolute: x: 2116.1994026110765 y: 391.72352459464594 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: context: enabled: false variable_selector: [] desc: "提取结果" model: completion_params: temperature: 0.7 mode: chat name: qwen2-instruct provider: xinference prompt_template: - id: 5442467a-8043-4150-9fbf-d90e979b74ea role: system text: "请从以下搜索到的信用结\ 果内提取{{#1724320483669.entity_name#}}的信用\ 信息,并作为返回。\n\n这是\ 搜索到的公司信用结果:{{#1724323898989.body#}}" selected: false title: "LLM-提取信用搜索结果" type: llm variables: [] vision: enabled: false height: 127 id: '1724383174669' position: x: 2424.3266656980936 y: 391.72352459464594 positionAbsolute: x: 2424.3266656980936 y: 391.72352459464594 selected: false sourcePosition: right targetPosition: left type: custom width: 244 - data: dataset_ids: - ad0eee52-ed1d-4189-b1ae-f45db519d76c desc: '' multiple_retrieval_config: reranking_model: model: bge-reranker-base provider: xinference score_threshold: 0.5 top_k: 1 query_variable_selector: - '1724320483669' - entity_name retrieval_mode: single selected: false single_retrieval_config: model: completion_params: {} mode: chat name: qwen2-instruct provider: xinference title: "知识检索" type: knowledge-retrieval height: 91 id: '1724727809359' position: x: 1225.088178178135 y: 183 positionAbsolute: x: 1225.088178178135 y: 183 selected: false sourcePosition: right targetPosition: left type: custom width: 244 viewport: x: -884.0415325168351 y: -102.65257239932822 zoom: 1.0074025769906287