mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-15 06:16:18 +00:00
Possibility to restrict paths to search for
The LLM also tries passing the relative_path param to the tool
This commit is contained in:
1 parent
993df0c25c
commit
81e0a324a5
4 files changed
+63
-37
No files matched your search
@@ -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))
|
||||
Reference in new issue
Block a user