nemoguardrails.server.experimental.provider.stream
Define the stream boundary implemented by provider adapters.
Module Contents
Classes
Functions
API
Compose a stateless classifier with handwritten protocol hooks.
Return the classifier’s stream projection contract.
Classify an event and expose it to stateful protocol hooks.
Delegate provider-native error framing to provider hooks.
Delegate end-of-stream validation to provider hooks.
Describe one provider event at the Guardrails boundary.
Require text exactly for roles that carry generated content.
Expose the complete stream behavior consumed by the shared runtime.
Validate, classify, and observe one provider event.
Frame a proxy error and its provider-native body as complete SSE blocks.
Validate provider protocol state when the byte stream ends.
Classify native events using declarative projection semantics.
Validate and classify one provider event.
Implement stateful protocol checks and provider-native error framing.
Frame a proxy error and its provider-native body as complete SSE blocks.
Observe one classified event and update protocol state.
Validate provider protocol state when the byte stream ends.
Bind shared classification to a fresh set of protocol hooks per request.
Construction checks declarations without running the hook factory. Runtime uses create_adapter; inspection can read the classifier directly. Factories must return independent hook instances so lifecycle state is never shared. Handwritten classifiers are supported at runtime, but are not automatically representable by a guard contract.
Reject malformed bindings without creating request state.
Create request-local hooks and validate their protocol interface.
Bases: enum.Enum
Identify a closed streaming capability understood by the framework.
Bases: enum.Enum
Describe how one provider event relates to guarded content.
Describe the runtime semantics of one guarded stream projection.
Classify every reviewed native event shape in a provider stream.
Return every shape deliberately covered by the stream contract.
Bases: ValueError
Report a provider event that the guarded stream cannot interpret.
Require a classified event to match its declared shape semantics.