feat(controller): Integrate py_get_definition for on-demand lookup
This commit is contained in:
@@ -46,6 +46,13 @@ def parse_symbols(text: str) -> list[str]:
|
||||
"""
|
||||
return re.findall(r"@([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)", text)
|
||||
|
||||
def get_symbol_definition(symbol: str, files: list[str]) -> tuple[str, str] | None:
|
||||
for file_path in files:
|
||||
result = mcp_client.py_get_definition(file_path, symbol)
|
||||
if 'not found' not in result.lower():
|
||||
return (file_path, result)
|
||||
return None
|
||||
|
||||
class GenerateRequest(BaseModel):
|
||||
prompt: str
|
||||
auto_add_history: bool = True
|
||||
|
||||
Reference in New Issue
Block a user