Skip to main content

Recipes

Short snippets for the jobs the SDK gets asked to do every day. Each recipe is one runnable code block and a paragraph of framing. Skim the table, copy the recipe you need, replace the placeholders, run it.

These are not tutorials. For a walked-through workflow, see Examples and the notebooks it links.

Index​

RecipeTopic
Fetch and update an alertMove an alert to a queue and record the move in a comment.
Bulk upsert 1000 documentsA bulk write with per-row result introspection.
Search across two entity typesMulti-type Search.types(...) with field projection.
Disposition with promptsHandle DispositionPromptRequiredError and retry cleanly.
Async fanout patternasyncio.gather plus a semaphore throttle over the *_async siblings.
User and group fieldsUserRef and GroupRef field updates.
Flaky tenant retry tuningRetry keywords for a tenant with intermittent 503s.
Export and diff configurationExport config bundles from two tenants and diff them.
Re-index after a configuration changeUnsearchable index, then start_full(), then make_searchable().
Create and walk a relationshipCreate a typed relationship and list neighbors.
Claim and complete a workflow taskClaim a task, then complete it with an action and document field changes.
Paginate with iterThe generator pattern for paginated list-style results.
From search to bound objectsHydrate SearchHits into bound Document / Alert instances.
Geo radius queryF.geo_radius composed with Q.text.
Preview a search request as curl or PythonCapture, share, snapshot, or log a call with *_preview().to_curl() or .to_httpx().
Validate input against a reference listValidate user input and surface bad values cleanly.
Mock the SDK in pytestStub SVIClient with object.__new__ and monkeypatch.

Conventions​

Every recipe assumes you have already built and authenticated an SVIClient:

import sasvi

client = sasvi.SVIClient.from_env()

Recipes leave out try / except unless the exception is the topic. To recover from a typed exception, see the Errors reference and the Troubleshooting hub.

Go further​