app:
  description: 规范自然灾害事件
  icon: ✉️
  icon_background: '#E0F2FE'
  mode: workflow
  name: 预警-自然灾害事件类型-DeepseekV3
  use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
  type: marketplace
  value:
    marketplace_plugin_unique_identifier: langgenius/volcengine_maas:0.0.10@ba0a7fc3151e89bf8645cd3abb3ccff971ee59e5b1127efca50b092dbb93bf80
kind: app
version: 0.1.5
workflow:
  conversation_variables: []
  environment_variables: []
  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:
        audio_file_size_limit: 50
        batch_count_limit: 5
        file_size_limit: 15
        image_file_size_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: 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:
        isInIteration: false
        sourceType: code
        targetType: end
      id: 1727242813814-source-1727235861736-target
      source: '1727242813814'
      sourceHandle: source
      target: '1727235861736'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: start
        targetType: llm
      id: 1727233123593-source-1732778846154-target
      source: '1727233123593'
      sourceHandle: source
      target: '1732778846154'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: llm
        targetType: code
      id: 1732778846154-source-1727242813814-target
      source: '1732778846154'
      sourceHandle: source
      target: '1727242813814'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: "{\n  \"warn_info\": \"DeryckWhibley坚称他'不是骗子',前经理否认了性胁迫指控\",\n  \"sys.files\"\
          : [],\n  \"sys.user_id\": \"sl_backend_twitter\"\n}"
        selected: false
        title: 开始
        type: start
        variables:
        - label: warn_info
          max_length: 2000
          options: []
          required: true
          type: paragraph
          variable: warn_info
      height: 213
      id: '1727233123593'
      position:
        x: -61.60583804915933
        y: 291.69166477189617
      positionAbsolute:
        x: -61.60583804915933
        y: 291.69166477189617
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    - data:
        desc: ''
        outputs:
        - value_selector:
          - '1727242813814'
          - result
          variable: result
        selected: false
        title: 结束
        type: end
      height: 89
      id: '1727235861736'
      position:
        x: 1122.9814661452995
        y: 304.9033674451216
      positionAbsolute:
        x: 1122.9814661452995
        y: 304.9033674451216
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    - data:
        code: "disaster_dict = {\n    \"地震\":\"earthquake\",\n\"火山爆发\":\"volcanic\
          \ eruption\",\n\"海啸\":\"tsunami\",\n\"台风/飓风\":\"typhoon/hurricane\",\n\"\
          龙卷风\":\"tornado\",\n\"洪水\":\"flood\",\n\"干旱\":\"drought\",\n\"山体滑坡\":\"\
          landslide\",\n\"泥石流\":\"mudslide\",\n\"雪崩\":\"avalanche\",\n\"森林火灾\":\"\
          forest fire\",\n\"冰川融化\":\"glacial melting\",\n\"沙尘暴\":\"dust storm\",\n\
          \"高温热浪\":\"heat wave\",\n\"寒潮\":\"cold wave\",\n\"暴雨\":\"rainstorm\",\n\"\
          工业事故\":\"Industrial accident\",\n\"交通事故\":\"Traffic accident\",\n\"火灾\"\
          :\"Fire\",\n\"爆炸\":\"Explosion\",\n\"核事故\":\"Nuclear accident\",\n\"化学品泄漏\"\
          :\"Chemical spill\",\n\"油轮泄漏\":\"Oil spill\",\n\"矿难\":\"Mining accident\"\
          ,\n\"食物中毒\":\"Food poisoning\",\n\"公共卫生事件\":\"Public health emergency\"\
          ,\n\"建筑物倒塌\":\"Building collapse\",\n\"恐怖袭击\":\"Terrorism\",\n\"水坝溃坝\":\"\
          Dam burst\",\n\"游行抗议\":\"Protest march\",\n\"冰雹\":\"Hail\",\n\"冻雨\":\"Freezing\
          \ Rain\",\n\"霾\":\"haze\",\n\"雷暴\":\"Thunderstorm\",\n\"大风\":\"High Wind\"\
          \n}\n\ndef main(kn_result: dict) -> dict:\n    kn_result = kn_result.replace(\"\
          输出:\",\"\")\n    json_obj = [{\"code\": \"\", \"name\": kn_result, \"score\"\
          : None}]\n    \n    json_obj = parse_json_to_list(kn_result)\n    # return\
          \ {\n    #     \"result\": json_obj,\n    # }\n    \n    # try:\n    # \
          \    json_obj = parse_json_to_list(kn_result)\n    #     return {\n    #\
          \         \"result\": json_obj,\n    #     }\n    # except:\n    #     pass\n\
          \    \n\n    return {\n        \"result\": json_obj,\n    }\n    \ndef parse_json_to_list(name):\n\
          \    result_list = []\n\n    # Iterating over the 'result' list in the JSON\n\
          \    code = disaster_dict.get(name, \"\")\n    if len(code)>0:\n       \
          \ result_list.append({\"code\": code, \"name\": name})\n\n    return result_list\
          \  \n    \n"
        code_language: python3
        desc: ''
        outputs:
          result:
            children: null
            type: array[object]
        selected: false
        title: KnResult2Obj
        type: code
        variables:
        - value_selector:
          - '1732778846154'
          - text
          variable: kn_result
      height: 53
      id: '1727242813814'
      position:
        x: 663.6977906608877
        y: 291.69166477189617
      positionAbsolute:
        x: 663.6977906608877
        y: 291.69166477189617
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    - data:
        context:
          enabled: false
          variable_selector: []
        desc: ''
        model:
          completion_params: {}
          mode: chat
          name: deepseek-v3-250324
          provider: langgenius/volcengine_maas/volcengine_maas
        prompt_template:
        - id: ff06405d-dfb9-40ca-987a-c24fd3cfd6fb
          role: system
          text: '```xml

            <instruction>

            根据给定的天气预警信息,打上相应的标签。标签列表包括:大风,雷暴,霾,冻雨,地震,火山爆发,海啸,台风/飓风,龙卷风,洪水,干旱,山体滑坡,泥石流,雪崩,森林火灾,冰川融化,沙尘暴,高温热浪,寒潮,暴雨,工业事故,交通事故,火灾,爆炸,核事故,化学品泄漏,油轮泄漏,矿难,食物中毒,公共卫生事件,建筑物倒塌,恐怖袭击,水坝溃坝,游行抗议,冰雹。


            <instructions>

            1. 仔细阅读输入的天气预警信息,理解其描述的具体事件或现象。

            2. 根据预警信息的内容,从提供的标签列表中选择最匹配的一个或多个标签。

            3. 确保所选标签与预警信息描述的事件或现象完全一致,避免无关标签。

            4. 如果预警信息描述的事件或现象不在标签列表中,则忽略该信息或选择最接近的标签。

            5. 输出时仅列出匹配的标签,不要包含任何额外的解释或XML标签。

            6. 如果预警信息包含多个事件或现象,请为每个事件或现象分别打上对应的标签。


            <examples>

            <example>

            输入:今日预计有强风,风速可达10级以上,请市民注意防范。

            输出:大风

            </example>


            <example>

            输入:受台风影响,沿海地区将出现暴雨和大风天气,局部地区可能有洪水。

            输出:台风/飓风,暴雨,洪水

            </example>


            <example>

            输入:某化工厂发生泄漏事故,导致周边空气质量下降,建议居民关闭门窗。

            输出:化学品泄漏,工业事故

            </example>


            <notes>

            1. 标签之间用逗号分隔,不要使用空格或其他符号。

            2. 如果预警信息描述的事件或现象与多个标签相关,请列出所有相关标签。

            3. 确保标签的准确性,避免主观判断或猜测。

            4. 输出格式应简洁明了,仅包含标签名称。

            </notes>

            </instruction>

            ```'
        - id: 9f485eef-bc41-4f14-b8dd-9d507b6a8d3d
          role: user
          text: '{{#1727233123593.warn_info#}}'
        selected: true
        title: LLM
        type: llm
        variables: []
        vision:
          enabled: false
      height: 89
      id: '1732778846154'
      position:
        x: 241.82807864225322
        y: 291.69166477189617
      positionAbsolute:
        x: 241.82807864225322
        y: 291.69166477189617
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    viewport:
      x: 185.06078589047775
      y: 3.447951724393647
      zoom: 0.751517595495081