From 7f8c3275091ee4c170a8aacc813a3bfc7def341e Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Wed, 16 Jul 2025 07:09:40 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=8A=20feat:=20Add=20Disable=20Streamin?= =?UTF-8?q?g=20Toggle=20(#8177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🌊 feat: Add Disable Streaming Option in Configuration - Introduced a new setting to disable streaming responses in openAI, Azure, and custom endpoint parameter panels. - Updated translation files to include labels and descriptions for the disable streaming feature. - Modified relevant schemas and parameter settings to support the new disable streaming functionality. * 🔧 fix: disableStreaming state not persisting when returning to a conversation - Added disableStreaming field to the IPreset interface and conversationPreset. - Moved toggles and sliders around for nicer left-right UI split in parameters panel. - Removed old reference to 'grounding' ub conversationPreset (now web_search) and added web_search to IPreset. --- client/src/locales/en/translation.json | 2 ++ packages/data-provider/src/parameterSettings.ts | 15 +++++++++++++++ packages/data-provider/src/schemas.ts | 5 +++++ packages/data-schemas/src/schema/defaults.ts | 5 ++--- packages/data-schemas/src/schema/preset.ts | 2 ++ packages/data-schemas/src/types/convo.ts | 1 + 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json index 811fa0df62..98c103d9c1 100644 --- a/client/src/locales/en/translation.json +++ b/client/src/locales/en/translation.json @@ -231,6 +231,7 @@ "com_endpoint_openai_reasoning_summary": "Responses API only: A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. Set to none,auto, concise, or detailed.", "com_endpoint_openai_resend": "Resend all previously attached images. Note: this can significantly increase token cost and you may experience errors with many image attachments.", "com_endpoint_openai_resend_files": "Resend all previously attached files. Note: this will increase token cost and you may experience errors with many attachments.", + "com_endpoint_disable_streaming": "Disable streaming responses and receive the complete response at once. Useful for models like o3 that require organization verification for streaming", "com_endpoint_openai_stop": "Up to 4 sequences where the API will stop generating further tokens.", "com_endpoint_openai_temp": "Higher values = more random, while lower values = more focused and deterministic. We recommend altering this or Top P but not both.", "com_endpoint_openai_topp": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We recommend altering this or temperature but not both.", @@ -239,6 +240,7 @@ "com_endpoint_output": "Output", "com_endpoint_plug_image_detail": "Image Detail", "com_endpoint_plug_resend_files": "Resend Files", + "com_endpoint_disable_streaming_label": "Disable Streaming", "com_endpoint_plug_set_custom_instructions_for_gpt_placeholder": "Set custom instructions to include in System Message. Default: none", "com_endpoint_plug_skip_completion": "Skip Completion", "com_endpoint_plug_use_functions": "Use Functions", diff --git a/packages/data-provider/src/parameterSettings.ts b/packages/data-provider/src/parameterSettings.ts index f01ad6139c..dee4e8b77f 100644 --- a/packages/data-provider/src/parameterSettings.ts +++ b/packages/data-provider/src/parameterSettings.ts @@ -284,6 +284,19 @@ const openAIParams: Record = { optionType: 'model', columnSpan: 4, }, + disableStreaming: { + key: 'disableStreaming', + label: 'com_endpoint_disable_streaming_label', + labelCode: true, + description: 'com_endpoint_disable_streaming', + descriptionCode: true, + type: 'boolean', + default: false, + component: 'switch', + optionType: 'model', + showDefault: false, + columnSpan: 2, + } as const, }; const anthropic: Record = { @@ -626,6 +639,7 @@ const openAI: SettingsConfiguration = [ openAIParams.reasoning_effort, openAIParams.useResponsesApi, openAIParams.reasoning_summary, + openAIParams.disableStreaming, ]; const openAICol1: SettingsConfiguration = [ @@ -648,6 +662,7 @@ const openAICol2: SettingsConfiguration = [ openAIParams.reasoning_summary, openAIParams.useResponsesApi, openAIParams.web_search, + openAIParams.disableStreaming, ]; const anthropicConfig: SettingsConfiguration = [ diff --git a/packages/data-provider/src/schemas.ts b/packages/data-provider/src/schemas.ts index a1494d68f5..bc488d4040 100644 --- a/packages/data-provider/src/schemas.ts +++ b/packages/data-provider/src/schemas.ts @@ -639,6 +639,8 @@ export const tConversationSchema = z.object({ useResponsesApi: z.boolean().optional(), /* OpenAI Responses API / Anthropic API / Google API */ web_search: z.boolean().optional(), + /* disable streaming */ + disableStreaming: z.boolean().optional(), /* assistant */ assistant_id: z.string().optional(), /* agents */ @@ -743,6 +745,8 @@ export const tQueryParamsSchema = tConversationSchema useResponsesApi: true, /** @endpoints openAI, anthropic, google */ web_search: true, + /** @endpoints openAI, custom, azureOpenAI */ + disableStreaming: true, /** @endpoints google, anthropic, bedrock */ topP: true, /** @endpoints google, anthropic */ @@ -1075,6 +1079,7 @@ export const openAIBaseSchema = tConversationSchema.pick({ reasoning_summary: true, useResponsesApi: true, web_search: true, + disableStreaming: true, }); export const openAISchema = openAIBaseSchema diff --git a/packages/data-schemas/src/schema/defaults.ts b/packages/data-schemas/src/schema/defaults.ts index c735ecd992..da986d729f 100644 --- a/packages/data-schemas/src/schema/defaults.ts +++ b/packages/data-schemas/src/schema/defaults.ts @@ -134,12 +134,11 @@ export const conversationPreset = { useResponsesApi: { type: Boolean, }, - /** OpenAI Responses API / Anthropic API */ + /** OpenAI Responses API / Anthropic API / Google API */ web_search: { type: Boolean, }, - /** Google */ - grounding: { + disableStreaming: { type: Boolean, }, /** Reasoning models only */ diff --git a/packages/data-schemas/src/schema/preset.ts b/packages/data-schemas/src/schema/preset.ts index 1b128413f3..c6ee8e6122 100644 --- a/packages/data-schemas/src/schema/preset.ts +++ b/packages/data-schemas/src/schema/preset.ts @@ -48,6 +48,8 @@ export interface IPreset extends Document { reasoning_effort?: string; reasoning_summary?: string; useResponsesApi?: boolean; + web_search?: boolean; + disableStreaming?: boolean; // end of additional fields agentOptions?: unknown; } diff --git a/packages/data-schemas/src/types/convo.ts b/packages/data-schemas/src/types/convo.ts index f7e58508f0..cf2e1d2efc 100644 --- a/packages/data-schemas/src/types/convo.ts +++ b/packages/data-schemas/src/types/convo.ts @@ -48,6 +48,7 @@ export interface IConversation extends Document { reasoning_summary?: string; useResponsesApi?: boolean; web_search?: boolean; + disableStreaming?: boolean; // Additional fields files?: string[]; expiredAt?: Date;