🐛 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;
|
const text = msg.data;
|
||||||
try {
|
try {
|
||||||
const json = JSON.parse(text);
|
const json = JSON.parse(text);
|
||||||
const delta = json.choices[0].delta.content;
|
const delta = json.choices[0]?.delta.content;
|
||||||
if (delta) {
|
if (delta) {
|
||||||
responseText += delta;
|
responseText += delta;
|
||||||
options.onUpdate?.(responseText, delta);
|
options.onUpdate?.(responseText, delta);
|
||||||
|
|
Loading…
Reference in New Issue