Artificial Intelligence

Coding implementation using ARCAD: Integrating Gemini developer API tools into langgraph proxy for automated AI workflows

Arcade transforms Langgraph proxy from a static dialogue interface to a dynamic, action-driven assistant by providing a wealth of ready-made tools, including web scratching and search, as well as dedicated APIs for finance, maps and more. In this tutorial, we will learn how to initialize ArcadetoolManager, get a single tool (such as Web.Scrapeurl) or the entire toolkit, and seamlessly integrate them into Google’s Gemini Developer API chat model via Langchain’s ChatGoogleGenerativeAi. With a few steps, we installed the dependencies, firmly loaded the API keys, retrieved and checked your tools, configured the Gemini model, and rotated the React-Style proxy with checkpoints. Throughout the process, Arcade’s intuitive Python interface keeps your code concise, and your focus has been on crafting powerful realistic workflows without the need for low-level HTTP calls or the manual parsing required.

!pip install langchain langchain-arcade langchain-google-genai langgraph

We integrate all the core libraries you need, including the core features of Langchain, arcade integration for obtaining and managing external tools, access to Gemini’s Google Genai Connector through API keys, and Langgraph’s orchestration framework so you can get up and run in one go.

from getpass import getpass
import os


if "GOOGLE_API_KEY" not in os.environ:
    os.environ["GOOGLE_API_KEY"] = getpass("Gemini API Key: ")


if "ARCADE_API_KEY" not in os.environ:
    os.environ["ARCADE_API_KEY"] = getpass("Arcade API Key: ")

We can safely prompt your Gemini and Arcade API keys without showing them on the screen. It sets them as environment variables, just asks if they are not defined yet so that your credentials are not outside of your notebook code.

from langchain_arcade import ArcadeToolManager


manager = ArcadeToolManager(api_key=os.environ["ARCADE_API_KEY"])
tools = manager.get_tools(tools=["Web.ScrapeUrl"], toolkits=["Google"])
print("Loaded tools:", [t.name for t in tools])

We initialize the ArcadetoolManager with your API keys and then get the Web.scrapeurl tool and the full Google Toolkit. It eventually prints out the name of the loaded tool, allowing you to confirm which features are now available to the proxy.

from langchain_google_genai import ChatGoogleGenerativeAI
from langgraph.checkpoint.memory import MemorySaver


model = ChatGoogleGenerativeAI(
    model="gemini-1.5-flash",  
    temperature=0,
    max_tokens=None,
    timeout=None,
    max_retries=2,
)


bound_model = model.bind_tools(tools)


memory = MemorySaver()

We initialize the Gemini Developer API CHAT model (Gemini-1.5-Flash) with a temperature of zero, bound in the arcade tool, so that the agent can call them during its inference, and set up MemorySaver to stick with the agent’s state checkpoint via CheckPoint via CheckPoint.

from langgraph.prebuilt import create_react_agent


graph = create_react_agent(
    model=bound_model,
    tools=tools,
    checkpointer=memory
)

We rotated a reactive langgraph proxy that combines your bound Gemini model, acquire arcade tools and storage cabinets, so that your proxy continues to overwrite calls through thinking, tool calls and reflections with state.

from langgraph.errors import NodeInterrupt


config = {
    "configurable": {
        "thread_id": "1",
        "user_id": "[email protected]"
    }
}
user_input = {
    "messages": [
        ("user", "List any new and important emails in my inbox.")
    ]
}


try:
    for chunk in graph.stream(user_input, config, stream_mode="values"):
        chunk["messages"][-1].pretty_print()
except NodeInterrupt as exc:
    print(f"n🔒 NodeInterrupt: {exc}")
    print("Please update your tool authorization or adjust your request, then re-run.")

We set up the configuration of your agent (thread ID and user ID) and user prompt, and then stream the React Agent response, printing every block fairly when it arrives. If the tool call hits Authorization Guard, it will capture the node interrupt and tell you to update your credentials or adjust the request before retrying.

In short, by centering the proxy architecture on the arcade, we can immediately access the plugin ecosystem of external functions that would otherwise take several days to build from scratch. The Bind_tools pattern combines Arcade’s toolset with Gemini’s natural language reasoning, while Langgraph’s React framework coordinates tool calls based on user queries. Whether you are crawling a website for real-time data, automating regular lookups or embedding domain-specific APIs, scales at an ambitious range, allowing you to swap new tools or toolkits as your usage evolves.


This is COLAB notebook. Also, don’t forget to follow us twitter And join us Telegram Channel and LinkedIn GrOUP. Don’t forget to join us 90K+ ml reddit.

🔥 [Register Now] Minicon Agesic AI Virtual Conference: Free Registration + Certificate of Attendance + 4-hour Short Event (May 21, 9am-1pm) + Hands-On the Workshop


Asif Razzaq is CEO of Marktechpost Media Inc. As a visionary entrepreneur and engineer, ASIF is committed to harnessing the potential of artificial intelligence to achieve social benefits. His recent effort is to launch Marktechpost, an artificial intelligence media platform that has an in-depth coverage of machine learning and deep learning news that can sound both technically, both through technical voices and be understood by a wide audience. The platform has over 2 million views per month, indicating its popularity among its audience.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button