Skip to navigation

nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses

View as MarkdownOpen in Claude

Bind reviewed LiteLLM Responses metadata without relaxing text boundaries.

The event model annotation extends the native surface. Requests, buffered responses, lifecycle response objects, and output-item policy remain OpenAI’s. See responses.md for source, recording provenance and explicit selection.

Module Contents

Classes

NameDescription
LiteLLMCompletedEventCheck the native terminal snapshot against accumulated deltas.
LiteLLMCreatedEventCheck the creation snapshot with the reviewed response metadata.
LiteLLMErrorEventAccept model metadata on the inherited flat diagnostic error shape.
LiteLLMFailedEventKeep any output in failed responses subject to snapshot checks.
LiteLLMInProgressEventCheck the progress snapshot without introducing a separate text target.
LiteLLMIncompleteEventKeep partial output guarded even when generation is incomplete.
LiteLLMMessageAddedEventPreserve message identity and single-part cardinality.
LiteLLMMessageDoneEventPreserve message completion checks and the original item identity.
LiteLLMPartAddedEventRetain the initial text part and its inherited content restrictions.
LiteLLMPartDoneEventRetain the completed text part as a checked snapshot.
LiteLLMQueuedEventRecognize queued metadata without enabling background requests.
LiteLLMReasoningAddedEventPermit reviewed reasoning metadata, never new plaintext reasoning.
LiteLLMReasoningDoneEventKeep reasoning summaries and content constrained to empty values.
LiteLLMResponsesEventMetadataAccept the gateway’s model annotation without using it to select events.
LiteLLMTextDeltaEventKeep the delta as the only newly generated text subject.
LiteLLMTextDoneEventKeep completed text subject to snapshot consistency checks.

Data

LITELLM_RESPONSES_ENDPOINT

STREAM_CLASSIFIER

STREAM_CONTRACT

STREAM_RULES

_EVENT_MODELS

API

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMCompletedEvent()

Bases: ResponsesCompletedEventProjection, LiteLLMResponsesEventMetadata

Check the native terminal snapshot against accumulated deltas.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMCreatedEvent()

Bases: ResponsesCreatedEventProjection, LiteLLMResponsesEventMetadata

Check the creation snapshot with the reviewed response metadata.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMErrorEvent()

Bases: ResponsesErrorEventProjection, LiteLLMResponsesEventMetadata

Accept model metadata on the inherited flat diagnostic error shape.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMFailedEvent()

Bases: ResponsesFailedEventProjection, LiteLLMResponsesEventMetadata

Keep any output in failed responses subject to snapshot checks.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMInProgressEvent()

Bases: ResponsesInProgressEventProjection, LiteLLMResponsesEventMetadata

Check the progress snapshot without introducing a separate text target.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMIncompleteEvent()

Bases: ResponsesIncompleteEventProjection, LiteLLMResponsesEventMetadata

Keep partial output guarded even when generation is incomplete.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMMessageAddedEvent()

Bases: ResponsesMessageAddedEventProjection, LiteLLMResponsesEventMetadata

Preserve message identity and single-part cardinality.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMMessageDoneEvent()

Bases: ResponsesMessageDoneEventProjection, LiteLLMResponsesEventMetadata

Preserve message completion checks and the original item identity.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMPartAddedEvent()

Bases: ResponsesContentPartAddedEventProjection, LiteLLMResponsesEventMetadata

Retain the initial text part and its inherited content restrictions.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMPartDoneEvent()

Bases: ResponsesContentPartDoneEventProjection, LiteLLMResponsesEventMetadata

Retain the completed text part as a checked snapshot.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMQueuedEvent()

Bases: ResponsesQueuedEventProjection, LiteLLMResponsesEventMetadata

Recognize queued metadata without enabling background requests.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMReasoningAddedEvent()

Bases: ResponsesReasoningAddedEventProjection, LiteLLMResponsesEventMetadata

Permit reviewed reasoning metadata, never new plaintext reasoning.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMReasoningDoneEvent()

Bases: ResponsesReasoningDoneEventProjection, LiteLLMResponsesEventMetadata

Keep reasoning summaries and content constrained to empty values.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMResponsesEventMetadata()

Bases: PolicyModel

Accept the gateway’s model annotation without using it to select events.

model
Annotated[Any, opaque()] = None
class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMTextDeltaEvent()

Bases: ResponsesTextDeltaEventProjection, LiteLLMResponsesEventMetadata

Keep the delta as the only newly generated text subject.

class nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LiteLLMTextDoneEvent()

Bases: ResponsesTextDoneEventProjection, LiteLLMResponsesEventMetadata

Keep completed text subject to snapshot consistency checks.

nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.LITELLM_RESPONSES_ENDPOINT = replace(RESPONSES_ENDPOINT, contract_name='litellm_responses', operation='LiteLL...
nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.STREAM_CLASSIFIER = build_policy_stream_classifier(StreamClassifierDefinition(subject=(STREAM_CONTRA...
nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.STREAM_CONTRACT = replace(OPENAI_STREAM_CONTRACT, projection_id='openai.litellm.responses.stream.t...
nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses.STREAM_RULES = tuple((replace(rule, model=(_EVENT_MODELS[rule.model]), text_path=(stream_text_p...
nemoguardrails.server.experimental.providers.openai.dialects.litellm.responses._EVENT_MODELS: dict[type[BaseModel], type[PolicyModel]] = {models.ResponsesTextDeltaEventProjection: LiteLLMTextDeltaEvent, models.Respons...