feat(gui): Implement @symbol regex parser for on-demand definition lookup

This commit is contained in:
2026-03-07 14:57:52 -05:00
parent 84396dc13a
commit a0a9d00310
4 changed files with 38 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import threading
import time
import sys
import os
import re
from typing import Any, List, Dict, Optional, Callable
from pathlib import Path
import json
@@ -38,6 +39,13 @@ def hide_tk_root() -> Tk:
root.wm_attributes("-topmost", True)
return root
def parse_symbols(text: str) -> list[str]:
"""
Finds all occurrences of '@SymbolName' in text and returns SymbolName.
SymbolName can be a function, class, or method (e.g. @MyClass, @my_func, @MyClass.my_method).
"""
return re.findall(r"@([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)", text)
class GenerateRequest(BaseModel):
prompt: str
auto_add_history: bool = True