SIGN IN SIGN UP

feat: add output guardrails workflow for processing

- Introduced a new workflow `outputGuardrails` in `output-guardrails.ts` to enhance output processing.
- Implemented a sequential processing flow:
  - Added a `TokenLimiterProcessor` to limit tokens to a maximum of 256,000.
  - Included a `BatchPartsProcessor` to batch stream chunks with a size of 10, emitting on non-text.
- Added parallel processing for independent checks:
  - Integrated a `PIIDetector` with a redaction strategy using the model `openrouter/google/gemma-4-31b-it:free`.
  - Integrated a `ModerationProcessor` with a blocking strategy using the same model.
- Mapped the output to retain transformed messages from the `PIIDetector`.
- Added a sequential step for `SystemPromptScrubber` to scrub the output based on the previous redaction, using a placeholder text of `[REDACTED]`.
S
ssdeanx committed
33d4f064680d76fed4c51dfdcc16a38a7e349c4b
Parent: 64e3c8d