Skip to content

Repository files navigation

LangChain + CapSolver Agent examples

Demo repository CI License: ISC

Runnable LangChain and LangGraph examples using the official capsolver-agent library.

This repository contains examples only. There is no separate langchain-capsolver Python package or release lifecycle.

Repository scope

The CapSolver Agent library already provides LangChain BaseTool implementations with typed inputs and async execution. This repository shows how to pass those tools to a LangChain agent; solving, errors, retries, and browser behavior remain in the shared CapSolver libraries.

Quick start

Requirements: Python 3.10+, a CapSolver API key, and an OpenAI API key for the sample model.

git clone https://github.com/capsolver-ai/langchain-capsolver.git
cd langchain-capsolver
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

Export the variables shown in .env.example, then run:

python examples/quickstart.py

Key integration code

from capsolver_agent.langchain_tools import get_langchain_tools
from langchain.agents import create_agent

agent = create_agent(
    model="openai:gpt-4.1-mini",
    tools=get_langchain_tools(),
    system_prompt="Use CapSolver only for authorized workflows.",
)

See examples/quickstart.py for a complete invocation.

What the shared library provides

  • Typed SolveCaptchaTool, DetectCaptchasTool, and SolveOnPageTool classes.
  • Balance and capability tools.
  • Consistent structured results from the same executor used by other frameworks.
  • Optional browser-mode support through the shared SDK.

Project layout

examples/quickstart.py   LangChain agent using CapSolver tools
requirements.txt         Shared SDK repositories plus LangChain
tests/test_demo.py        Offline syntax and repository-scope checks
.github/workflows/ci.yml  Demo validation

Documentation

Responsible use

Use CapSolver only in lawful, user-authorized, terms-compliant automation. Never commit API keys, cookies, tokens, proxy credentials, or private target data.

Contributing and support

See CONTRIBUTING.md, SUPPORT.md, and SECURITY.md.

License and attribution

Licensed under the ISC License. LangChain and LangGraph are third-party projects. This repository is maintained by CapSolver and is not affiliated with or endorsed by LangChain.

About

Runnable LangChain and LangGraph examples using the CapSolver Agent library.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages