AgentOps-AI / AgentOps-AI/agentops

[Bug]: No trances in agno streaming

Đang mở
#1,188 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
5.8k
Fork
619
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.