Agents Arcade

fireworks-aifireworks-cookbookarchivedtutorialsmachine-learningjupyter-notebooksfunction-callingai-workflowsArcade.devintegrationsproduction-examplesgenerative-aiagentic-systemsrag

Using Fireworks AI with Arcade.dev to Send Emails

Open In Colab

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:

  1. Setting up the required packages and authentication
  2. Configuring the email tool with Arcade
  3. Creating a basic email-sending agent
  4. Executing and handling the email responses

Let's see how we can combine these powerful tools to automate email communication!

Prerequisites

[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:

  1. Initialize Fireworks AI client
  2. Get LLM to generate email parameters
  3. 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:

  1. OAuth Authentication - Securely connecting your Gmail account to Arcade
  2. Tool Integration - Using Fireworks AI to generate email parameters and Arcade to execute actions
  3. Reusable Agent - Building a flexible EmailAgent class
  4. 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!