mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
🚧 feat: Support Guardrail Config Option streamProcessingMode (#12815)
`streamProcessingMode` affects how guardrail processes the stream from the model. If it's in "sync" mode, it chunks up the response and processes them before returning them to the user. If it's in "async" mode, it both processes the chunk & sends it to the user at the same time, allowing for smoother streaming (at the cost of guardrail only reacting *after* offending content starts to stream, in some cases).
This commit is contained in:
parent
e0a4e53b7f
commit
83ea3efbc1
2 changed files with 3 additions and 0 deletions
|
|
@ -129,6 +129,7 @@ describe('initializeBedrock', () => {
|
|||
guardrailIdentifier: 'test-guardrail-id',
|
||||
guardrailVersion: '1',
|
||||
trace: 'enabled' as const,
|
||||
streamProcessingMode: 'async',
|
||||
};
|
||||
|
||||
const params = createMockParams({
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ export interface GuardrailConfiguration {
|
|||
guardrailVersion: string;
|
||||
/** The trace behavior for the guardrail */
|
||||
trace?: 'enabled' | 'disabled' | 'enabled_full';
|
||||
/** The processing mode for guardrail; 'sync' is the default guardrail behavior if unset */
|
||||
streamProcessingMode?: 'sync' | 'async';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue