LlamaIndex FunctionTool for x402 Service Discovery — find paid API services at runtime
Project description
llama-index-x402-discovery
A LlamaIndex FunctionTool that lets any LlamaIndex agent or query engine discover x402-payable API services at runtime via the x402 Service Discovery API. Returns quality-ranked results so your agent can find the best available endpoint without hardcoded URLs.
Install
pip install llama-index-x402-discovery
# or without PyPI:
pip install requests llama-index-core
# and copy x402discovery_llama/__init__.py into your project
Usage
from x402discovery_llama import X402DiscoveryTool
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
llm = OpenAI(model="gpt-4o-mini")
agent = ReActAgent.from_tools([X402DiscoveryTool], llm=llm, verbose=True)
response = agent.chat("Find a data enrichment service under $0.05 per call")
print(response)
The agent calls x402_discover and returns up to 5 quality-ranked services with endpoint URLs and pricing so it can choose the best one.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_x402_discovery-1.0.0.tar.gz.
File metadata
- Download URL: llama_index_x402_discovery-1.0.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dd141c9b984336d6e2d3c6e093249a79c638fe43ffb206605bf9a4f8df0b92e
|
|
| MD5 |
72b2e792ce53105f476edfe9b0fee647
|
|
| BLAKE2b-256 |
439d1694fc0fdf56995b46e99666abe6ada04709f1ea2679f7440c0e0c1836ca
|
File details
Details for the file llama_index_x402_discovery-1.0.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_x402_discovery-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9de7c61f9f09ed0df5880d944f9733d3ca701b3ccc3d436902313e9663fad4a4
|
|
| MD5 |
397ed5a989ea134f8145ad218a3b55e2
|
|
| BLAKE2b-256 |
b8e22ad1455e2b3a07276953114d3f7f2e5a864b539fdc2be769621772ad4f46
|