Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow output guardrails on stream responses #979

Open
cescoffier opened this issue Oct 13, 2024 · 0 comments
Open

Allow output guardrails on stream responses #979

cescoffier opened this issue Oct 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@cescoffier
Copy link
Collaborator

The idea is to add the possibility to define a strategy:

  • full-response (default, defeat the purpose of streaming, so should be logged at build time)
  • delimiter - validate the response chunk by chunk where each chunk is the accumulation of token till a defined delimiter
  • size - validate the response chunk by chunk where each chunk is the accumulation of token till a defined size
  • token - validate each token individually - this strategy is just there to be complete, because, I doubt it will be very useful

Be aware that the guardrail method will be called on the event loop, and for now, cannot block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant