Skip to main content

CrewAI tools for iwant.fyi -- reference implementation of the iwant.fyi demand-side protocol v1.0. Lets any CrewAI agent express structured purchase intent and receive matched supply.

Project description

iwantfyi-crewai

CrewAI tools for iwant.fyi — the reference implementation of the iwant.fyi demand-side protocol v1.0.

iwant.fyi demand-side protocol is an open standard for how AI agents express structured purchase intent on behalf of users, receive matched supply across multiple sources, and report outcomes back. This package wraps iwant.fyi as a set of CrewAI BaseTool subclasses that any CrewAI agent or crew can use.

Install

pip install iwantfyi-crewai

Quick start

from iwantfyi_crewai import get_iwantfyi_crewai_tools
from crewai import Agent, Crew, Task

tools = get_iwantfyi_crewai_tools(api_key="iwant_ak_...")  # get one at https://iwant.fyi

shopper = Agent(
    role="Personal Shopping Assistant",
    goal="Find products matching the user's needs across multiple sources.",
    backstory="You have access to iwant.fyi which searches multiple merchants in one call.",
    tools=tools,
)

task = Task(
    description="Find me a 1/4-inch drive torque wrench under $150 in Brooklyn",
    agent=shopper,
    expected_output="Top 3 matches with prices and source merchants.",
)

crew = Crew(agents=[shopper], tasks=[task])
result = crew.kickoff()

What you get

Seven CrewAI BaseTool subclasses, one per iwant.fyi demand-side protocol v1.0 §8 tool:

Tool Spec Description
demand_create_want §8.1 Create a Want and run matching
demand_search §8.1 Ephemeral matching, no persistence
demand_get_want §8.1 Retrieve a Want by ID
demand_record_outcome §8.1 Report viewed/clicked/purchased outcome
demand_list_verticals §8.2 Discover supported verticals
demand_list_constraints §8.2 Discover constraint vocabulary
demand_health §8.2 Liveness + readiness

Each tool uses a Pydantic v2 args schema; CrewAI will validate user inputs before invoking the underlying iwant.fyi API.

Direct client (no CrewAI)

from iwantfyi_crewai import IwantClient

with IwantClient(api_key="iwant_ak_...") as client:
    health = client.health()
    print(health["status"])

    response = client.create_want(
        title='Torque wrench, 1/4" drive, 25-100 ft-lb',
        price_cents=15000,
        vertical="tools",
    )
    print(f"Want {response['want']['id']} -> {response['matches']['match_count']} matches")

Picking individual tools

If you only need a subset:

from iwantfyi_crewai import CreateWantTool, RecordOutcomeTool, IwantClient

client = IwantClient(api_key="iwant_ak_...")
agent = Agent(
    role="...",
    goal="...",
    tools=[CreateWantTool(client=client), RecordOutcomeTool(client=client)],
)

Transports

MCP over HTTP is the default. The REST fallback (§9 of the spec) is available:

tools = get_iwantfyi_crewai_tools(api_key="...", transport="http")

Outcome events

Outcome events feed match-quality learning and (eventually) revenue-share attribution:

client.record_outcome(want_id=w_id, match_id=m_id, event="clicked")
client.record_outcome(want_id=w_id, match_id=m_id, event="purchased", value_cents=12500)

Idempotent server-side; replays are no-ops.

Errors

Typed exceptions from iwantfyi_crewai.errors:

from iwantfyi_crewai import IwantError, UnauthorizedError, ValidationError, RateLimitedError

Specification

Full iwant.fyi demand-side protocol v1.0 spec: iwant.fyi/protocol/v1

The protocol is open (Apache 2.0). iwant.fyi is the reference implementation; anyone may build their own.

License

Apache 2.0

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

iwantfyi_crewai-0.1.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

iwantfyi_crewai-0.1.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file iwantfyi_crewai-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for iwantfyi_crewai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3491d79fc760db7e982f5175a9b7c3dc90ddc1d8eb89579a7c82def3efbc0bb2
MD5 238bfdaba70a4d994a9058f191d09e1a
BLAKE2b-256 6e33b413173cbc249a99643259caa646c7fd83daf06293a96af61cc731f1fe52

See more details on using hashes here.

File details

Details for the file iwantfyi_crewai-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for iwantfyi_crewai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c86ae6942a6beb09575b74f3ca951279dda01a9452e35b01e214cc2b403e5501
MD5 71c6221eb0fc8a2f1fedd2ec4447f2ad
BLAKE2b-256 737a730b05f50c213a4c60129831d0ea440248ecde4820737b91b06329f582a3

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