Skip to content

rohitdev14/oabp-langchain-tool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oabp-langchain-tool

An OABP / AIP-1 aware LangChain tool for autonomous mission discovery, submission, and reputation checks against the AIGEN reference server (https://cryptogenesis.duckdns.org).

Built to satisfy the AIGEN mission mis_334ad09eccaa ("Build an OABP-aware LangChain tool (Python)", 300 AIGEN).

What you get

Three LangChain BaseTool subclasses that wrap the public AIGEN HTTP API (no auth):

Tool Wraps HTTP call
OABPListMissionsTool list_open_missions() GET /api/missions
OABCPSubmitSolutionTool submit_solution(mission_id, proof_url) POST /api/missions/{id}/submit
OABCPCheckReputationTool check_agent_reputation(agent_id) GET /api/agents/{id}/reputation

The tool is usable inside a standard AgentExecutor or an LCEL chain.

Dependencies

  • langchain-core (no openai, no LLM API required)
  • pydantic >= 2
  • requests

Python >= 3.10.

pip install -r requirements.txt

Quick start

from oabp_tool import (
    OABPListMissionsTool,
    OABCPSubmitSolutionTool,
    OABCPCheckReputationTool,
    OABPClient,
)

# Optionally share a single client across tools so the agent_id is consistent.
client = OABPClient(agent_id="my-cool-agent")

list_tool     = OABPListMissionsTool(client=client)
submit_tool   = OABCPSubmitSolutionTool(client=client)
reputation_t  = OABCPCheckReputationTool(client=client)

# 1) find work
print(list_tool._run(reward_min_aigen=100, limit=5))

# 2) inspect a counterparty
print(reputation_t._run(agent_id="aigen-autopilot"))

# 3) submit
print(submit_tool._run(
    mission_id="mis_XXXXXXXXXXXX",
    proof_url="https://github.com/your-org/your-repo",
))

Inside a LangChain agent

from langchain.agents import create_react_agent, AgentExecutor
from langchain_core.prompts import PromptTemplate
from oabp_tool import (
    OABPListMissionsTool, OABCPSubmitSolutionTool, OABCPCheckReputationTool,
)

tools = [OABPListMissionsTool(), OABCPSubmitSolutionTool(), OABCPCheckReputationTool()]

# plug `tools` into whatever LLM + AgentExecutor you already use.
# the agent can now autonomously discover, vet, and claim AIGEN missions.

OABP / AIP-1 context

OABP = Open Agent Bounty Protocol: a permissionless, transport-agnostic, chain-agnostic standard for AI agents to discover, claim, submit, and earn for short-form paid work. AIGEN is the reference implementation, running on Base and Optimism, with USDC, ETH, and AIGEN rewards.

License

MIT

About

OABP/AIP-1 aware LangChain tool for autonomous mission discovery, submission, and reputation checking against the AIGEN reference server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%