Possibility to restrict paths to search for

The LLM also tries passing the relative_path param to the tool
This commit is contained in:
Michael Panchenko committed 2025-06-30 21:16:49 +02:00
1 parent 993df0c25c
commit 81e0a324a5
4 files changed
+63 -37

No files matched your search

+9 -3
View File
@@ -20,10 +20,16 @@ class InMemorySerenaConfig(SerenaConfigBase):
if __name__ == "__main__":
agent = SerenaAgent(project=REPO_ROOT)
agent = SerenaAgent(project=REPO_ROOT, serena_config=InMemorySerenaConfig())
# apply a tool
find_refs_tool = agent.get_tool(FindReferencingSymbolsTool)
print("Finding the symbol 'SyncLanguageServer'\n")
result = agent.execute_task(lambda: find_refs_tool.apply(name_path="SolidLanguageServer", relative_path="src/solidlsp/ls.py"))
find_file_tool = agent.get_tool(FindFileTool)
search_pattern_tool = agent.get_tool(SearchForPatternTool)
result = agent.execute_task(
lambda: search_pattern_tool.apply(
".*Pyright.*|.*Omnisharp.*", restrict_search_to_code_files=False, relative_path="src/solidlsp/ls.py"
)
)
pprint(json.loads(result))