-
Notifications
You must be signed in to change notification settings - Fork 475
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Contact Details
π¦ Package Version
0.4.21
ποΈ Framework Version
Agno 2.1.0, Python 3.12
π Describe the Bug
Got the following error, trying to initialize AgentOps as part of my Agno team setup.
Using FastAPI, and making use of stream=True and async runs for all my agents/team.
'async for' requires an object with aiter method, got coroutine
Expected vs actual behavior:
- Expected: Streaming works as normal
- Actual: Returns coroutine instead of async generator
Workaround:
- Removing agentops.init() fixes the issue
Additional context:
- Works fine without AgentOps
- Breaks immediately after adding agentops.init()
- Likely related to instrumentation/monkey-patching of async methods
import agentops
from agno.team import Team
from agno.models.openai import OpenAIChat
agentops.init(api_key="your-key")
team = Team(model=OpenAIChat(id="gpt-4"), ...)
This breaks after agentops.init()
async for event in team.arun(query, stream=True, stream_intermediate_steps=True):
yield event
π€ Contribution
- Yes, I'd be happy to submit a pull request with these changes.
- I need some guidance on how to contribute.
- I'd prefer the AgentOps team to handle this update.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working