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: langgenius/volcengine_maas:0.0.7@f8e44422cfa5b9a6ac1f2d3b43ef1069868efdad1e5cec2590de3f53ceac37b0
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: 500
        batch_count_limit: 50
        file_size_limit: 1024
        image_file_size_limit: 1000
        video_file_size_limit: 10000
        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: llm
      id: 1720414200671-source-1720414237605-target
      source: '1720414200671'
      sourceHandle: source
      target: '1720414237605'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: template-transform
        targetType: end
      id: 1720415806041-source-1720415185037-target
      source: '1720415806041'
      sourceHandle: source
      target: '1720415185037'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: code
        targetType: iteration
      id: 1720415379070-source-1743777522098-target
      source: '1720415379070'
      sourceHandle: source
      target: '1743777522098'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: true
        isInLoop: false
        iteration_id: '1743777522098'
        sourceType: iteration-start
        targetType: llm
      id: 1743777522098start-source-1743777541778-target
      source: 1743777522098start
      sourceHandle: source
      target: '1743777541778'
      targetHandle: target
      type: custom
      zIndex: 1002
    - data:
        isInLoop: false
        sourceType: iteration
        targetType: template-transform
      id: 1743777522098-source-1720415806041-target
      source: '1743777522098'
      sourceHandle: source
      target: '1720415806041'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: llm
        targetType: if-else
      id: 1720414237605-source-1743952702602-target
      source: '1720414237605'
      sourceHandle: source
      target: '1743952702602'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInLoop: false
        sourceType: if-else
        targetType: template-transform
      id: 1743952702602-true-1743780001641-target
      source: '1743952702602'
      sourceHandle: 'true'
      target: '1743780001641'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: template-transform
        targetType: variable-aggregator
      id: 1743780001641-source-1743952715913-target
      source: '1743780001641'
      sourceHandle: source
      target: '1743952715913'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: variable-aggregator
        targetType: code
      id: 1743952715913-source-1720415379070-target
      source: '1743952715913'
      sourceHandle: source
      target: '1720415379070'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: if-else
        targetType: template-transform
      id: 1743952702602-false-1743952837696-target
      source: '1743952702602'
      sourceHandle: 'false'
      target: '1743952837696'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        isInLoop: false
        sourceType: template-transform
        targetType: variable-aggregator
      id: 1743952837696-source-1743952715913-target
      source: '1743952837696'
      sourceHandle: source
      target: '1743952715913'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: 开始
        type: start
        variables:
        - label: 输入主题
          max_length: 5000
          options: []
          required: true
          type: paragraph
          variable: subject
        - label: 是否需要转换
          max_length: 48
          options:
          - 手动去除json字符
          - 无需处理
          required: true
          type: select
          variable: type
      height: 114
      id: '1720414200671'
      position:
        x: 268
        y: 124.5
      positionAbsolute:
        x: 268
        y: 124.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        context:
          enabled: true
          variable_selector:
          - '1720414200671'
          - subject
        desc: ''
        model:
          completion_params: {}
          mode: chat
          name: DeepSeek-V3
          provider: langgenius/volcengine_maas/volcengine_maas
        prompt_template:
        - id: e1e8888f-b66a-459d-b025-bb5fd15aad3c
          role: system
          text: '

            ### 角色 ###

            你是一个精通专业写作的作家，请根据用户要求进行大纲生成，具体要求为：{{#1720414200671.subject#}}



            ### 技能 ###

            按用户要求估算出总字数, 由于接下来的处理节点每次最多输出2000个汉字，所以你需要在拆分目录时考虑字数影响

            围绕主题，利用金字塔原理，输出一个摘要和一组大纲目录标题



            ### 输出 ###

            1. 注意，接收你输出的程序，只能接受JSON格式

            2. 格式模版为`{"title":"{{文章标题}}","summary": "{{摘要}}", "outline": [ "{{目录大标题}}"
            ],"word_count":{{目标字数}}}`

            3. 注意outline输出时，子标题要按数字标记顺序



            ### 示例 ###

            输入：请写一篇关于花朵的论文

            输出：

            { "title": "花的实用价值和文化意义","summary": "本文综述了花朵的多重价值和功能，从生物学特性探讨其在生态系统中的角色，分析花朵的经济影响，以及其在全球文化中的象征意义。文章首先解析花朵的生物构造和繁殖机制，随后讨论其在维持生物多样性中的作用，探讨其在园艺和商业中的经济价值，最后阐释花朵在不同文化传统中的象征和使用。",
            "outline": [  "花朵的生物学特性", "花朵在生态系统中的作用", "花朵在全球文化中的象征意义","word_count":10000
            ] }

            '
        selected: false
        title: 大纲撰写
        type: llm
        variables: []
        vision:
          enabled: false
      height: 88
      id: '1720414237605'
      position:
        x: 375
        y: -46.5
      positionAbsolute:
        x: 375
        y: -46.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        desc: ''
        outputs:
        - value_selector:
          - '1720415806041'
          - output
          variable: output
        selected: false
        title: 结束
        type: end
      height: 88
      id: '1720415185037'
      position:
        x: 2469.162543721636
        y: 118.5
      positionAbsolute:
        x: 2469.162543721636
        y: 118.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        code: "\nfunction main({text}) {\n    const json = JSON.parse(text)\n    return\
          \ {\n        title: json.title,\n        summary: json.summary,\n      \
          \  outline: json.outline,\n        part_word_count: Math.ceil(json.word_count\
          \ / json.outline.length) \n    }\n}\n"
        code_language: javascript
        desc: ''
        outputs:
          outline:
            children: null
            type: array[string]
          part_word_count:
            children: null
            type: number
          summary:
            children: null
            type: string
          title:
            children: null
            type: string
        selected: false
        title: 代码执行
        type: code
        variables:
        - value_selector:
          - '1743780001641'
          - output
          variable: text
      height: 52
      id: '1720415379070'
      position:
        x: 1430.851301645003
        y: -123.5
      positionAbsolute:
        x: 1430.851301645003
        y: -123.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        desc: ''
        selected: true
        template: '# {{ title }}


          摘要: {{ summary }}


          {% for text in array %}

          {{ text }}

          {% endfor %}'
        title: 模板转换(整理文章输出)
        type: template-transform
        variables:
        - value_selector:
          - '1743777522098'
          - output
          variable: array
        - value_selector:
          - '1720415379070'
          - title
          variable: title
        - value_selector:
          - '1720415379070'
          - summary
          variable: summary
      height: 52
      id: '1720415806041'
      position:
        x: 2121.162543721636
        y: -46.5
      positionAbsolute:
        x: 2121.162543721636
        y: -46.5
      selected: true
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        desc: ''
        error_handle_mode: terminated
        height: 177
        is_parallel: false
        iterator_selector:
        - '1720415379070'
        - outline
        output_selector:
        - '1743777541778'
        - text
        output_type: array[string]
        parallel_nums: 10
        selected: false
        start_node_id: 1743777522098start
        title: 迭代
        type: iteration
        width: 388
      height: 177
      id: '1743777522098'
      position:
        x: 1744.1625437216362
        y: 209.5
      positionAbsolute:
        x: 1744.1625437216362
        y: 209.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 388
      zIndex: 1
    - data:
        desc: ''
        isInIteration: true
        selected: false
        title: ''
        type: iteration-start
      draggable: false
      height: 48
      id: 1743777522098start
      parentId: '1743777522098'
      position:
        x: 24
        y: 68
      positionAbsolute:
        x: 1768.1625437216362
        y: 277.5
      selectable: false
      sourcePosition: right
      targetPosition: left
      type: custom-iteration-start
      width: 44
      zIndex: 1002
    - data:
        context:
          enabled: true
          variable_selector:
          - '1743777522098'
          - item
        desc: ''
        isInIteration: true
        isInLoop: false
        iteration_id: '1743777522098'
        model:
          completion_params:
            temperature: 0.7
          mode: chat
          name: DeepSeek-V3
          provider: langgenius/volcengine_maas/volcengine_maas
        prompt_template:
        - id: 0b623d2a-d981-462e-8b7e-fafe8c464146
          role: system
          text: "### 角色  ###\n长文章节写手\n\n\n### 要求 ###\n根据给定要求进行文章撰写\n仅撰写主题相关的内容，不做任何延伸,不做总结\n\
            字数目标：{{#1720415379070.part_word_count#}}汉字\n\n\n### 上下文 ####\n主题：{{#1720414200671.subject#}}\
            \ \n摘要：{{#1720415379070.summary#}}\n当前目录标题： {{#1743777522098.item#}}\n\
            \n\n### 输出示例 ####\n \n\n## 一级标题\n### 二级标题\n内容\n### 二级标题\n内容\n### 二级标题\n\
            内容\n### 二级标题\n内容\n"
        selected: false
        title: 章节撰写
        type: llm
        variables: []
        vision:
          enabled: false
      height: 88
      id: '1743777541778'
      parentId: '1743777522098'
      position:
        x: 129
        y: 66
      positionAbsolute:
        x: 1873.1625437216362
        y: 275.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
      zIndex: 1002
    - data:
        desc: ''
        selected: false
        template: '{{ arg1 | replace("json","") | replace("`","") }}'
        title: 模板转换(去除```json字符)
        type: template-transform
        variables:
        - value_selector:
          - '1720414237605'
          - text
          variable: arg1
      height: 52
      id: '1743780001641'
      position:
        x: 968
        y: 218.5
      positionAbsolute:
        x: 968
        y: 218.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        cases:
        - case_id: 'true'
          conditions:
          - comparison_operator: is
            id: 2ced53ff-7d42-4609-8b35-864903889de3
            value: 手动去除json字符
            varType: string
            variable_selector:
            - '1720414200671'
            - type
          id: 'true'
          logical_operator: and
        desc: ''
        selected: false
        title: 条件分支
        type: if-else
      height: 124
      id: '1743952702602'
      position:
        x: 648
        y: 301.5
      positionAbsolute:
        x: 648
        y: 301.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        desc: ''
        output_type: string
        selected: false
        title: 变量聚合器
        type: variable-aggregator
        variables:
        - - '1743780001641'
          - output
        - - '1743952837696'
          - output
      height: 129
      id: '1743952715913'
      position:
        x: 1289.851301645003
        y: 344.5
      positionAbsolute:
        x: 1289.851301645003
        y: 344.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    - data:
        desc: ''
        selected: false
        template: '{{ arg1 }}'
        title: 模板转换(无需处理)
        type: template-transform
        variables:
        - value_selector:
          - '1720414237605'
          - text
          variable: arg1
      height: 52
      id: '1743952837696'
      position:
        x: 968
        y: 465.5
      positionAbsolute:
        x: 968
        y: 465.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 242
    viewport:
      x: -1623.67256839651
      y: 426.15672335472163
      zoom: 1
