app:
  description: 使用消息推送能力推送企微
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: workflow
  name: 定时库存提醒任务-外发版
  use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
  type: marketplace
  value:
    marketplace_plugin_unique_identifier: hjlarry/database:0.0.6@534bc26cf5bc4ff6b5557457452287ccc71f00eef9378784c4f43ca49954ca2f
    version: null
- current_identifier: null
  type: marketplace
  value:
    marketplace_plugin_unique_identifier: langgenius/openai_api_compatible:0.0.42@cf508badd3f6c086c137a6034697e0c48a60038783b3c3ed0af2fe55000842e8
    version: null
kind: app
version: 0.5.0
workflow:
  conversation_variables: []
  environment_variables:
  - description: ''
    id: 077181b6-9976-42c9-81b3-f84dde65fa89
    name: query_inventory
    selector:
    - env
    - query_inventory
    value: SELECT product_name FROM product WHERE inventory < 0;
    value_type: string
  features:
    file_upload:
      allowed_file_extensions:
      - .JPG
      - .JPEG
      - .PNG
      - .GIF
      - .WEBP
      - .SVG
      allowed_file_types:
      - image
      allowed_file_upload_methods:
      - local_file
      - remote_url
      enabled: false
      fileUploadConfig:
        attachment_image_file_size_limit: 2
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        file_upload_limit: 20
        image_file_batch_limit: 10
        image_file_size_limit: 10
        single_chunk_attachment_limit: 10
        video_file_size_limit: 100
        workflow_file_upload_limit: 10
      image:
        enabled: false
        number_limits: 3
        transfer_methods:
        - local_file
        - remote_url
      number_limits: 3
    opening_statement: ''
    retriever_resource:
      enabled: true
    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:
        isInIteration: false
        isInLoop: false
        sourceType: tool
        targetType: code
      id: 1774964014723-source-1774964028613-target
      source: '1774964014723'
      sourceHandle: source
      target: '1774964028613'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: code
        targetType: llm
      id: 1774964028613-source-1774964032526-target
      source: '1774964028613'
      sourceHandle: source
      target: '1774964032526'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInLoop: false
        sourceType: trigger-schedule
        targetType: tool
      id: 1775006051150-source-1774964014723-target
      source: '1775006051150'
      sourceHandle: source
      target: '1774964014723'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: llm
        targetType: http-request
      id: 1774964032526-source-1775024311896-target
      source: '1774964032526'
      sourceHandle: source
      target: '1775024311896'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        is_team_authorization: true
        paramSchemas:
        - auto_generate: null
          default: null
          form: llm
          human_description:
            en_US: The SQL query string.
            ja_JP: The SQL query string.
            pt_BR: The SQL query string.
            zh_Hans: SQL 查询语句。
          label:
            en_US: SQL Query
            ja_JP: SQL Query
            pt_BR: SQL Query
            zh_Hans: SQL 查询语句
          llm_description: The SQL query string.
          max: null
          min: null
          name: query
          options: []
          placeholder: null
          precision: null
          required: true
          scope: null
          template: null
          type: string
        - auto_generate: null
          default: null
          form: llm
          human_description:
            en_US: Optional, Filling in this field will overwrite the database connection
              entered during authorization.
            ja_JP: Optional, Filling in this field will overwrite the database connection
              entered during authorization.
            pt_BR: Optional, Filling in this field will overwrite the database connection
              entered during authorization.
            zh_Hans: 选填，填写后将覆盖授权时填写的数据库连接。
          label:
            en_US: DB URI
            ja_JP: DB URI
            pt_BR: DB URI
            zh_Hans: DB URI
          llm_description: ''
          max: null
          min: null
          name: db_uri
          options: []
          placeholder: null
          precision: null
          required: false
          scope: null
          template: null
          type: string
        - auto_generate: null
          default: json
          form: form
          human_description:
            en_US: Choose the output format.
            ja_JP: Choose the output format.
            pt_BR: Choose the output format.
            zh_Hans: 选择输出格式。
          label:
            en_US: Output format
            ja_JP: Output format
            pt_BR: Output format
            zh_Hans: 输出格式
          llm_description: ''
          max: null
          min: null
          name: format
          options:
          - icon: ''
            label:
              en_US: JSON
              ja_JP: JSON
              pt_BR: JSON
              zh_Hans: JSON
            value: json
          - icon: ''
            label:
              en_US: CSV
              ja_JP: CSV
              pt_BR: CSV
              zh_Hans: CSV
            value: csv
          - icon: ''
            label:
              en_US: YAML
              ja_JP: YAML
              pt_BR: YAML
              zh_Hans: YAML
            value: yaml
          - icon: ''
            label:
              en_US: Markdown
              ja_JP: Markdown
              pt_BR: Markdown
              zh_Hans: Markdown
            value: md
          - icon: ''
            label:
              en_US: Excel
              ja_JP: Excel
              pt_BR: Excel
              zh_Hans: Excel
            value: xlsx
          - icon: ''
            label:
              en_US: HTML
              ja_JP: HTML
              pt_BR: HTML
              zh_Hans: HTML
            value: html
          placeholder: null
          precision: null
          required: false
          scope: null
          template: null
          type: select
        - auto_generate: null
          default: null
          form: form
          human_description:
            en_US: 'Optional. For example {"connect_args": {"ssl": {"ca": "/path/to/ca.pem"}}}

              More connection options can be found at https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine

              '
            ja_JP: 'Optional. For example {"connect_args": {"ssl": {"ca": "/path/to/ca.pem"}}}

              More connection options can be found at https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine

              '
            pt_BR: 'Optional. For example {"connect_args": {"ssl": {"ca": "/path/to/ca.pem"}}}

              More connection options can be found at https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine

              '
            zh_Hans: '选填项。例如 {"connect_args": {"ssl": {"ca": "/path/to/ca.pem"}}}

              更多连接选项可参考 https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine

              '
          label:
            en_US: DB Config Options
            ja_JP: DB Config Options
            pt_BR: DB Config Options
            zh_Hans: 数据库连接配置选项
          llm_description: ''
          max: null
          min: null
          name: config_options
          options: []
          placeholder: null
          precision: null
          required: false
          scope: null
          template: null
          type: string
        params:
          config_options: ''
          db_uri: ''
          format: ''
          query: ''
        plugin_id: hjlarry/database
        plugin_unique_identifier: hjlarry/database:0.0.6@534bc26cf5bc4ff6b5557457452287ccc71f00eef9378784c4f43ca49954ca2f
        provider_icon: /console/api/workspaces/current/plugin/icon?tenant_id=1a0d2228-cd70-487f-ab08-7dae6f1bf8a4&filename=65d2d7404efb4952bb715a35ae79ccce92e70b820fd6cdb74e9acc58a505f7cf.svg
        provider_id: hjlarry/database/database
        provider_name: hjlarry/database/database
        provider_type: builtin
        selected: true
        title: SQL Execute
        tool_configurations:
          config_options:
            type: mixed
            value: "{\n  \"connect_args\": {\n    \"client_encoding\": \"utf8\"\n\
              \  }\n}"
          format:
            type: constant
            value: json
        tool_description: 此工具用于在已存在的数据库中执行 SQL 查询。
        tool_label: SQL Execute
        tool_name: sql_execute
        tool_node_version: '2'
        tool_parameters:
          db_uri:
            type: mixed
            value: ''
          query:
            type: mixed
            value: ' {{#env.query_inventory#}}'
        type: tool
      height: 114
      id: '1774964014723'
      position:
        x: 443.63901582154597
        y: 340
      positionAbsolute:
        x: 443.63901582154597
        y: 340
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        code: "\ndef main(query_result: dict) -> dict:\n    flag = 0\n    if not query_result:\n\
          \        return {\n        \"flag\": flag,\n        \"result\": \"[]\"\n\
          \    }\n    result = query_result[0].get(\"result\", [])\n    len_result\
          \ = len(result)\n    if len_result ==1:\n        flag = 1\n    elif 1<len_result<50:\n\
          \        flag = 2\n    elif len_result>=50:\n        flag = 3\n    return\
          \ {\n        \"flag\": flag,\n        \"result\": str(result)\n    }"
        code_language: python3
        outputs:
          flag:
            children: null
            type: number
          result:
            children: null
            type: string
        selected: false
        title: 代码执行
        type: code
        variables:
        - value_selector:
          - '1774964014723'
          - json
          value_type: array[object]
          variable: query_result
      height: 52
      id: '1774964028613'
      position:
        x: 744.3195079107729
        y: 340
      positionAbsolute:
        x: 744.3195079107729
        y: 340
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        context:
          enabled: true
          variable_selector:
          - '1774964028613'
          - result
        model:
          completion_params:
            temperature: 0.7
          mode: chat
          name: DeepSeek-V3
          provider: langgenius/openai_api_compatible/openai_api_compatible
        prompt_template:
        - id: b208ebae-e63c-4119-9fa7-d75311df5f8b
          role: system
          text: '# 任务描述

            你是一个零售数据分析助手。结合从数据库里查询的库存信息，整合成最后的答案。


            你的上游是一个数据库查询器，输出内容是目前库里库存不足的产品信息。


            ## 输出要求

            - 如果上一个节点正常输出，请整合成最后的答案！

            - 如果上一个节点没有准确数据信息，请不要编造任何答案，可输出：抱歉，未查到具体信息！

            '
        - id: 2ec97497-5834-47e7-b568-b5b6ebfd230b
          role: user
          text: '{{#context#}}'
        selected: false
        title: LLM
        type: llm
        vision:
          enabled: false
      height: 88
      id: '1774964032526'
      position:
        x: 1046.319507910773
        y: 340
      positionAbsolute:
        x: 1046.319507910773
        y: 340
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        config:
          frequency: daily
          mode: visual
          timezone: UTC
          visual_config:
            monthly_days:
            - 1
            on_minute: 0
            time: 12:00 AM
            weekdays:
            - sun
        frequency: daily
        mode: visual
        selected: false
        timezone: Asia/Shanghai
        title: 定时触发器
        type: trigger-schedule
        visual_config:
          monthly_days:
          - 1
          on_minute: 0
          time: 12:00 AM
          weekdays:
          - sun
      height: 130
      id: '1775006051150'
      position:
        x: 110.66713344912773
        y: 319
      positionAbsolute:
        x: 110.66713344912773
        y: 319
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        authorization:
          config: null
          type: no-auth
        body:
          data:
          - id: key-value-44
            key: ''
            type: text
            value: " {\n    \t\"msgtype\": \"text\",\n    \t\"text\": {\n        \t\
              \"content\": {{#1774964032526.text#}}\n    \t}\n   }'"
          type: json
        headers: ''
        method: post
        params: ''
        retry_config:
          max_retries: 3
          retry_enabled: true
          retry_interval: 100
        selected: false
        ssl_verify: true
        timeout:
          max_connect_timeout: 0
          max_read_timeout: 0
          max_write_timeout: 0
        title: HTTP 请求
        type: http-request
        url: ''
        variables: []
      height: 82
      id: '1775024311896'
      position:
        x: 1347
        y: 340
      positionAbsolute:
        x: 1347
        y: 340
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    viewport:
      x: 329.12999623147005
      y: 177.0207785445366
      zoom: 0.757858283255199
  rag_pipeline_variables: []
