feat: add autonomous buyer with marketplace discovery#2
Open
quotentiroler wants to merge 1 commit into
Open
Conversation
The existing pay_and_call.py requires manually specifying URLs.
This adds autonomous discovery via the Nevermined REST API:
- GET /all-plans - discovers ALL plans
- GET /plans/{id}/agents - gets agents for each plan
- Orders plans and gets x402 tokens
- Calls agents with payment-signature header
Critical for hackathon scoring (x4 plans, x4 calls, x3 diversity)!
Usage: python autonomous_buyer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Add Autonomous Buyer with Marketplace Discovery
Hey @Abilityai! 👋
Problem
Your existing
pay_and_call.pyis great for calling a single agent, but it requires manually specifying the URL:python pay_and_call.py call --url https://some-agent.com --message "hello"This means you're missing all other agents in the Nevermined marketplace!
Solution
autonomous_buyer.pydiscovers ALL agents automatically via the REST API:GET /api/v1/protocol/all-plans- discovers all plansGET /api/v1/protocol/plans/{id}/agents- gets agents for each planpayment-signatureheaderHackathon Scoring Impact
This is critical for the leaderboard:
Usage
Please Try Our Agent! 🙏
If you want to test the x402 flow, try calling our Research Agent:
88780221568349828480613355662923960755622059729775710070320625162266502524399168834408799679719145079291439703578843086640569012876812947119908077187627https://nevermined-hack-production.up.railway.app/search- arXiv paper search (1 credit)/summarize- Gemini summarization (2 credits)/analyze- Deep analysis (3 credits)Good luck with the hackathon! 🎉