### Install Backend Dependencies Source: https://github.com/openbmb/chatdev/blob/main/README.md Installs Python backend dependencies using uv. Ensure Python 3.12+ is installed. ```bash uv sync ``` -------------------------------- ### Build and Run Docker Compose Source: https://github.com/openbmb/chatdev/blob/main/README.md Builds and starts the ChatDev application using Docker Compose. Ensure Docker and Docker Compose are installed and a .env file is present. ```bash # From the project root docker compose up --build ``` -------------------------------- ### Start Backend Manually Source: https://github.com/openbmb/chatdev/blob/main/README.md Starts the ChatDev backend server. Use --reload to watch for source file changes. Customize reload directories with --reload-dir or --reload-exclude. ```bash # Run from the project root uv run python server_main.py --port 6400 --reload ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/openbmb/chatdev/blob/main/README.md Installs Node.js frontend dependencies using npm. Navigate to the frontend directory first. ```bash cd frontend && npm install ``` -------------------------------- ### Run Application with Makefile Source: https://github.com/openbmb/chatdev/blob/main/README.md Starts both the backend and frontend services simultaneously using the Makefile. Access the web console at http://localhost:5173. ```bash make dev ``` -------------------------------- ### Start Frontend Manually Source: https://github.com/openbmb/chatdev/blob/main/README.md Starts the ChatDev frontend development server. Ensure VITE_API_BASE_URL points to the backend. Access the web console at http://localhost:5173. ```bash cd frontend VITE_API_BASE_URL=http://localhost:6400 npm run dev ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/openbmb/chatdev/blob/main/README.md Copies the example environment file to be used for configuration. Set API keys and base URLs in the .env file. ```bash cp .env.example .env ``` -------------------------------- ### Subgraph Node Examples Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/subgraph.md Illustrative examples of how to use the Subgraph node, including referencing external YAML files and defining subgraphs inline. ```APIDOC ## Subgraph Node Examples ### Referencing External File ```yaml nodes: - id: Review Process type: subgraph config: type: file config: path: common/review_flow.yaml ``` ### Inline Subgraph Definition ```yaml nodes: - id: Translation Unit type: subgraph config: type: config config: id: translation_subgraph description: Multi-language translation subprocess nodes: - id: Translator type: agent config: provider: openai name: gpt-4o role: You are a professional translator who translates content to the target language. - id: Proofreader type: agent config: provider: openai name: gpt-4o role: You are a proofreading expert who checks and polishes translated content. edges: - from: Translator to: Proofreader start: [Translator] end: [Proofreader] ``` ### Combining Multiple Subgraphs ```yaml nodes: - id: Input Handler type: agent config: provider: openai name: gpt-4o - id: Analysis Module type: subgraph config: type: file config: path: modules/analysis.yaml - id: Report Module type: subgraph config: type: file config: path: modules/report_gen.yaml edges: - from: Input Handler to: Analysis Module - from: Analysis Module to: Report Module ``` ``` -------------------------------- ### Passthrough Node Basic Usage Example Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/passthrough.md A minimal example demonstrating the basic usage of a Passthrough node within a workflow. ```yaml nodes: - id: Router type: passthrough config: {} ``` -------------------------------- ### Literal Node Examples Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/literal.md Illustrative examples of how to use the Literal node in various scenarios. ```APIDOC ## Literal Node Examples ### Basic Usage Outputs a welcome message with the assistant role. ```yaml nodes: - id: Welcome Message type: literal config: content: | Welcome to the intelligent assistant! Please describe your needs. role: assistant ``` ### Injecting Fixed Context Injects predefined rules or context as a user message. ```yaml nodes: - id: Context Injector type: literal config: content: | Please note the following rules: 1. Answers must be concise and clear 2. Reply in English 3. If uncertain, please state so role: user - id: Assistant type: agent config: provider: openai name: gpt-4o edges: - from: Context Injector to: Assistant ``` ### Fixed Responses in Conditional Branches Provides fixed responses for different conditions determined by a classifier. ```yaml nodes: - id: Classifier type: agent config: provider: openai name: gpt-4o role: Determine user intent, reply with KNOWN or UNKNOWN - id: Known Response type: literal config: content: I can help you complete this task. role: assistant - id: Unknown Response type: literal config: content: Sorry, I cannot understand your request. Please describe it in a different way. role: assistant edges: - from: Classifier to: Known Response condition: type: keyword config: any: [KNOWN] - from: Classifier to: Unknown Response condition: type: keyword config: any: [UNKNOWN] ``` ### Testing Purposes Provides a multi-line test input for downstream processing nodes. ```yaml nodes: - id: Test Input type: literal config: content: | This is a test text for verifying downstream processing logic. Contains multiple lines. role: user - id: Processor type: python config: timeout_seconds: 30 edges: - from: Test Input to: Processor start: [Test Input] ``` ``` -------------------------------- ### Define a Read Text File Tool Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/function.md Example implementation of a function tool using type hints and ParamMeta for documentation. ```python from typing import Annotated from utils.function_catalog import ParamMeta def read_text_file( path: Annotated[str, ParamMeta(description="workspace-relative path")], *, encoding: str = "utf-8", _context: dict | None = None, ) -> str: ctx = FileToolContext(_context) target = ctx.resolve_under_workspace(path) return target.read_text(encoding=encoding) ``` -------------------------------- ### FastMCP Sample Server Implementation Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/mcp.md A Python example using the FastMCP library to create a simple MCP server with a `rand_num` tool. This script can be run locally or remotely. ```python from fastmcp import FastMCP import random mcp = FastMCP("Company Simple MCP Server", debug=True) @mcp.tool def rand_num(a: int, b: int) -> int: return random.randint(a, b) if __name__ == "__main__": mcp.run() ``` -------------------------------- ### Loop Counter Node Usage Example Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/loop_counter.md An example demonstrating how to configure and use the Loop Counter node in a workflow. ```APIDOC ## Loop Counter Node Example ### Description This example shows a basic implementation of the Loop Counter node to limit a workflow to 5 iterations. ### Request Example ```yaml nodes: - id: Iteration Guard type: loop_counter config: max_iterations: 5 reset_on_emit: true message: Maximum iteration count reached, process terminated. ``` ``` -------------------------------- ### Configure a Loop Timer Node Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/loop_timer.md Example configuration for a Loop Timer node set to a 5-minute duration. ```yaml nodes: - id: Time Guard type: loop_timer config: max_duration: 5 duration_unit: minutes reset_on_emit: true message: Time limit reached (5 minutes), process terminated. ``` -------------------------------- ### Configure Agent Tooling Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/README.md Example YAML configuration for an agent node using function-based tooling with auto-loading enabled. ```yaml nodes: - id: solve type: agent config: provider: openai model: gpt-4o-mini prompt_template: solver tooling: type: function config: tools: - name: describe_available_files - name: load_file auto_load: true timeout: 20 ``` -------------------------------- ### Configure Agent Tooling in YAML Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/function.md Example YAML configuration for enabling specific function tools within an agent node. ```yaml nodes: - id: summarize type: agent config: tooling: type: function config: tools: - name: describe_available_files - name: read_text_file ``` -------------------------------- ### Travel Planning Workflow with Map and Tree Combination Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/dynamic_execution.md An example of a complex workflow combining 'map' for parallel planning requests and 'tree' for aggregating results. This setup is suitable for scenarios where multiple independent planning tasks need to be executed and their outcomes consolidated into a single coherent plan. ```yaml graph: nodes: - id: Eat Planner type: literal config: content: Plan what to eat in Shanghai role: user - id: Play Planner type: literal config: content: Plan what to do in Shanghai role: user - id: Stay Planner type: literal config: content: Plan where to stay in Shanghai role: user - id: Collector type: passthrough config: only_last_message: false - id: Travel Executor type: agent config: name: gpt-4o role: You are a travel planner. Please plan according to user requests. - id: Final Aggregator type: agent config: name: gpt-4o role: Please integrate the inputs into a complete travel plan. edges: - from: Eat Planner to: Collector - from: Play Planner to: Collector - from: Stay Planner to: Collector - from: Collector to: Travel Executor dynamic: # Map fan-out: 3 planning requests → 3 parallel executions type: map split: type: message config: max_parallel: 10 - from: Travel Executor to: Final Aggregator dynamic: # Tree reduce: 3 results → 1 final plan type: tree split: type: message config: group_size: 2 max_parallel: 10 ``` -------------------------------- ### Local MCP Configuration Example Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/mcp.md Configure local MCP agents using this YAML, specifying the command, arguments, and working directory. The `wait_for_log` field is crucial for signaling readiness. ```yaml nodes: - id: local_mcp type: agent config: tooling: type: mcp_local config: command: uvx args: - blender-mcp cwd: ${REPO_ROOT} wait_for_log: "MCP ready" startup_timeout: 8 ``` -------------------------------- ### Install ChatDev Skills for OpenClaw Source: https://github.com/openbmb/chatdev/blob/main/README.md Installs the necessary ChatDev skills for integration with OpenClaw. This command should be run within your OpenClaw instance. ```bash clawdhub install chatdev ``` -------------------------------- ### Gemini Provider Configuration Example Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/workflow_authoring.md Configure the Gemini provider with model details, API key, and specific parameters like response modalities and safety settings. Environment variables can be used for sensitive information like API keys. ```yaml model: provider: gemini base_url: https://generativelanguage.googleapis.com api_key: ${GEMINI_API_KEY} name: gemini-2.0-flash-001 input_mode: messages params: response_modalities: ["text", "image"] safety_settings: - category: HARM_CATEGORY_SEXUAL threshold: BLOCK_LOWER ``` -------------------------------- ### Configure Loop Counter Node Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/loop_counter.md Example configuration for a loop_counter node with a limit of 5 iterations and automatic reset. ```yaml nodes: - id: Iteration Guard type: loop_counter config: max_iterations: 5 reset_on_emit: true message: Maximum iteration count reached, process terminated. ``` -------------------------------- ### Configure Thinking Module in YAML Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/thinking.md Example of how to configure the 'reflection' thinking mode within a node's configuration in YAML. Ensure the API key is securely provided. ```yaml nodes: - id: Thoughtful Agent type: agent config: provider: openai name: gpt-4o api_key: ${API_KEY} thinking: type: reflection config: reflection_prompt: | Please carefully review your response, considering: 1. Is the logic sound? 2. Are there any factual errors? 3. Is the expression clear? Then provide an improved response. ``` -------------------------------- ### Python Environment Management with uv Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/function_catalog.md Tools for managing Python environments and dependencies using `uv`. This includes installing packages, initializing environments, and running modules or scripts. ```python install_python_packages init_python_env uv_run ``` -------------------------------- ### Human Node Prompt Source: https://github.com/openbmb/chatdev/blob/main/frontend/public/tutorial-zh.md This prompt provides instructions for the 'Human Node', guiding the user on how to provide feedback or accept the current output. ```text 请对文章给出修改建议,或输入 ACCEPT 跳出循环。 ``` -------------------------------- ### Typical Workflow with Python Node for Result Parsing Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/python.md Illustrates a workflow where an LLM generates Python code, which is then parsed by a Python node. This setup is common for code generation tasks. ```yaml nodes: - id: LLM Generator type: agent config: provider: openai name: gpt-4o api_key: ${API_KEY} role: You need to generate executable Python code based on user input. The code should be wrapped in ```python ```. - id: Result Parser type: python config: timeout_seconds: 30 edges: - from: LLM Generator to: Result Parser ``` -------------------------------- ### Remote MCP Configuration Example Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/mcp.md Use this YAML configuration for agents requiring remote MCP access via HTTP(S). Ensure the server endpoint and any necessary headers like Authorization are correctly set. ```yaml nodes: - id: remote_mcp type: agent config: tooling: type: mcp_remote config: server: https://mcp.mycompany.com/mcp headers: Authorization: Bearer ${MY_MCP_TOKEN} timeout: 15 ``` -------------------------------- ### Launch FastMCP Server Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/mcp.md Command to launch the FastMCP sample server using `uv` with HTTP transport. Adjust the port as needed. ```bash uv run fastmcp run mcp_example/mcp_server.py --transport streamable-http --port 8010 ``` -------------------------------- ### Basic Python Node Configuration Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/python.md Demonstrates basic configuration for a Python node, setting a custom timeout and environment variables. ```yaml nodes: - id: Data Processor type: python config: timeout_seconds: 120 env: key: value ``` -------------------------------- ### Memory Store Configuration Sample Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/memory.md Configure memory stores like 'simple' or 'file' with paths and embedding settings. Use environment variables for sensitive information like API keys. ```yaml memory: - name: convo_cache type: simple config: memory_path: WareHouse/shared/simple.json embedding: provider: openai model: text-embedding-3-small api_key: ${API_KEY} - name: project_docs type: file config: index_path: WareHouse/index/project_docs.json file_sources: - path: docs/ file_types: [".md", ".mdx"] recursive: true embedding: provider: openai model: text-embedding-3-small ``` -------------------------------- ### Agent Node Memory Attachment Example Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/memory.md Define memory attachments for an agent node, specifying which memories to use, retrieval stages, and read/write permissions. This example attaches 'convo_cache' for generation stages and 'project_docs' for reading. ```yaml nodes: - id: answer type: agent config: provider: openai model: gpt-4o-mini prompt_template: answer_user memories: - name: convo_cache retrieve_stage: ["gen"] top_k: 5 read: true write: true - name: project_docs read: true write: false ``` -------------------------------- ### Basic Literal Node Usage Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/literal.md Demonstrates the basic configuration of a Literal node to output a welcome message with the assistant role. ```yaml nodes: - id: Welcome Message type: literal config: content: | Welcome to the intelligent assistant! Please describe your needs. role: assistant ``` -------------------------------- ### Python File Reading Tool Example Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/zh/modules/tooling/function.md Example of a Python function `read_text_file` that reads text from a file. It uses `Annotated` for parameter descriptions and accepts an optional `_context` dictionary for tool execution context. The `FileToolContext` is used to resolve file paths relative to the workspace. ```python from typing import Annotated from utils.function_catalog import ParamMeta def read_text_file( path: Annotated[str, ParamMeta(description="workspace 相对路径")], *, encoding: str = "utf-8", _context: dict | None = None, ) -> str: ctx = FileToolContext(_context) target = ctx.resolve_under_workspace(path) return target.read_text(encoding=encoding) ``` -------------------------------- ### Launch Workflow Execution Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/ws_frontend_logic.md Initiates the workflow execution by sending a POST request to the backend. It requires prerequisites like a selected file, task prompt or attachments, and a ready WebSocket connection. ```javascript shouldGlow.value = false status.value = 'Launching...' // POST request to /api/workflow/execute with payload // ... status.value = 'Running...' isWorkflowRunning.value = true ``` -------------------------------- ### Agent Node Configuration with Function Tool Calling Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/agent.md Set up an agent node to use function calling tools. Specify the tool type as 'function' and list the available tools. An optional execution timeout can be configured. ```yaml nodes: - id: Assistant type: agent config: provider: openai name: gpt-4o api_key: ${API_KEY} tooling: type: function # Tool type: function, mcp_remote, mcp_local config: tools: # List of function tools from functions/function_calling/ directory - name: describe_available_files - name: load_file timeout: 20 # Optional: execution timeout (seconds) ``` -------------------------------- ### Passthrough Node for Conditional Routing Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/passthrough.md This example shows how a Passthrough node can be used in conjunction with conditional edges to route messages based on keywords. ```yaml nodes: - id: Classifier type: agent config: provider: openai name: gpt-4o role: | Classify input content, reply TECHNICAL or BUSINESS - id: Router type: passthrough config: {} - id: Tech Handler type: agent config: provider: openai name: gpt-4o - id: Biz Handler type: agent config: provider: openai name: gpt-4o edges: - from: Classifier to: Router - from: Router to: Tech Handler condition: type: keyword config: any: [TECHNICAL] - from: Router to: Biz Handler condition: type: keyword config: any: [BUSINESS] ``` -------------------------------- ### User Interaction Tool Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/function_catalog.md Sends instructions to the user and receives a response, suitable for scenarios requiring human input. ```python call_user ``` -------------------------------- ### Mem0 Memory Configuration Sample Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/memory.md Configure the 'mem0' memory store, which is cloud-managed and requires an API key and agent ID. No local embeddings or persistence are needed. ```yaml memory: - name: agent_memory type: mem0 config: api_key: ${MEM0_API_KEY} agent_id: my-agent ``` -------------------------------- ### Registering a Custom Memory Store Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/memory.md Demonstrates how to register a new memory store by subclassing MemoryBase and using the register_memory_store function. Ensure to update FIELD_SPECS and export the design template. ```python register_memory_store("my_store", config_cls=..., factory=..., summary="...") ``` -------------------------------- ### Utility Commands with Makefile Source: https://github.com/openbmb/chatdev/blob/main/README.md Provides access to various utility commands for managing the ChatDev application. ```bash make help ``` ```bash make sync ``` ```bash make validate-yamls ``` -------------------------------- ### Execute Workflow via CLI Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/workflow_authoring.md Run a workflow instance using the command line interface. ```bash python run.py --path yaml_instance/demo.yaml --name test_run ``` -------------------------------- ### Basic Agent Node Configuration Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/agent.md Configure a basic agent node with OpenAI provider, API endpoint, and a system role prompt. Ensure environment variables for BASE_URL and API_KEY are set. ```yaml nodes: - id: Writer type: agent config: provider: openai base_url: ${BASE_URL} api_key: ${API_KEY} name: gpt-4o role: | You are a professional technical documentation writer. Please answer questions in clear and concise language. params: temperature: 0.7 max_tokens: 2000 ``` -------------------------------- ### Establish WebSocket Connection Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/ws_frontend_logic.md Establishes a new WebSocket connection. It first resets the connection state, then creates a new WebSocket instance, and sets up event handlers for connection open, message, error, and close events. ```javascript const socket = new WebSocket('ws://localhost:8000/ws') ws = socket socket.onopen = () => { console.log('WebSocket connected') } socket.onmessage = (event) => { const data = JSON.parse(event.data) if (data.type === 'connection') { sessionId = data.session_id isConnectionReady.value = true shouldGlow.value = true status.value = 'Waiting for launch...' } } socket.onerror = (error) => { console.error('WebSocket error:', error) } socket.onclose = () => { console.log('WebSocket disconnected') } ``` -------------------------------- ### 配置 Agent 节点的 Thinking 模块 Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/zh/modules/thinking.md 在 YAML 配置文件中通过 nodes[].config.thinking 声明思考模式及其配置。 ```yaml nodes: - id: Thoughtful Agent type: agent config: provider: openai name: gpt-4o api_key: ${API_KEY} thinking: type: reflection config: reflection_prompt: | 请仔细审视你的回答,考虑以下方面: 1. 逻辑是否严密 2. 有无事实错误 3. 表达是否清晰 然后给出改进后的回答。 ``` -------------------------------- ### Agent Node with MCP Local Tooling Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/zh/nodes/agent.md Configure an agent node to use MCP for local tool execution via standard input/output. Specify the command to launch the MCP server, its arguments, working directory, environment variables, and startup timeout. ```yaml nodes: - id: Local MCP Agent type: agent config: provider: openai name: gpt-4o api_key: ${API_KEY} tooling: type: mcp_local config: command: uvx # 启动命令 args: ["mcp-server-sqlite", "--db-path", "data.db"] cwd: ${WORKSPACE} # 可选,一般不需要配置 env: # 可选,一般不需要配置 DEBUG: "true" startup_timeout: 10 # 可选:启动超时(秒) ``` -------------------------------- ### Run ChatDev with Human-Agent-Interaction Mode Source: https://github.com/openbmb/chatdev/blob/main/README.md To activate Human-Agent-Interaction mode, use this command. You can play the role of a reviewer and make suggestions to the programmer. ```bash python3 run.py --task [description_of_your_idea] --config "Human" ``` -------------------------------- ### Basic Agent Node Configuration Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/zh/nodes/agent.md Configure a basic agent node with a specific LLM provider, API endpoint, and system prompt. Ensure API keys and base URLs are correctly set, potentially using environment variables. ```yaml nodes: - id: Writer type: agent config: provider: openai base_url: ${BASE_URL} api_key: ${API_KEY} name: gpt-4o role: | 你是一位专业的技术文档撰写者,请用清晰简洁的语言回答问题。 params: temperature: 0.7 max_tokens: 2000 ``` -------------------------------- ### Injecting Fixed Context with Literal Node Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/literal.md Shows how to use a Literal node to inject fixed context or instructions into a workflow, followed by an agent node. ```yaml nodes: - id: Context Injector type: literal config: content: | Please note the following rules: 1. Answers must be concise and clear 2. Reply in English 3. If uncertain, please state so role: user - id: Assistant type: agent config: provider: openai name: gpt-4o edges: - from: Context Injector to: Assistant ``` -------------------------------- ### Configure Regex Split Strategy Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/dynamic_execution.md Use regular expressions to partition text content into parallel execution units. ```yaml split: type: regex pattern: "(?s).{1,2000}(?:\\s|$)" # Split every ~2000 characters ``` -------------------------------- ### Implement a Human-Machine Collaboration Loop Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/human.md Sets up an iterative loop between an agent and a human reviewer using conditional edges. ```yaml nodes: - id: Article Writer type: agent config: provider: openai name: gpt-4o api_key: ${API_KEY} role: You are a professional writer who writes articles based on user requirements. - id: Human Reviewer type: human config: description: | Please review the article: - If satisfied with the result, enter ACCEPT to end the process - Otherwise, enter modification suggestions to continue iterating edges: - from: Article Writer to: Human Reviewer - from: Human Reviewer to: Article Writer condition: type: keyword config: none: [ACCEPT] case_sensitive: false ``` -------------------------------- ### Run ChatDev with Art Mode Source: https://github.com/openbmb/chatdev/blob/main/README.md To activate Art mode, use this command. This enables the designer agent to generate images used in the software. ```bash python3 run.py --task [description_of_your_idea] --config "Art" ``` -------------------------------- ### Configure a Basic Human Node Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/human.md Defines a simple human review step within a workflow configuration. ```yaml nodes: - id: Human Reviewer type: human config: description: Please review the above content. If satisfied, enter ACCEPT; otherwise, enter your modification suggestions. ``` -------------------------------- ### Export Design Templates Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/workflow_authoring.md Regenerate YAML templates and frontend mirror files after modifying configurations. ```bash python -m tools.export_design_template \ --output yaml_template/design.yaml \ --mirror frontend/public/design_0.4.0.yaml ``` -------------------------------- ### Import Tools via YAML Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/function_catalog.md Reference tools in YAML by specifying their type and configuration. You can import entire modules or individual functions. ```yaml tooling: - type: function config: tools: - name: file:All # Import entire module - name: save_file # Import single function - name: deep_research:All ``` -------------------------------- ### User Interaction API Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/modules/tooling/function_catalog.md Tool for sending instructions to the user. ```APIDOC ## User Interaction ### Description Send instructions to the user and get a response. ### Functions - **call_user**: Send instructions to the user ``` -------------------------------- ### Editor 2 Prompt Configuration Source: https://github.com/openbmb/chatdev/blob/main/frontend/public/tutorial-en.md Use this prompt to configure the Editor 2 agent for integrating and polishing articles based on revision suggestions. Ensure the output is only the revised article. ```text You are an editor skilled at integrating and polishing an article. Based on the article and the revision suggestions, refine and revise the article. Output only the revised article. ``` -------------------------------- ### CLI Command to Inspect Schema Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/config_schema_contract.md This command-line interface helper uses Python to inspect the configuration schema. It takes breadcrumbs as a JSON string argument to specify the desired schema node, mirroring the `/schema` API endpoint's functionality. ```bash python run.py --inspect-schema --schema-breadcrumbs '[{"node":"DesignConfig","field":"graph"}]' ``` -------------------------------- ### Configure Multi-Stage Human Review Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/en/nodes/human.md Chains multiple human review nodes to enforce sequential approval processes. ```yaml nodes: - id: Draft Generator type: agent config: provider: openai name: gpt-4o - id: Content Review type: human config: description: Please review content accuracy. Enter APPROVED or modification suggestions. - id: Final Reviewer type: human config: description: Final confirmation. Enter PUBLISH to publish or REJECT to reject. edges: - from: Draft Generator to: Content Review - from: Content Review to: Final Reviewer condition: type: keyword config: any: [APPROVED] ``` -------------------------------- ### 注入固定上下文 Source: https://github.com/openbmb/chatdev/blob/main/docs/user_guide/zh/nodes/literal.md 通过 Literal 节点向后续 Agent 节点注入固定的规则指令。 ```yaml nodes: - id: Context Injector type: literal config: content: | 请注意以下规则: 1. 回答必须简洁明了 2. 使用中文回复 3. 如有不确定,请说明 role: user - id: Assistant type: agent config: provider: openai name: gpt-4o edges: - from: Context Injector to: Assistant ```