Agents Arcade
fireworks-aifireworks-cookbookarchivedtutorialsmachine-learningjupyter-notebooksfunction-callingai-workflowsArcade.devintegrationsproduction-examplesgenerative-aiagentic-systemsrag
Export
Using Fireworks AI with Arcade.dev to Send Emails
This notebook demonstrates how to integrate Fireworks AI's language models with Arcade's tools to create an AI agent that can send emails. We'll show:
- Setting up the required packages and authentication
- Configuring the email tool with Arcade
- Creating a basic email-sending agent
- Executing and handling the email responses
Let's see how we can combine these powerful tools to automate email communication!
Prerequisites
- Fireworks AI API key - see here https://fireworks.ai/
- Arcade API key - see here https://arcade.dev/
- Gmail account to connect via OAuth
[1]
Gmail Configuration
We need to connect our Gmail account to Arcade. This will open a browser window for OAuth authentication.
[2]
[3]
[ ]
Basic Email Tool Call
Here we create a simple integration between Fireworks AI's LLM and Arcade's Gmail tool:
- Initialize Fireworks AI client
- Get LLM to generate email parameters
- Use Arcade to send the email
[5]
Email sent successfully!
Response: ExecuteToolResponse(id='te_2y0UP2X1vHeaDGzSgXGf55hK5CJ', duration=429.60190773010254, execution_id='tc_2y0UP2pk3KJ6rtbD8SbbKg7QaCr', execution_type='immediate', finished_at='2025-06-03T17:15:56Z', output=Output(authorization=None, error=None, logs=None, value={'body': '', 'cc': '', 'date': '', 'from': '', 'header_message_id': '', 'history_id': '', 'id': '19736cae73432411', 'in_reply_to': '', 'label_ids': ['SENT'], 'references': '', 'reply_to': '', 'snippet': '', 'subject': '', 'thread_id': '19736cae73432411', 'to': '', 'url': 'https://mail.google.com/mail/u/0/#sent/19736cae73432411'}), run_at=None, status='success', success=True)
Creating a Reusable Email Agent
Let's wrap this functionality into a class for easier reuse:
[6]
Example Usage
[ ]
[ ]
Advanced: Email Search and Analysis
Let's extend our agent to search through emails:
[ ]
Summary
You've successfully created an email agent using Arcade and Fireworks AI! This notebook demonstrated:
- OAuth Authentication - Securely connecting your Gmail account to Arcade
- Tool Integration - Using Fireworks AI to generate email parameters and Arcade to execute actions
- Reusable Agent - Building a flexible EmailAgent class
- Multiple Actions - Sending emails, listing emails, and searching by headers
Next Steps
- Explore more Arcade tools like Calendar, Slack, and Drive
- Build complex workflows combining multiple tools
- Add error handling and retry logic for production use
Check out the Arcade documentation for more tools and capabilities!