Skip to main content

pipecat-specstream

SpecStream for Pipecat voice and multimodal agents: live web search, page reading, Deep Search lists and research reports as function-calling tools.

This integration is maintained by SpecStream, the company behind the service. Tested with Pipecat v1.16.0.

SpecStream has three products:

  1. Search API: GET /v1/web-search, $5 per 1,000 searches of up to 10 results, or $1 per 1,000 with speed=fast, the default here because it suits voice.
  2. Extract API: POST /v1/extract, up to 20 URLs a call (web pages, PDF, Word, Excel), $0.80 per 1,000 pages. A page with no text is not charged.
  3. Deep Search: ask for a list in plain words and get every match on the live web as structured rows, each value with the page it was read from. Each delivered row is charged 5¢, 15¢ or $1 depending on what the row needs.

Install

uv add pipecat-specstream
export SPECSTREAM_API_KEY=ss_live_...   # Agents & API in your SpecStream workspace

A free account comes with $2 of credit and needs no card: specstream.ai.

Use it in a Pipecat pipeline

from pipecat.processors.aggregators.llm_context import LLMContext
from pipecat_specstream import SpecStreamDeepSearch

specstream = SpecStreamDeepSearch(api_key=os.getenv("SPECSTREAM_API_KEY"), max_price_usd=5)
context = LLMContext(tools=specstream.tools())

The schemas carry their handlers, so the LLM service registers them on its own. Put the context in an LLMContextAggregatorPair and the pipeline is the usual one: transport.input(), stt, user_aggregator, llm, tts, transport.output(), assistant_aggregator. Call await specstream.close() at teardown.

Tool What it does
specstream_web_search One fact or a quick answer from the live web, with the page it came from.
specstream_read_pages The text, title and date of 1 to 20 known pages.
specstream_price_list The most a Deep Search list can cost. Nothing runs and nothing is charged.
specstream_find_list A Deep Search list of every match. It runs as an async function call: the bot keeps talking and the rows reach the model when the list is done.
specstream_get_list_results The rows of a list again, for example the next ones. Free.

Spending

  • max_price_usd is the most one list may cost. Only the developer sets it; the model can't raise it, and a list priced above it never starts.
  • With ask_before_buying=True (the default), the model must call specstream_price_list, tell the user the price and pass the price the user accepted as approved_max_usd. If the price has grown, nothing runs.
  • A repeated call for the same list within the hour gets the list it already started, so it is never bought twice.
Argument Default What it does
api_key SPECSTREAM_API_KEY Your SpecStream API key.
max_price_usd required The most one list may cost, in dollars.
ask_before_buying True Ask the user to accept the price before a list starts.
search_speed "fast" "fast" for the lowest latency, "default" for the most accurate answer.
rows_in_answer 10 How many rows go back to the model at once; the rest are at the list's link.
wait_secs 420 How long a list may run before the rows found so far are returned.

Research reports

SpecStreamResearch gives the agent a written report that answers a question from the live web, with the page behind each cited sentence. A report costs $0.10 (quick), $0.30 (standard) or $1.00 (deep), charged once, when it is delivered. A failed or cancelled report is not charged.

from pipecat.adapters.llm.schemas.tools_schema import ToolsSchema
from pipecat_specstream import SpecStreamDeepSearch, SpecStreamResearch

search = SpecStreamDeepSearch(max_price_usd=5)
research = SpecStreamResearch(max_price_usd=0.30)   # quick and standard reports, never deep
tools = ToolsSchema(standard_tools=search.function_schemas() + research.function_schemas())
context = LLMContext(tools=tools)
Tool What it does
specstream_research_price The price of a report at each depth the agent may buy. Nothing runs and nothing is charged.
specstream_start_research Starts the report. It runs as an async function call: the bot keeps talking and the report reaches the model when it is done, about a minute for a quick one.
specstream_get_research A report by its id: its status while it runs, the text and its cited pages when it is completed. Free.
  • max_price_usd is the most one report may cost. The model sees only the depths at or under it and can't raise it.
  • With ask_before_buying=True (the default), the model must tell the user the price and pass the price the user accepted as approved_max_usd. Without it, nothing runs.
  • A repeated call for the same question within the hour gets the report it already started, so it is never bought twice.
  • length is "short" by default, which suits a spoken answer; include_domains and exclude_domains choose the sites it reads.

A failed call goes back to the model as {"status": "error", "error": "..."}; it never stops the pipeline.

Run the example

cd examples
export SPECSTREAM_API_KEY=... DEEPGRAM_API_KEY=... CARTESIA_API_KEY=... OPENAI_API_KEY=...
uv run --with "pipecat-ai[daily,deepgram,cartesia,openai,silero,runner]" --with pipecat-specstream python foundational.py

Open the address it prints and ask: "What's in the news today?", "Read https://example.com", or "Find dental clinics in Lisbon with online booking".

research.py is the same bot with research reports: ask "Research how the EU and the US regulate stablecoin reserves".

License

BSD 2-Clause.

Metadata

Release files for pipecat-specstream 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipecat-specstream 0.2.0
File Size Uploaded Provenance Actions
pipecat_specstream-0.2.0.tar.gz 22.4 kB Without provenance Details for pipecat_specstream-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pipecat-specstream 0.2.0
File Interpreter ABI Platform Actions
pipecat_specstream-0.2.0-py3-none-any.whl Python 3 none any Details for pipecat_specstream-0.2.0-py3-none-any.whl

Total release size: 40.4 kB

Release files / pipecat_specstream-0.2.0.tar.gz

Download URL pipecat_specstream-0.2.0.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fcb1327387a8b839f736503d10e1c89c1d8536309fc2cad48b46d551569827a5
BLAKE2b-256 checksum
How to use checksums
1023fce95ae40bba8eacdd0a0a3551a4e4f7f6a60aea34dc9170ef59ab02ca1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / pipecat_specstream-0.2.0-py3-none-any.whl

Download URL pipecat_specstream-0.2.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecd87f25e92376e1d4db5c2186a7428ed0c4f66e5aa574e1ab43faa4db2e2f93
BLAKE2b-256 checksum
How to use checksums
0004dc8dd18785867cfe81b77ffc191b31f5b1ef2f1e509e03d95a54fd3ba9c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for pipecat-specstream 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page