cavi-ai/
@cavi-ai/api-clientv0.11.0 stable
GitHub ↗

Testing

Use the stable testing subpath for conformance helpers. Keep tests focused on consumed RuntimeClient behavior, and use capability gating for optional surfaces.

This client mirrors and verifies upstream-compatible behavior. Upstream runtimes remain the canonical protocol owners.

Referenced examples

Verified example · TypeScript

Runtime capabilities

examples/runtime-capabilities.ts

@cavi-ai/api-clientv0.11.048adfa6b
TypeScript · complete source
import { runtimeSupports, type RuntimeClient } from "@cavi-ai/api-client";

export async function submitWhenBatchIsAvailable(client: RuntimeClient) {
  const capabilities = await client.getRuntimeCapabilities();
  if (!runtimeSupports(capabilities, "batch") || !client.submitBatch) return null;
  return client.submitBatch([{ customId: "summary", body: { input: "Summarize this." } }]);
}

Package imports

Referenced by

Artifact provenance
Package
@cavi-ai/api-client@0.11.0
Release
v0.11.0
Commit
48adfa6ba7c3d5e8ffee0a6cf2572574ca630fa0
Source
examples/runtime-capabilities.ts
Tarball SHA-256
3379cd47b4890d0e00f5949583f90a83367705878b16141e825f66ef5d8819e5
Content SHA-256
306450f08c69a6e068f80490b1f2cc4f0808af0911fdec5b9b145e33a9ba5534