Skip to content

Commit 13c6a5b

Browse files
committed
docs: rewrite README from MCP SSE implementation to comprehensive PraisonAI Agents documentation
1 parent afa4df5 commit 13c6a5b

10 files changed

Lines changed: 2584 additions & 53 deletions

File tree

src/praisonai-agents/README.md

Lines changed: 527 additions & 48 deletions
Large diffs are not rendered by default.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""
2+
Gemini Deep Research Agent Example
3+
4+
Uses Google's deep-research-pro model via the Interactions API
5+
for automated research with web search.
6+
7+
Supports two modes:
8+
1. Polling (default): Checks status periodically, shows progress logs
9+
2. Streaming: Real-time output with thinking summaries (recommended)
10+
11+
Requirements:
12+
- GEMINI_API_KEY or GOOGLE_API_KEY environment variable
13+
- google-genai >= 1.55.0 (pip install google-genai)
14+
"""
15+
from dotenv import load_dotenv
16+
load_dotenv()
17+
18+
from praisonaiagents import DeepResearchAgent
19+
20+
agent = DeepResearchAgent(
21+
name="Gemini Researcher",
22+
instructions="""
23+
You are a professional researcher. Focus on:
24+
- Comprehensive analysis with multiple perspectives
25+
- Data-backed insights and trends
26+
- Clear structure with executive summary
27+
""",
28+
model="deep-research-pro", # Auto-detected as Gemini
29+
verbose=True,
30+
)
31+
32+
print(f"Agent: {agent}")
33+
print(f"Provider: {agent.provider}")
34+
35+
# Streaming is enabled by default for real-time progress updates
36+
# This shows thinking summaries and streams the report as it's generated
37+
result = agent.research(
38+
"What is the current price of Ethereum?"
39+
# stream=True is the default, set stream=False to disable
40+
)
41+
42+
# The report is already printed during streaming when verbose=True
43+
# But we can also access it programmatically:
44+
print("\n" + "=" * 60)
45+
print(f"Report length: {len(result.report)} characters")
46+
print(f"Interaction ID: {result.interaction_id}")
47+
print(f"Reasoning steps captured: {len(result.reasoning_steps)}")
48+
print("=" * 60)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"""
2+
OpenAI Deep Research Agent Example
3+
4+
Uses OpenAI's o3-deep-research or o4-mini-deep-research models
5+
via the Responses API for automated research with web search.
6+
7+
Supports two modes:
8+
1. Non-streaming (default): Waits for completion, returns full report
9+
2. Streaming: Real-time progress with reasoning summaries and web searches
10+
11+
Requirements:
12+
- OPENAI_API_KEY environment variable
13+
"""
14+
from dotenv import load_dotenv
15+
load_dotenv()
16+
17+
from praisonaiagents import DeepResearchAgent
18+
19+
agent = DeepResearchAgent(
20+
name="Research Assistant",
21+
instructions="""
22+
You are a professional researcher. Focus on:
23+
- Data-rich insights with specific figures
24+
- Reliable sources and citations
25+
- Clear, structured responses
26+
""",
27+
model="o4-mini-deep-research", # or "o3-deep-research" for higher quality
28+
verbose=True
29+
)
30+
31+
print(f"Agent: {agent}")
32+
print(f"Provider: {agent.provider}")
33+
34+
# Streaming is enabled by default for real-time progress updates
35+
# Shows: reasoning summaries, web search queries, and report text as generated
36+
result = agent.research(
37+
"What is the current price of Bitcoin?"
38+
# stream=True is the default, set stream=False to disable
39+
)
40+
41+
# The report is already printed during streaming when verbose=True
42+
# But we can also access it programmatically:
43+
print("\n" + "=" * 60)
44+
print(f"Report length: {len(result.report)} characters")
45+
print(f"Citations: {len(result.citations)}")
46+
print(f"Web searches: {len(result.web_searches)}")
47+
print("=" * 60)

src/praisonai-agents/praisonaiagents/__init__.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
from .agent.agent import Agent
1616
from .agent.image_agent import ImageAgent
1717
from .agent.context_agent import ContextAgent, create_context_agent
18+
from .agent.deep_research_agent import (
19+
DeepResearchAgent,
20+
DeepResearchResponse,
21+
Citation,
22+
ReasoningStep,
23+
WebSearchCall,
24+
CodeExecutionStep,
25+
MCPCall,
26+
FileSearchCall,
27+
Provider
28+
)
1829
from .agents.agents import PraisonAIAgents
1930
from .task.task import Task
2031
from .tools.tools import Tools
@@ -186,7 +197,16 @@ def cleanup_telemetry_resources():
186197
'disable_performance_mode',
187198
'cleanup_telemetry_resources',
188199
'MinimalTelemetry',
189-
'TelemetryCollector'
200+
'TelemetryCollector',
201+
'DeepResearchAgent',
202+
'DeepResearchResponse',
203+
'Citation',
204+
'ReasoningStep',
205+
'WebSearchCall',
206+
'CodeExecutionStep',
207+
'MCPCall',
208+
'FileSearchCall',
209+
'Provider'
190210
]
191211

192212
# Add MCP to __all__ if available

src/praisonai-agents/praisonaiagents/agent/__init__.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,36 @@
44
from .context_agent import ContextAgent, create_context_agent
55
from .handoff import Handoff, handoff, handoff_filters, RECOMMENDED_PROMPT_PREFIX, prompt_with_handoff_instructions
66
from .router_agent import RouterAgent
7+
from .deep_research_agent import (
8+
DeepResearchAgent,
9+
DeepResearchResponse,
10+
Citation,
11+
ReasoningStep,
12+
WebSearchCall,
13+
CodeExecutionStep,
14+
MCPCall,
15+
FileSearchCall,
16+
Provider
17+
)
718

8-
__all__ = ['Agent', 'ImageAgent', 'ContextAgent', 'create_context_agent', 'Handoff', 'handoff', 'handoff_filters', 'RECOMMENDED_PROMPT_PREFIX', 'prompt_with_handoff_instructions', 'RouterAgent']
19+
__all__ = [
20+
'Agent',
21+
'ImageAgent',
22+
'ContextAgent',
23+
'create_context_agent',
24+
'Handoff',
25+
'handoff',
26+
'handoff_filters',
27+
'RECOMMENDED_PROMPT_PREFIX',
28+
'prompt_with_handoff_instructions',
29+
'RouterAgent',
30+
'DeepResearchAgent',
31+
'DeepResearchResponse',
32+
'Citation',
33+
'ReasoningStep',
34+
'WebSearchCall',
35+
'CodeExecutionStep',
36+
'MCPCall',
37+
'FileSearchCall',
38+
'Provider'
39+
]

0 commit comments

Comments
 (0)