Skip to content

Commit

Permalink
🐛 fix: Preserve Default Model in Message Requests (#1857)
Browse files Browse the repository at this point in the history
* fix: do not remove default model from message request

* chore: bump data-provider
  • Loading branch information
danny-avila authored Feb 21, 2024
1 parent dd8038b commit 1284466
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion packages/data-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "librechat-data-provider",
"version": "0.4.2",
"version": "0.4.3",
"description": "data services for librechat apps",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
17 changes: 0 additions & 17 deletions packages/data-provider/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,6 @@ export const compactOpenAISchema = tConversationSchema
})
.transform((obj: Partial<TConversation>) => {
const newObj: Partial<TConversation> = { ...obj };
if (newObj.model === 'gpt-3.5-turbo') {
delete newObj.model;
}
if (newObj.temperature === 1) {
delete newObj.temperature;
}
Expand Down Expand Up @@ -545,9 +542,6 @@ export const compactGoogleSchema = tConversationSchema
})
.transform((obj) => {
const newObj: Partial<TConversation> = { ...obj };
if (newObj.model === google.model.default) {
delete newObj.model;
}
if (newObj.temperature === google.temperature.default) {
delete newObj.temperature;
}
Expand Down Expand Up @@ -577,9 +571,6 @@ export const compactAnthropicSchema = tConversationSchema
})
.transform((obj) => {
const newObj: Partial<TConversation> = { ...obj };
if (newObj.model === 'claude-1') {
delete newObj.model;
}
if (newObj.temperature === 1) {
delete newObj.temperature;
}
Expand All @@ -603,11 +594,6 @@ export const compactChatGPTSchema = tConversationSchema
})
.transform((obj) => {
const newObj: Partial<TConversation> = { ...obj };
// model: obj.model ?? 'text-davinci-002-render-sha',
if (newObj.model === 'text-davinci-002-render-sha') {
delete newObj.model;
}

return removeNullishValues(newObj);
})
.catch(() => ({}));
Expand All @@ -626,9 +612,6 @@ export const compactPluginsSchema = tConversationSchema
})
.transform((obj) => {
const newObj: Partial<TConversation> = { ...obj };
if (newObj.model === 'gpt-3.5-turbo') {
delete newObj.model;
}
if (newObj.chatGptLabel === null) {
delete newObj.chatGptLabel;
}
Expand Down

0 comments on commit 1284466

Please sign in to comment.