-
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.
Merge branch 'main' into blog-to-podcast
- Loading branch information
Showing
184 changed files
with
5,793 additions
and
7,659 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
# Machine specific | ||
.idea | ||
.vscode | ||
*.code-workspace | ||
|
||
# Ignore .env files | ||
.env | ||
|
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
import asyncio | ||
|
||
from agno.agent import Agent | ||
from agno.models.openai import OpenAIChat | ||
|
||
agent = Agent( | ||
model=OpenAIChat(id="gpt-4o"), | ||
description="You help people with their health and fitness goals.", | ||
instructions=["Recipes should be under 5 ingredients"], | ||
markdown=True, | ||
) | ||
# -*- Print a response to the cli | ||
asyncio.run(agent.aprint_response("Share a breakfast recipe.", stream=True)) |
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
File renamed without changes.
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
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,13 @@ | ||
"""Run `pip install duckduckgo-search` to install dependencies.""" | ||
|
||
from agno.agent import Agent | ||
from agno.models.anthropic import Claude | ||
from agno.tools.duckduckgo import DuckDuckGoTools | ||
|
||
agent = Agent( | ||
model=Claude(id="claude-3-5-sonnet-20240620"), | ||
tools=[DuckDuckGoTools()], | ||
show_tool_calls=True, | ||
markdown=True, | ||
) | ||
agent.print_response("Whats happening in France?", stream=True) |
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,6 @@ | ||
*.jpg | ||
*.png | ||
*.mp3 | ||
*.wav | ||
*.mp4 | ||
*.mp3 |
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
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...book/models/google/gemini_openai/basic.py → cookbook/models/aws/bedrock/basic.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
4 changes: 2 additions & 2 deletions
4
...book/models/ollama_hermes/basic_stream.py → cookbook/models/aws/bedrock/basic_stream.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from pathlib import Path | ||
|
||
from agno.agent import Agent | ||
from agno.media import Image | ||
from agno.models.aws import AwsBedrock | ||
from agno.tools.duckduckgo import DuckDuckGoTools | ||
|
||
agent = Agent( | ||
model=AwsBedrock(id="amazon.nova-pro-v1:0"), | ||
tools=[DuckDuckGoTools()], | ||
markdown=True, | ||
) | ||
|
||
image_path = Path(__file__).parent.joinpath("sample.jpg") | ||
|
||
# Read the image file content as bytes | ||
with open(image_path, "rb") as img_file: | ||
image_bytes = img_file.read() | ||
|
||
agent.print_response( | ||
"Tell me about this image and give me the latest news about it.", | ||
images=[ | ||
Image(content=image_bytes, format="jpeg"), | ||
], | ||
) |
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,14 @@ | ||
"""Run `pip install duckduckgo-search` to install dependencies.""" | ||
|
||
from agno.agent import Agent | ||
from agno.models.aws import AwsBedrock | ||
from agno.tools.duckduckgo import DuckDuckGoTools | ||
|
||
agent = Agent( | ||
model=AwsBedrock(id="mistral.mistral-large-2402-v1:0"), | ||
tools=[DuckDuckGoTools()], | ||
instructions="You are a helpful assistant that can use the following tools to answer questions.", | ||
show_tool_calls=True, | ||
markdown=True, | ||
) | ||
agent.print_response("Whats happening in France?") |
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,14 @@ | ||
"""Run `pip install duckduckgo-search` to install dependencies.""" | ||
|
||
from agno.agent import Agent | ||
from agno.models.aws import AwsBedrock | ||
from agno.tools.duckduckgo import DuckDuckGoTools | ||
|
||
agent = Agent( | ||
model=AwsBedrock(id="amazon.nova-lite-v1:0"), | ||
tools=[DuckDuckGoTools()], | ||
instructions="You are a helpful assistant that can use the following tools to answer questions.", | ||
show_tool_calls=True, | ||
markdown=True, | ||
) | ||
agent.print_response("Whats happening in France?", stream=True) |
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,66 @@ | ||
# AWS Bedrock Anthropic Claude | ||
|
||
[Models overview](https://docs.anthropic.com/claude/docs/models-overview) | ||
|
||
> Note: Fork and clone this repository if needed | ||
### 1. Create and activate a virtual environment | ||
|
||
```shell | ||
python3 -m venv ~/.venvs/aienv | ||
source ~/.venvs/aienv/bin/activate | ||
``` | ||
|
||
### 2. Export your AWS Credentials | ||
|
||
```shell | ||
export AWS_ACCESS_KEY_ID=*** | ||
export AWS_SECRET_ACCESS_KEY=*** | ||
export AWS_REGION=*** | ||
``` | ||
|
||
### 3. Install libraries | ||
|
||
```shell | ||
pip install -U boto3 duckduckgo-search agno | ||
``` | ||
|
||
### 4. Run basic agent | ||
|
||
- Streaming on | ||
|
||
```shell | ||
python cookbook/models/aws/claude/basic_stream.py | ||
``` | ||
|
||
- Streaming off | ||
|
||
```shell | ||
python cookbook/models/aws/claude/basic.py | ||
``` | ||
|
||
### 5. Run Agent with Tools | ||
|
||
- DuckDuckGo Search | ||
|
||
```shell | ||
python cookbook/models/aws/claude/tool_use.py | ||
``` | ||
|
||
### 6. Run Agent that returns structured output | ||
|
||
```shell | ||
python cookbook/models/aws/claude/structured_output.py | ||
``` | ||
|
||
### 7. Run Agent that uses storage | ||
|
||
```shell | ||
python cookbook/models/aws/claude/storage.py | ||
``` | ||
|
||
### 8. Run Agent that uses knowledge | ||
|
||
```shell | ||
python cookbook/models/aws/claude/knowledge.py | ||
``` |
File renamed without changes.
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,15 @@ | ||
import asyncio | ||
|
||
from agno.agent import Agent, RunResponse # noqa | ||
from agno.models.aws import Claude | ||
|
||
agent = Agent( | ||
model=Claude(id="anthropic.claude-3-5-sonnet-20240620-v1:0"), markdown=True | ||
) | ||
|
||
# Get the response in a variable | ||
# run: RunResponse = agent.run("Share a 2 sentence horror story") | ||
# print(run.content) | ||
|
||
# Print the response in the terminal | ||
asyncio.run(agent.aprint_response("Share a 2 sentence horror story")) |
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,17 @@ | ||
import asyncio | ||
from typing import Iterator # noqa | ||
|
||
from agno.agent import Agent, RunResponse # noqa | ||
from agno.models.aws import Claude | ||
|
||
agent = Agent( | ||
model=Claude(id="anthropic.claude-3-5-sonnet-20240620-v1:0"), markdown=True | ||
) | ||
|
||
# Get the response in a variable | ||
# run_response: Iterator[RunResponse] = agent.run("Share a 2 sentence horror story", stream=True) | ||
# for chunk in run_response: | ||
# print(chunk.content) | ||
|
||
# Print the response in the terminal | ||
asyncio.run(agent.aprint_response("Share a 2 sentence horror story", stream=True)) |
Oops, something went wrong.