feat(gui): Implement @symbol regex parser for on-demand definition lookup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user