Skip to content

Commit 68a2160

Browse files
Fix Agno examples for v2 API compatibility
- Update Team initialization to remove deprecated 'mode' parameter - Replace RunResponse with RunOutput in agno_workflow_setup.py - Update requirements.txt to use 'ddgs' instead of 'duckduckgo-search' - Remove deprecated Team parameters (success_criteria, enable_agentic_context, add_context, show_tool_calls) Fixes #1266 Co-Authored-By: Alex <meta.alex.r@gmail.com>
1 parent 89b980f commit 68a2160

4 files changed

Lines changed: 11 additions & 17 deletions

File tree

examples/agno/agno_basic_agents.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ def demonstrate_basic_agents():
6868
)
6969

7070
# Create a team with coordination mode
71-
# The "coordinate" mode allows agents to work together and share information
71+
# The team allows agents to work together and share information
7272
team = Team(
73-
name="News and Weather Team",
74-
mode="coordinate", # Agents will coordinate their responses
7573
members=[news_agent, weather_agent],
74+
name="News and Weather Team",
7675
)
7776

7877
# Run a task that requires team coordination

examples/agno/agno_research_team.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,21 @@ def demonstrate_research_team():
167167

168168
# Create collaborative team with advanced features
169169
agent_team = Team(
170-
name="Discussion Team",
171-
mode="collaborate",
172-
model=OpenAIChat("gpt-4o"),
173170
members=[
174171
reddit_researcher,
175172
hackernews_researcher,
176173
academic_paper_researcher,
177174
twitter_researcher,
178175
],
176+
name="Discussion Team",
177+
model=OpenAIChat("gpt-4o"),
179178
instructions=[
180179
"You are a discussion master coordinating a research team.",
181180
"Facilitate productive discussion between all researchers.",
182181
"Ensure each researcher contributes their unique perspective.",
183182
"Guide the team towards a comprehensive understanding of the topic.",
184183
"You have to stop the discussion when you think the team has reached a consensus.",
185184
],
186-
success_criteria="The team has reached a consensus with insights from all perspectives.",
187-
enable_agentic_context=True,
188-
add_context=True,
189-
show_tool_calls=True,
190185
markdown=True,
191186
debug_mode=True,
192187
show_members_responses=True,

examples/agno/agno_workflow_setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
"""
1717

18-
from agno.agent import Agent, RunResponse
18+
from agno.agent import Agent, RunOutput
1919
import agentops
2020
from dotenv import load_dotenv
2121
from agno.workflow import Workflow
@@ -52,7 +52,7 @@ class CacheWorkflow(Workflow):
5252
# This agent will be used to generate responses when cache misses occur
5353
agent = Agent(model=OpenAIChat(id="gpt-4o-mini"), description="General purpose agent for generating responses")
5454

55-
def run(self, message: str) -> Iterator[RunResponse]:
55+
def run(self, message: str) -> Iterator[RunOutput]:
5656
"""
5757
Execute the workflow with caching logic.
5858
@@ -66,14 +66,14 @@ def run(self, message: str) -> Iterator[RunResponse]:
6666
message: The input query to process
6767
6868
Yields:
69-
RunResponse: Streamed response chunks
69+
RunOutput: Streamed response chunks
7070
"""
7171
logger.info(f"Checking cache for '{message}'")
7272

7373
if self.session_state.get(message):
7474
logger.info(f"Cache hit for '{message}'")
7575
# Return cached response immediately (no API call needed)
76-
yield RunResponse(run_id=self.run_id, content=self.session_state.get(message))
76+
yield RunOutput(run_id=self.run_id, content=self.session_state.get(message))
7777
return
7878

7979
logger.info(f"Cache miss for '{message}'")
@@ -99,11 +99,11 @@ def demonstrate_workflows():
9999
try:
100100
workflow = CacheWorkflow()
101101

102-
response: Iterator[RunResponse] = workflow.run(message="Tell me a joke.")
102+
response: Iterator[RunOutput] = workflow.run(message="Tell me a joke.")
103103

104104
pprint_run_response(response, markdown=True, show_time=True)
105105

106-
response: Iterator[RunResponse] = workflow.run(message="Tell me a joke.")
106+
response: Iterator[RunOutput] = workflow.run(message="Tell me a joke.")
107107

108108
pprint_run_response(response, markdown=True, show_time=True)
109109

examples/agno/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ googlesearch-python
55
pycountry
66
arxiv
77
pypdf
8-
duckduckgo-search
8+
ddgs

0 commit comments

Comments
 (0)