Skip to content

Commit

Permalink
fix a bug with execute_only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
atinylittleshell committed Aug 20, 2023
1 parent c950984 commit 04eb21b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-cheetahs-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'function-gpt': patch
---

fix a bug with execute_only mode
10 changes: 8 additions & 2 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ export class ChatGPTSession {
content: message,
});

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { function_call_execute_only, ...optionsToSend } = options;

const response = await this.openai.chat.completions.create({
...options,
...optionsToSend,
messages: this.sessionMessages,
functions: this.getFunctionSchema(),
});
Expand Down Expand Up @@ -250,8 +253,11 @@ export class ChatGPTSession {
return '';
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { function_call_execute_only, ...optionsToSend } = options;

const response = await this.openai.chat.completions.create({
...options,
...optionsToSend,
messages: this.sessionMessages,
functions: this.getFunctionSchema(),
});
Expand Down

0 comments on commit 04eb21b

Please sign in to comment.