Skip to content

Commit

Permalink
hotfix openai function call tool_calls no index
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydzhou committed Sep 22, 2024
1 parent 4d1f9e4 commit 3a96905
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/client/platforms/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ export class ChatGPTApi implements LLMApi {
}>;
const tool_calls = choices[0]?.delta?.tool_calls;
if (tool_calls?.length > 0) {
index += 1;
const id = tool_calls[0]?.id;
const args = tool_calls[0]?.function?.arguments;
if (id) {
index += 1;
runTools.push({
id,
type: tool_calls[0]?.type,
Expand Down

0 comments on commit 3a96905

Please sign in to comment.