Human-in-the-loop for CrewAI: a BaseTool that asks a real human on their phone and blocks on a fail-closed answer, instead of the console human_input prompt.
Project description
pushary-crewai
Human-in-the-loop for CrewAI. Replace the console
human_input=True prompt with a tool that reaches a real person on their phone and
blocks until they answer, fail-closed.
Requires the Pushary Partner plan.
Install
pip install pushary-crewai
Set PUSHARY_API_KEY (get it in your dashboard).
Connect a phone once
from pushary_crewai import connect
link = connect("user_123") # show this to your end-user; one tap connects their phone
Give an agent an ask-human tool
from crewai import Agent, Task, Crew
from pushary_crewai import make_ask_human_tool
agent = Agent(
role="Ops",
goal="Ship safely",
backstory="Careful operator.",
tools=[make_ask_human_tool("user_123")],
)
task = Task(
description="Draft the release. Before finalizing, call ask_human to get approval.",
expected_output="approved release notes",
agent=agent,
)
Crew(agents=[agent], tasks=[task]).kickoff()
The tool blocks until the person answers and returns a fail-closed instruction. The
external_id is bound when you build the tool, never taken from the model, so a
prompt-injected agent cannot ask the wrong person.
Lower-level helpers
from pushary_crewai import ask_human
d = ask_human("Approve this refund?", external_id="user_123", type="confirm")
if d["approved"]:
issue_refund()
API
connect(external_id, *, api_key=None, base_url=None)— enroll an end-user's phone.make_ask_human_tool(external_id, *, name=..., ...)— a CrewAIBaseToolbound to that user.ask_human(question, *, external_id, type="confirm", ...)— blocking, returns the decision dict.resolve_pushary_callback(raw_body, signature, secret)— verify + parse a callback for a durable path.describe_answer(type, result),is_affirmative(answer),deterministic_key(parts),SIGNATURE_HEADER.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pushary_crewai-0.1.0.tar.gz.
File metadata
- Download URL: pushary_crewai-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a819354d34d8ec8c3480f1c613ba3639462d4fc8b069b96c1d1a79aa0bac5f26
|
|
| MD5 |
bd680fe10e15c892be5b59fa348f68ea
|
|
| BLAKE2b-256 |
d120c6de9c9a87aecbeb7e7f15a4ffc99053f9fec9cc8b19a9190bde882aa1d4
|
File details
Details for the file pushary_crewai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pushary_crewai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2930f80882a151850aee88df7d966309fa32f189ebb55f23c399238ba81414c7
|
|
| MD5 |
5a398fdc9c0902aeb740257ee5b02381
|
|
| BLAKE2b-256 |
c4858203854386c2929635d0ffe323615cdbe8b463e97ac5c6822999bad9a2e9
|