Quercle tools for LlamaIndex - AI-powered web fetch and search
Project description
llama-index-tools-quercle
Quercle tools for LlamaIndex - AI-powered web fetch and search.
Installation
pip install llama-index-tools-quercle
Quick Start
Using QuercleToolSpec (Recommended)
from llama_index.tools.quercle import QuercleToolSpec
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
# Create the tool spec
quercle = QuercleToolSpec(api_key="qk_...") # Or set QUERCLE_API_KEY env var
# Get all tools and create an agent
agent = ReActAgent.from_tools(quercle.to_tool_list(), llm=OpenAI())
# Use the agent
response = agent.chat("Search for the latest Python news")
print(response)
Using Standalone Tools
from llama_index.tools.quercle import create_quercle_fetch_tool, create_quercle_search_tool
# Create individual tools
fetch_tool = create_quercle_fetch_tool(api_key="qk_...")
search_tool = create_quercle_search_tool(api_key="qk_...")
# Use directly
result = fetch_tool.call(url="https://example.com", prompt="Summarize this page")
result = search_tool.call(query="Python web frameworks")
Direct Usage
from llama_index.tools.quercle import QuercleToolSpec
quercle = QuercleToolSpec()
# Fetch and analyze a web page
content = quercle.fetch(
url="https://docs.python.org/3/whatsnew/3.12.html",
prompt="List the main new features"
)
# Search the web
results = quercle.search(
query="best practices for Python async programming",
allowed_domains=["python.org", "realpython.com"]
)
Tools
fetch
Fetch a web page and analyze its content using AI.
Parameters:
url(str): The URL to fetch and analyzeprompt(str): Instructions for how to analyze the page content
Returns: AI-processed analysis of the page content
search
Search the web and get AI-synthesized answers with citations.
Parameters:
query(str): The search queryallowed_domains(list[str], optional): Only include results from these domainsblocked_domains(list[str], optional): Exclude results from these domains
Returns: AI-synthesized answer with source citations
Async Support
Both tools support async operations:
import asyncio
from llama_index.tools.quercle import QuercleToolSpec
async def main():
quercle = QuercleToolSpec()
# Async fetch
content = await quercle.afetch(
url="https://example.com",
prompt="Summarize this page"
)
# Async search
results = await quercle.asearch(query="Python news")
asyncio.run(main())
Configuration
API Key
Set your Quercle API key either:
- Pass directly:
QuercleToolSpec(api_key="qk_...") - Environment variable:
export QUERCLE_API_KEY=qk_...
Timeout
Configure request timeout in seconds:
quercle = QuercleToolSpec(timeout=60.0)
License
MIT
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_tools_quercle-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_tools_quercle-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cf1cb93d51b642943f66c0db75c1e3878ebf0cc7aed92393a95f4b917cb5871
|
|
| MD5 |
417ecd6c0c7e79161d39f6dd1f45ac48
|
|
| BLAKE2b-256 |
587d2e6ebcb78ecb293b01527b562ad916ac73ced9deb303cf68fdec9a5522f0
|
Provenance
The following attestation bundles were made for llama_index_tools_quercle-0.1.0.tar.gz:
Publisher:
publish.yml on quercledev/quercle-llama-index
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_tools_quercle-0.1.0.tar.gz -
Subject digest:
0cf1cb93d51b642943f66c0db75c1e3878ebf0cc7aed92393a95f4b917cb5871 - Sigstore transparency entry: 870285590
- Sigstore integration time:
-
Permalink:
quercledev/quercle-llama-index@cde15865b071deae82390b2dde978dd9f03b88ad -
Branch / Tag:
refs/heads/master - Owner: https://github.com/quercledev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cde15865b071deae82390b2dde978dd9f03b88ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file llama_index_tools_quercle-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_tools_quercle-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
134b8a90d058a65e126ee3f76d88c51303f767a0a89e941947ce1bef9cce9ecd
|
|
| MD5 |
e0aa22d83a28db3515eefacaa842973c
|
|
| BLAKE2b-256 |
f4e8e2e9d3baab5eea6ec9a72fa74b37c86e72b64a80305df15b9623e74c45f3
|
Provenance
The following attestation bundles were made for llama_index_tools_quercle-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on quercledev/quercle-llama-index
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llama_index_tools_quercle-0.1.0-py3-none-any.whl -
Subject digest:
134b8a90d058a65e126ee3f76d88c51303f767a0a89e941947ce1bef9cce9ecd - Sigstore transparency entry: 870285593
- Sigstore integration time:
-
Permalink:
quercledev/quercle-llama-index@cde15865b071deae82390b2dde978dd9f03b88ad -
Branch / Tag:
refs/heads/master - Owner: https://github.com/quercledev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cde15865b071deae82390b2dde978dd9f03b88ad -
Trigger Event:
push
-
Statement type: