mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 06:17:58 +00:00
Make Agno agent work
This commit is contained in:
1 parent
131ca8a15e
commit
d32d74a477
4 files changed
+69
-16
No files matched your search
+16
-6
@@ -1,32 +1,42 @@
|
||||
import os
|
||||
from logging import Logger
|
||||
|
||||
from agno.agent import Agent
|
||||
from agno.models.anthropic import Claude
|
||||
from agno.models.google import Gemini
|
||||
from agno.playground import Playground, serve_playground_app
|
||||
from dotenv import load_dotenv
|
||||
from sensai.util import logging
|
||||
from sensai.util.helper import mark_used
|
||||
|
||||
from serena.agent import SerenaAgent
|
||||
from serena.agno import SerenaAgnoToolkit
|
||||
|
||||
os.chdir(os.path.dirname(os.path.abspath(__file__)))
|
||||
mark_used(Gemini, Claude)
|
||||
load_dotenv()
|
||||
|
||||
project_file_path = "../myproject.yml"
|
||||
serena_agent = SerenaAgent(project_file_path)
|
||||
serena_agent = SerenaAgent(project_file_path, start_language_server=True)
|
||||
|
||||
model = Claude(id="claude-3-7-sonnet-20250219")
|
||||
# model = Gemini(id="gemini-2.5-pro-exp-03-25")
|
||||
|
||||
agno_agent = Agent(
|
||||
name="Serena",
|
||||
model=model,
|
||||
description="A fully-featured coding assistant",
|
||||
tools=[SerenaAgnoToolkit(serena_agent)], # type: ignore
|
||||
show_tool_calls=True,
|
||||
show_tool_calls=False,
|
||||
markdown=True,
|
||||
system_message="", # Todo
|
||||
read_tool_call_history=True,
|
||||
read_tool_call_history=False,
|
||||
telemetry=False,
|
||||
)
|
||||
|
||||
|
||||
## The app object should be in the module scope so that the server can access it for hot reloading
|
||||
# The app object must be in the module scope so that the server can access it for hot reloading
|
||||
app = Playground(agents=[agno_agent]).get_app()
|
||||
|
||||
if __name__ == "__main__":
|
||||
serve_playground_app("agno_agent:app", reload=True)
|
||||
Logger.root.setLevel(logging.INFO)
|
||||
serve_playground_app("agno_agent:app", reload=False)
|
||||
Reference in new issue
Block a user