ChatDev/yaml_instance/demo_sub_graph.yaml
2026-01-07 16:24:01 +08:00

75 lines
2.0 KiB
YAML
Executable File

version: 0.4.0
vars: {}
graph:
id: paper_gen
description: Article generation with an inline critique subgraph and revision.
is_majority_voting: false
log_level: INFO
start:
- A
nodes:
- id: A
type: agent
config:
provider: openai
base_url: ${BASE_URL}
api_key: ${API_KEY}
name: gpt-4o
role: 'You are a literary writer, skilled at generating a complete **prose** piece based on a word or phrase input by the user.
The user will input a word or a short sentence, and you need to generate a **prose** piece of no less than 2000 words based on it, requiring multiple paragraphs, rich in **beauty** rather than introductory text.
'
params:
temperature: 0.1
max_tokens: 4000
- id: B
type: subgraph
config:
type: config
config:
id: paper_critique
description: Article revision suggestions
is_majority_voting: false
nodes:
- id: B1
type: agent
config:
provider: openai
base_url: ${BASE_URL}
api_key: ${API_KEY}
name: gpt-4o
role: 'You are an editor, skilled at providing article revision suggestions.
Please provide specific revision suggestions based on the article provided by the user, covering content, structure, and language.
The main requirement is that the writing should be beautiful.
'
params:
temperature: 0.1
max_tokens: 4000
edges: []
- id: C
type: agent
config:
base_url: ${BASE_URL}
api_key: ${API_KEY}
provider: openai
name: gpt-4o
role: 'You are a writer, skilled at revising articles.
Please revise the article based on the article and revision suggestions provided by the user.
'
params:
temperature: 0.1
max_tokens: 4000
edges:
- from: A
to: B
- from: A
to: C
- from: B
to: C