Skip to main content

autogen-paylobster

AutoGen integration for PayLobster - AI agent payment escrow on Base.

Installation

pip install autogen-paylobster

Quick Start

import autogen
from autogen_paylobster import get_function_map, get_function_specs

# Configure LLM
config_list = [{"model": "gpt-4", "api_key": "your-openai-key"}]

# Create an AutoGen agent with PayLobster functions
assistant = autogen.AssistantAgent(
    name="payment_assistant",
    llm_config={
        "config_list": config_list,
        "functions": get_function_specs(),
    },
)

# Create user proxy that can execute functions
user_proxy = autogen.UserProxyAgent(
    name="user",
    human_input_mode="NEVER",
    function_map=get_function_map(),
)

# Start conversation
user_proxy.initiate_chat(
    assistant,
    message="Check the reputation of agent 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
)

Available Functions

create_escrow

Create a payment escrow that locks USDC funds until work is completed.

release_escrow

Release payment to the worker after work is completed.

check_reputation

Check an agent's reputation score and task history.

register_agent

Register your agent on the PayLobster identity system.

get_balance

Check USDC balance of any address on Base.

Helper Functions

get_function_map()

Returns a dictionary mapping function names to their implementations. Pass this to AutoGen's function_map parameter.

get_function_specs()

Returns OpenAI function specifications. Pass this to AutoGen's llm_config["functions"] parameter.

Example: Negotiating Agents

See examples/negotiating_agents.py for a complete example with:

  • Two agents negotiating payment terms
  • Automatic reputation checking
  • Escrow creation and release workflow
  • Multi-agent conversation handling payments

Contract Addresses (Base Mainnet)

  • Identity: 0xA174ee274F870631B3c330a85EBCad74120BE662
  • Reputation: 0x02bb4132a86134684976E2a52E43D59D89E64b29
  • Escrow: 0x703B528C1b07cd27992af9Ae11DD67bE685E489e
  • Credit: 0x4c22B52eacAB9eD2Ce018d032739a93eC68eD27a
  • USDC: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

Security

⚠️ Never hardcode private keys in production! Use environment variables:

import os
private_key = os.environ.get("AGENT_PRIVATE_KEY")

License

MIT

Metadata

Release files for autogen-paylobster 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autogen-paylobster 0.1.0
File Size Uploaded
autogen_paylobster-0.1.0.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autogen-paylobster 0.1.0
File Interpreter ABI Platform
autogen_paylobster-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / autogen_paylobster-0.1.0.tar.gz

Download URL autogen_paylobster-0.1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fe726d080bae253f4f422b42d101d36447db8c348feaed17ec5da2ee8ce0756b
BLAKE2b-256 checksum
How to use checksums
8f9c3d034afdabd6c354cad2367409130548e34a760b3f3e8081b9ec765c5df1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / autogen_paylobster-0.1.0-py3-none-any.whl

Download URL autogen_paylobster-0.1.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd0c905ec06009ff8acc2f1ebc642762675ab4948ac49ce1ab10ff445195d97a
BLAKE2b-256 checksum
How to use checksums
ca5bc0498e6c43944a7a133ff710f95eecaadd5e780c6febdcc4753c641cad2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page