nemoguardrails.server.experimental.providers.openai.responses.stream_hooks
nemoguardrails.server.experimental.providers.openai.responses.stream_hooks
Keep Responses completion and stream identity checks outside field policy.
Module Contents
Classes
API
Require native completion and one consistent assistant identity.
The kernel verifies every text snapshot against observed deltas. These hooks additionally reject post-terminal data and changes to supplied text item IDs, output positions, or sequence order. State belongs to one upstream stream. Missing unrelated provider metadata is not synthesized or required.
Remember supplied identity and reject switching the guarded target.
Render a terminal Responses error event, not a Chat DONE sentinel.
Validate protocol state after the classifier has validated the event.
Reject truncated foreground streams even if they contain DONE.