Haystack integration for Scavio Web Search
Project description
scavio-haystack
Scavio integration for Haystack by deepset.
Provides ScavioWebSearch, a web search component backed by the Scavio API. It returns results
as Haystack Document objects (with title and URL metadata) plus the list of source links, and
mirrors the existing TavilyWebSearch / ExaWebSearch components.
Scavio is a unified search API for AI agents. Get an API key at dashboard.scavio.dev.
Installation
pip install scavio-haystack
Usage
from haystack_integrations.components.websearch.scavio import ScavioWebSearch
from haystack.utils import Secret
web_search = ScavioWebSearch(
api_key=Secret.from_env_var("SCAVIO_API_KEY"), # defaults to SCAVIO_API_KEY
top_k=5,
)
result = web_search.run(query="What is Haystack by deepset?")
documents = result["documents"]
links = result["links"]
In a pipeline
from haystack import Pipeline
from haystack.components.builders import PromptBuilder
from haystack.components.generators import OpenAIGenerator
from haystack_integrations.components.websearch.scavio import ScavioWebSearch
template = """
Given the following web search results, answer the question.
Results:
{% for doc in documents %}{{ doc.content }}
{% endfor %}
Question: {{ query }}
Answer:
"""
pipe = Pipeline()
pipe.add_component("search", ScavioWebSearch(top_k=5))
pipe.add_component("prompt_builder", PromptBuilder(template=template))
pipe.add_component("llm", OpenAIGenerator())
pipe.connect("search.documents", "prompt_builder.documents")
pipe.connect("prompt_builder", "llm")
query = "What is Haystack by deepset?"
result = pipe.run(data={"search": {"query": query}, "prompt_builder": {"query": query}})
print(result["llm"]["replies"][0])
Async support
import asyncio
from haystack_integrations.components.websearch.scavio import ScavioWebSearch
async def main():
web_search = ScavioWebSearch(top_k=3)
result = await web_search.run_async(query="What is Haystack by deepset?")
print(f"Found {len(result['documents'])} documents")
asyncio.run(main())
Parameters
api_key: API key for Scavio. Defaults to theSCAVIO_API_KEYenvironment variable.top_k: Maximum number of results to return. Defaults to 10.search_params: Additional parameters passed to the Scavio Google search endpoint. Supported keys includecountry_code,language,page,search_type,device,nfpr,light_request. Can be set at init time or overridden perrun.
Development
This project uses Hatch.
pip install hatch
hatch run fmt-check # lint + format check
hatch run test:unit # unit tests
hatch run test:all # all tests (set SCAVIO_API_KEY for integration tests)
License
scavio-haystack is distributed under the terms of the Apache-2.0 license.
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 scavio_haystack-0.1.0.tar.gz.
File metadata
- Download URL: scavio_haystack-0.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dca3ed79a26bd27b9269ffb4ba23a0cf5734849e0a633fdf1309b1d63b02a8e0
|
|
| MD5 |
eea4de1f1ff03a1e5030b903a15b1904
|
|
| BLAKE2b-256 |
79689f8a23b5f611e8745f066d7b9fa2ed006afe862ed2cb155da7c9a5f7ac28
|
Provenance
The following attestation bundles were made for scavio_haystack-0.1.0.tar.gz:
Publisher:
release.yml on scavio-ai/haystack-scavio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scavio_haystack-0.1.0.tar.gz -
Subject digest:
dca3ed79a26bd27b9269ffb4ba23a0cf5734849e0a633fdf1309b1d63b02a8e0 - Sigstore transparency entry: 1930261764
- Sigstore integration time:
-
Permalink:
scavio-ai/haystack-scavio@5864cea127941134cebe10bd323015f693f2feea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/scavio-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5864cea127941134cebe10bd323015f693f2feea -
Trigger Event:
push
-
Statement type:
File details
Details for the file scavio_haystack-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scavio_haystack-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9a459b91e849ef625453c70b13fb024160beb88732ba72fb377955ce52f789f
|
|
| MD5 |
fcf7cde6abb20c6c6f043b7691ed6cb2
|
|
| BLAKE2b-256 |
c8231956c620baa80f27500d294f41c2fa756fe65aa7d5a5701ca4a073738621
|
Provenance
The following attestation bundles were made for scavio_haystack-0.1.0-py3-none-any.whl:
Publisher:
release.yml on scavio-ai/haystack-scavio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scavio_haystack-0.1.0-py3-none-any.whl -
Subject digest:
d9a459b91e849ef625453c70b13fb024160beb88732ba72fb377955ce52f789f - Sigstore transparency entry: 1930261883
- Sigstore integration time:
-
Permalink:
scavio-ai/haystack-scavio@5864cea127941134cebe10bd323015f693f2feea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/scavio-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5864cea127941134cebe10bd323015f693f2feea -
Trigger Event:
push
-
Statement type: