mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-19 04:14:46 +08:00
fix: support local models by making thought field optional in Plan model (#601)
- Make thought field optional in Plan model to fix Pydantic validation errors with local models - Add Ollama configuration example to conf.yaml.example - Update documentation to include local model support - Improve planner prompt with better JSON format requirements Fixes local model integration issues where models like qwen3:14b would fail due to missing thought field in JSON output. Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
@@ -153,7 +153,11 @@ When planning information gathering, consider these key aspects and ensure COMPR
|
||||
|
||||
# Output Format
|
||||
|
||||
Directly output the raw JSON format of `Plan` without "```json". The `Plan` interface is defined as follows:
|
||||
**CRITICAL: You MUST output a valid JSON object that exactly matches the Plan interface below. Do not include any text before or after the JSON. Do not use markdown code blocks. Output ONLY the raw JSON.**
|
||||
|
||||
**IMPORTANT: The JSON must contain ALL required fields: locale, has_enough_context, thought, title, and steps. Do not return an empty object {}.**
|
||||
|
||||
The `Plan` interface is defined as follows:
|
||||
|
||||
```ts
|
||||
interface Step {
|
||||
@@ -172,6 +176,24 @@ interface Plan {
|
||||
}
|
||||
```
|
||||
|
||||
**Example Output:**
|
||||
```json
|
||||
{
|
||||
"locale": "en-US",
|
||||
"has_enough_context": false,
|
||||
"thought": "To understand the current market trends in AI, we need to gather comprehensive information about recent developments, key players, and market dynamics.",
|
||||
"title": "AI Market Research Plan",
|
||||
"steps": [
|
||||
{
|
||||
"need_search": true,
|
||||
"title": "Current AI Market Analysis",
|
||||
"description": "Collect data on market size, growth rates, major players, and investment trends in AI sector.",
|
||||
"step_type": "research"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
# Notes
|
||||
|
||||
- Focus on information gathering in research steps - delegate all calculations to processing steps
|
||||
|
||||
@@ -27,7 +27,7 @@ class Plan(BaseModel):
|
||||
..., description="e.g. 'en-US' or 'zh-CN', based on the user's language"
|
||||
)
|
||||
has_enough_context: bool
|
||||
thought: str
|
||||
thought: str = Field(default="", description="Thinking process for the plan")
|
||||
title: str
|
||||
steps: List[Step] = Field(
|
||||
default_factory=list,
|
||||
|
||||
Reference in New Issue
Block a user