mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 18:16:10 +00:00
Merge branch 'main' into feature/context-and-mode
# Conflicts: # scripts/gen_prompt_factory.py # src/serena/agent.py # src/serena/llm/multilang_prompt.py
This commit is contained in:
commit
f85aabb40e
79 files changed
+2658
-1582
No files matched your search
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
This script demonstrates how to use Serena's tools locally, useful
|
||||
for testing or development. Here the config is pointing to the serena repo itself,
|
||||
it assumes that you already have a serena_config.yml file setup.
|
||||
"""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from pprint import pprint
|
||||
|
||||
from serena.agent import *
|
||||
|
||||
project_root = Path(__file__).parent.parent
|
||||
|
||||
if __name__ == "__main__":
|
||||
agent = SerenaAgent(project_config=str(project_root / ".serena" / "project.yml"))
|
||||
overview_tool = agent.get_tool(GetSymbolsOverviewTool)
|
||||
find_symbol_tool = agent.get_tool(FindSymbolTool)
|
||||
|
||||
print("Getting an overview of the util package\n")
|
||||
pprint(json.loads(overview_tool.apply("src/serena/util")))
|
||||
|
||||
print("\n\n")
|
||||
|
||||
print("Finding the symbol 'SerenaAgent'\n")
|
||||
pprint(json.loads(find_symbol_tool.apply("SerenaAgent")))
|
||||
@@ -1,6 +1,4 @@
|
||||
from serena.mcp import create_mcp_server
|
||||
|
||||
mcp = create_mcp_server()
|
||||
from serena.mcp import start_mcp_server
|
||||
|
||||
if __name__ == "__main__":
|
||||
mcp.run()
|
||||
start_mcp_server()
|
||||
Reference in new issue
Block a user