mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-26 15:24:48 +08:00
feat: lite deep researcher implementation
This commit is contained in:
53
src/prompts/planner_model.py
Normal file
53
src/prompts/planner_model.py
Normal file
@@ -0,0 +1,53 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List, Optional
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class StepType(str, Enum):
|
||||
RESEARCH = "research"
|
||||
PROCESSING = "processing"
|
||||
|
||||
|
||||
class Step(BaseModel):
|
||||
need_web_search: bool = Field(
|
||||
..., description="Must be explicitly set for each step"
|
||||
)
|
||||
title: str
|
||||
description: str = Field(..., description="Specify exactly what data to collect")
|
||||
step_type: StepType = Field(..., description="Indicates the nature of the step")
|
||||
execution_res: Optional[str] = Field(
|
||||
default=None, description="The Step execution result"
|
||||
)
|
||||
|
||||
|
||||
class Plan(BaseModel):
|
||||
has_enough_context: bool
|
||||
thought: str
|
||||
title: str
|
||||
steps: List[Step] = Field(
|
||||
...,
|
||||
description="Research & Processing steps to get more context",
|
||||
)
|
||||
|
||||
class Config:
|
||||
json_schema_extra = {
|
||||
"examples": [
|
||||
{
|
||||
"has_enough_context": False,
|
||||
"thought": (
|
||||
"To understand the current market trends in AI, we need to gather comprehensive information."
|
||||
),
|
||||
"title": "AI Market Research Plan",
|
||||
"steps": [
|
||||
{
|
||||
"need_web_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",
|
||||
}
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user