mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
AIX: OpenAI chatGenerate: ignore pure-obfuscation messages
This commit is contained in:
@@ -70,6 +70,13 @@ export function createOpenAIChatCompletionsChunkParser(): ChatGenerateParseFunct
|
||||
if (_forwardOpenRouterDataError(chunkData, pt))
|
||||
return;
|
||||
|
||||
// [OpenAI] Obfuscation message with no data -> skip
|
||||
if (!chunkData?.['choices'] && chunkData?.['obfuscation']) {
|
||||
// NOTE: these sort of messages have no useful data and would break the parser here
|
||||
// console.log('AIX: OpenAI-dispatch: missing-choices chunk skipped', chunkData);
|
||||
return;
|
||||
}
|
||||
|
||||
const json = OpenAIWire_API_Chat_Completions.ChunkResponse_schema.parse(chunkData);
|
||||
|
||||
// -> Model
|
||||
|
||||
Reference in New Issue
Block a user