High-level Runnable for the structured-batch enrichment pattern.
Wraps :class:ParallelTaskGroup with a default_task_spec so callers
can pass a list of records (pydantic instances or dicts) and get back a
list of enriched output dicts. Mirrors the canonical enrichment pattern
documented at
https://docs.parallel.ai/task-api/examples/task-enrichment.
Defaults to the core processor (the docs' recommendation for
enrichment workflows).
LangChain integration for Parallel's Monitor API (alpha).
The Monitor API runs scheduled web queries and emits webhook events when
results change. As of parallel-web 0.5.1 the SDK does not expose this
surface, so this module talks to /v1alpha/monitors directly via httpx.
The Monitor API is currently in alpha; endpoints and shapes may change without notice. Track https://docs.parallel.ai/monitor-api/monitor-quickstart for updates.
Build a TaskSpecParam dict from pydantic classes / schemas / text.
Mirrors the helper used in https://docs.parallel.ai/task-api/examples/task-enrichment.
Extract citations, low-confidence fields, and interaction_id.
Saves Task-API consumers the boilerplate of walking the result shape to
pull out per-field citations, find which fields the model wasn't sure
about, and grab the interaction_id for multi-turn chaining.
Works on results from :class:ParallelTaskRunTool,
:class:ParallelDeepResearch, and individual entries from
:class:ParallelTaskGroup / :class:ParallelEnrichment batches.
Verify a Parallel webhook signature (Standard Webhooks scheme).
Parallel signs webhook payloads using HMAC-SHA256 over
"<webhook-id>.<webhook-timestamp>.<body>", base64-encoded
with padding. The signature is delivered as the webhook-signature
header (possibly with multiple space-delimited v1,<sig> entries).
See https://docs.parallel.ai/resources/webhook-setup.
The verification flow is:
tolerance_seconds from now
(replay protection).v1,<sig> entry in the header.