Vastly improved debug tool and related instructions

Accompanying simulation test
Cleanup - A single source of truth for parameter descriptions
This commit is contained in:
Fahad
2025-06-17 16:23:26 +04:00
parent 9bf2a2a51c
commit 044a8621a3
12 changed files with 829 additions and 238 deletions

View File

@@ -14,17 +14,22 @@ from systemprompts import ANALYZE_PROMPT
from .base import BaseTool, ToolRequest
# Field descriptions to avoid duplication between Pydantic and JSON schema
ANALYZE_FIELD_DESCRIPTIONS = {
"files": "Files or directories to analyze (must be absolute paths)",
"prompt": "What to analyze or look for",
"analysis_type": "Type of analysis to perform",
"output_format": "How to format the output",
}
class AnalyzeRequest(ToolRequest):
"""Request model for analyze tool"""
files: list[str] = Field(..., description="Files or directories to analyze (must be absolute paths)")
prompt: str = Field(..., description="What to analyze or look for")
analysis_type: Optional[str] = Field(
None,
description="Type of analysis: architecture|performance|security|quality|general",
)
output_format: Optional[str] = Field("detailed", description="Output format: summary|detailed|actionable")
files: list[str] = Field(..., description=ANALYZE_FIELD_DESCRIPTIONS["files"])
prompt: str = Field(..., description=ANALYZE_FIELD_DESCRIPTIONS["prompt"])
analysis_type: Optional[str] = Field(None, description=ANALYZE_FIELD_DESCRIPTIONS["analysis_type"])
output_format: Optional[str] = Field("detailed", description=ANALYZE_FIELD_DESCRIPTIONS["output_format"])
class AnalyzeTool(BaseTool):
@@ -50,12 +55,12 @@ class AnalyzeTool(BaseTool):
"files": {
"type": "array",
"items": {"type": "string"},
"description": "Files or directories to analyze (must be absolute paths)",
"description": ANALYZE_FIELD_DESCRIPTIONS["files"],
},
"model": self.get_model_field_schema(),
"prompt": {
"type": "string",
"description": "What to analyze or look for",
"description": ANALYZE_FIELD_DESCRIPTIONS["prompt"],
},
"analysis_type": {
"type": "string",
@@ -66,13 +71,13 @@ class AnalyzeTool(BaseTool):
"quality",
"general",
],
"description": "Type of analysis to perform",
"description": ANALYZE_FIELD_DESCRIPTIONS["analysis_type"],
},
"output_format": {
"type": "string",
"enum": ["summary", "detailed", "actionable"],
"default": "detailed",
"description": "How to format the output",
"description": ANALYZE_FIELD_DESCRIPTIONS["output_format"],
},
"temperature": {
"type": "number",