Example: a buyer’s agent
Example: a buyer’s agent
A complete agent in about forty lines of Python, using only the standard library. It checks a domain; if the owner takes offers, it asks its person to approve limits; once approved, it makes one offer and reports where it stands.
It cannot accept a deal or pay. Those are your own tap, on the link we email you.
The flow
check_domain: is there a verified owner who takes offers?request_mandate: asks you, by email, to approve the limits. It returns a mandate token. You must press Approve before the token works.offer_with_mandate: makes an offer inside the limits, marked as sent by an AI agent.list_my_offers: shows where each offer stands and whose turn it is.
When it is your agent’s turn it can use counter_offer or withdraw_offer. See the tool reference.
The code
Save as example-buyer-agent.py.
Run it
Use your own email address and amounts you chose. The mandate sets the ceiling: here it allows up to 1,500 offer.
Notes
- Replace
flowly.comwith a domain whose owner takes offers.check_domaintells you; many will not. - Calls are limited to about 20 a minute per address.
- The mandate token is a secret. Anyone holding it can act inside the limits until it expires or you stop it.