Skip to content

Commit

Permalink
fix: make separate coding agent file
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragts committed Nov 18, 2024
1 parent a791554 commit f9b292b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
29 changes: 29 additions & 0 deletions cookbook/playground/coding_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""Run `pip install ollama sqlalchemy 'fastapi[standard]'` to install dependencies."""

from phi.agent import Agent
from phi.model.ollama import Ollama
from phi.playground import Playground, serve_playground_app
from phi.storage.agent.sqlite import SqlAgentStorage


local_agent_storage_file: str = "tmp/local_agents.db"
common_instructions = [
"If the user about you or your skills, tell them your name and role.",
]

coding_agent = Agent(
name="Coding Agent",
agent_id="coding_agent",
model=Ollama(id="hhao/qwen2.5-coder-tools:32b"),
reasoning=True,
markdown=True,
add_history_to_messages=True,
description="You are a coding agent",
add_datetime_to_instructions=True,
storage=SqlAgentStorage(table_name="coding_agent", db_file=local_agent_storage_file),
)

app = Playground(agents=[coding_agent]).get_app()

if __name__ == "__main__":
serve_playground_app("coding_agent:app", reload=True)
14 changes: 1 addition & 13 deletions cookbook/playground/ollama_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@
markdown=True,
)

coding_agent = Agent(
name="Coding Agent",
agent_id="coding_agent",
model=Ollama(id="hhao/qwen2.5-coder-tools:32b"),
reasoning=True,
markdown=True,
add_history_to_messages=True,
description="You are a coding agent",
add_datetime_to_instructions=True,
storage=SqlAgentStorage(table_name="coding_agent", db_file=local_agent_storage_file),
)


youtube_agent = Agent(
name="YouTube Agent",
Expand All @@ -81,7 +69,7 @@
markdown=True,
)

app = Playground(agents=[web_agent, finance_agent, youtube_agent, coding_agent]).get_app()
app = Playground(agents=[web_agent, finance_agent, youtube_agent]).get_app()

if __name__ == "__main__":
serve_playground_app("ollama_agents:app", reload=True)

0 comments on commit f9b292b

Please sign in to comment.