diff --git a/packages/bruno-app/src/components/AiChatSidebar/index.js b/packages/bruno-app/src/components/AiChatSidebar/index.js index e0120488c20..f64e12469a9 100644 --- a/packages/bruno-app/src/components/AiChatSidebar/index.js +++ b/packages/bruno-app/src/components/AiChatSidebar/index.js @@ -555,7 +555,8 @@ const AiChatSidebar = ({ collection, variant = 'sidebar' }) => { if (textareaRef.current) textareaRef.current.style.height = 'auto'; try { - await dispatch(sendAiMessage(activeTabUid, text, allContent, requestContext, selectedModel, contentType, aiVariables, appEnabled, aiRequests)); + const modelFormat = selectedModelEntry?.apiFormat || null; + await dispatch(sendAiMessage(activeTabUid, text, allContent, requestContext, selectedModel, modelFormat, contentType, aiVariables, appEnabled, aiRequests)); setProcessingStage('applying'); setTimeout(() => setProcessingStage(null), 500); } catch (err) { @@ -667,11 +668,17 @@ const AiChatSidebar = ({ collection, variant = 'sidebar' }) => { try { localStorage.setItem(SELECTED_MODEL_LS_KEY, modelId); } catch {} }; - const selectedModelLabel = useMemo(() => { - if (selectedModel === AUTO_MODEL_ID) return 'Auto'; - return availableModels.find((m) => m.id === selectedModel)?.label || 'Auto'; + const selectedModelEntry = useMemo(() => { + if (selectedModel === AUTO_MODEL_ID) return null; + return availableModels.find((m) => m.id === selectedModel) || null; }, [availableModels, selectedModel]); + const selectedModelLabel = useMemo(() => { + if (!selectedModelEntry) return 'Auto'; + const suffix = selectedModelEntry.apiFormat === 'responses' ? ' · Responses API' : ''; + return `${selectedModelEntry.label}${suffix}`; + }, [selectedModelEntry]); + const ModelSelectorTrigger = forwardRef((props, ref) => (
@@ -686,7 +693,7 @@ const AiChatSidebar = ({ collection, variant = 'sidebar' }) => { { id: AUTO_MODEL_ID, label: 'Auto', onClick: () => handleModelSelect(AUTO_MODEL_ID) }, ...availableModels.map((model) => ({ id: model.id, - label: model.label, + label: `${model.label}${model.apiFormat === 'responses' ? ' · Responses API' : ''}`, onClick: () => handleModelSelect(model.id) })) ], diff --git a/packages/bruno-app/src/components/Preferences/AI/CompatEndpointCard.js b/packages/bruno-app/src/components/Preferences/AI/CompatEndpointCard.js index 70fd64c4766..6659cd447c1 100644 --- a/packages/bruno-app/src/components/Preferences/AI/CompatEndpointCard.js +++ b/packages/bruno-app/src/components/Preferences/AI/CompatEndpointCard.js @@ -137,7 +137,8 @@ const CompatEndpointCard = ({ onAddModel({ id: uuid(), modelId: id, - label: newModelLabel.trim() || id + label: newModelLabel.trim() || id, + apiFormat: 'chat-completions' }); setNewModelId(''); setNewModelLabel(''); @@ -375,6 +376,8 @@ const CompatEndpointCard = ({ {models.map((model) => { const enabled = isModelEnabled(model.id); const disabled = !provider.configured || !providerEnabled; + const apiFormat = model.apiFormat || 'chat-completions'; + const modelName = model.label || model.modelId || model.id; return (
onUpdateModel(model.id, { modelId: e.target.value })} /> +