SDKs And CLI

The SDK and CLI foundations are source-only alpha packages. They are useful for early operator scripts and demos, but PyPI, npm, Homebrew, apt, and scoop distribution are still pending.

Python SDK

Source package: packages/python/retvest-client

python -m pip install -e packages/python/retvest-client
from retvest_client import RetvestClient

client = RetvestClient("https://retvest.example", api_key="rvak_...")
answer = client.query("What changed in the latest policy?", collection_id="...")
print(answer["answer"])

The Python SDK supports login, API-key auth, bounded document upload, RAG query, basic me(), unwrapped JSON requests, Work Run correction helpers, and binary downloads for the admin CLI.

TypeScript SDK

Source package: packages/typescript/retvest-client

npm install ../packages/typescript/retvest-client
import { RetvestClient } from "@retvest/client";

const client = new RetvestClient({
  baseUrl: "https://retvest.example",
  apiKey: "rvak_..."
});

const answer = await client.query({
  question: "What changed in the latest policy?",
  collectionId: "..."
});

The TypeScript SDK has a no-build ESM foundation with typed declarations. A full OpenAPI-generated surface is pending the Chapter 142 snapshot.

Work Run Correction Helpers

Work Run correction helpers are available in the source packages while package registries and the OpenAPI-generated SDK surface remain pending.

SDK and CLI operator scripts may use helper methods for:

  • /admin/work-runs/{work_run_id}/corrections
  • /admin/work-runs/{work_run_id}/corrections/audit
  • /admin/work-runs/{work_run_id}/corrections/{correction_id}/apply
  • /admin/work-runs/{work_run_id}/corrections/{correction_id}/reject
  • /admin/work-runs/{work_run_id}/corrections/{correction_id}/retry

TypeScript helper names include createWorkRunCorrection(), listWorkRunCorrections(), readCorrectionAudit(), applyWorkRunCorrection(), rejectWorkRunCorrection(), retryWorkRunCorrection(), workRunCorrectionProblemResult(), and shouldRetryWorkRunCorrectionProblem(). Python helper names include create_work_run_correction(), list_work_run_corrections(), read_correction_audit(), apply_work_run_correction(), reject_work_run_correction(), request_correction_retry(), work_run_correction_problem_result(), and should_retry_work_run_correction_problem().

Print only metadata such as correction ids, correction_sequence, correction_status, prev_hash, row_hash, and receipt_digest. Treat pending, applied, rejected, and superseded as the public correction lifecycle statuses from the generated OpenAPI snapshot for stricter generated client types. Do not print original assertions, corrected assertions, observed consequences, request bodies, idempotency keys, customer text, generated answers, citation bodies, or private evidence refs. Rejected corrections should be printed as status and a bounded rejection_reason_code, not as rejected correction text. RIL packet manifests consume the same metadata boundary; packet validation behavior belongs to retvest-ril.

For write-side developer examples covering correction create, list, apply, reject, retry-request, idempotency, expected-version, expected_work_run_version, typed Problem handling, and retry behavior, use Create corrections, List corrections, Apply corrections, and Reject corrections, plus Request retry. The Correction API errors page covers fixture-aligned Problem codes, request IDs, cursor pagination, Retry-After, idempotency, expected-version, already-finalized Problems, invalid-transition Problems, and unsafe retry boundaries. The Correction SDK examples page keeps the current SDK package names, shipped limits, and typed Problem helpers visible while avoiding a claim that package registry artifacts or OpenAPI-generated correction SDK methods are published.

Admin CLI

Source package: packages/python/retvest-cli

The CLI reads RETVEST_API_URL and RETVEST_API_KEY. API keys are not accepted as command-line flags.

export RETVEST_API_URL=https://retvest.example
export RETVEST_API_KEY=rvak_...
retvest query "Summarize onboarding gaps" --collection-id "..."
retvest upload ./policy.pdf --collection-id "..."
retvest license-status
retvest compliance-export --out ./compliance.zip

The CLI is source-only today. Live API proof, packaging, completion installation, and broader admin commands remain pending.

Choose what this site may use. Your choice is kept in this browser only.