Batching
Batching is optional rather than universally available in v0.16.0. The compile-checked batch capability guard checks both the advertised batch capability and submitBatch.
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.16.048214137
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.16.0
- Release
- v0.16.0
- Commit
482141371d7fdb2dd38f7d6eaa5732aec669385a- Source
examples/runtime-capabilities.ts- Tarball SHA-256
f8ca0ce45d7bf563b1212c708668a5fe788967b8b7d5dbdc9e119e9e09d60167- Content SHA-256
274cf7e926de9581e270ef9bf6120666e7f0595ddf98b6378d7b9921fcff88d3