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:
jimmyuconn1982
2025-09-27 17:48:39 -07:00
committed by GitHub
parent 5f4eb38fdb
commit 24f6905c18
5 changed files with 43 additions and 2 deletions

View File

@@ -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

View File

@@ -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,