Skip to content

Commit b117c3c

Browse files
authored
Fix setOptions() to properly handle modelOptions (danny-avila#975)
For danny-avila#974 - Adds an else to the check for this.modelOptions - Allows the modelOptions to be updated when the model is already initialized
1 parent 1376894 commit b117c3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/clients/OpenAIClient.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ class OpenAIClient extends BaseClient {
5959
typeof modelOptions.presence_penalty === 'undefined' ? 1 : modelOptions.presence_penalty,
6060
stop: modelOptions.stop,
6161
};
62+
} else {
63+
// Update the modelOptions if it already exists
64+
this.modelOptions = {
65+
...this.modelOptions,
66+
...modelOptions,
67+
};
6268
}
6369

6470
if (process.env.OPENROUTER_API_KEY) {

0 commit comments

Comments
 (0)