from agno.agent import Agent
from agno.team import Team
from agno.models.openai import OpenAIChat
TRUEFOUNDRY_API_KEY = os.getenv("TRUEFOUNDRY_API_KEY") # export TRUEFOuNDRY_API_KEY='your-truefoundry-api-key'
TRUEFOUNDRY_BASE_URL = os.getenv("TRUEFOUNDRY_BASE_URL")
# Research Agent
researcher = Agent(
model=OpenAIChat(
id="openai-main/gpt-4o",
api_key="your-truefoundry-api-key",
base_url="your-truefoundry-gateway-url"
),
name="Researcher",
description="Conducts thorough research on topics",
instructions=[
"Research the given topic thoroughly",
"Provide factual and well-sourced information"
]
)
# Writer Agent
writer = Agent(
model=OpenAIChat(
id="openai-main/gpt-4o",
api_key="your-truefoundry-api-key",
base_url="your-truefoundry-gateway-url"
),
name="Writer",
description="Creates well-structured content",
instructions=[
"Write clear and engaging content",
"Structure information logically"
]
)
# Create team
research_team = Team(
agents=[researcher, writer],
instructions=[
"Researcher should investigate the topic first",
"Writer should create content based on research findings"
]
)
# Execute team task
result = research_team.run("Research and write about sustainable energy solutions")