LlmGateway
Provider-agnostic LLM gateway.
One interface per provider implementation lives in its own Gradle module (e.g. mojentic-ollama). Gateways are thin Ktor-Client wrappers — they translate between provider HTTP APIs and Mojentic's neutral types. No business logic lives in a gateway.
All methods are suspend or return a Flow. Cancellation of the calling coroutine propagates to the underlying HTTP request.
Functions
List models the provider currently advertises.
Single-shot completion.
Structured-output completion. The provider is instructed to return a JSON object matching schema.
Structured-output completion that also returns provider evidence.
Streaming completion. Returns a cold Flow that emits one GatewayStreamEvent per chunk. Cancellation tears down the HTTP request.