nemoguardrails.server.experimental.providers.openai.integration
Compose explicit OpenAI operation sets and provider-native errors.
Module Contents
Functions
Data
API
Create a Chat-only OpenAI instance with an explicitly reviewed endpoint.
Omitting endpoint selects the strict OpenAI Chat boundary through
create_openai_integration. A trusted application may instead supply
an OpenAI-wire-compatible dialect endpoint; it must use the OpenAI error
mapping. Other instances are unaffected. Unselected routes retain the
application’s passthrough behavior.
Create the private buffered and streaming OpenAI Chat proxy surface.
A trusted application may explicitly supply a reviewed OpenAI-wire-compatible endpoint, such as the LiteLLM subset. Omitting it retains the OpenAI policy. This does not detect a backend, load a contract, or select a dialect from request data. The supplied endpoint must use the OpenAI error mapping.
Create an OpenAI instance with the selected built-in guard bindings.
operations is a nonempty sequence of unique names, in binding order.
The fixed default selects Chat Completions and Responses; it does not mean
all operations a future version might support. A bare string is invalid.
Selection installs guard bindings, not a route allowlist. Unselected routes retain the application’s passthrough behavior and are not thereby guarded. These are strict OpenAI boundaries: an upstream URL does not select a dialect. Trusted applications can customize explicit endpoint bindings.
Raises:
TypeError:operationsis not a sequence of operation names.ValueError: The selection is empty, unknown, or contains duplicates.
Built-in operation names accepted by the OpenAI integration factory.