🐛 fix azure openai 'choices' parameter is empty (#60)
This commit is contained in:
parent
ed7b9b7dda
commit
64e8945122
|
@ -162,7 +162,7 @@ export class ChatGPTApi implements LLMApi {
|
|||
const text = msg.data;
|
||||
try {
|
||||
const json = JSON.parse(text);
|
||||
const delta = json.choices[0].delta.content;
|
||||
const delta = json.choices[0]?.delta.content;
|
||||
if (delta) {
|
||||
responseText += delta;
|
||||
options.onUpdate?.(responseText, delta);
|
||||
|
|
Loading…
Reference in New Issue