🤖

Dify AI 教程:News Hot List

暂无描述

⬡ 13 节点 ↓ 9 下载 ⚙ workflow ⭐ 85/100 2026-05-28

工作流图谱

YAML 源码

app:
  description: ''
  icon: 🤖
  icon_background: '#FFEAD5'
  mode: workflow
  name: 'Dify AI 教程:News Hot List '
  use_icon_as_answer_icon: false
kind: app
version: 0.1.3
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: 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
        sourceType: start
        targetType: http-request
      id: 1731657142529-source-1731657173907-target
      source: '1731657142529'
      sourceHandle: source
      target: '1731657173907'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: http-request
        targetType: llm
      id: 1731657173907-source-1731657269402-target
      source: '1731657173907'
      sourceHandle: source
      target: '1731657269402'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: llm
        targetType: code
      id: 1731657269402-source-1731657495644-target
      source: '1731657269402'
      sourceHandle: source
      target: '1731657495644'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: code
        targetType: iteration
      id: 1731657495644-source-1731657624078-target
      source: '1731657495644'
      sourceHandle: source
      target: '1731657624078'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: true
        iteration_id: '1731657624078'
        sourceType: http-request
        targetType: llm
      id: 1731657694132-source-1731657813535-target
      source: '1731657694132'
      sourceHandle: source
      target: '1731657813535'
      targetHandle: target
      type: custom
      zIndex: 1002
    - data:
        isInIteration: false
        sourceType: iteration
        targetType: template-transform
      id: 1731657624078-source-1731657915903-target
      source: '1731657624078'
      sourceHandle: source
      target: '1731657915903'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: true
        iteration_id: '1731657624078'
        sourceType: template-transform
        targetType: http-request
      id: 1731662449984-source-1731657694132-target
      source: '1731662449984'
      sourceHandle: source
      target: '1731657694132'
      targetHandle: target
      type: custom
      zIndex: 1002
    - data:
        isInIteration: true
        iteration_id: '1731657624078'
        sourceType: iteration-start
        targetType: template-transform
      id: 1731657624078start-source-1731662449984-target
      source: 1731657624078start
      sourceHandle: source
      target: '1731662449984'
      targetHandle: target
      type: custom
      zIndex: 1002
    - data:
        isInIteration: false
        sourceType: template-transform
        targetType: code
      id: 1731657915903-source-1732083026646-target
      source: '1731657915903'
      sourceHandle: source
      target: '1732083026646'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: code
        targetType: http-request
      id: 1732083026646-source-1732083061013-target
      source: '1732083026646'
      sourceHandle: source
      target: '1732083061013'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: http-request
        targetType: end
      id: 1732083061013-source-1731658032951-target
      source: '1732083061013'
      sourceHandle: source
      target: '1731658032951'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: 开始
        type: start
        variables: []
      height: 64
      id: '1731657142529'
      position:
        x: 374.9091923574524
        y: 42.18373368734646
      positionAbsolute:
        x: 374.9091923574524
        y: 42.18373368734646
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    - data:
        authorization:
          config: null
          type: no-auth
        body:
          data: []
          type: none
        desc: ''
        headers: ''
        method: get
        params: ''
        selected: false
        timeout:
          max_connect_timeout: 0
          max_read_timeout: 0
          max_write_timeout: 0
        title: 获取36氪24小时热榜
        type: http-request
        url: https://api.vvhan.com/api/hotlist/36Ke
        variables: []
      height: 134
      id: '1731657173907'
      position:
        x: 643.668564924877
        y: 42.18373368734646
      positionAbsolute:
        x: 643.668564924877
        y: 42.18373368734646
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    - data:
        context:
          enabled: false
          variable_selector: []
        desc: ''
        model:
          completion_params:
            temperature: 0.7
          mode: chat
          name: qwen2.5:latest
          provider: ollama
        prompt_template:
        - id: 87334ee0-f176-4030-94da-324daaefd4b4
          role: system
          text: '```xml

            <instruction>

            <instructions>

             1. 抓取了360氪新闻榜单 json :{{#1731657173907.body#}}

             2. 只生成榜单前面 3 条数据

             3. 生成如下结构的内容:

               [{

                 "title": "新闻标题",

                 "url": "新闻链接"

               }]

             4.输出不要添加```json 包裹

            </instructions>

             

            <examples>

             <example>

               <output>

                 [

                   {"title": "8点1氪|个人购房不超140平契税降至1%;特斯拉10万员工薪酬数据曝光;校园招聘严禁限定985和211高校","url":"https://36kr.com/p/3035465134387461"},

                     {"title": "避免内耗,吉利将整合极氪和领克两大品牌|36氪独家","url":"https://36kr.com/p/3034230633984003"},

            {"title": "Transformer打破三十年数学猜想,Meta研究者用AI给出反例,算法杀手攻克数学难题|36氪独家","url":"https://36kr.com/p/3034698843615238"},

                 ]

               </output>

             </example>

            <examples>'
        selected: false
        title: LLM梳理新闻数组
        type: llm
        variables: []
        vision:
          enabled: false
      height: 119
      id: '1731657269402'
      position:
        x: 618.3168305973979
        y: 282
      positionAbsolute:
        x: 618.3168305973979
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    - data:
        code: "import json\nimport re\n\ndef clean_url(url):\n    # 移除所有非打印的ASCII字符(包括控制字符)\n\
          \    cleaned_url = re.sub(r'[\\x00-\\x1F\\x7F-\\x9F]', '', url)\n    # 移除多余的空格(包括制表符、换页符等)\n\
          \    cleaned_url = re.sub(r'\\s+', ' ', cleaned_url).strip()\n    return\
          \ cleaned_url\n\ndef main(arg1: str) -> dict:\n    try:\n        json_object\
          \ = json.loads(arg1)\n        \n        # 遍历列表中的每个对象以获取 URL,并清理URL\n   \
          \     if isinstance(json_object, list):\n            for item in json_object:\n\
          \                raw_url = item.get('url')\n                if raw_url is\
          \ not None:\n                    # 清理URL\n                    cleaned_url\
          \ = clean_url(raw_url)\n                    # 更新item中的URL\n            \
          \        item['url'] = cleaned_url\n        \n        return {\n       \
          \     \"result\": json_object\n        }\n    except json.JSONDecodeError\
          \ as e:\n        return {\n            \"result\": None,\n            \"\
          error\": f\"Invalid JSON: {str(e)}\"\n        }\n\n# 示例输入\nrag1 = '[{\"\
          name\": \"Item 1\", \"url\": \"http://item1.example.com\\n\"}, {\"name\"\
          : \"Item 2\", \"url\": \"http://item2.example.com\"}]'\nprint(main(rag1))"
        code_language: python3
        desc: ''
        outputs:
          result:
            children: null
            type: array[object]
        selected: false
        title: 转换数据位json格式
        type: code
        variables:
        - value_selector:
          - '1731657269402'
          - text
          variable: arg1
      height: 64
      id: '1731657495644'
      position:
        x: 899.074037541089
        y: 282
      positionAbsolute:
        x: 899.074037541089
        y: 282
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 243
    - data:
        desc: ''
        error_handle_mode: terminated
        height: 225
        is_parallel: false
        iterator_selector:
        - '1731657495644'
        - result
        output_selector:
        - '1731657813535'
        - text
        output_type: array[string]
        parallel_nums: 10
        selected: false
        start_node_id: 1731657624078start
        title: 迭代获取新闻正文
        type: iteration
        width: 934
      height: 2...(过长已截断)