Repository navigation
Conversation
|
👀 We've notified the reward creators here. |
This branch has not been deployed
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.
/claim #2
Adds
examples/crewai-prepay-check/: a CrewAI agent with one tool,prepay_check, that reads an x402 endpoint's 402 before anything pays it.What it does
tool.py:check_url()plusPrePayCheckTool(a CrewAIBaseToolwith a pydanticargs_schema). It runsnpx -y @agent402-dev/pay-server check <url> --jsonfrom a neutral working directory (otherwise npx resolves a local package of the same name, as this repository has) and returns the CLI's JSON unchanged.npxis missing or prints no JSON.main.py: agent and task, model fromMODEL(defaultgpt-4o-mini). The agent has no payment tool. Instructions: never pay whenfixes > 0or when the check failed. Tracing is off (CREWAI_TRACING_ENABLED=false), so a run sends only the one check request.broken_402_server.py: a small local server that answers 402 withoutPAYMENT-REQUIRED, for the "will not pay" case.requirements.txtpinscrewai==1.15.50.README.mdcovers install, run, what the tool returns, and that nothing is paid.Verified by running it
prepay_checkagainst the live routehttps://agent402-check402.agent402-ebc.workers.dev/x402/check402?url=https%3A%2F%2Fexample.com:fixes: 0, price0.01 USDC.prepay_checkagainstbroken_402_server.py:fixes: 1,header_missing("HTTP 402 without a PAYMENT-REQUIRED header").python main.pyon both: live answerPrice: 0.01 USDC,Pay: yes,fixes=0; broken answerPrice: unknown,Pay: no, with the fix named.python -m py_compileon all three Python files. No repository tests were run: none cover Python and no TypeScript changed.Nothing was signed or paid; no wallet, key or RPC was used.
Fixes #2