AgentOps-AI / AgentOps-AI/agentops

[Bug]: No trances in agno streaming

Abierto
#1,188 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
5.8k
Forks
619
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Contact Details

anandeshsharma@gmail.com

### 📦 Package Version

0.4.19

### 🎞️ Framework Version

agno 1.77

### 🔎 Describe the Bug
```python
import os
from textwrap import dedent

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.newspaper4k import Newspaper4kTools

research_agent = Agent(
model=OpenAIChat(id="o3-mini", api_key=os.getenv("OPENAI_API_KEY")),
tools=[DuckDuckGoTools(), Newspaper4kTools()],
description=dedent("""\
You are an elite investigative journalist with decades of experience at the New York Times.
Your expertise encompasses: 📰

- Deep investigative research and analysis
- Meticulous fact-checking and source verification
- Compelling narrative construction
- Data-driven reporting and visualization
- Expert interview synthesis
- Trend analysis and future predictions
- Complex topic simplification
- Ethical journalism practices
- Balanced perspective presentation
- Global context integration\
"""),
instructions=dedent("""\
1. Research Phase 🔍
- Search for 10+ authoritative sources on the topic
- Prioritize recent publications and expert opinions
- Identify key stakeholders and perspectives

2. Analysis Phase 📊
- Extract and verify critical information
- Cross-reference facts across multiple sources
- Identify emerging patterns and trends
- Evaluate conflicting viewpoints

3. Writing Phase ✍️
- Craft an attention-grabbing headline
- Structure content in NYT style
- Include relevant quotes and statistics
- Maintain objectivity and balance
- Explain complex concepts clearly

4. Quality Control ✓
- Verify all facts and attributions
- Ensure narrative flow and readability
- Add context where necessary
- Include future implications
"""),
expected_output=dedent("""\
# {Compelling Headline} 📰

## Executive Summary
{Concise overview of key findings and significance}

## Background & Context
{Historical context and importance}
{Current landscape overview}

## Key Findings
{Main discoveries and analysis}
{Expert insights and quotes}
{Statistical evidence}

## Impact Analysis
{Current implications}
{Stakeholder perspectives}
{Industry/societal effects}

## Future Outlook
{Emerging trends}
{Expert predictions}
{Potential challenges and opportunities}

## Expert Insights
{Notable quotes and analysis from industry leaders}
{Contrasting viewpoints}

## Sources & Methodology
{List of primary sources with key contributions}
{Research methodology overview}

---
Research conducted by AI Investigative Journalist
New York Times Style Report
Published: {current_date}
Last Updated: {current_time}\
"""),
markdown=True,
show_tool_calls=True,
stream=True,
add_datetime_to_instructions=True,
)
```

```python

agentops.init(trace_name=f"{self.name}_{self.version}")
async def generate_model_response():
if research_agent is None:
# Fallback for build validation
yield f"data: {json.dumps({'message': 'Build validation mode - agent not fully loaded'})}\n\n"
return

agent_response = await research_agent.arun(agent_input.message)
async for chunk in agent_response:
yield f"data: {json.dumps(chunk.content)}\n\n"

return StreamingResponse(
generate_model_response(),
media_type="text/event-stream",
)
```

while streaming I didn't get any traces, is there any solution to it?

### 🤝 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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.