Skip to main content

AutoGen integration for PayLobster - AI agent payment escrow on Base

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autogen_paylobster-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autogen_paylobster-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file autogen_paylobster-0.1.0.tar.gz.

File metadata

  • Download URL: autogen_paylobster-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for autogen_paylobster-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe726d080bae253f4f422b42d101d36447db8c348feaed17ec5da2ee8ce0756b
MD5 3701994dcbcda5a324d648df4bf1d9e8
BLAKE2b-256 8f9c3d034afdabd6c354cad2367409130548e34a760b3f3e8081b9ec765c5df1

See more details on using hashes here.

File details

Details for the file autogen_paylobster-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autogen_paylobster-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd0c905ec06009ff8acc2f1ebc642762675ab4948ac49ce1ab10ff445195d97a
MD5 f092ced8dec2fe72dcbe86b6c5e8949a
BLAKE2b-256 ca5bc0498e6c43944a7a133ff710f95eecaadd5e780c6febdcc4753c641cad2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page