You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constrole=message.roleas'assistant';// this is what we expect; in theory it could be different which would make our types a slight lie but would be fine.
@@ -251,12 +260,18 @@ function finalizeChatCompletion(snapshot: ChatCompletionSnapshot): ChatCompletio
251
260
const{arguments: args, name }=function_call;
252
261
if(args==null)thrownewOpenAIError(`missing function_call.arguments for choice ${index}`);
253
262
if(!name)thrownewOpenAIError(`missing function_call.name for choice ${index}`);
254
-
return{message: { content,function_call: {arguments: args, name }, role }, finish_reason, index };
263
+
return{
264
+
message: { content,function_call: {arguments: args, name }, role },
265
+
finish_reason,
266
+
index,
267
+
logprobs,
268
+
};
255
269
}
256
270
if(tool_calls){
257
271
return{
258
272
index,
259
273
finish_reason,
274
+
logprobs,
260
275
message: {
261
276
role,
262
277
content,
@@ -281,7 +296,7 @@ function finalizeChatCompletion(snapshot: ChatCompletionSnapshot): ChatCompletio
281
296
},
282
297
};
283
298
}
284
-
return{message: {content: content, role }, finish_reason, index };
299
+
return{message: {content: content, role }, finish_reason, index, logprobs};
0 commit comments