This commit is contained in:
Fahad
2025-06-18 06:24:24 +04:00
parent c3276595f9
commit b56993a42f
8 changed files with 183 additions and 207 deletions

View File

@@ -14,29 +14,29 @@ from systemprompts import THINKDEEP_PROMPT
from .base import BaseTool, ToolRequest
# Field descriptions to avoid duplication between Pydantic and JSON schema
THINKDEEP_FIELD_DESCRIPTIONS = {
"prompt": (
"Your current thinking/analysis to extend and validate. IMPORTANT: Before using this tool, Claude MUST "
"first think hard and establish a deep understanding of the topic and question by thinking through all "
"relevant details, context, constraints, and implications. Share these extended thoughts and ideas in "
"the prompt so the model has comprehensive information to work with for the best analysis."
),
"problem_context": "Additional context about the problem or goal. Be as expressive as possible.",
"focus_areas": "Specific aspects to focus on (architecture, performance, security, etc.)",
"files": "Optional file paths or directories for additional context (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
"images": "Optional images for visual analysis - diagrams, charts, system architectures, or any visual information to analyze",
}
class ThinkDeepRequest(ToolRequest):
"""Request model for thinkdeep tool"""
prompt: str = Field(
...,
description="Your current thinking/analysis to extend and validate. IMPORTANT: Before using this tool, Claude MUST first think hard and establish a deep understanding of the topic and question by thinking through all relevant details, context, constraints, and implications. Share these extended thoughts and ideas in the prompt so the model has comprehensive information to work with for the best analysis.",
)
problem_context: Optional[str] = Field(
None, description="Additional context about the problem or goal. Be as expressive as possible."
)
focus_areas: Optional[list[str]] = Field(
None,
description="Specific aspects to focus on (architecture, performance, security, etc.)",
)
files: Optional[list[str]] = Field(
None,
description="Optional file paths or directories for additional context (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
)
images: Optional[list[str]] = Field(
None,
description="Optional images for visual analysis - diagrams, charts, system architectures, or any visual information to analyze",
)
prompt: str = Field(..., description=THINKDEEP_FIELD_DESCRIPTIONS["prompt"])
problem_context: Optional[str] = Field(None, description=THINKDEEP_FIELD_DESCRIPTIONS["problem_context"])
focus_areas: Optional[list[str]] = Field(None, description=THINKDEEP_FIELD_DESCRIPTIONS["focus_areas"])
files: Optional[list[str]] = Field(None, description=THINKDEEP_FIELD_DESCRIPTIONS["files"])
images: Optional[list[str]] = Field(None, description=THINKDEEP_FIELD_DESCRIPTIONS["images"])
class ThinkDeepTool(BaseTool):
@@ -64,33 +64,27 @@ class ThinkDeepTool(BaseTool):
"properties": {
"prompt": {
"type": "string",
"description": (
"Your current thinking/analysis to extend and validate. IMPORTANT: Before using this tool, "
"Claude MUST first think deeply and establish a deep understanding of the topic and question "
"by thinking through all relevant details, context, constraints, and implications. Share "
"these extended thoughts and ideas in the prompt so the model has comprehensive information "
"to work with for the best analysis."
),
"description": THINKDEEP_FIELD_DESCRIPTIONS["prompt"],
},
"model": self.get_model_field_schema(),
"problem_context": {
"type": "string",
"description": "Additional context about the problem or goal. Be as expressive as possible.",
"description": THINKDEEP_FIELD_DESCRIPTIONS["problem_context"],
},
"focus_areas": {
"type": "array",
"items": {"type": "string"},
"description": "Specific aspects to focus on (architecture, performance, security, etc.)",
"description": THINKDEEP_FIELD_DESCRIPTIONS["focus_areas"],
},
"files": {
"type": "array",
"items": {"type": "string"},
"description": "Optional file paths or directories for additional context (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
"description": THINKDEEP_FIELD_DESCRIPTIONS["files"],
},
"images": {
"type": "array",
"items": {"type": "string"},
"description": "Optional images for visual analysis - diagrams, charts, system architectures, or any visual information to analyze",
"description": THINKDEEP_FIELD_DESCRIPTIONS["images"],
},
"temperature": {
"type": "number",