Metadata-Version: 2.5
Name: eqbuilder
Version: 0.1.7
Summary: Score your AI agent's replies for human-likeness before sending — free trial, then pay-per-score via x402 (USDC on Base, no account, no API key). Includes LangChain and CrewAI tools.
Project-URL: Homepage, https://eqbuilder.dev
Project-URL: Documentation, https://eqbuilder.dev/integrate
Author-email: EqBuilder <jaymarrero2@gmail.com>
License: MIT
Keywords: ai-agents,crewai,eq,human-likeness,langchain,scoring,x402
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Requires-Dist: requests>=2.28
Provides-Extra: all
Requires-Dist: crewai>=0.28; extra == 'all'
Requires-Dist: eth-account>=0.10; extra == 'all'
Requires-Dist: langchain-core>=0.2; extra == 'all'
Provides-Extra: crewai
Requires-Dist: crewai>=0.28; extra == 'crewai'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.2; extra == 'langchain'
Provides-Extra: payments
Requires-Dist: eth-account>=0.10; extra == 'payments'
Description-Content-Type: text/markdown

# eqbuilder

Score your AI agent's replies for **human-likeness** before sending — and check they **stick to your approved facts**. No account, no API key. Get 3 lifetime free scores per caller with strict `data_consent=True`. Free score text and its result may be retained under a one-way pseudonymous caller key for calibration, so never submit secrets or sensitive personal data. Follow-up contact and wishlist feedback are optional and separate. Then score through `POST /api/simulate` with Base USDC via [x402](https://eqbuilder.dev): the buyer wallet needs USDC only, **no ETH**.

```python
# pip install eqbuilder
from eqbuilder import EqBuilder

eq = EqBuilder(data_consent=True)
result = eq.free_score(
    "Sounds good — I'll double-check the invoice and get back to you.",
    delay_seconds=4.2,
    profile="analytical_executive",
)
print(result["eq_score_percentage"], result.get("suggested_prompt_addition"))
```

> **Free trial note:** Every free score requires `data_consent=True`.
> `EqBuilder` defaults to `data_consent=False`; opt in explicitly at construction
> or on an individual `free_score(..., data_consent=True)` call. A false or
> non-boolean value is rejected before a free round is consumed.
> All three free scores follow the same path. Optional product feedback can be
> sent separately with `eq.wishlist("...")`.

## Set and forget (one standing call)

```python
# pip install "eqbuilder[payments]"
eq = EqBuilder(wallet_key="0x<private key of a wallet holding USDC on Base>")
result = eq.auto_score(
    "Sounds good — I'll double-check the invoice and get back to you.",
    delay_seconds=4.2,
    profile="analytical_executive",
)
print(result["paid"])  # False while free scores last, True once it graduates to x402
```

`auto_score` needs only explicit free-data consent plus an authorized wallet. It uses
your free trial while it lasts, then transparently retries the same
input through the paid x402 path on `429 free_trial_exhausted`. Without a `wallet_key`
it raises `PaymentRequired` with one machine-readable developer handoff containing the
live quote path, Base USDC funding requirement, and card alternative. Free and paid results have slightly
different shapes; the added `"paid"` key tells you which path ran. If a **paid** call
times out, the SDK does not automatically replay the paid authorization. Preserve the
original error/receipt and check payment status or contact the operator before creating
a fresh authorization.

If you decline free-trial retention (`data_consent=False`), call `score()` directly
for a paid evaluation; paid scoring does not silently inherit the free consent.

## LangChain (one line)

```python
# pip install "eqbuilder[langchain]"
from eqbuilder.langchain_tool import get_langchain_tools

tools = get_langchain_tools(data_consent=True)  # add wallet_key="0x..." for paid fallback
```

## CrewAI

```python
# pip install "eqbuilder[crewai]"
from eqbuilder.crewai_tool import HumanLikenessScoreTool

agent = Agent(role="support", tools=[HumanLikenessScoreTool()], ...)
# The tool schema requires data_consent=true for a free call.
```

Everything at once: `pip install "eqbuilder[all]"` (payments + LangChain + CrewAI).

## Paid scoring (after the 3 free scores)

```python
# pip install "eqbuilder[payments]"
eq = EqBuilder(wallet_key="0x<private key of a wallet holding USDC on Base>")
result = eq.score("...", delay_seconds=4.2, profile="analytical_executive")
deep   = eq.score("...", delay_seconds=4.2, profile="analytical_executive", tier="deep")
```

Payment is canonical x402 v2: `score()` calls `POST /api/simulate`, reads its
live HTTP 402 quote, chooses Base USDC, signs a gasless EIP-3009 transfer
authorization, and retries once with `PAYMENT-SIGNATURE`. The success response
contains the result and a `PAYMENT-RESPONSE` settlement receipt. The live quote
is authoritative for amount and terms; do not hardcode an approximate price.
SOL and `X-PAYMENT` remain compatibility paths, not this SDK quickstart.

Paid text does **not** enter the free consented corpus. Its
`share_for_calibration` option is a separate opt-in; when true, eligible
high-scoring text may be retained for manual operator calibration review.

## Privacy-safe corpus evidence

```python
evidence = eq.corpus_evidence()  # aggregate counts only; no raw text or identities
```

The stable public evidence endpoint is
`https://eqbuilder.dev/api/corpus/evidence` (crawler alias:
`https://eqbuilder.dev/.well-known/corpus-evidence.json`). It reports thresholded
aggregate corpus and improvement evidence, not raw submissions or guaranteed
model improvement.

## Script adherence (paid)

```python
check = eq.script_check(
    reply_text="The plan is $49/mo, see example.com/pricing",
    approved_facts=["Plan price is $29/mo", "Docs: https://docs.example.com"],
)
# flags the invented $49 price and the off-script URL
```

## Improvement loop

```python
def rewrite(text, suggestion):
    return my_llm(f"Rewrite this reply. {suggestion}\n\n{text}")

final = eq.improve(
    "...",
    4.2,
    "analytical_executive",
    rewrite,
    max_rounds=3,
    data_consent=True,  # required when using the free improvement loop
)
```

- 28 personality profiles: `eq.profiles()`
- Pricing: `eq.pricing()`
- Full API & MCP endpoint: https://eqbuilder.dev/integrate
