mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2026-04-25 11:18:06 +00:00
fix typos
This commit is contained in:
parent
033617e4ba
commit
c2dd7abd55
@ -180,7 +180,7 @@ OpenClaw 可以与 ChatDev 集成,通过 **调用已有的 agent 团队**,
|
||||
2. 为你的 OpenClaw 实例安装所需的技能:
|
||||
|
||||
```bash
|
||||
clawdbot install chatdev
|
||||
clawdhub install chatdev
|
||||
```
|
||||
|
||||
3. 让 OpenClaw 创建一个 ChatDev 工作流。例如:
|
||||
|
||||
@ -188,7 +188,7 @@ To get started:
|
||||
1. Start the ChatDev 2.0 backend.
|
||||
2. Install the required skills for your OpenClaw instance:
|
||||
```bash
|
||||
clawdbot install chatdev
|
||||
clawdhub install chatdev
|
||||
```
|
||||
|
||||
3. Ask your OpenClaw to create a ChatDev workflow. For example:
|
||||
|
||||
405
skills.md
405
skills.md
@ -1,405 +0,0 @@
|
||||
---
|
||||
name: chatdev
|
||||
description: Invoke ChatDev ability units (workflows) via local API (port 6400). Use when the user needs specialized agent workflows like paper reviews (arXiv), data visualization (from CSV), or when they mention "ChatDev", "ability units", or "workflows" at http://127.0.0.1:6400.
|
||||
---
|
||||
|
||||
# ChatDev Ability Units
|
||||
|
||||
Ability units represent capability units. You can browse what's available, inspect
|
||||
required args, run them, or upload new ones. Use these endpoints when you need to
|
||||
invoke a predefined ability unit (e.g., paper review, data visualization) via the
|
||||
local API.
|
||||
|
||||
Run ability units via the local API and return `final_message` from the JSON response.
|
||||
|
||||
## API endpoints
|
||||
1) Browse ability units
|
||||
- Method: GET
|
||||
- URL: http://127.0.0.1:6400/api/workflows
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v http://127.0.0.1:6400/api/workflows
|
||||
```
|
||||
|
||||
2) Get ability unit raw content
|
||||
- Method: GET
|
||||
- URL: http://127.0.0.1:6400/api/workflows/<filename>/get
|
||||
- Purpose: fetch the raw YAML content for an ability unit file.
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v \
|
||||
http://127.0.0.1:6400/api/workflows/test.yaml/get
|
||||
```
|
||||
|
||||
3) Get ability unit args
|
||||
- Method: GET
|
||||
- URL: http://127.0.0.1:6400/api/workflows/<ability_unit>.yaml/args
|
||||
- Purpose: fetch input parameter schema for an ability unit.
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X GET \
|
||||
http://127.0.0.1:6400/api/workflows/test.yaml/args
|
||||
```
|
||||
|
||||
4) Run ability unit
|
||||
- Method: POST
|
||||
- URL: http://127.0.0.1:6400/api/workflow/run
|
||||
- Content-Type: application/json
|
||||
- SSE support: set `Accept: text/event-stream` to stream events (`started`, `log`,
|
||||
`completed`, `error`). Omit the header to get the normal JSON response.
|
||||
- Output: parse JSON and return `final_message`. If missing, report failure and
|
||||
include any error fields. After you get `output_dir`, move it to your working
|
||||
directory.
|
||||
- Available ability units:
|
||||
1) Paper Review
|
||||
- yaml_file: `yaml_instance/paper_review.yaml`
|
||||
- task_prompt: arXiv URL/ID or paper title.
|
||||
- Purpose: fetch content and deliver technical + writing reviews.
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X POST http://127.0.0.1:6400/api/workflow/run \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Accept: text/event-stream" \
|
||||
-d '{
|
||||
"yaml_file": "yaml_instance/paper_review.yaml",
|
||||
"task_prompt": "https://arxiv.org/abs/1706.03762"
|
||||
}'
|
||||
```
|
||||
|
||||
2) Data Visualization
|
||||
- yaml_file: `yaml_instance/data_visualization_basic.yaml`
|
||||
- task_prompt: dataset description + analysis goals.
|
||||
- attachments: absolute paths to CSV files.
|
||||
- Purpose: profile, clean, plan 4-6 charts, iterate visualizations.
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X POST http://127.0.0.1:6400/api/workflow/run \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"yaml_file": "yaml_instance/data_visualization_basic.yaml",
|
||||
"task_prompt": "please analyze and visualize the data",
|
||||
"attachments": ["/Users/yufan/Projects/bugfix/ChatDev/sample_sales.csv"]
|
||||
}'
|
||||
```
|
||||
|
||||
5) Upload ability unit
|
||||
- Method: POST
|
||||
- URL: http://127.0.0.1:6400/api/workflows/upload/content
|
||||
- Content-Type: application/json
|
||||
- Format notes: `filename` should end with `.yaml`; `content` must be a valid YAML
|
||||
string that includes `version`, `vars`, and a `graph` with `id`, `start`,
|
||||
`nodes`, and `edges` (as in the example).
|
||||
- Tip: if uploads keep failing with format errors, call the "get ability unit raw content" endpoint to inspect
|
||||
an existing ability unit's structure and copy its format.
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X POST \
|
||||
http://127.0.0.1:6400/api/workflows/upload/content \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @- <<'EOF'
|
||||
{
|
||||
"filename": "test.yaml",
|
||||
"content": "version: 0.4.0\nvars: {}\ngraph:\n id: paper_review\n description: Three agents collaboratively review academic papers from different perspectives. Input can be an arxiv URL or paper title.\n is_majority_voting: false\n start:\n - Paper Fetcher\n nodes:\n - id: Paper Fetcher\n type: agent\n config:\n name: gpt-4o\n provider: openai\n role: |\n You are a paper content fetcher.\n base_url: ${BASE_URL}\n api_key: ${API_KEY}\n description: Fetches paper content from arxiv\n context_window: 0\n edges: []"
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
6) Update ability unit
|
||||
- Method: PUT
|
||||
- URL: http://127.0.0.1:6400/api/workflows/<filename>/update
|
||||
- Content-Type: application/json
|
||||
- Format notes: same payload as upload (`filename` + YAML `content` string).
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X PUT \
|
||||
http://127.0.0.1:6400/api/workflows/test.yaml/update \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @- <<'EOF'
|
||||
{
|
||||
"filename": "test.yaml",
|
||||
"content": "version: 0.4.0\nvars: {}\ngraph:\n id: paper_review\n description: Update example.\n is_majority_voting: false\n start:\n - Paper Fetcher\n nodes:\n - id: Paper Fetcher\n type: agent\n config:\n name: gpt-4o\n provider: openai\n role: |\n You are a paper content fetcher.\n base_url: ${BASE_URL}\n api_key: ${API_KEY}\n description: Fetches paper content from arxiv\n context_window: 0\n edges: []"
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
7) Rename ability unit
|
||||
- Method: POST
|
||||
- URL: http://127.0.0.1:6400/api/workflows/<filename>/rename
|
||||
- Content-Type: application/json
|
||||
- Body: `{ "new_filename": "new_name.yaml" }`
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X POST \
|
||||
http://127.0.0.1:6400/api/workflows/test.yaml/rename \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"new_filename":"renamed.yaml"}'
|
||||
```
|
||||
|
||||
8) Copy ability unit
|
||||
- Method: POST
|
||||
- URL: http://127.0.0.1:6400/api/workflows/<filename>/copy
|
||||
- Content-Type: application/json
|
||||
- Body: `{ "new_filename": "copy.yaml" }`
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X POST \
|
||||
http://127.0.0.1:6400/api/workflows/test.yaml/copy \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"new_filename":"test-copy.yaml"}'
|
||||
```
|
||||
|
||||
9) Delete ability unit
|
||||
- Method: DELETE
|
||||
- URL: http://127.0.0.1:6400/api/workflows/<filename>/delete
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -v -X DELETE \
|
||||
http://127.0.0.1:6400/api/workflows/test.yaml/delete
|
||||
```
|
||||
|
||||
10) List local tools (function_calling)
|
||||
- Method: GET
|
||||
- URL: http://127.0.0.1:6400/api/tools/local
|
||||
- Example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -X GET http://127.0.0.1:6400/api/tools/local
|
||||
```
|
||||
|
||||
## Tools hot updates
|
||||
Local function tools are managed via the same backend (port 6400).
|
||||
|
||||
Endpoints:
|
||||
- List local tools: `GET http://127.0.0.1:6400/api/tools/local`
|
||||
- Create/overwrite local tool file: `POST http://127.0.0.1:6400/api/tools/local`
|
||||
|
||||
Create example:
|
||||
```
|
||||
curl --noproxy 127.0.0.1 -X POST http://127.0.0.1:6400/api/tools/local \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"filename": "add.py",
|
||||
"content": "def add(a: int, b: int) -> dict:\n return {\"result\": a + b}\n",
|
||||
"overwrite": true
|
||||
}'
|
||||
```
|
||||
|
||||
YAML example (local function_calling):
|
||||
```
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
tools:
|
||||
- name: add
|
||||
```
|
||||
|
||||
## Common scenarios and tool suggestions
|
||||
- If the agent needs to search the web, use `web_search`.
|
||||
- If the agent needs to fetch a URL's content, use `read_webpage_content`.
|
||||
- If the agent needs to inspect local files, use `describe_available_files` and `list_directory`.
|
||||
- If the agent needs to read a file snippet, use `read_text_file_snippet` or `read_file_segment`.
|
||||
- If the agent needs to write output files, use `save_file`.
|
||||
|
||||
## Advanced Workflow Templates
|
||||
|
||||
Below are advanced YAML templates you can copy and adapt. They cover debate loops,
|
||||
subgraph reuse, conditional edges, and selective payload routing.
|
||||
|
||||
### 1) Two-Agent Debate Loop with Judge Stop Criteria
|
||||
```yaml
|
||||
version: 0.4.0
|
||||
vars: {}
|
||||
graph:
|
||||
id: debate_loop
|
||||
description: Two agents debate until the judge outputs "Verdict: STOP".
|
||||
is_majority_voting: false
|
||||
start:
|
||||
- Topic
|
||||
nodes:
|
||||
- id: Topic
|
||||
type: passthrough
|
||||
config: {}
|
||||
- id: Pro
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
You are the PRO debater. Respond with arguments and counterpoints.
|
||||
- id: Con
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
You are the CON debater. Respond with arguments and counterpoints.
|
||||
- id: Judge
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
Evaluate the debate. Output:
|
||||
Score: <0-1>
|
||||
Notes: <brief>
|
||||
Verdict: CONTINUE|STOP
|
||||
- id: Final
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
Produce the final summary of the debate and recommendation.
|
||||
edges:
|
||||
- from: Topic
|
||||
to: Pro
|
||||
keep_message: true
|
||||
- from: Topic
|
||||
to: Con
|
||||
keep_message: true
|
||||
- from: Pro
|
||||
to: Judge
|
||||
- from: Con
|
||||
to: Judge
|
||||
- from: Judge
|
||||
to: Pro
|
||||
condition: need_reflection_loop
|
||||
- from: Judge
|
||||
to: Con
|
||||
condition: need_reflection_loop
|
||||
- from: Judge
|
||||
to: Final
|
||||
condition: should_stop_loop
|
||||
```
|
||||
|
||||
### 2) Subgraph Reuse + Selective Payload Passing
|
||||
```yaml
|
||||
version: 0.4.0
|
||||
vars: {}
|
||||
graph:
|
||||
id: parent_with_subgraph
|
||||
description: Uses a subgraph and only forwards the "Summary" section.
|
||||
start:
|
||||
- Request
|
||||
nodes:
|
||||
- id: Request
|
||||
type: passthrough
|
||||
config: {}
|
||||
- id: ResearchSubgraph
|
||||
type: subgraph
|
||||
config:
|
||||
type: file
|
||||
config:
|
||||
path: "subgraphs/deep_research_executor_sub.yaml"
|
||||
- id: Writer
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
Write the final report using only the provided Summary.
|
||||
edges:
|
||||
- from: Request
|
||||
to: ResearchSubgraph
|
||||
keep_message: true
|
||||
- from: ResearchSubgraph
|
||||
to: Writer
|
||||
process:
|
||||
type: regex_extract
|
||||
config:
|
||||
pattern: "Summary:\\s*(.*)"
|
||||
group: 1
|
||||
multiline: true
|
||||
dotall: true
|
||||
on_no_match: pass
|
||||
```
|
||||
|
||||
### 3) Conditional Routing + Minimal Payload
|
||||
```yaml
|
||||
version: 0.4.0
|
||||
vars: {}
|
||||
graph:
|
||||
id: router_with_conditions
|
||||
description: Route to different nodes based on tags; forward only CONTENT block.
|
||||
start:
|
||||
- Router
|
||||
nodes:
|
||||
- id: Router
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
Decide the route. Output exactly:
|
||||
ROUTE: QA|REPORT
|
||||
CONTENT: <payload to forward>
|
||||
- id: QA
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
Answer the question concisely.
|
||||
- id: REPORT
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
Write a structured report.
|
||||
edges:
|
||||
- from: Router
|
||||
to: QA
|
||||
condition:
|
||||
type: keyword
|
||||
config:
|
||||
any: ["ROUTE: QA"]
|
||||
process:
|
||||
type: regex_extract
|
||||
config:
|
||||
pattern: "CONTENT:\\s*(.*)"
|
||||
group: 1
|
||||
dotall: true
|
||||
on_no_match: drop
|
||||
- from: Router
|
||||
to: REPORT
|
||||
condition:
|
||||
type: keyword
|
||||
config:
|
||||
any: ["ROUTE: REPORT"]
|
||||
process:
|
||||
type: regex_extract
|
||||
config:
|
||||
pattern: "CONTENT:\\s*(.*)"
|
||||
group: 1
|
||||
dotall: true
|
||||
on_no_match: drop
|
||||
```
|
||||
|
||||
## Tips
|
||||
- Any workflow YAML can be used as a subgraph to compose more complex tasks, including existing ability units/workflows. Example:
|
||||
```
|
||||
- id: Research Subgraph
|
||||
type: subgraph
|
||||
config:
|
||||
type: file
|
||||
config:
|
||||
path: "yaml_instance/deep_research_v1.yaml"
|
||||
```
|
||||
- Ensure that all generated artifacts are output to your workspace file paths whenever possible
|
||||
- Ensure that all agents’ roles are concise, sophisticated, and equipped with sufficient tools
|
||||
280
yaml_instance/middle_east_simulation.yaml
Normal file
280
yaml_instance/middle_east_simulation.yaml
Normal file
@ -0,0 +1,280 @@
|
||||
version: 0.0.1
|
||||
vars: {}
|
||||
graph:
|
||||
id: middle_east_simulation
|
||||
description: Simulate Middle East situation from multiple parties perspectives
|
||||
log_level: INFO
|
||||
is_majority_voting: false
|
||||
start:
|
||||
- Situation Brief
|
||||
end:
|
||||
- Final Report
|
||||
nodes:
|
||||
- id: Situation Brief
|
||||
type: agent
|
||||
context_window: -1
|
||||
config:
|
||||
provider: openai
|
||||
name: gpt-4o
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
role: |-
|
||||
You are a News Analyst. Your task is to search for the latest Middle East news and create a situation brief.
|
||||
|
||||
[Instructions]
|
||||
1. Use web_search to get the latest Middle East news
|
||||
2. Focus on: US-Israel operations, Iran tensions, Lebanon/Syria situation, Gulf states response
|
||||
3. Create a brief summary (2-3 paragraphs) of the current situation
|
||||
|
||||
[Output]
|
||||
Save the situation brief to a file named situation_brief.txt
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: web_search
|
||||
- name: describe_available_files
|
||||
- name: load_file
|
||||
|
||||
- id: US Perspective
|
||||
type: agent
|
||||
context_window: -1
|
||||
config:
|
||||
provider: openai
|
||||
name: gpt-4o
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
role: |-
|
||||
You are playing the role of the United States Government. Analyze the current Middle East situation from the US perspective.
|
||||
|
||||
[Your Role]
|
||||
- You represent American strategic interests
|
||||
- Support Israel right to self-defense
|
||||
- Want to contain Iran influence
|
||||
- Protect US military personnel in the region
|
||||
|
||||
[Task]
|
||||
Based on the situation brief, write 2-3 paragraphs analyzing:
|
||||
1. Current US objectives in the Middle East
|
||||
2. How US views Iran, Israel, and other actors
|
||||
3. What US likely will do next
|
||||
|
||||
Write in first person as the US government. Be realistic and strategic.
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: describe_available_files
|
||||
- name: load_file
|
||||
|
||||
- id: Israel Perspective
|
||||
type: agent
|
||||
context_window: -1
|
||||
config:
|
||||
provider: openai
|
||||
name: gpt-4o
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
role: |-
|
||||
You are playing the role of the Israeli Government. Analyze the current Middle East situation from Israel perspective.
|
||||
|
||||
[Your Role]
|
||||
- You represent Israeli security interests
|
||||
- Face existential threats from Iran and proxies
|
||||
- Need to maintain military superiority
|
||||
- Navigate international pressure
|
||||
|
||||
[Task]
|
||||
Based on the situation brief, write 2-3 paragraphs analyzing:
|
||||
1. Israel current security concerns
|
||||
2. How Israel views Iran, Hezbollah, Hamas
|
||||
3. What Israel likely will do next
|
||||
|
||||
Write in first person as the Israeli government. Be defensive but determined.
|
||||
|
||||
[Note: This is a simulation for educational purposes]
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: describe_available_files
|
||||
- name: load_file
|
||||
|
||||
- id: Iran Perspective
|
||||
type: agent
|
||||
context_window: -1
|
||||
config:
|
||||
provider: openai
|
||||
name: gpt-4o
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
role: |-
|
||||
You are playing the role of the Iranian Government. Analyze the current Middle East situation from Iran perspective.
|
||||
|
||||
[Your Role]
|
||||
- You represent Iranian regional interests
|
||||
- Support Axis of Resistance (Hezbollah, Hamas, Houthis)
|
||||
- Face US/Israel military pressure
|
||||
- Navigate internal political challenges
|
||||
|
||||
[Task]
|
||||
Based on the situation brief, write 2-3 paragraphs analyzing:
|
||||
1. Iran regional strategy and allies
|
||||
2. How Iran views US, Israel, Saudi Arabia
|
||||
3. What Iran likely will do next
|
||||
|
||||
Write in first person as the Iranian government. Be defensive about sovereignty.
|
||||
|
||||
[Note: This is a simulation for educational purposes]
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: describe_available_files
|
||||
- name: load_file
|
||||
|
||||
- id: Arab League Perspective
|
||||
type: agent
|
||||
context_window: -1
|
||||
config:
|
||||
provider: openai
|
||||
name: gpt-4o
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
role: |-
|
||||
You are playing the role of the Arab League / Gulf States. Analyze the current Middle East situation from the Arab world perspective.
|
||||
|
||||
[Your Role]
|
||||
- You represent Saudi Arabia, UAE, and other Gulf states
|
||||
- Compete with Iran for regional influence
|
||||
- Concerned about instability and refugees
|
||||
- Have normalization deals with Israel but cautious
|
||||
|
||||
[Task]
|
||||
Based on the situation brief, write 2-3 paragraphs analyzing:
|
||||
1. How Arab states view the US-Iran-Israel triangle
|
||||
2. Regional stability concerns
|
||||
3. What Arab states likely will do
|
||||
|
||||
Write in first person as the Arab League.
|
||||
|
||||
[Note: This is a simulation for educational purposes]
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: describe_available_files
|
||||
- name: load_file
|
||||
|
||||
- id: Simulation Orchestrator
|
||||
type: agent
|
||||
context_window: -1
|
||||
config:
|
||||
provider: openai
|
||||
name: gpt-4o
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
role: |-
|
||||
You are a Political Simulation Orchestrator. Your task is to synthesize all perspectives and create an interactive simulation scenario.
|
||||
|
||||
[Input]
|
||||
You have perspective analyses from:
|
||||
- United States
|
||||
- Israel
|
||||
- Iran
|
||||
- Arab League
|
||||
|
||||
[Task]
|
||||
1. Read all perspective files
|
||||
2. Identify key conflicts and opportunities for dialogue
|
||||
3. Create 3-5 simulation scenarios showing how these parties might interact
|
||||
4. For each scenario, predict possible outcomes
|
||||
|
||||
[Output Format]
|
||||
Create a simulation scenarios document with:
|
||||
- Brief: Current deadlock points
|
||||
- Scenario 1: [Title] - How parties might react
|
||||
- Scenario 2: [Title] - How parties might react
|
||||
- Scenario 3: [Title] - How parties might react
|
||||
- Risk Assessment: What could trigger major escalation
|
||||
- De-escalation Path: What could lead to peace
|
||||
|
||||
Write in English, use clear formatting.
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: describe_available_files
|
||||
- name: load_file
|
||||
|
||||
- id: Final Report
|
||||
type: agent
|
||||
context_window: -1
|
||||
config:
|
||||
provider: openai
|
||||
name: gpt-4o
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
role: |-
|
||||
You are a Senior Political Analyst. Create a final comprehensive report on the Middle East simulation.
|
||||
|
||||
[Task]
|
||||
Compile all inputs into a professional analysis report:
|
||||
|
||||
1. Executive Summary (1 paragraph)
|
||||
2. Current Situation Overview
|
||||
3. Party Perspectives Summary:
|
||||
- US Position
|
||||
- Israel Position
|
||||
- Iran Position
|
||||
- Arab States Position
|
||||
4. Simulation Scenarios
|
||||
5. Key Takeaways
|
||||
6. Outlook (next 3-6 months)
|
||||
|
||||
[Format]
|
||||
Use markdown. Write in Chinese (Simplified). Make it comprehensive but readable.
|
||||
|
||||
This is for educational/analytical purposes only.
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: describe_available_files
|
||||
- name: load_file
|
||||
|
||||
edges:
|
||||
- from: Situation Brief
|
||||
to: US Perspective
|
||||
condition: true
|
||||
- from: Situation Brief
|
||||
to: Israel Perspective
|
||||
condition: true
|
||||
- from: Situation Brief
|
||||
to: Iran Perspective
|
||||
condition: true
|
||||
- from: Situation Brief
|
||||
to: Arab League Perspective
|
||||
condition: true
|
||||
- from: US Perspective
|
||||
to: Simulation Orchestrator
|
||||
condition: true
|
||||
- from: Israel Perspective
|
||||
to: Simulation Orchestrator
|
||||
condition: true
|
||||
- from: Iran Perspective
|
||||
to: Simulation Orchestrator
|
||||
condition: true
|
||||
- from: Arab League Perspective
|
||||
to: Simulation Orchestrator
|
||||
condition: true
|
||||
- from: Simulation Orchestrator
|
||||
to: Final Report
|
||||
condition: true
|
||||
52
yaml_instance/url_summarize.yaml
Normal file
52
yaml_instance/url_summarize.yaml
Normal file
@ -0,0 +1,52 @@
|
||||
version: 0.4.0
|
||||
vars: {}
|
||||
graph:
|
||||
id: url_summarize
|
||||
description: 爬取URL内容并总结
|
||||
is_majority_voting: false
|
||||
log_level: INFO
|
||||
start:
|
||||
- Web Fetcher
|
||||
nodes:
|
||||
- id: Web Fetcher
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
你是网页内容抓取助手。你的任务是从URL提取内容。
|
||||
|
||||
[关键指令]
|
||||
1. 必须使用 read_webpage_content 工具来抓取网页
|
||||
2. URL格式: {"url": "https://example.com"}
|
||||
3. 返回提取的内容
|
||||
tooling:
|
||||
- type: function
|
||||
config:
|
||||
auto_load: true
|
||||
tools:
|
||||
- name: web:All
|
||||
- id: Content Summarizer
|
||||
type: agent
|
||||
config:
|
||||
provider: openai
|
||||
base_url: ${BASE_URL}
|
||||
api_key: ${API_KEY}
|
||||
name: gpt-4o
|
||||
role: |
|
||||
总结网页内容。
|
||||
|
||||
输出格式(中文):
|
||||
## 摘要
|
||||
<2-3句总结>
|
||||
|
||||
## 关键点
|
||||
- <point 1>
|
||||
- <point 2>
|
||||
- <point 3>
|
||||
edges:
|
||||
- from: Web Fetcher
|
||||
to: Content Summarizer
|
||||
keep_message: true
|
||||
Loading…
x
Reference in New Issue
Block a user