Predefined Tools
Using Predefined Tools¶
In this example, we demonstrate how to use predefined tools in a workflow. These tools offer out-of-the-box functionality, such as searching YouTube, Wikipedia, or Google, without needing to write custom Python code.
Waldiez supports multiple tool types:
- Global Tools: Python functions accessible to all agents in the flow.
- Custom Tools: Manually defined Python tools scoped to specific agents.
- Predefined Tools: Built-in integrations (e.g., YouTube, Wikipedia) that only require basic configuration (e.g., API keys).
Example: YouTube Search¶
This example uses the YouTube Search tool to retrieve relevant videos based on a user query.
1. Add the YouTube Search Tool¶
Go to the Tools tab and click Add Tool.
- Name:
youtube_search
- Description:
Search YouTube videos for relevant content
- Type: Select YouTube Search from the dropdown
Then, follow the instructions to provide your YouTube API Key:
How to get a YouTube API Key:
- Go to the Google Cloud Console
- Create a new project or use an existing one.
- Navigate to APIs & Services > Library
- Enable the YouTube Data API v3
- Go to APIs & Services > Credentials
- Click Create Credentials > API key, and paste it in the tool config.
2. Create the Agent Flow¶
- Drag a User Proxy agent onto the canvas
- Drag an Assistant agent onto the canvas
- Connect them together
- Assign the
youtube_search
tool to the Assistant agent and a model of your choice (e.g.,gpt-4.1
)
3. Set the Message¶
- Click on the connection line and configure a text message:
- Message Type:
Text
- Message:
Let's find a video with instructions about creating workflows with Waldiez
- Message Type:
4. Run and Observe¶
- Press ▶️ to run the flow.
- The Assistant agent will automatically invoke the YouTube tool and return relevant results.
Supported Predefined Tools¶
Predefined tools currently available in Waldiez:
Tool Name | Description | Requires API Key |
---|---|---|
YouTube Search | Search YouTube videos via Data API v3 | ✅ Yes |
Wikipedia Search | Search content from Wikipedia | ❌ No |
Tavily Search | AI-powered web search using Tavily | ✅ Yes |
Google Search | Search Google results | ✅ Yes |
💡 After selecting a predefined tool, the modal will display detailed instructions on how to obtain and configure the required API key(s), if applicable.
Files and References¶
- Flow: youtube_search.waldiez
- Generated notebook: youtube_search.ipynb