Package org.mockserver.llm
package org.mockserver.llm
-
ClassDescriptionDescribes where to extract the isolation key from an inbound HTTP request for per-session conversation state isolation.String escaping for the small set of code paths that hand-assemble JSON inside provider codecs (streaming chunks, where building a full Jackson tree per token is unwarranted overhead).Pure, deterministic helper for content-filter / guardrail simulation across providers.Immutable (status, jsonBody) pair for a content-filter block response.Pure, deterministic helper that produces the provider-specific JSON error body real LLM providers return for overload / rate-limit / server errors.Pure, deterministic helper that produces the provider-specific overload / rate-limit / server-error response bodies (and the matching default HTTP status) that real LLM providers return.Immutable (status, jsonBody) pair returned by
LlmErrorBody.bodyFor(org.mockserver.model.Provider, org.mockserver.llm.LlmErrorBody.Kind).The kind of provider error to synthesise.Process-wide, stateful request quota for LLM responses — a fixed-window rate limiter.Pure, deterministic helper that produces the provider-specific rate-limit HTTP headers real LLM providers send.Presets that emit provider-style refusals — the response an aligned model returns when it declines to answer on safety grounds.Utility for encoding and decoding LLM conversation isolation metadata in scenario names.Pure, deterministic encoder for the OpenAI Moderations endpoint (POST /v1/moderations) response body.Process-wide server-side state for the OpenAI Responses API (POST /v1/responses).An issued, stored Responses-API response: its id, the full conversation as of this turn, and the raw response body.A multimodal audio content part recognised in a decoded request message.A multimodal image content part recognised in a decoded request message.Deterministic normalisation of LLM prompt text prior to conversation-predicate matching.Deterministic, read-only heuristic that infers theProviderfrom anHttpRequest's path (and, as a fallback, its Host header).The wire format used by a provider for streaming responses.Applies streaming physics (timing delays) to a list of SSE events.Builds the prompt sent to a runtime LLM backend to generate a realistic MockServer expectation from an unmatched request.Result returned by the AI stub generation endpoint.Pure, deterministic approximate token counter and lightweight subword segmenter for LLM text.