📄

长篇故事生成(迭代)

暂无描述

⬡ 10 节点 ↓ 9 下载 ⚙ advanced-chat ⭐ 85/100 2026-05-28

工作流图谱

YAML 源码

app:
  description: ''
  icon: 📄
  icon_background: '#FBE8FF'
  mode: advanced-chat
  name: 长篇故事生成(迭代)
  use_icon_as_answer_icon: false
dependencies:
- current_identifier: null
  type: marketplace
  value:
    marketplace_plugin_unique_identifier: langgenius/openai:0.0.13@9caa0421b5519db036aaccdbf1980d1071550767d6c59e9d9388dd386a92e9f6
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: start
        targetType: llm
      id: 1716783101349-source-1716783205923-target
      source: '1716783101349'
      sourceHandle: source
      target: '1716783205923'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: llm
        targetType: code
      id: 1716783205923-source-1716783405935-target
      source: '1716783205923'
      sourceHandle: source
      target: '1716783405935'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: code
        targetType: iteration
      id: 1716783405935-source-1716786291494-target
      source: '1716783405935'
      sourceHandle: source
      target: '1716786291494'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: iteration
        targetType: code
      id: 1716786291494-source-1716786321875-target
      source: '1716786291494'
      sourceHandle: source
      target: '1716786321875'
      targetHandle: target
      type: custom
      zIndex: 0
    - data:
        isInIteration: false
        sourceType: code
        targetType: answer
      id: 1716786321875-source-1716786344896-target
      source: '1716786321875'
      sourceHandle: source
      target: '1716786344896'
      targetHandle: target
      type: custom
      zIndex: 0
    nodes:
    - data:
        desc: ''
        selected: false
        title: 开始
        type: start
        variables:
        - label: 文章标题
          max_length: 256
          options: []
          required: true
          type: text-input
          variable: article_title
        - label: 文章内容
          max_length: 33024
          options: []
          required: true
          type: paragraph
          variable: article_outline
      height: 116
      id: '1716783101349'
      position:
        x: 30
        y: 330.5
      positionAbsolute:
        x: 30
        y: 330.5
      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: gpt-4o
          provider: langgenius/openai/openai
        prompt_template:
        - id: 872364eb-6859-4011-b830-e9d547b2a2b4
          role: system
          text: "<instruction> \n你需要根据提供的标题和大纲写一篇长文。按照以下步骤完成任务: \n1. 使用article_title作为文章标题。\
            \ \n2. 根据提供的article_outline组织文章。大纲中的每个部分应对应文章中的一个部分。 \n3. 确保文章内容详实,每个部分都包含详细的信息、解释、例子以及任何其他相关内容,以充分涵盖主题。\
            \ \n4. 确保各部分之间的过渡顺畅,保持连贯的流畅性。 \n5. 输出应不包含任何XML标签。仅提供包含以下键和值的JSON数组:“section”(文章每个部分的标题),“bullets”(每个部分的提纲)。\
            \ \n<example> \n<input> \n<article_title> \n气候变化对沿海城市的影响 \n</article_title>\
            \ \n<article_outline> \n1. 引言 \n2. 海平面上升 \n3. 风暴频率增加 \n4. 结论 \n</article_outline>\
            \ \n</input> \n<output> \n[ { \"section\": \"引言\", \"bullets\": \"1. 气候变化对沿海城市影响的概述\
            \ 2. 理解这些影响的重要性\" }, { \"section\": \"海平面上升\", \"bullets\": \"1. 海平面上升的原因\
            \ 2. 对沿海基础设施和社区的影响 3. 受影响城市的例子\" }, { \"section\": \"风暴频率增加\", \"bullets\"\
            : \"1. 气候变化与风暴频率的关联 2. 更频繁和严重的风暴对沿海地区的影响 3. 最近风暴的案例研究\" }, { \"section\"\
            : \"结论\", \"bullets\": \"1. 关键点总结 2. 应对气候变化的紧迫性 3. 对政策制定者和社区的行动呼吁\" }\
            \ ] \n</output> \n</example> \n</instruction> \n<input> \n<article_title>\
            \ \n{{#1716783101349.article_title#}} \n</article_title>\n<article_outline>\
            \ \n{{#1716783101349.article_outline#}} \n</article_outline> \n</input>\
            \ \n<output>\n"
        selected: false
        title: 生成段落标题和段落内容
        type: llm
        variables: []
        vision:
          configs:
            detail: high
          enabled: true
      height: 96
      id: '1716783205923'
      position:
        x: 334
        y: 330.5
      positionAbsolute:
        x: 334
        y: 330.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        code: "def main(arg1: str) -> dict:\n    import json\n    data = json.loads(arg1)\n\
          \    \n    # Create an array of objects\n    result = [{'section': item[\"\
          section\"], 'bullets': item[\"bullets\"]} for item in data]\n    \n    return\
          \ {\n        'result': result\n    }"
        code_language: python3
        desc: ''
        outputs:
          result:
            children: null
            type: array[object]
        selected: false
        title: 提取段落标题和段落内容
        type: code
        variables:
        - value_selector:
          - '1716783205923'
          - text
          variable: arg1
      height: 54
      id: '1716783405935'
      position:
        x: 638
        y: 330.5
      positionAbsolute:
        x: 638
        y: 330.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        desc: 一段一段生成长篇故事
        error_handle_mode: terminated
        height: 261
        is_parallel: false
        iterator_selector:
        - '1716783405935'
        - result
        output_selector:
        - '1716805725916'
        - text
        output_type: array[string]
        parallel_nums: 10
        selected: false
        startNodeType: llm
        start_node_id: '1716805725916'
        title: 迭代
        type: iteration
        width: 446
      height: 261
      id: '1716786291494'
      position:
        x: 942
        y: 330.5
      positionAbsolute:
        x: 942
        y: 330.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 446
      zIndex: 1
    - data:
        code: "\ndef main(articleSections: list):\n    data = articleSections\n  \
          \  return {\n        \"result\": \"\\n\".join(data)\n    }\n"
        code_language: python3
        desc: 将迭代节点输出的数组 Array 转换成字符串 String
        outputs:
          result:
            children: null
            type: string
        selected: false
        title: 代码执行
        type: code
        variables:
        - value_selector:
          - '1716786291494'
          - output
          variable: articleSections
      height: 98
      id: '1716786321875'
      position:
        x: 1448
        y: 330.5
      positionAbsolute:
        x: 1448
        y: 330.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        answer: '{{#1716786321875.result#}}'
        desc: ''
        selected: false
        title: 结束
        type: answer
        variables: []
      height: 105
      id: '1716786344896'
      position:
        x: 1752
        y: 330.5
      positionAbsolute:
        x: 1752
        y: 330.5
      selected: false
      sourcePosition: right
      targetPosition: left
      type: custom
      width: 244
    - data:
        context:
          enabled: false
          variable_selector: []
        desc: 生成文章
        isInIteration: true
        isIterationStart: true
        iteration_id: '1716786291494'
        memory:
          role_prefix:
            assistant: ''
            user: ''
          window:
            enabled: false
            size: 50
        model:
          completion_params:
            temperature: 0.7
          mode: chat
          name: gpt-4o
          provider: langgenius/openai/openai
        prompt_template:
        - id: 0c84c8c2-bcde-43be-a392-87cd04b40674
          role: system
          text: "You are an expert document writer. Your job is to write long form\
            \ cohesive content. \n"
        - id: a661230f-2367-4f35-98d8-d9d608745354
          role: user
          text: "You are writing a document called {{#1716783101349.article_title#}}.\
            \ Write a section based on the following information: {{#1716786291494.item#}}.\
            \  \n\n\n<Full outline>\nTake the full outline as a reference when generating\
            \ full article. \n{{#1716783205923.text#}}"
        selected: false
        title: 'LLM '
        type: llm
        variables: []
        vision:
          configs:
            detail: high
          enabled: false
      extent: parent
      height: 124
      id: '1716805725916'
      parentId: '1716786291494'
      position:
        x: 85
        y: 85
      positionAbsolute:
        x: 1027
        y: ...(过长已截断)