======================== LIBRARY RULES ======================== - Show the documentation for the programming language and framework you are using - Prefer to use the framework integrations over calling the tools directly - Prefer to let the agent choose the best tool to use ======================== CODE SNIPPETS ======================== TITLE: Instantiate and Use Arcade Client DESCRIPTION: Demonstrates how to instantiate the Arcade client and make a tool call. This example shows calling a tool to get the square root of a number and star a repository. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/quickstart.mdx#_snippet_1 LANGUAGE: python CODE: ``` from arcade import Arcade client = Arcade("YOUR_API_KEY") async def main(): # Call a tool to get the square root of 625 result = await client.tools.math.sqrt(625) print(f"The square root of 625 is {result}") # Call a tool to star a repository await client.tools.github.star_repo("ArcadeAI/arcade-ai") print("Successfully starred the repository ArcadeAI/arcade-ai") client.run(main()) ``` LANGUAGE: javascript CODE: ``` import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade("YOUR_API_KEY"); async function main() { // Call a tool to get the square root of 625 const result = await client.tools.math.sqrt(625); console.log(`The square root of 625 is ${result}`); // Call a tool to star a repository await client.tools.github.star_repo("ArcadeAI/arcade-ai"); console.log("Successfully starred the repository ArcadeAI/arcade-ai"); } main(); ``` ---------------------------------------- TITLE: Local Development Setup DESCRIPTION: Instructions for setting up the local development environment for Arcade. This involves installing dependencies using pnpm and starting the development server. SOURCE: https://github.com/arcadeai/docs/blob/main/README.md#_snippet_0 LANGUAGE: shell CODE: ``` pnpm install ``` LANGUAGE: shell CODE: ``` pnpm dev ``` ---------------------------------------- TITLE: Python Installation and Usage Example DESCRIPTION: Demonstrates how to install the Google Finance toolkit and provides a conceptual example of its usage within an agent. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_360 LANGUAGE: bash CODE: ``` # Install the toolkit pip install arcade_google-finance ``` LANGUAGE: python CODE: ``` # Example usage within an agent (conceptual) from arcade.agents import Agent from arcade.tools import Toolkit # Assuming 'agent' is an initialized Arcade Agent instance # and 'google_finance_toolkit' is loaded # Example 1: Get stock summary # result_summary = agent.run("Get stock summary for GOOG on NASDAQ") # Example 2: Get historical data # result_history = agent.run("Get historical data for AAPL on NASDAQ for the last year") # Note: Actual agent.run() calls would be more structured, # potentially involving tool selection and parameter passing. # The toolkit provides tools like: # GoogleFinance.GetStockSummary(ticker_symbol='GOOG', exchange_identifier='NASDAQ') # GoogleFinance.GetStockHistoricalData(ticker_symbol='AAPL', exchange_identifier='NASDAQ', window='ONE_YEAR') ``` ---------------------------------------- TITLE: Install Arcade Client DESCRIPTION: Installs the Arcade client library for Python or JavaScript. Use 'pip' for Python and 'npm' for JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/quickstart.mdx#_snippet_0 LANGUAGE: python CODE: ``` pip install arcadepy ``` LANGUAGE: javascript CODE: ``` npm install @arcadeai/arcadejs ``` ---------------------------------------- TITLE: Install Arcade CLI with All Features DESCRIPTION: Installs the `arcade-ai` package including all features, such as the TDK and Serve components. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/migrate-to-v2.mdx#_snippet_2 LANGUAGE: python CODE: ``` pip install 'arcade-ai[all]' ``` ---------------------------------------- TITLE: Install Arcade CLI with Evaluation Framework DESCRIPTION: Installs the `arcade-ai` package along with the evaluation framework, enabling its use. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/migrate-to-v2.mdx#_snippet_1 LANGUAGE: python CODE: ``` pip install 'arcade-ai[evals]' ``` ---------------------------------------- TITLE: Run Arcade Client Example DESCRIPTION: Executes the Python or JavaScript script to demonstrate Arcade client functionality. The output confirms successful tool calls. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/quickstart.mdx#_snippet_2 LANGUAGE: bash CODE: ``` python3 example.py > The square root of 625 is 25 > Successfully starred the repository ArcadeAI/arcade-ai ``` LANGUAGE: bash CODE: ``` node example.mjs > The square root of 625 is 25 > Successfully starred the repository ArcadeAI/arcade-ai ``` ---------------------------------------- TITLE: Install Arcade Serve DESCRIPTION: Installs the `arcade-serve` package for writing custom Arcade workers. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/migrate-to-v2.mdx#_snippet_4 LANGUAGE: python CODE: ``` pip install arcade-serve ``` ---------------------------------------- TITLE: Install Arcade CLI DESCRIPTION: Installs the `arcade-ai` package, which serves as Arcade.dev's CLI for creating toolkits, serving and deploying toolkits, chatting, and more. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/migrate-to-v2.mdx#_snippet_0 LANGUAGE: python CODE: ``` pip install arcade-ai ``` ---------------------------------------- TITLE: Install Arcade Client with pip DESCRIPTION: Installs the Arcade Client using Python's package installer (pip). This command is typically found in the quickstart guide. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_115 LANGUAGE: python CODE: ``` pip install arcade-client ``` ---------------------------------------- TITLE: Install Arcade Go Client DESCRIPTION: Installs the Arcade Go client using the go get command. This package provides Go bindings for Arcade's tools, allowing integration into Go-based applications and services. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/arcade-clients.mdx#_snippet_2 LANGUAGE: bash CODE: ``` go get -u 'github.com/ArcadeAI/arcade-go' ``` ---------------------------------------- TITLE: Setup Development Environment DESCRIPTION: Establishes a virtual environment and installs project dependencies, including pre-commit hooks, for local development. This ensures the toolkit and its dependencies are correctly configured. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/build-tools/create-a-toolkit.mdx#_snippet_1 LANGUAGE: bash CODE: ``` uv venv --seed -p 3.13 make install source .venv/bin/activate ``` ---------------------------------------- TITLE: Install Arcade TDK DESCRIPTION: Installs the `arcade-tdk` package for writing custom Arcade tools and toolkits. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/migrate-to-v2.mdx#_snippet_3 LANGUAGE: python CODE: ``` pip install arcade-tdk ``` ---------------------------------------- TITLE: Start Arcade Worker and Engine DESCRIPTION: Commands to start the Arcade worker and the Arcade Engine locally. The worker must be running for the engine to function, and they are typically started in separate terminal instances. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/local.mdx#_snippet_5 LANGUAGE: bash CODE: ``` # Start the worker arcade serve # Start the engine arcade-engine ``` ---------------------------------------- TITLE: Install Toolkit Dependencies with Make DESCRIPTION: Executes the `install` command from the Makefile to install all project dependencies, pre-commit hooks, and the toolkit itself in development mode. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_311 LANGUAGE: shell CODE: ``` make install ``` ---------------------------------------- TITLE: Arcade Notion Toolkit Installation DESCRIPTION: Instructions for installing the Arcade Notion toolkit for self-hosted installations. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_637 LANGUAGE: bash CODE: ``` pip install arcade_notion_toolkit ``` ---------------------------------------- TITLE: Installation and Usage DESCRIPTION: Instructions for installing the Google Contacts toolkit and guidance on self-hosting or using hosted tools. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_614 LANGUAGE: bash CODE: ``` pip install arcade_google_contacts ``` ---------------------------------------- TITLE: Get Jira Boards Example DESCRIPTION: Example of how to call the Jira GetBoards tool directly in Python and JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/jira.mdx#_snippet_48 LANGUAGE: Python CODE: ``` from langchain_community.tools.jira.tool import JiraToolkit from langchain_community.utilities.jira import Jira jira = Jira() toolkit = JiraToolkit.from_jira(jira) # Call the Tool Directly print(toolkit.get_boards.run(limit=10, offset=0)) ``` LANGUAGE: JavaScript CODE: ``` import { JiraToolkit } from "langchain_community/kits/jira"; import { Jira } from "langchain_community/utilities/jira"; const jira = new Jira(); const toolkit = JiraToolkit.fromJira(jira); // Call the Tool Directly console.log(await toolkit.getBoards.invoke({ limit: 10, offset: 0 })); ``` ---------------------------------------- TITLE: Install Arcade Spotify Toolkit DESCRIPTION: Instructions for installing the Arcade Spotify toolkit using pip. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_17 LANGUAGE: Python CODE: ``` pip install arcade_spotify ``` ---------------------------------------- TITLE: Arcade CLI Commands for Local Development DESCRIPTION: Commands for interacting with the Arcade CLI to manage and serve toolkits locally. 'arcade show --local' verifies local installation, 'arcade serve' starts the toolkit server, and 'arcade serve --reload' enables hot-reloading. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_317 LANGUAGE: APIDOC CODE: ``` arcade show --local Description: Verifies if the toolkit is properly registered locally. Expected Output: Lists the toolkit in the output. arcade serve Description: Serves the toolkit locally, making its tools available. Default Port: 8002 arcade serve --reload Description: Serves the toolkit locally with automatic reloading on file changes. ``` ---------------------------------------- TITLE: Complete Example: Agent Workflow DESCRIPTION: A comprehensive example demonstrating the full workflow: initializing the Arcade client, retrieving tools, setting up an agent, and running it with error handling for authentication. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_358 LANGUAGE: Python CODE: ``` from agents import Agent, Runner from arcadepy import AsyncArcade from agents_arcade import get_arcade_tools from agents_arcade.errors import AuthorizationError import asyncio async def main(): client = AsyncArcade() tools = await get_arcade_tools(client, toolkits=["gmail"]) google_agent = Agent( name="Google agent", instructions="You are a helpful assistant that can assist with Google API calls.", model="gpt-4o-mini", tools=tools, ) try: result = await Runner.run( starting_agent=google_agent, input="What are my latest emails?", context={"user_id": "{arcade_user_id}"}, ) print("Final output:\n\n", result.final_output) except AuthorizationError as e: print("Please Login to Google:", e) if __name__ == "__main__": asyncio.run(main()) ``` ---------------------------------------- TITLE: Arcade Slack Toolkit Installation DESCRIPTION: Instructions for installing the Arcade Slack toolkit for self-hosting. This command installs the necessary package using pip. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_253 LANGUAGE: bash CODE: ``` pip install arcade_slack ``` ---------------------------------------- TITLE: Install Arcade CLI DESCRIPTION: Installs the Arcade command-line interface using either the uv or pip package manager. This is a prerequisite for using the CLI to manage API keys. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/api-keys.mdx#_snippet_0 LANGUAGE: bash CODE: ``` uv pip install arcade-ai ``` LANGUAGE: bash CODE: ``` pip install arcade-ai ``` ---------------------------------------- TITLE: List Toolkits for Docker Worker DESCRIPTION: Example content for the `toolkits.txt` file, specifying Python packages to be installed in the custom Docker worker image. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_336 LANGUAGE: text CODE: ``` arcade-google arcade-firecrawl arcade-zoom ``` ---------------------------------------- TITLE: Install Arcade Google Search Toolkit DESCRIPTION: Installs the Arcade Google Search toolkit using pip, typically for self-hosting Arcade tools. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_19 LANGUAGE: bash CODE: ``` pip install arcade_google_search ``` ---------------------------------------- TITLE: Install Arcade CLI using uv DESCRIPTION: Provides instructions for installing the Arcade CLI within a Python virtual environment. It details the steps to create a virtual environment using `uv`, activate it, and then install the `arcade-ai` package. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_70 LANGUAGE: Python CODE: ``` # install uv: https://docs.astral.sh/uv/getting-started/installation/ uv venv --seed source .venv/bin/activate # install the Arcade CLI uv pip install arcade-ai ``` ---------------------------------------- TITLE: Install Arcade Client DESCRIPTION: Installs the Arcade CLI from the 'arcade-ai' package using pip and logs into your Arcade account. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_462 LANGUAGE: shell CODE: ``` pip install arcade-ai arcade login ``` ---------------------------------------- TITLE: Install Arcade YouTube Toolkit DESCRIPTION: Instructions for installing the Arcade YouTube toolkit using pip. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_159 LANGUAGE: python CODE: ``` pip install arcade_youtube ``` ---------------------------------------- TITLE: Install Go Client DESCRIPTION: Instructions for installing the Arcade Go client library using the Go package manager. This command fetches the latest version of the library. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_284 LANGUAGE: go CODE: ``` go get -u 'github.com/ArcadeAI/arcade-go' ``` ---------------------------------------- TITLE: Shell: Install Arcade AI Package DESCRIPTION: Installs the Arcade AI Python package using uv pip. This command is necessary to get the Arcade AI client libraries and tools for your project. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_490 LANGUAGE: shell CODE: ``` uv pip install arcade-ai ``` ---------------------------------------- TITLE: Start Arcade Serve CLI Command DESCRIPTION: The `arcade serve` command starts a tool server worker with locally installed tools. It allows configuration of the host, port, authentication, and enables features like auto-reloading, OpenTelemetry logging, and debug mode. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_79 LANGUAGE: cli CODE: ``` arcade serve [OPTIONS] Start tool server worker with locally installed tools Options: --host TEXT Host for the app, from settings by default. [default: 127.0.0.1] -p, --port INTEGER Port for the app, defaults to [default: 8002] --no-auth Disable authentication for the worker. Not recommended for production. --reload Enable auto-reloading when toolkit or server files change. --otel-enable Send logs to OpenTelemetry --mcp Run as a local MCP server over stdio -d, --debug Show debug information --help Show this message and exit. ``` ---------------------------------------- TITLE: Install Arcade Google Jobs Toolkit DESCRIPTION: Instructions for installing the Arcade Google Jobs toolkit using pip. This command downloads and installs the necessary package for using Google Jobs search functionalities within the Arcade framework. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_56 LANGUAGE: bash CODE: ``` pip install arcade_google_jobs ``` ---------------------------------------- TITLE: Install Arcade Packages for OpenAI Agents DESCRIPTION: Provides the command to install the necessary Python packages for integrating Arcade tools with OpenAI Agents. This setup ensures your environment is ready to use Arcade's capabilities within your agent applications. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_353 LANGUAGE: bash CODE: ``` pip install agents-arcade arcadepy ``` ---------------------------------------- TITLE: Install Arcade CLI & SDK with pip DESCRIPTION: Installs the Arcade Command Line Interface (CLI) and Software Development Kit (SDK) using pip. Refer to the CLI guide for detailed instructions. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_116 LANGUAGE: python CODE: ``` pip install arcade-cli ``` ---------------------------------------- TITLE: Install Arcade Engine (Ubuntu/Debian) DESCRIPTION: Installs the Arcade Engine binary on Ubuntu/Debian systems using APT. This involves adding the Arcade AI repository key and source list, updating the package index, and then installing the 'arcade-engine' package. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/local.mdx#_snippet_2 LANGUAGE: bash CODE: ``` wget -qO - https://deb.arcade.dev/public-key.asc | sudo apt-key add - echo "deb https://deb.arcade.dev/ubuntu stable main" | sudo tee /etc/apt/sources.list.d/arcade-ai.list sudo apt update sudo apt install arcade-engine ``` ---------------------------------------- TITLE: Verify Toolkit Installation DESCRIPTION: Lists all locally installed Arcade tools and their metadata, such as name, description, toolkit package, and version. This command helps verify that toolkits have been successfully installed. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/toolkits.mdx#_snippet_2 LANGUAGE: bash CODE: ``` arcade show --local ``` ---------------------------------------- TITLE: Install Arcade Zoom Toolkit DESCRIPTION: Instructions for installing the Arcade Zoom toolkit using pip. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_36 LANGUAGE: python CODE: ``` pip install arcade_zoom ``` ---------------------------------------- TITLE: Arcade GitHub Toolkit Installation DESCRIPTION: Instructions for self-hosting Arcade tools, specifically the GitHub toolkit. This involves installing the necessary Python package. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_578 LANGUAGE: bash CODE: ``` pip install arcade_github ``` ---------------------------------------- TITLE: Install Arcade Client with pip DESCRIPTION: Installs the Arcade Client using pip, the Python package installer. This is the primary method for integrating Arcade's client libraries into your Python projects. Ensure you have Python and pip installed. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/overview.mdx#_snippet_0 LANGUAGE: bash CODE: ``` pip install arcade-client ``` ---------------------------------------- TITLE: Install Arcade SDK and Slack SDK DESCRIPTION: Command to install the necessary Python packages for using Arcade AI and interacting with Slack, as required for building tools with user authorization. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_304 LANGUAGE: bash CODE: ``` uv pip install arcade-ai slack_sdk ``` ---------------------------------------- TITLE: Install a Toolkit DESCRIPTION: Installs a specific Arcade toolkit, such as 'arcade-math', using pip for local development. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_464 LANGUAGE: python CODE: ``` pip install arcade-math ``` ---------------------------------------- TITLE: Install Toolkit via PyPI DESCRIPTION: Installs an Arcade toolkit from the Python Package Index (PyPI) into the active Python virtual environment. This command uses pip to fetch and install the specified toolkit. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/toolkits.mdx#_snippet_1 LANGUAGE: bash CODE: ``` pip install arcade-[toolkit_name] # Example for math toolkit: pip install arcade-math ``` ---------------------------------------- TITLE: Install Evaluation Dependencies DESCRIPTION: Installs the necessary Arcade AI evaluation dependencies using either uv or pip. This command ensures your environment is set up to run evaluations. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/evaluate-tools/create-an-evaluation-suite.mdx#_snippet_0 LANGUAGE: bash CODE: ``` uv pip install 'arcade-ai[evals]' ``` LANGUAGE: bash CODE: ``` pip install 'arcade-ai[evals]' ``` ---------------------------------------- TITLE: Python Notion Toolkit Usage Example DESCRIPTION: Illustrative Python code snippet demonstrating how to import and use the Notion toolkit for common operations like getting page content. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_633 LANGUAGE: python CODE: ``` from arcade_notion_toolkit import NotionToolkit # Initialize the toolkit (authentication is handled separately via Arcade's auth provider) ttoolkit = NotionToolkit() # Example: Get content of a page by its ID page_id = "your-page-id-here" page_content = toolkit.get_page_content_by_id(page_id=page_id) print(f"Page Content:\n{page_content}") # Example: Create a new page new_page_title = "My New AI Generated Page" parent_page_title = "My Projects" new_page_content = "This page was created by an AI agent." toolkit.create_page(parent_title=parent_page_title, title=new_page_title, content=new_page_content) print(f"Page '{new_page_title}' created successfully.") # Example: Search for pages by title search_results = toolkit.search_by_title(query="meeting notes", limit=5) print(f"Search Results:\n{search_results}") ``` ---------------------------------------- TITLE: Verify Local Toolkit Installation DESCRIPTION: Verifies the installation of local Arcade AI toolkits. This command lists all installed tools, their descriptions, associated toolkits, and versions. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_474 LANGUAGE: shell CODE: ``` arcade show --local ``` ---------------------------------------- TITLE: Jira List Priority Schemes Example DESCRIPTION: Example of calling the Jira ListPrioritySchemes tool directly in Python. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/jira.mdx#_snippet_54 LANGUAGE: Python CODE: ``` from langchain_community.tools.jira.tool import JiraToolkit from langchain_community.utilities.jira import Jira jira = Jira() priority_schemes = jira.list_priority_schemes() print(priority_schemes) ``` ---------------------------------------- TITLE: Instantiate and Use Arcade Client DESCRIPTION: Demonstrates how to initialize the Arcade client with an API key and execute tools. It includes examples for a math tool (Math.Sqrt) and an authenticated tool (GitHub.SetStarred), showing how to handle authorization prompts. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_28 LANGUAGE: python CODE: ``` from arcadepy import Arcade # You can also set the `ARCADE_API_KEY` environment variable instead of passing it as a parameter. client = Arcade(api_key="{arcade_api_key}") # Arcade needs a unique identifier for your application user (this could be an email address, a UUID, etc). # In this example, use the email you used to sign up for Arcade.dev: user_id = "{arcade_user_id}" # Let's use the `Math.Sqrt` tool from the Arcade Math toolkit to get the square root of a number. response = client.tools.execute( tool_name="Math.Sqrt", input={"a": '625'}, user_id=user_id, ) print(f"The square root of 625 is {response.output.value}") # Now, let's use a tool that requires authentication to star a GitHub repository auth_response = client.tools.authorize( tool_name="GitHub.SetStarred", user_id=user_id, ) if auth_response.status != "completed": print(f"Click this link to authorize: `{auth_response.url}`. The process will continue once you have authorized the app." ) # Wait for the user to authorize the app client.auth.wait_for_completion(auth_response.id); response = client.tools.execute( tool_name="GitHub.SetStarred", input={ "owner": "ArcadeAI", "name": "arcade-ai", "starred": True, }, user_id=user_id, ) print(response.output.value) ``` ---------------------------------------- TITLE: Example Rubric Configuration DESCRIPTION: Demonstrates how to configure an EvalRubric in Python, specifying fail and warn thresholds, and failure conditions for tool selection. This setup defines the criteria for passing or warning during an evaluation. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_437 LANGUAGE: python CODE: ``` rubric = EvalRubric( fail_threshold=0.85, warn_threshold=0.95, fail_on_tool_selection=True, tool_selection_weight=1.0, ) ``` ---------------------------------------- TITLE: Install google-adk-arcade Package DESCRIPTION: Installs the `google-adk-arcade` package using pip. Ensure you have Python and pip installed. This is a prerequisite for using the integration. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/google-adk/overview.mdx#_snippet_0 LANGUAGE: bash CODE: ``` pip install google-adk-arcade ``` ---------------------------------------- TITLE: Install Arcade Toolkits via PyPI DESCRIPTION: Installs Arcade AI toolkits from the Python Package Index (PyPI). Ensure you are in the same Python virtual environment as the arcade-ai package. Replace `[toolkit_name]` with the desired toolkit, e.g., `arcade-math`. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_473 LANGUAGE: shell CODE: ``` pip install arcade-[toolkit_name] ``` LANGUAGE: shell CODE: ``` pip install arcade-math ``` ---------------------------------------- TITLE: Install Arcade CLI DESCRIPTION: Installs the Arcade CLI from the 'arcade-ai' package using pip. This CLI is used to connect to the cloud or local Arcade Engine. It also includes the login command. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/local.mdx#_snippet_0 LANGUAGE: bash CODE: ``` pip install arcade-ai arcade login ``` ---------------------------------------- TITLE: Initialize and Run OpenAI Agent with Arcade Tools DESCRIPTION: Demonstrates the basic setup for an OpenAI Agent using Arcade. It initializes the Arcade client, fetches specific toolkits (like Gmail), creates an agent with instructions and a model, and runs the agent with user context. Includes error handling for authorization. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_206 LANGUAGE: python CODE: ``` from agents import Agent, Runner from arcadepy import AsyncArcade from agents_arcade import get_arcade_tools from agents_arcade.errors import AuthorizationError async def main(): # Initialize the Arcade client client = AsyncArcade() # Get tools from the "gmail" toolkit tools = await get_arcade_tools(client, toolkits=["gmail"]) # Create an agent with Gmail tools google_agent = Agent( name="Gmail agent", instructions="You are a helpful assistant that can assist with Gmail API calls.", model="gpt-4o-mini", tools=tools, ) try: # Run the agent with a unique user_id for authorization result = await Runner.run( starting_agent=google_agent, input="What are my latest emails?", context={"user_id": "{arcade_user_id}"}, ) print("Final output:\n\n", result.final_output) except AuthorizationError as e: print("Please Login to Google:", e) if __name__ == "__main__": import asyncio asyncio.run(main()) ``` ---------------------------------------- TITLE: Dropbox Toolkit: Download File Example (JavaScript) DESCRIPTION: Example of how to call the Dropbox DownloadFile tool directly using JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/dropbox/dropbox.mdx#_snippet_8 LANGUAGE: JavaScript CODE: ``` import { Arcade } from "@arcade/arcade"; // Initialize Arcade const arcade = new Arcade(); // Call the tool const response = await arcade.toolExecutor.executeTool({ toolName: "Dropbox.DownloadFile", input: { file_path: "/My Documents/My Folder/My File.pdf", }, }); console.log(response); ``` ---------------------------------------- TITLE: Get Jira Priority By ID Example DESCRIPTION: Example of how to call the Jira GetPriorityById tool directly in Python and JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/jira.mdx#_snippet_49 LANGUAGE: Python CODE: ``` from langchain_community.tools.jira.tool import JiraToolkit from langchain_community.utilities.jira import Jira jira = Jira() toolkit = JiraToolkit.from_jira(jira) # Call the Tool Directly print(toolkit.get_priority_by_id.run("priority_id")) ``` LANGUAGE: JavaScript CODE: ``` import { JiraToolkit } from "langchain_community/kits/jira"; import { Jira } from "langchain_community/utilities/jira"; const jira = new Jira(); const toolkit = JiraToolkit.fromJira(jira); // Call the Tool Directly console.log(await toolkit.getPriorityById.invoke({ priority_id: "priority_id" })); ``` ---------------------------------------- TITLE: Install Arcade Engine with Brew DESCRIPTION: Installs the Arcade Engine binary using the Homebrew package manager. This is a convenient method for macOS users. Ensure Homebrew is installed and configured. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/overview.mdx#_snippet_2 LANGUAGE: bash CODE: ``` brew install arcade-engine ``` ---------------------------------------- TITLE: Install Arcade and Google API Libraries DESCRIPTION: Installs the necessary Python libraries for interacting with Arcade and the Google API client, including authentication helpers. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_182 LANGUAGE: bash CODE: ``` pip install arcadepy google-api-python-client google-auth-httplib2 google-auth-oauthlib ``` ---------------------------------------- TITLE: Get Jira Project By ID Example DESCRIPTION: Example of how to call the Jira GetProjectById tool directly in Python and JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/jira.mdx#_snippet_47 LANGUAGE: Python CODE: ``` from langchain_community.tools.jira.tool import JiraToolkit from langchain_community.utilities.jira import Jira jira = Jira() toolkit = JiraToolkit.from_jira(jira) # Call the Tool Directly print(toolkit.get_project_by_id.run("project_id_or_key")) ``` LANGUAGE: JavaScript CODE: ``` import { JiraToolkit } from "langchain_community/kits/jira"; import { Jira } from "langchain_community/utilities/jira"; const jira = new Jira(); const toolkit = JiraToolkit.fromJira(jira); // Call the Tool Directly console.log(await toolkit.getProjectById.invoke({ project: "project_id_or_key" })); ``` ---------------------------------------- TITLE: Install a Toolkit DESCRIPTION: Installs a toolkit package, such as 'arcade-math', into the current Python environment. This is necessary for the Arcade worker to run, as it requires at least one installed tool. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/local.mdx#_snippet_3 LANGUAGE: python CODE: ``` pip install arcade-math ``` ---------------------------------------- TITLE: Install arcade-engine via APT DESCRIPTION: Installs the arcade-engine binary using the APT package manager on Debian-based Linux distributions. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_118 LANGUAGE: bash CODE: ``` sudo apt-get update && sudo apt-get install arcade-engine ``` ---------------------------------------- TITLE: API Configuration Options DESCRIPTION: Details the configuration parameters for the Arcade Engine's API, including settings for development mode, host binding, and various HTTP timeouts and request size limits. It also provides examples for production and local development setups. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/configure/engine.mdx#_snippet_3 LANGUAGE: APIDOC CODE: ``` API Configuration: Configures the server for specific protocols. - api.development: (optional, default: `false`) Enable development mode, with more logging and simple worker authentication. - api.http.host: (default: `localhost`) Address to which Arcade Engine binds its server (e.g., `localhost` or `0.0.0.0`). - api.http.read_timeout: (optional, default: `30s`) Timeout for reading data from clients. - api.http.write_timeout: (optional, default: `1m`) Timeout for writing data to clients. - api.http.idle_timeout: (optional, default: `30s`) Timeout for idle connections. - api.http.max_request_body_size: (optional, default: `4Mb`) Maximum request body size. Example Production Configuration: ```yaml api: http: host: "0.0.0.0" read_timeout: "1m" ``` Example Local Development Configuration: ```yaml api: development: true ``` ``` ---------------------------------------- TITLE: Dropbox Toolkit: Download File Example (Python) DESCRIPTION: Example of how to call the Dropbox DownloadFile tool directly using Python. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/dropbox/dropbox.mdx#_snippet_7 LANGUAGE: Python CODE: ``` from arcade import Arcade # Initialize Arcade arcade = Arcade() # Call the tool response = arcade.tool_executor.execute_tool( tool_name="Dropbox.DownloadFile", input={ "file_path": "/My Documents/My Folder/My File.pdf" } ) print(response) ``` ---------------------------------------- TITLE: Jira List Priority Schemes Example DESCRIPTION: Example of calling the Jira ListPrioritySchemes tool directly in JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/jira.mdx#_snippet_55 LANGUAGE: JavaScript CODE: ``` import { Jira } from "langchain_community/utilities/jira"; const jira = new Jira(); jira.listPrioritySchemes().then(prioritySchemes => { console.log(prioritySchemes); }); ``` ---------------------------------------- TITLE: Initialize Agent with Tools DESCRIPTION: Create an agent instance by providing its name, instructions, the language model to use, and the list of Arcade tools it should have access to. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_356 LANGUAGE: Python CODE: ``` from agents import Agent # Assuming 'tools' variable is already populated from the previous step # tools = await get_arcade_tools(client, toolkits=["gmail"]) google_agent = Agent( name="Gmail agent", instructions="You are a helpful assistant that can assist with Google API calls.", model="gpt-4o-mini", tools=tools, ) ``` ---------------------------------------- TITLE: Search Jira Projects Example DESCRIPTION: Example of how to call the Jira SearchProjects tool directly in Python and JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/jira.mdx#_snippet_46 LANGUAGE: Python CODE: ``` from langchain_community.tools.jira.tool import JiraToolkit from langchain_community.utilities.jira import Jira jira = Jira() toolkit = JiraToolkit.from_jira(jira) # Call the Tool Directly print(toolkit.search_projects.run(keywords="test", limit=10, offset=0)) ``` LANGUAGE: JavaScript CODE: ``` import { JiraToolkit } from "langchain_community/kits/jira"; import { Jira } from "langchain_community/utilities/jira"; const jira = new Jira(); const toolkit = JiraToolkit.fromJira(jira); // Call the Tool Directly console.log(await toolkit.searchProjects.invoke({ keywords: "test", limit: 10, offset: 0 })); ``` ---------------------------------------- TITLE: Install Arcade Engine (macOS) DESCRIPTION: Installs the Arcade Engine binary on macOS using Homebrew. This command adds the ArcadeAI tap and installs the engine, making it available in your system's PATH. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/local.mdx#_snippet_1 LANGUAGE: bash CODE: ``` brew install ArcadeAI/tap/arcade-engine ``` ---------------------------------------- TITLE: Install Arcade Google Shopping Toolkit DESCRIPTION: Installs the Arcade Google Shopping toolkit using pip. This command is used for self-hosting Arcade tools on your own infrastructure. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_342 LANGUAGE: python CODE: ``` pip install arcade_google_shopping ``` ---------------------------------------- TITLE: Install Arcade Engine with APT DESCRIPTION: Installs the Arcade Engine binary using the APT package manager, typically on Debian-based Linux distributions. This method requires root privileges. Ensure the Arcade repository is added. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/overview.mdx#_snippet_3 LANGUAGE: bash CODE: ``` sudo apt-get update && sudo apt-get install arcade-engine ``` ---------------------------------------- TITLE: Install Arcade CLI with pip DESCRIPTION: Installs the Arcade Command Line Interface (CLI) and SDK using pip. This provides command-line tools for interacting with Arcade services. Requires Python and pip. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/local-deployment/install/overview.mdx#_snippet_1 LANGUAGE: bash CODE: ``` pip install arcade-cli ``` ---------------------------------------- TITLE: List Jira Projects Example DESCRIPTION: Example of how to call the Jira ListProjects tool directly in Python and JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/jira.mdx#_snippet_45 LANGUAGE: Python CODE: ``` from langchain_community.tools.jira.tool import JiraToolkit from langchain_community.utilities.jira import Jira jira = Jira() toolkit = JiraToolkit.from_jira(jira) # Call the Tool Directly print(toolkit.list_projects.run(limit=10, offset=0)) ``` LANGUAGE: JavaScript CODE: ``` import { JiraToolkit } from "langchain_community/kits/jira"; import { Jira } from "langchain_community/utilities/jira"; const jira = new Jira(); const toolkit = JiraToolkit.fromJira(jira); // Call the Tool Directly console.log(await toolkit.listProjects.invoke({ limit: 10, offset: 0 })); ``` ---------------------------------------- TITLE: Install Arcade Google Drive Toolkit DESCRIPTION: Installs the Arcade Google Drive toolkit using pip, allowing integration with Google Drive functionalities. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_620 LANGUAGE: bash CODE: ``` pip install arcade_google_docs ``` ---------------------------------------- TITLE: Start Arcade Engine with Config File DESCRIPTION: This command starts the Arcade Engine, specifying a custom configuration file. Ensure a worker is running before starting the engine. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_446 LANGUAGE: shell CODE: ``` arcade-engine -c /path/to/config.yaml ``` ---------------------------------------- TITLE: Arcade AI Package Installation DESCRIPTION: Instructions for installing the Arcade AI ecosystem packages. This includes the core CLI, the evaluation framework, and the toolkit development kit (TDK). SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_286 LANGUAGE: bash CODE: ``` pip install arcade-ai pip install 'arcade-ai[evals]' pip install 'arcade-ai[all]' pip install arcade-tdk pip install arcade-serve ``` ---------------------------------------- TITLE: Start GitHub Auth and Get User Token (Python) DESCRIPTION: Initiates the GitHub authentication process for a given user ID using the Arcade SDK. It provides a URL for the user to complete authorization and then waits for the process to finish, retrieving the user's GitHub API token from the context. The example demonstrates using this token to fetch the stargazers count for a GitHub repository. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_23 LANGUAGE: Python CODE: ``` import requests from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable user_id = "user@example.com" """ In this example, we will use Arcade to authenticate with GitHub and retrieve the number of stargazers of the ArcadeAI/arcade-ai repository. There is a tool for that in the Arcade SDK, which simplifies the process for you to interact with GitHub either through our Python or JavaScript SDKs or via LLM tool calling. Below we are just showing how to use Arcade as an auth provider, if you ever need to. """ # Start the authorization process auth_response = client.auth.start( user_id=user_id, provider="github", ) if auth_response.status != "completed": print("Please complete the authorization challenge in your browser:") print(auth_response.url) # Wait for the authorization to complete auth_response = client.auth.wait_for_completion(auth_response) if not auth_response.context.token: raise ValueError("No token found in auth response") token = auth_response.context.token owner = "ArcadeAI" name = "arcade-ai" headers = { "Accept": "application/vnd.github+json", "Authorization": f"Bearer {token}", "X-GitHub-Api-Version": "2022-11-28", } url = f"https://api.github.com/repos/{owner}/{name}" response = requests.get(url, headers=headers) response.raise_for_status() print(response.json().get("stargazers_count")) ``` ---------------------------------------- TITLE: Set Up Agent with Arcade Tools DESCRIPTION: Illustrates creating a Google ADK Agent, configuring its model, name, instructions, description, and providing it with a list of authorized Arcade tools. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_111 LANGUAGE: python CODE: ``` # import the Google ADK requirements from google.adk import Agent, Runner from google.adk.artifacts import InMemoryArtifactService from google.adk.sessions import InMemorySessionService from google.genai import types # create a new session and artifact services session_service = InMemorySessionService() artifact_service = InMemoryArtifactService() # Create an agent with Gmail tools google_agent = Agent( model="gemini-2.0-flash", name="google_tool_agent", instruction="I can use Gmail tools to manage an inbox!", description="An agent equipped with tools to read Gmail emails." tools=tools, ) ``` ---------------------------------------- TITLE: Install Arcade Outlook Calendar Toolkit DESCRIPTION: Instructions for installing the Arcade Outlook Calendar toolkit using pip. This is a prerequisite for self-hosting Arcade tools. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_641 LANGUAGE: bash CODE: ``` pip install arcade_outlook_calendar ``` ---------------------------------------- TITLE: Install Arcade Python Client DESCRIPTION: Installs the Arcade Python client using pip. This package provides Python bindings for Arcade's tools, enabling seamless integration into Python applications. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/arcade-clients.mdx#_snippet_0 LANGUAGE: bash CODE: ``` pip install arcadepy ``` ---------------------------------------- TITLE: Execute Code Example DESCRIPTION: Commands to execute the Python and JavaScript code examples. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/auth/call-third-party-apis-directly.mdx#_snippet_7 LANGUAGE: python CODE: ``` python3 direct_api_call.py ``` LANGUAGE: javascript CODE: ``` node direct_api_call.js ``` ---------------------------------------- TITLE: Dropbox Toolkit: Search Files and Folders Example (JavaScript) DESCRIPTION: Example of how to call the Dropbox SearchFilesAndFolders tool directly using JavaScript. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/dropbox/dropbox.mdx#_snippet_6 LANGUAGE: JavaScript CODE: ``` import { Arcade } from "@arcade/arcade"; // Initialize Arcade const arcade = new Arcade(); // Call the tool const response = await arcade.toolExecutor.executeTool({ toolName: "Dropbox.SearchFilesAndFolders", input: { keywords: "quarterly report", search_in_folder_path: "/My Documents/My Folder", }, }); console.log(response); ``` ---------------------------------------- TITLE: Package Initialization Files DESCRIPTION: Demonstrates how to expose the arithmetic tools by importing them into the package's __init__.py files. This makes the tools accessible when the package is imported. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/build-tools/create-a-toolkit.mdx#_snippet_5 LANGUAGE: python CODE: ``` # arcade_arithmetic/tools/__init__.py from arcade_arithmetic.tools.operations import add, multiply, subtract __all__ = ["add", "multiply", "subtract"] ``` LANGUAGE: python CODE: ``` # arcade_arithmetic/__init__.py from arcade_arithmetic.tools import add, multiply, subtract __all__ = ["add", "multiply", "subtract"] ``` ---------------------------------------- TITLE: Install Arcade X Toolkit DESCRIPTION: Provides the command to install the Arcade X toolkit using pip. This is necessary for self-hosting Arcade tools. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_166 LANGUAGE: Python CODE: ``` pip install arcade_x ``` ---------------------------------------- TITLE: Arcade Slack Tool Execution Example DESCRIPTION: This example demonstrates how to directly execute a Slack tool provided by Arcade, specifically fetching messages from a channel. It shows the parameters required for such an execution, bypassing direct LLM interaction. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_122 LANGUAGE: URL CODE: ``` https://api.arcade.dev/dashboard/playground/execute?toolId=GetMessagesInChannelByName&toolkits=%5B%5D&authProviders=%5B%5D&secrets=%5B%5D&input=%7B%22owner%22%3A%22ArcadeAI%22%2C%22name%22%3A%22arcade-ai%22%2C%22starred%22%3A%22true%22%2C%22channel_name%22%3A%22general%22%2C%22limit%22%3A%225%22%7D ``` ---------------------------------------- TITLE: Install Arcade Packages for Python DESCRIPTION: Installs the necessary Python packages to integrate Arcade.dev tools and handle authentication within your AI applications. This setup is crucial for enabling your agents to interact with authenticated services. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_484 LANGUAGE: python CODE: ``` pip install agents-arcade arcadepy ``` ---------------------------------------- TITLE: Install Twilio Toolkit DESCRIPTION: Instructions for installing the Twilio Toolkit package using pip. This ensures you have the necessary library to integrate Twilio services. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_665 LANGUAGE: bash CODE: ``` pip install arcade_twilio==0.1.0 ``` ---------------------------------------- TITLE: Call Walmart Get Product Details Tool DESCRIPTION: Demonstrates how to call the Walmart Get Product Details tool directly in Python and JavaScript. This example shows how to retrieve detailed information for a specific product using its item ID. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/search/walmart.mdx#_snippet_1 LANGUAGE: Python CODE: ``` from arcade.tools.walmart import WalmartSearch search_products = WalmartSearch() # Example: Get details for a specific item ID item_id = "414600577" product_details = search_products.get_product_details(item_id=item_id) print(product_details) ``` LANGUAGE: JavaScript CODE: ``` import { WalmartSearch } from "@arcade/tools"; const searchProducts = new WalmartSearch(); // Example: Get details for a specific item ID const itemId = "414600577"; const productDetails = await searchProducts.getProductDetails(itemId); console.log(productDetails); ``` ---------------------------------------- TITLE: Install Arcade Dependencies DESCRIPTION: Installs the necessary Arcade AI and Google toolkits using pip. These are required for integrating Arcade with Claude Desktop and accessing its functionalities. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_482 LANGUAGE: bash CODE: ``` pip install arcade-ai pip install arcade-google ``` ---------------------------------------- TITLE: Complete Example: Arcade Tools with OpenAI Agents DESCRIPTION: Provides a full integration example of using Arcade tools with OpenAI Agents. It covers initializing the Arcade client, fetching and preparing tools (like the Gmail toolkit) for the agent, defining the agent's instructions and model, and running the agent to perform tasks such as retrieving emails. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/home/oai-agents/use-arcade-tools.mdx#_snippet_6 LANGUAGE: Python CODE: ``` from agents import Agent, Runner from arcadepy import AsyncArcade from agents_arcade import get_arcade_tools from agents_arcade.errors import AuthorizationError async def main(): client = AsyncArcade() tools = await get_arcade_tools(client, toolkits=["gmail"]) google_agent = Agent( name="Google agent", instructions="You are a helpful assistant that can assist with Google API calls.", model="gpt-4o-mini", tools=tools, ) try: result = await Runner.run( starting_agent=google_agent, input="What are my latest emails?", context={"user_id": "{arcade_user_id}"}, ) print("Final output:\n\n", result.final_output) except AuthorizationError as e: print("Please Login to Google:", e) if __name__ == "__main__": import asyncio asyncio.run(main()) ``` LANGUAGE: JavaScript CODE: ``` import Arcade from '@arcadeai/arcadejs'; import { executeOrAuthorizeZodTool, toZod } from "@arcadeai/arcadejs/lib"; import { Agent, run, tool } from '@openai/agents'; // 1) Initialize Arcade client const client = new Arcade(); // 2) Fetch Gmail toolkit from Arcade and prepare tools for OpenAI Agents const googleToolkit = await client.tools.list({ toolkit: "gmail", limit: 30 }); const tools = toZod({ tools: googleToolkit.items, client, userId: "", // Replace this with your application's user ID (e.g. email address, UUID, etc.) executeFactory: executeOrAuthorizeZodTool, }).map(tool); // 3) Create a new agent with the Gmail toolkit const googleAgent = new Agent({ name: "Gmail agent", instructions: "You are a helpful assistant that can assist with Google API calls.", model: "gpt-4o-mini", tools }); // 4) Run the agent const result = await run(googleAgent, "What are my latest emails?"); // 5) Print the result console.log(result.finalOutput); ``` ---------------------------------------- TITLE: Instantiate and Use Arcade Client DESCRIPTION: Demonstrates how to initialize the Arcade client with an API key, set a user ID, execute a tool (Math.Sqrt), and authorize and execute a tool requiring authentication (GitHub.SetStarred). Includes handling for user authorization flow. SOURCE: https://github.com/arcadeai/docs/blob/main/public/llms-full.txt#_snippet_303 LANGUAGE: python CODE: ``` from arcadepy import Arcade # You can also set the `ARCADE_API_KEY` environment variable instead of passing it as a parameter. client = Arcade(api_key="{arcade_api_key}") # Arcade needs a unique identifier for your application user (this could be an email address, a UUID, etc). # In this example, use the email you used to sign up for Arcade.dev: user_id = "{arcade_user_id}" # Let's use the `Math.Sqrt` tool from the Arcade Math toolkit to get the square root of a number. response = client.tools.execute( tool_name="Math.Sqrt", input={"a": '625'}, user_id=user_id, ) print(f"The square root of 625 is {response.output.value}") # Now, let's use a tool that requires authentication to star a GitHub repository auth_response = client.tools.authorize( tool_name="GitHub.SetStarred", user_id=user_id, ) if auth_response.status != "completed": print(f"Click this link to authorize: `{auth_response.url}`. The process will continue once you have authorized the app." ) # Wait for the user to authorize the app client.auth.wait_for_completion(auth_response.id); response = client.tools.execute( tool_name="GitHub.SetStarred", input={ "owner": "ArcadeAI", "name": "arcade-ai", "starred": True, }, user_id=user_id, ) print(response.output.value) ``` ---------------------------------------- TITLE: Dropbox Toolkit: Search Files and Folders Example (Python) DESCRIPTION: Example of how to call the Dropbox SearchFilesAndFolders tool directly using Python. SOURCE: https://github.com/arcadeai/docs/blob/main/pages/toolkits/productivity/dropbox/dropbox.mdx#_snippet_5 LANGUAGE: Python CODE: ``` from arcade import Arcade # Initialize Arcade arcade = Arcade() # Call the tool response = arcade.tool_executor.execute_tool( tool_name="Dropbox.SearchFilesAndFolders", input={ "keywords": "quarterly report", "search_in_folder_path": "/My Documents/My Folder" } ) print(response) ```