Skip to main content

crewai-getabrain

CrewAI tools for GetABrain, an API that lets an agent ask verified people in the US a question and get structured answers back.

Two tools:

Tool Name the model sees What it does
GetABrainAskTool getabrain_ask_human Sends a question, waits up to max_wait_seconds for answers, returns them. If nobody has answered yet it returns status: "pending" and a query_id.
GetABrainGetAnswersTool getabrain_get_answers Reads the answers to an earlier question by query_id. Free and read-only.

People take minutes to hours to answer, so a pending result is normal. The question stays open and the second tool picks up the answers later.

Install

pip install -U crewai-getabrain

Credentials

Create an account and API key at https://www.getabrain.ai/requestor/signup (or see the quick start), then:

export GETABRAIN_API_KEY="gab_k_..."
export GETABRAIN_API_SECRET="gab_s_..."

Cost: with a live key, every answer is paid from your GetABrain balance. With a test-mode key (POST /api/v1/requestor/keys {"mode": "test"}), answers are simulated by an AI stand-in, never reach people, and come back marked "simulated": true with a notice. Build and test with a test-mode key first.

Use it directly

from crewai_getabrain import GetABrainAskTool, GetABrainGetAnswersTool

ask = GetABrainAskTool(max_wait_seconds=60)
print(ask.run(
    question="Which name is easier to remember?",
    query_type="multiple_choice",
    options=["Quillo", "Brightdesk"],
    num_responses=3,
))

The result is a JSON string:

{"query_id": "...", "status": "answered", "answers_received": 3, "answers_requested": 3,
 "answers": [{"selected_ids": ["2"], "selected_options": ["Brightdesk"]}, "..."],
 "test_mode": false}

Use it in a crew

from crewai import Agent, Crew, Task
from crewai_getabrain import GetABrainAskTool, GetABrainGetAnswersTool

checker = Agent(
    role="Product checker",
    goal="Settle judgment calls by asking real people instead of guessing",
    backstory="You call getabrain_ask_human when a decision needs human judgment.",
    tools=[GetABrainAskTool(), GetABrainGetAnswersTool()],
)
task = Task(
    description="Find out whether the headline 'Ship faster' is clear to a normal person.",
    expected_output="Yes or no, with what the person said.",
    agent=checker,
)
print(Crew(agents=[checker], tasks=[task]).kickoff())

A runnable version is in example.py.

Errors (missing keys, bad arguments, API errors) come back to the agent as a string starting with Error:.

Arguments the model fills

Argument Type Notes
question str Required.
query_type yes_no | multiple_choice | rating_scale | text Default yes_no. rating_scale is 1 to 5.
options list[str] Required for multiple_choice (2 or more).
context str Optional background shown to the person.
num_responses int How many different people answer. Default 1.

Settings you set in code

Setting Default Notes
max_wait_seconds 60 How long one call waits before returning pending.
poll_interval_seconds 5 Time between status checks.
max_responses 5 Upper limit on num_responses per call, a spend guard.
speed None relaxed / standard / fast / rush: higher pays people more per answer.
api_key, api_secret, base_url env vars GETABRAIN_API_KEY, GETABRAIN_API_SECRET, GETABRAIN_BASE_URL.
client None Pass a ready getabrain.GetABrain client instead.

Other query types (image comparison, ranking, A/B tests, video and audio review) are available through the getabrain Python SDK and the API docs.

Development

uv sync --group test
uv run pytest

Unit tests mock HTTP and make no network calls.

License

MIT

Metadata

Release files for crewai-getabrain 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 crewai-getabrain 0.1.0
File Size Uploaded Provenance Actions
crewai_getabrain-0.1.0.tar.gz 9.1 kB Without provenance Details for crewai_getabrain-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crewai-getabrain 0.1.0
File Interpreter ABI Platform Actions
crewai_getabrain-0.1.0-py3-none-any.whl Python 3 none any Details for crewai_getabrain-0.1.0-py3-none-any.whl

Total release size: 16.8 kB

Release files / crewai_getabrain-0.1.0.tar.gz

Download URL crewai_getabrain-0.1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7398c2c7da8851145f108919cc41787573569266ca9ece7afdc493be90605822
BLAKE2b-256 checksum
How to use checksums
777304dace9b7e711ab1d43db08364ca3ec6326d99bad91950827dcb3278f527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL crewai_getabrain-0.1.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9326b1ec83c50eef3deaa6fb12ca8e4779c99269ec9878113ddbf73faf9384f
BLAKE2b-256 checksum
How to use checksums
4e65afc75b5da5fe0d9ec4adc63cb1ce9be509b69bdad013bfc4f0b02e949f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for crewai-getabrain 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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