Skip to main content

Polyglot Package Cheatsheet

Code-verified API reference for packages/polyglot.

Core Facades

Inference Quick Start

Use a preset for the normal path:
Get parsed JSON:

Inference Constructors

Inference Request Builder Methods

Single-call variant:
With explicit request:

Inference Execution Surfaces

Streaming (InferenceStream)

Inference Runtime / Provider Setup

Driver registry helpers:

Embeddings Quick Start

Embeddings Constructors and Builder Methods

Single-call variant:
With explicit request:
Execution shortcuts:

Embeddings Runtime / Provider Setup

Testing

Deterministic test seams:
  • Tests\Support\FakeInferenceDriver
    • queue sync InferenceResponse fixtures or streaming PartialInferenceDelta batches
    • best for most inference runtime tests that do not need HTTP or adapter coverage
  • Tests\Support\FakeEmbeddingsDriver
    • queue EmbeddingsResponse fixtures and record handled requests
    • best for most embeddings runtime and memoization tests
  • MockHttpDriver
    • use when transport and provider adapter behavior still matter
    • best for golden tests, request assertions, and provider-specific error-path coverage