[Obs AI Assistant] OpenAI Connector default model assignment bug (#178369)

This commit is contained in:
Rassyan 2024-04-12 03:09:45 +08:00 committed by GitHub
parent c80be519b2
commit 7c6f4fe7d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,14 +33,12 @@ export const getRequestWithStreamOption = (
stream: boolean,
defaultModel: string
): string => {
if (!APIS_ALLOWING_STREAMING.has(url)) {
return body;
}
try {
const jsonBody = JSON.parse(body);
if (jsonBody) {
jsonBody.stream = stream;
if (APIS_ALLOWING_STREAMING.has(url)) {
jsonBody.stream = stream;
}
jsonBody.model = jsonBody.model || defaultModel;
}