Skip to main content

When your AI needs a human, just ping one.

Project description

🏓 HumanPing

When your AI needs a human, just ping one.

PyPI Python Tests License Discord

The Python SDK for HumanPing — the marketplace where AI agents hire humans.
Your agent's bridge to the real world. Verify, call, feel, explore.


What is HumanPing?

HumanPing is a platform where AI agents pay real humans to do things they can't do themselves. Think of it as the escape hatch from the digital world to the physical one.

Your agent can't make a phone call. Can't walk into a restaurant. Can't feel the vibe of a room. Can't provide genuine empathy.

Humans can. And now your agent can hire them with 3 lines of code.

Install

pip install humanping

Quick Start

from humanping import HumanPing

hp = HumanPing(api_key="hp_...")

# Ask a human to verify something in the real world
result = hp.verify("Is this restaurant still open?", location="123 Main St", budget=5.00)
print(result.answer)  # "Yes, open until 10 PM. The patio is packed."

That's it. Your agent asked, a human answered.

What Can Your Agent Do?

🔍 Verify — Reality Check

Ask a human to verify your agent's work or check something in the real world.

# Verify a business
result = hp.verify("Is this coffee shop still in business?", location="456 Oak Ave", budget=5.00)

# Sanity-check your agent's output
result = hp.reality_check(
    what="I drafted this email to the client",
    context=email_draft,
    question="Tone, professionalism, errors?",
    budget=3.00,
)

📞 Call — Voice Proxy

Have a human make a phone call on your agent's behalf.

result = hp.call(
    number="+1-514-555-1234",
    script="Reserve a table for 2, Friday 7 PM",
    fallback_instructions="If unavailable, try Saturday",
    budget=8.00,
)
print(result.transcript)

🎭 Gut Check — Human Intuition

Get the kind of judgment only humans have. Not analysis — feeling.

result = hp.gut_check(
    content="Check out this Tinder profile bio...",
    question="Does this person seem trustworthy?",
    scale="1-10",
    budget=2.00,
)
print(f"Trust score: {result.score}/10")
print(f"Why: {result.answer}")

🌍 Field Mission — Eyes on the Ground

Send a human to be your agent's eyes and legs in the physical world.

result = hp.field(
    location="123 Rue St-Paul, Montreal",
    objective="Photograph the menu and confirm they're open",
    budget=10.00,
)
for proof in result.proofs:
    print(f"{proof.type}: {proof.url}")

💛 Empathy Escalation — Know Your Limits

When your agent recognizes it's not enough, hand off to a real human.

result = hp.escalate(
    context=conversation_history,
    reason="User is grieving, needs real human support",
    handoff="warm",
    budget=20.00,
)

🔮 Vibe Read — Feel the Room

Send a human to read the vibe of an event, space, or community.

result = hp.vibe(
    target="Bitcoin Twitter Spaces",
    duration="15m",
    budget=15.00,
)
print(result.answer)
# "Mood: cautiously optimistic. The main host is bullish..."

Async Support

Every method has an async counterpart. Use async with for connection pooling:

async with HumanPing(api_key="hp_...") as hp:
    task = await hp.async_task(
        description="Check this venue",
        type="field_mission",
        budget=10.00,
    )
    result = await task.async_wait()
    print(result.answer)

Or use the sugar methods directly:

result = await hp.async_verify("Is this place open?", location="...", budget=5.00)
result = await hp.async_call(number="+1-514-555-1234", script="Reserve table for 2")
result = await hp.async_gut_check("Does this email seem legit?")

Generic Task API

All sugar methods are built on hp.task() — use it for full control:

task = hp.task(
    description="Verify this business exists at 123 Main St",
    type="verification",
    budget=5.00,
    deadline="30m",
    urgency="urgent",
    proof=["photo", "gps"],
    location="123 Main St, Montreal",
    webhook_url="https://mybot.com/callback",
    prefer_partner="worker_abc123",
    metadata={"source": "my-agent", "priority": "high"},
)

# Non-blocking: check back later
print(task.id, task.status)

# Blocking: wait for result
result = task.wait(timeout="30m")

# Or poll manually
task.refresh()
if task.status == "completed":
    print(task.result.answer)

Webhooks

Don't want to poll? Get a POST when the task completes:

task = hp.task(
    description="Verify this address",
    type="verification",
    budget=5.00,
    webhook_url="https://mybot.com/humanping/callback",
)
# Your webhook receives the full TaskResult as JSON

Partner Network

Build relationships with your best humans. They learn your agent's style.

# List your partners
partners = hp.partners.list()
for p in partners:
    print(f"{p.display_name} — Trust: {p.trust_score}, Missions: {p.missions_completed}")

# Route tasks to preferred partners
task = hp.task(
    description="Important verification",
    type="verification",
    budget=10.00,
    prefer_partner="worker_abc123",
)

# Save a great worker as a partner
hp.partners.save("worker_abc123", notes="Fast and thorough in Montreal")

Wallet

Manage your agent's funds:

# Check balance
balance = hp.wallet.balance()
print(f"Available: ${balance.available:.2f}")
print(f"In escrow: ${balance.pending:.2f}")

# Add funds
hp.wallet.deposit(amount=100.00)

# View transactions
for tx in hp.wallet.transactions(limit=10):
    print(f"{tx.type}: ${tx.amount:+.2f}{tx.description}")

LangChain Integration

Use HumanPing as a tool in your LangChain agent:

from langchain.tools import StructuredTool
from humanping import HumanPing

hp = HumanPing(api_key="hp_...")

def human_verify(question: str, location: str = None, budget: float = 5.0) -> str:
    result = hp.verify(question, location=location, budget=budget)
    return f"Human says: {result.answer}"

tool = StructuredTool.from_function(
    func=human_verify,
    name="human_verify",
    description="Ask a real human to verify something in the physical world.",
)

# Add to your agent's toolkit
agent = create_openai_tools_agent(llm, [tool, ...], prompt)

See examples/langchain_tool.py for the full integration.

Error Handling

Clean exceptions for every failure mode:

from humanping import HumanPing
from humanping.exceptions import (
    AuthenticationError,
    InsufficientFundsError,
    TaskTimeoutError,
    RateLimitError,
)

hp = HumanPing(api_key="hp_...")

try:
    result = hp.verify("Check this place", budget=5.00)
except AuthenticationError:
    print("Bad API key")
except InsufficientFundsError as e:
    print(f"Need ${e.required:.2f}, have ${e.available:.2f}")
except TaskTimeoutError:
    print("No human picked this up in time")
except RateLimitError as e:
    print(f"Slow down! Retry in {e.retry_after}s")

Configuration

# From environment variable
import os
os.environ["HUMANPING_API_KEY"] = "hp_..."
hp = HumanPing()  # Picks up the env var

# Custom base URL (for testing)
hp = HumanPing(api_key="hp_...", base_url="http://localhost:8000/v1")

# Custom timeout
hp = HumanPing(api_key="hp_...", timeout=60.0)

API Reference

Method What it does Default budget
hp.task() Create any task (generic)
hp.verify() Verify something IRL $5
hp.call() Make a phone call $8
hp.gut_check() Get human intuition $2
hp.field() Field mission (go somewhere) $10
hp.escalate() Empathy handoff $15
hp.vibe() Read the vibe $15
hp.reality_check() Verify agent's work $3

Every method has an async_ counterpart (e.g., hp.async_verify()).

Examples

See the examples/ directory for complete, runnable examples:

Philosophy

You taught AI to use tools. Now teach it to ask for help.

The best agents aren't the ones that do everything alone. They're the ones that know when to ask a human. HumanPing is the bridge.

License

MIT — Build whatever you want.


humanping.ai · Docs · Discord · Twitter

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

humanping-0.2.0.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

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

humanping-0.2.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file humanping-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for humanping-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2538b1a76bc4e3f29dadfcbc5de084a9f45226516523ed204f282c34ba548a76
MD5 f9b7b4c9be8fe84ab6e1d5b5e38e1ec3
BLAKE2b-256 0d5ce243aee31d6567fb9478b66b0e11d84960347db00303ab5743a1f690698f

See more details on using hashes here.

File details

Details for the file humanping-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: humanping-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for humanping-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6632c0d8e866411853d97826eb39d269c7d7e5824eb3a79ec512dbb58eea9b0e
MD5 35b9fdc576585db5c9475aaed224c4f1
BLAKE2b-256 77b0daf66a3e0cda916a60558932ea3ab0667d6ccf1df30f1695c9921c934cde

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