{"id":26051492,"url":"https://github.com/arcadeai/arcade-ai","last_synced_at":"2025-05-15T03:06:28.990Z","repository":{"id":259939834,"uuid":"792542977","full_name":"ArcadeAI/arcade-ai","owner":"ArcadeAI","description":"Arcade Python SDK and CLI","archived":false,"fork":false,"pushed_at":"2025-05-12T22:50:22.000Z","size":2918,"stargazers_count":367,"open_issues_count":14,"forks_count":28,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-12T23:33:35.664Z","etag":null,"topics":["agent","ai","arcade","arcade-ai","artificial-intelligence","langchain","langgraph","llm","llm-tool-call","llm-tools","openai","toolcalling"],"latest_commit_sha":null,"homepage":"https://docs.arcade.dev","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArcadeAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-26T22:25:48.000Z","updated_at":"2025-05-12T22:50:23.000Z","dependencies_parsed_at":"2024-11-27T20:19:36.185Z","dependency_job_id":"73748426-0acc-4e62-89c5-048c5e458217","html_url":"https://github.com/ArcadeAI/arcade-ai","commit_stats":null,"previous_names":["arcadeai/arcade-ai"],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArcadeAI%2Farcade-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArcadeAI%2Farcade-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArcadeAI%2Farcade-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArcadeAI%2Farcade-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArcadeAI","download_url":"https://codeload.github.com/ArcadeAI/arcade-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264766,"owners_count":22041793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","arcade","arcade-ai","artificial-intelligence","langchain","langgraph","llm","llm-tool-call","llm-tools","openai","toolcalling"],"created_at":"2025-03-08T04:55:26.229Z","updated_at":"2025-05-15T03:06:28.858Z","avatar_url":"https://github.com/ArcadeAI.png","language":"Python","funding_links":[],"categories":["CLIs"],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003e\n  \u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n  \u003cimg\n    src=\"https://docs.arcade.dev/images/logo/arcade-logo.png\"\n    style=\"width: 400px;\"\n  \u003e\n\u003c/h3\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://github.com/arcadeai/arcade-ai/blob/main/LICENSE\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License\"\u003e\n\u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/github/last-commit/ArcadeAI/arcade-ai\" alt=\"GitHub last commit\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/arcadeai/arcade-ai/actions/workflow/on-release-main.yml\"\u003e\n\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/arcadeai/arcade-ai/check-toolkits.yml\" alt=\"GitHub Actions Status\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://img.shields.io/pypi/pyversions/arcade-ai\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/pyversions/arcade-ai\" alt=\"Python Version\"\u003e\n\u003c/a\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n  \u003cp align=\"center\" style=\"display: flex; justify-content: center; gap: 10px;\"\u003e\n    \u003ca href=\"https://x.com/TryArcade\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Follow%20on%20X-000000?style=for-the-badge\u0026logo=x\u0026logoColor=white\" alt=\"Follow on X\" style=\"width: 125px;height: 25px; padding-top: .8px; border-radius: 5px;\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.linkedin.com/company/arcade-ai\" \u003e\n      \u003cimg src=\"https://img.shields.io/badge/Follow%20on%20LinkedIn-0077B5?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\" alt=\"Follow on LinkedIn\" style=\"width: 150px; padding-top: 1.5px;height: 22px; border-radius: 5px;\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://discord.com/invite/GUZEMpEZ9p\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Join%20our%20Discord-5865F2?style=for-the-badge\u0026logo=discord\u0026logoColor=white\" alt=\"Join our Discord\" style=\"width: 150px; padding-top: 1.5px; height: 22px; border-radius: 5px;\" /\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\" style=\"display: flex; justify-content: center; gap: 5px; font-size: 15px;\"\u003e\n    \u003ca href=\"https://docs.arcade.dev/home\" target=\"_blank\"\u003eDocumentation\u003c/a\u003e •\n    \u003ca href=\"https://docs.arcade.dev/tools\" target=\"_blank\"\u003eTools\u003c/a\u003e •\n    \u003ca href=\"https://docs.arcade.dev/home/quickstart\" target=\"_blank\"\u003eQuickstart\u003c/a\u003e •\n    \u003ca href=\"https://docs.arcade.dev/home/contact-us\" target=\"_blank\"\u003eContact Us\u003c/a\u003e\n\n# Arcade Tool SDK\n\nArcade is a developer platform that lets you build, deploy, and manage tools for AI agents.\n\nThe Tool SDK makes it easy to create powerful, secure tools that your agents can use to interact with the world.\n\n![diagram](https://github.com/user-attachments/assets/1a567e5f-d6b4-4b1e-9918-c401ad232ebb)\n\nTo learn more, check out our [documentation](https://docs.arcade.dev/home).\n\n_Pst. hey, you, give us a star if you like it!_\n\n\u003ca href=\"https://github.com/ArcadeAI/arcade-ai\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/stars/ArcadeAI/arcade-ai.svg\" alt=\"GitHub stars\"\u003e\n\u003c/a\u003e\n\n## Table of Contents\n\n-   [Quickstart: Install and call a tool](#quickstart-install-and-call-a-tool)\n-   [Build LLM Tools with Arcade SDK](#build-llm-tools-with-arcade-sdk)\n    -   [Tool SDK Installation](#tool-sdk-installation)\n    -   [Creating a new Toolkit](#creating-a-new-toolkit)\n    -   [Deploy your tools to call with LLMs](#deploy-your-tools-to-call-with-llms)\n-   [Calling your tools](#calling-your-tools)\n    -   [LLM API](#llm-api)\n    -   [Tools API](#tools-api)\n    -   [Integrating with Agent Frameworks](#integrating-with-agent-frameworks)\n    -   [Arcade Auth API](#arcade-auth-api)\n-   [Client Libraries](#client-libraries)\n-   [Support and Community](#support-and-community)\n\n## Quickstart: Install and call a tool\n\n```bash\n# Install the Arcade CLI\npip install arcade-ai\n\n# Log in to Arcade\narcade login\n\n# Show what tools are hosted by Arcade\narcade show\n\n# show what tools are in a toolkit\narcade show -T GitHub\n\n# look at the definition of a tool\narcade show -t GitHub.SetStarred\n```\n\nThe GitHub.SetStarred tool is hosted by Arcade, so you can call it directly\nwithout any additional setup of OAuth or servers. A simple way to test tools,\nwether hosted by Arcade or not, is to use the `arcade chat` app.\n\n```bash\narcade chat\n```\n\nThis will start a chat with an LLM that can call tools.\n\ntry calling the GitHub.SetStarred tool with a message like \"Star the arcade-ai repo\"\n\n```\n\u003e arcade chat\n\n=== Arcade Chat ===\n\nChatting with Arcade Engine at https://api.arcade.dev\n\nUser sam@arcade.dev:\nstar the arcadeai/arcade-ai repo\n\nAssistant:\nThanks for authorizing the action! Sending your request...\n\nAssistant:\nI have successfully starred the repository arcadeai/arcade-ai for you.\n```\n\nIf Arcade already hosts the tools you need to build your agent, you\ncan navigate to the [Quickstart](https://docs.arcade.dev/home/quickstart) to\nlearn how to call tools programmatically in Python, Typescript, or HTTP.\n\nYou can also build your own tools with the SDK and deploy them in one command\non Arcade Cloud\n\n## Build LLM Tools with Arcade SDK\n\nArcade provides a tool SDK that allows you to build your own tools and use them in your agentic applications just like the existing tools Arcade provides. This is useful for building new tools, customizing existing tools to fit your needs, combining multiple tools, or building tools that are not yet supported by Arcade.\n\n### Tool SDK Installation\n\n**Prerequisites**\n\n-   **Python 3.10+** and **pip**\n\nNow you can install the Tool SDK through pip.\n\n1. **Install the Arcade CLI:**\n\n    ```bash\n    pip install arcade-ai\n    ```\n\n    If you plan on writing evaluations for your tools and the LLMs you use, you will also need to install the `evals` extra.\n\n    ```bash\n    pip install 'arcade-ai[evals]'\n    ```\n\n2. **Log in to Arcade:**\n    ```bash\n    arcade login\n    ```\n    This will prompt you to open a browser and authorize the CLI. It will then save the credentials to your machine typically in `~/.arcade/credentials.json`. If you haven't used the CLI before, you will need to create an account on this page.\n\nNow you're ready to build tools with Arcade!\n\n### Creating a New Toolkit\n\nToolkits are the main building blocks of Arcade. They are a collection of tools that are related to a specific service, use case,\nor agent. Toolkits are created and distributed python packages to facilitate version, dependency, and distribution.\n\nTo create a new toolkit, you can use the `arcade new` command. This will create a new toolkit in the current directory.\n\n1. **Generate a new toolkit template:**\n\n    ```bash\n    arcade new\n    ```\n\n    ```text\n    Name of the new toolkit?: mytoolkit\n    Description of the toolkit?: myToolkit is a toolkit for ...\n    Github owner username?: mytoolkit\n    Author's email?: user@example.com\n    ```\n\n    This will create a new toolkit in the current directory.\n\n    The generated toolkit includes all the scaffolding you need for a working tool. Look for the `mytoolkit/tool.py` file to customize the behavior of your tool.\n\n2. **Install your new toolkit:**\n\n    ```bash\n    # make sure you have python installed\n    python --version\n\n    # install your new toolkit\n    cd mytoolkit\n    make install\n    ```\n\n    This will install the toolkit in your local python environment using poetry.\n\n    The template is meant to be customized so feel free to change anything about the structure,\n    package management, linting, etc.\n\n3. **Show the tools in the template Toolkit:**\n\n    ```bash\n    # show the tools in Mytoolkit\n    arcade show --local -T Mytoolkit\n\n    # show the definition of a tool\n    arcade show --local -t Mytoolkit.SayHello\n\n    # show all tools installed in your local python environment\n    arcade show --local\n    ```\n\nNow you can edit the `mytoolkit/tool.py` file to customize the behavior of your tool. Next,\nyou can host your tools to call with LLMs by deploying your toolkit to Arcade Cloud.\n\n### Deploy your tools to call with LLMs\n\nTo make your tools in the toolkit available to call with LLMs, you can deploy your toolkit to Arcade Cloud.\n\nThe `worker.toml` file created in the directory where you ran `arcade new` will be used to deploy your toolkit.\n\nIn that directory, run the following command to deploy your toolkit:\n\n```bash\n# from inside the mytoolkit dir\ncd ../\n\narcade deploy\n```\n\nThis command will package your toolkit and deploy it as a worker instance in Arcade's cloud infrastructure:\n\n```\n[11:52:44] Deploying 'demo-worker...'\n⠦ Deploying 1 workers             Changed Packages\n┏━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┓\n┃ Added    ┃ Removed ┃ Updated ┃ No Changes ┃\n┡━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━┩\n│ Mytoolkit│         │         │            │\n└──────────┴─────────┴─────────┴────────────┘\n[11:53:13] ✅ Worker 'demo-worker' deployed successfully.\n```\n\nYou can manage your deployed workers with the following commands:\n\n```bash\n# List all workers (both local and cloud-deployed)\narcade worker list\n\n# Remove a deployed worker\narcade worker rm demo-worker\n```\n\nOnce deployed, your toolkit is immediately available through the Arcade platform. You can now call your tools through the playground, LLM API, or Tools API without any additional setup.\n\nFor local development and testing when running the Arcade Engine locally or tunneling to it, you can\nuse `arcade serve` to host your toolkit locally and connect it to the Arcade Engine.\n\nIf you are running the Arcade Engine locally, go to localhost:9099 (or other local address)\nand add the worker address in the \"workers\" page.\n\n## Calling your tools\n\nArcade provides multiple ways to use your tools with various agent frameworks. Depending on your use case, you can choose the best method for your application.\n\n### LLM API\n\nThe LLM API provides the simplest way to integrate Arcade tools into your application. It extends the standard OpenAI API with additional capabilities:\n\n```python\nimport os\nfrom openai import OpenAI\n\nprompt = \"Say hello to Sam\"\n\napi_key = os.environ[\"ARCADE_API_KEY\"]\nopenai = OpenAI(\n    base_url=\"https://api.arcade.dev/v1\",\n    api_key=api_key,\n)\n\nresponse = openai.chat.completions.create(\n    model=\"gpt-4o-mini\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n        {\"role\": \"user\", \"content\": prompt},\n    ],\n    tools=[\"Mytoolkit.SayHello\"],\n    tool_choice=\"generate\",\n    user=\"user@example.com\"\n)\n\nprint(response.choices[0].message.content)\n```\n\nWhen a user hasn't authorized a service, the API seamlessly returns an authorization link in the response:\n\n```\nPlease authorize the tool by visiting: https://some.auth.url.arcade.will.generate.for.you...\n\n```\n\nAll you need to do is show the url to the user, and from then on, the user will never have to do this again. All future requests will use the authorized token.\n\nAfter authorization, the same API call returns the completed action:\n\n```\nHello Sam!\n```\n\n### Tools API\n\nUse the Tools API when you want to integrate Arcade's runtime for tool calling into an agent framework (like LangChain or LangGraph), or if you're using your own approach and want to call Arcade tools or tools you've built with the Arcade Tool SDK.\n\nHere's an example of how to use the Tools API to call a tool directly without a framework:\n\n```python\nimport os\nfrom arcadepy import Arcade\n\nclient = Arcade(api_key=os.environ[\"ARCADE_API_KEY\"])\n\n# Start the authorization process for Slack\nauth_response = client.tools.authorize(\n    tool_name=\"Mytoolkit.SayHello\",\n    user_id=\"user@example.com\",\n)\n\n# If the tool is not already authorized, prompt the user to authenticate\nif auth_response.status != \"completed\":\n    print(\"Please authorize by visiting:\")\n    print(auth_response.url)\n    client.auth.wait_for_completion(auth_response)\n\n# Execute the tool to send a Slack message after authorization\ntool_input = {\n    \"username\": \"sam\",\n    \"message\": \"I'll be late to the meeting\"\n}\nresponse = client.tools.execute(\n    tool_name=\"Mytoolkit.SayHello\",\n    input=tool_input,\n    user_id=\"user@example.com\",\n)\nprint(response)\n\n```\n\n### Integrating with Agent Frameworks\n\nYou can also use the Tools API with a framework like LangChain or LangGraph.\n\nCurrently Arcade provides ease-of-use integrations for the following frameworks:\n\n-   LangChain/Langgraph\n-   CrewAI\n-   LlamaIndex (coming soon)\n\nHere's an example of how to use the Tools API with LangChain/Langgraph:\n\n```python\nimport os\n\nfrom langchain_arcade import ToolManager\nfrom langchain_openai import ChatOpenAI\nfrom langgraph.checkpoint.memory import MemorySaver\nfrom langgraph.prebuilt import create_react_agent\n\n# 1) Set API keys (place your real keys in env variables or directly below)\narcade_api_key = os.environ.get(\"ARCADE_API_KEY\", \"YOUR_ARCADE_API_KEY\")\nopenai_api_key = os.environ.get(\"OPENAI_API_KEY\", \"YOUR_OPENAI_API_KEY\")\n\n# 2) Create an ToolManager and fetch/add tools/toolkits\nmanager = ToolManager(api_key=arcade_api_key)\n\n# Tool names follow the format \"ToolkitName.ToolName\"\ntools = manager.init_tools(tools=[\"Web.ScrapeUrl\"])\nprint(manager.tools)\n\n# Get all tools from a toolkit\ntools = manager.init_tools(toolkits=[\"github\"])\nprint(manager.tools)\n\n# add a tool\nmanager.add_tool(\"Search.SearchGoogle\")\nprint(manager.tools)\n\n# add a toolkit\nmanager.add_toolkit(\"Search\")\nprint(manager.tools)\n\n# 3) Get StructuredTool objects for langchain\nlc_tools = manager.to_langchain()\n\n# 4) Create a ChatOpenAI model and bind the Arcade tools.\nmodel = ChatOpenAI(model=\"gpt-4o\", api_key=openai_api_key)\nbound_model = model.bind_tools(lc_tools)\n\n# 5) Use MemorySaver for checkpointing.\nmemory = MemorySaver()\n\n# 6) Create a ReAct-style agent from the prebuilt function.\ngraph = create_react_agent(model=bound_model, tools=lc_tools, checkpointer=memory)\n\n# 7) Provide basic config and a user query.\n# Note: user_id is required for the tool to be authorized\nconfig = {\"configurable\": {\"thread_id\": \"1\", \"user_id\": \"user@example.com\"}}\nuser_input = {\"messages\": [(\"user\", \"star the arcadeai/arcade-ai repo on github\")]}\n\n# 8) Stream the agent's output. If the tool is unauthorized, it may trigger interrupts\nfor chunk in graph.stream(user_input, config, stream_mode=\"values\"):\n    chunk[\"messages\"][-1].pretty_print()\n\n# if we were interrupted, we can check for interrupts in state\ncurrent_state = graph.get_state(config)\nif current_state.tasks:\n    for task in current_state.tasks:\n        if hasattr(task, \"interrupts\"):\n            for interrupt in task.interrupts:\n                print(interrupt.value)\n```\n\nThe last message may result in an authorization prompt.\n\nIf so, the user will need to authorize the tool by visiting the url in the response. Once authorized, running the\nsame script will return the completed action since the tool will be authorized for that\nuser.\n\n### Arcade Auth API\n\nThe Auth API provides the lowest-level integration with Arcade, for when you only need Arcade's authentication capabilities. This API is ideal for:\n\n-   Framework developers building their own agent systems\n-   Applications with existing tool execution mechanisms\n-   Developers who need fine-grained control over LLM interactions and tool execution\n\nWith the Auth API, Arcade handles all the complex authentication tasks (OAuth flow management, link creation, token storage, refresh cycles), while you retain complete control over how you interact with LLMs and execute tools.\n\n```python\nfrom arcadepy import Arcade\nfrom google.oauth2.credentials import Credentials\nfrom googleapiclient.discovery import build\n\nclient = Arcade()\n\n# Get this user UNIQUE ID from a trusted source,\n# like your database or user management system\nuser_id = \"user@example.com\"\n\n# Start the authorization process\nresponse = client.auth.start(\n    user_id=user_id,\n    provider=\"google\",\n    scopes=[\"https://www.googleapis.com/auth/gmail.readonly\"],\n)\n\nif response.status != \"completed\":\n    print(\"Please complete the authorization challenge in your browser:\")\n    print(response.url)\n\n# Wait for the authorization to complete\nauth_response = client.auth.wait_for_completion(response)\n\n# Use the authorized token in your own tool execution logic\ntoken = auth_response.context.token\n\n# Example: Using the token with your own Gmail API implementation\ncredentials = Credentials(token=token)\ngmail_service = build('gmail', 'v1', credentials=credentials)\nemails = gmail_service.users().messages().list(userId='me').execute()\n```\n\n## Client Libraries\n\n-   **[ArcadeAI/arcade-py](https://github.com/ArcadeAI/arcade-py):**\n    The Python client for interacting with Arcade.\n\n-   **[ArcadeAI/arcade-js](https://github.com/ArcadeAI/arcade-js):**\n    The JavaScript client for interacting with Arcade.\n\n-   **[ArcadeAI/arcade-go](https://github.com/ArcadeAI/arcade-go):** (coming soon)\n    The Go client for interacting with Arcade.\n\n## Support and Community\n\n-   **Discord:** Join our [Discord community](https://discord.com/invite/GUZEMpEZ9p) for real-time support and discussions.\n-   **GitHub:** Contribute or report issues on the [Arcade GitHub repository](https://github.com/ArcadeAI/arcade-ai).\n-   **Documentation:** Find in-depth guides and API references at [Arcade Documentation](https://docs.arcade.dev).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcadeai%2Farcade-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farcadeai%2Farcade-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farcadeai%2Farcade-ai/lists"}