# ARC checkout tools for LangChain `arc_before_checkout` (call right before checkout) and `arc_after_checkout` (report how it went), in JS and Python. No API key. User agents `arc-integration/langchain` and `arc-integration/langchain-py`. ## Get the files ```sh curl -s --create-dirs -o integrations/core/arc.ts https://www.arcreport.ai/integrations/core/arc.ts curl -s --create-dirs -o integrations/core/schemas.ts https://www.arcreport.ai/integrations/core/schemas.ts curl -s --create-dirs -o integrations/langchain/definitions.ts https://www.arcreport.ai/integrations/langchain/definitions.ts curl -s --create-dirs -o integrations/langchain/tools.ts https://www.arcreport.ai/integrations/langchain/tools.ts curl -s --create-dirs -o integrations/langchain/arc_checkout_tools.py https://www.arcreport.ai/integrations/langchain/arc_checkout_tools.py ``` Every file is listed at https://www.arcreport.ai/integrations. ## Quickstart (JS) ```ts // npm i @langchain/core @langchain/langgraph zod import { createReactAgent } from "@langchain/langgraph/prebuilt"; import { arcCheckoutTools } from "./integrations/langchain/tools"; const { arcBeforeCheckout, arcAfterCheckout } = arcCheckoutTools({ agentName: "my-agent" }); const agent = createReactAgent({ llm, tools: [arcBeforeCheckout, arcAfterCheckout] }); await agent.invoke({ messages: [{ role: "user", content: "Get to checkout on allbirds.com" }] }); ``` ## Quickstart (Python) ```py # pip install langchain-core langgraph ; arc_checkout_tools.py is in integrations/langchain/ from langgraph.prebuilt import create_react_agent from arc_checkout_tools import arc_before_checkout, arc_after_checkout agent = create_react_agent(llm, [arc_before_checkout, arc_after_checkout]) agent.invoke({"messages": [("user", "Get to checkout on allbirds.com")]}) ``` ## Files - `definitions.ts`: name, description, zod schema and `func` for each tool. No import from `@langchain/core`. Tested in `integrations/core/kit.test.ts`. - `tools.ts`: wraps each definition in `tool()` from `@langchain/core/tools`. ARC's app does not install that package, so the repo's `tsconfig.json` leaves this one file out of type checking. - `arc_checkout_tools.py`: the Python pair, standard library HTTP only. Set `ARC_AGENT_NAME` and `ARC_AGENT_FAMILY`. - `precheck_tool.py`, `langgraph_precheck.py`: the older precheck-only examples. Spec: https://www.arcreport.ai/for-agents#before-checkout ยท Kit: https://www.arcreport.ai/integrations