Include vision and transcription models in API requests
This commit is contained in:
20
src/App.jsx
20
src/App.jsx
@@ -2515,15 +2515,21 @@ async function sendMessage() {
|
|||||||
signal: requestController.signal,
|
signal: requestController.signal,
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
session_id: targetSessionId,
|
session_id: targetSessionId,
|
||||||
model: requestModel,
|
model,
|
||||||
message: userMsg.content,
|
message: userMsg.content,
|
||||||
enriched_message: userMsg.content && contextBlocks.length > 0 ? enrichedPrompt : null,
|
enriched_message: userMsg.content && contextBlocks.length > 0 ? enrichedPrompt : null,
|
||||||
stream: true,
|
stream: true,
|
||||||
sources: citationSources || [],
|
sources: citationSources || [],
|
||||||
attachments: outgoingAttachments,
|
attachments: outgoingAttachments,
|
||||||
|
vision_model: visionModel || null,
|
||||||
|
transcription_model: transcriptionModel || null,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (!res.ok) throw new Error(await readBackendErrorText(res))
|
if (!res.ok) {
|
||||||
|
const error = new Error(await readBackendErrorText(res))
|
||||||
|
error.status = res.status
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
const reader = res.body?.getReader()
|
const reader = res.body?.getReader()
|
||||||
if (!reader) throw new Error('Missing response body')
|
if (!reader) throw new Error('Missing response body')
|
||||||
@@ -2579,15 +2585,21 @@ async function sendMessage() {
|
|||||||
signal: requestController.signal,
|
signal: requestController.signal,
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
session_id: targetSessionId,
|
session_id: targetSessionId,
|
||||||
model: requestModel,
|
model,
|
||||||
message: userMsg.content,
|
message: userMsg.content,
|
||||||
enriched_message: userMsg.content && contextBlocks.length > 0 ? enrichedPrompt : null,
|
enriched_message: userMsg.content && contextBlocks.length > 0 ? enrichedPrompt : null,
|
||||||
stream: false,
|
stream: false,
|
||||||
sources: citationSources || [],
|
sources: citationSources || [],
|
||||||
attachments: outgoingAttachments,
|
attachments: outgoingAttachments,
|
||||||
|
vision_model: visionModel || null,
|
||||||
|
transcription_model: transcriptionModel || null,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if (!res.ok) throw new Error(await readBackendErrorText(res))
|
if (!res.ok) {
|
||||||
|
const error = new Error(await readBackendErrorText(res))
|
||||||
|
error.status = res.status
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
const assistantMsgId = `msg-${Date.now()}`
|
const assistantMsgId = `msg-${Date.now()}`
|
||||||
|
|||||||
Reference in New Issue
Block a user