|
from agno.agent import Agent |
|
from agno.models.openai import OpenAIChat |
|
from agno.team import Team |
|
from agno.tools.duckduckgo import DuckDuckGoTools |
|
from agno.models.ollama import Ollama |
|
from agno.models.groq import Groq |
|
import os |
|
chat=Groq(id='llama-3.3-70b-versatile') if os.getenv("GROQ_API_KEY") else Ollama(id="qwen2.5") |
|
|
|
researcher = Agent( |
|
name="Researcher", |
|
role="Expert at finding information by breaking the structure into components ie) architecture, code, algorithm, linux system", |
|
tools=[DuckDuckGoTools(fixed_max_results=3)], |
|
show_tool_calls=True, |
|
tool_call_limit=1, |
|
model=chat, |
|
|
|
) |
|
|
|
engineer = Agent( |
|
name="Security Engineer", |
|
role="Security Expert at writing short, clear, engaging content for hands-on best practices, and common pitfalls with solution", |
|
model=chat, |
|
) |
|
|
|
|
|
content_team = Team( |
|
name="Content Team", |
|
mode="coordinate", |
|
members=[researcher, engineer], |
|
instructions="You are a team of researchers and writers that work together to create high-quality content.", |
|
model=chat, |
|
markdown=True, |
|
) |
|
def bestPractice(topic): |
|
r = content_team.run(topic) |
|
return [m for m in r.messages if m.role == 'assistant'][-1].content |
|
|
|
if __name__=='__main__': |
|
from pprint import pprint |
|
from agno.utils.pprint import pprint_run_response |
|
r=content_team.run("Docker Containers") |
|
pprint_run_response(r, markdown=True) |
|
print([m for m in r.messages if m.role == 'assistant'][-1].content) |
|
|
|
|
|
print("") |
|
pprint(r.messages) |
|
|
|
|
|
|