-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
146 changed files
with
6,699 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import asyncio | ||
|
||
from agno.agent import Agent, RunResponse | ||
from agno.models.openai import OpenAIChat | ||
from agno.tools.duckduckgo import DuckDuckGoTools | ||
from rich.pretty import pprint | ||
|
||
providers = ["openai", "anthropic", "ollama", "cohere", "google"] | ||
instructions = [ | ||
"Your task is to write a well researched report on AI providers.", | ||
"The report should be unbiased and factual.", | ||
] | ||
|
||
|
||
async def get_agent(delay, provider): | ||
agent = Agent( | ||
model=OpenAIChat(id="gpt-4"), | ||
instructions=instructions, | ||
tools=[DuckDuckGoTools()], | ||
) | ||
await asyncio.sleep(delay) | ||
response: RunResponse = await agent.arun( | ||
f"Write a report on the following AI provider: {provider}" | ||
) | ||
return response | ||
|
||
|
||
async def get_reports(): | ||
tasks = [] | ||
for delay, provider in enumerate(providers): | ||
delay = delay * 2 | ||
tasks.append(get_agent(delay, provider)) | ||
|
||
results = await asyncio.gather(*tasks) | ||
return results | ||
|
||
|
||
async def main(): | ||
results = await get_reports() | ||
for result in results: | ||
print("************") | ||
pprint(result.content) | ||
print("************") | ||
print("\n") | ||
|
||
|
||
if __name__ == "__main__": | ||
asyncio.run(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
cookbook/agent_concepts/knowledge/vector_dbs/singlestore.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from agno.agent import Agent | ||
from agno.cli.console import console | ||
from agno.models.anthropic import Claude | ||
from agno.models.openai import OpenAIChat | ||
|
||
task = "9.11 and 9.9 -- which is bigger?" | ||
|
||
reasoning_agent_claude = Agent( | ||
model=Claude("claude-3-5-sonnet-20241022"), | ||
reasoning_model=OpenAIChat(id="o3-mini"), | ||
) | ||
|
||
reasoning_agent_openai = Agent( | ||
model=OpenAIChat(id="gpt-4o"), | ||
reasoning_model=OpenAIChat(id="o3-mini"), | ||
) | ||
|
||
console.rule("[bold green]Claude Reasoning Agent[/bold green]") | ||
reasoning_agent_claude.print_response(task, stream=True) | ||
|
||
console.rule("[bold yellow]OpenAI Reasoning Agent[/bold yellow]") | ||
reasoning_agent_openai.print_response(task, stream=True) |
Empty file.
Oops, something went wrong.