Skip to content

Add cookbook: streaming output guardrails client-side handling - #999

Merged
naresh4dev merged 1 commit into
mainfrom
docs/streaming-output-guardrails
Jul 24, 2026
Merged

Add cookbook: streaming output guardrails client-side handling#999
naresh4dev merged 1 commit into
mainfrom
docs/streaming-output-guardrails

Conversation

@naresh4dev

Copy link
Copy Markdown
Contributor

Summary

  • Adds a new cookbook guide under Cookbooks > Use Cases for handling streaming output guardrail results on the client side
  • Covers how to capture hook_results from the final SSE chunk after [DONE], inspect verdicts, and implement client-side retry, fallback, content filtering, and logging patterns
  • Includes Python and Node code examples for all patterns, plus a combined approach
  • References the existing streaming responses guardrails docs

Changes

  • New file: guides/use-cases/streaming-output-guardrails.mdx
  • Updated: docs.json — added page to the Cookbooks > Use Cases navigation group

Resolved review comments from #840

  1. Added strict_open_ai_compliance to Portkey SDK examples — The Python (strict_open_ai_compliance=False) and Node (strictOpenAiCompliance: false) Portkey SDK init blocks in Step 1 now include the required header, matching the OpenAI SDK examples
  2. Added Node.js examples to all Python-only sections — Step 3 (Inspect the verdict), Pattern 4 (Logging and observability), and Combining patterns now include both Python and Node code in <CodeGroup> blocks

Made with Cursor

- New guide covering how to capture hook_results from streaming responses
  and implement client-side retry, fallback, content filtering, and logging
- Includes Python and Node examples for all patterns
- Resolves review comments from PR #840: adds strict_open_ai_compliance
  to Portkey SDK examples and adds Node.js examples to all sections

Co-authored-by: Cursor <cursoragent@cursor.com>
@mintlify

mintlify Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
portkey-docs 🟢 Ready View Preview Jul 24, 2026, 1:19 PM

@naresh4dev
naresh4dev merged commit 932af52 into main Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants