Files
serena/scripts/demo_run_tools.py
T
Michael Panchenko 3ee5f8e900 Minor prompting, renaming and memory file handling
- Moved symbol-reading related prompt to system prompt (from planning) since it's always need
- Use relative_path as kwarg in all tools (models get confused by different kwarg names)
- Identify and list memories without .md extension appearing
2025-06-03 12:23:35 +02:00

30 lines
905 B
Python

"""
This script demonstrates how to use Serena's tools locally, useful
for testing or development. Here the tools will be operation the serena repo itself.
"""
from pprint import pprint
from serena.agent import *
from serena.constants import REPO_ROOT
@dataclass
class InMemorySerenaConfig(SerenaConfigBase):
"""
In-memory implementation of Serena configuration with the GUI disabled.
"""
gui_log_window_enabled: bool = False
web_dashboard: bool = False
if __name__ == "__main__":
# project_path = str(Path("test") / "resources" / "repos" / "python" / "test_repo")
agent = SerenaAgent(project=REPO_ROOT)
# apply a tool
find_refs_tool = agent.get_tool(FindReferencingSymbolsTool)
print("Finding the symbol 'SyncLanguageServer'\n")
pprint(json.loads(find_refs_tool.apply(name_path="SyncLanguageServer", relative_path="src/multilspy/language_server.py")))