Skip to main content

scavio-haystack

PyPI - Version PyPI - Python Version

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 the SCAVIO_API_KEY environment variable.
  • top_k: Maximum number of results to return. Defaults to 10.
  • search_params: Additional parameters for the Scavio Google (v2) search endpoint. Supported keys: country_code (mapped to gl), language (mapped to hl), page (mapped to start=(page-1)*10), device, and nfpr. Any other key is passed through verbatim (e.g. google_domain, location, safe). Can be set at init time or overridden per run.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scavio_haystack-0.1.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scavio_haystack-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file scavio_haystack-0.1.1.tar.gz.

File metadata

  • Download URL: scavio_haystack-0.1.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scavio_haystack-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ba780850da863d7515f7d105f86faf67380b523c2025b27722cee2257ac9d324
MD5 3c121d56db1357b3ec200925a625591e
BLAKE2b-256 4696df046b452bd1565ffffecb075b465acb74695c04c4b16613550a47486644

See more details on using hashes here.

Provenance

The following attestation bundles were made for scavio_haystack-0.1.1.tar.gz:

Publisher: release.yml on scavio-ai/haystack-scavio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scavio_haystack-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for scavio_haystack-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bc2de5829794592e6195786aed59fcf0e4bc0d5ca0b1f4290ca49b02ae4abce
MD5 4539ade7ded3417577c32eb29984ae2f
BLAKE2b-256 0c46a63adae5b3b8e9c41fe290b27717d84c0d4c248e0357825b76ec61f2e994

See more details on using hashes here.

Provenance

The following attestation bundles were made for scavio_haystack-0.1.1-py3-none-any.whl:

Publisher: release.yml on scavio-ai/haystack-scavio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page