Skip to content

Commit 9d8c38d

Browse files
ohlavaTC-MOjirispilka
authored
Apply suggestions from code review
Co-authored-by: Michał Olender <[email protected]> Co-authored-by: Jiří Spilka <[email protected]>
1 parent 3870730 commit 9d8c38d

File tree

1 file changed

+17
-19
lines changed
  • sources/platform/integrations/ai

1 file changed

+17
-19
lines changed

sources/platform/integrations/ai/agno.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ This guide shows how to integrate Apify Actors with Agno to empower your AI agen
2626

2727
### Prerequisites
2828

29-
- *Apify API token*: Obtain your token from the [Apify console](https://console.apify.com/account/integrations).
30-
- *Python environment*: Ensure Python is installed (version 3.8+ recommended).
31-
- *Required packages*: Install the following dependencies in your terminal:
29+
- _Apify API token_: Obtain your token from the [Apify console](https://console.apify.com/account/integrations).
30+
- _Python environment_: Ensure Python is installed (version 3.8+ recommended).
31+
- _Required packages_: Install the following dependencies in your terminal:
3232

3333
```bash
3434
pip install agno apify-client
@@ -39,17 +39,17 @@ pip install agno apify-client
3939
Start by setting up an Agno agent with Apify tools. This example uses the RAG Web Browser Actor to extract content from a specific URL.
4040

4141
```python
42+
import os
43+
4244
from agno.agent import Agent
4345
from agno.tools.apify import ApifyTools
4446

47+
os.environ["APIFY_API_TOKEN"] = "YOUR_APIFY_API_TOKEN" # Replace with your Apify API token
48+
os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" # Replace with your OpenAI API key
49+
4550
# Initialize the agent with Apify tools
4651
agent = Agent(
47-
tools=[
48-
ApifyTools(
49-
actors=["apify/rag-web-browser"],
50-
apify_api_token="YOUR_APIFY_API_TOKEN" # Replace YOUR_APIFY_API_TOKEN with your token
51-
)
52-
],
52+
tools=[ApifyTools( actors=["apify/rag-web-browser"])],
5353
show_tool_calls=True,
5454
markdown=True
5555
)
@@ -60,20 +60,19 @@ agent.print_response("Extract key details from https://docs.agno.com/introductio
6060

6161
Running this code will scrape the specified URL and return formatted content your agent can use.
6262

63-
:::tip Environment variable token
64-
65-
You can also set the APIFY_API_TOKEN environment variable instead of passing it directly in the code.
66-
67-
:::
68-
69-
### Advanced Scenario: Travel Planning Agent
63+
### Advanced scenario: Travel planning agent
7064

7165
Combine multiple Apify Actors to create a powerful travel planning agent. This example uses the RAG Web Browser and Google Places Crawler to gather travel insights and local business data.
7266

7367
```python
68+
import os
69+
7470
from agno.agent import Agent
7571
from agno.tools.apify import ApifyTools
7672

73+
os.environ["APIFY_API_TOKEN"] = "YOUR_APIFY_API_TOKEN" # Replace with your Apify API token
74+
os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" # Replace with your OpenAI API key
75+
7776
# Create a travel planning agent
7877
agent = Agent(
7978
name="Travel Planner",
@@ -85,8 +84,7 @@ agent = Agent(
8584
actors=[
8685
"apify/rag-web-browser", # For general web research
8786
"compass/crawler-google-places" # For location-based data
88-
],
89-
apify_api_token="YOUR_APIFY_API_TOKEN"
87+
]
9088
)
9189
],
9290
show_tool_calls=True,
@@ -117,7 +115,7 @@ Browse the [Apify Store](https://apify.com/store) to find additional Actors for
117115

118116
:::
119117

120-
### Available Apify Tools
118+
### Available Apify tools
121119

122120
Agno supports any Apify Actor via the ApifyTools class. You can specify a single Actor ID or a list of Actor IDs to register multiple tools for your agent at once.
123121

0 commit comments

Comments
 (0)