Skip to content

Commit 1284466

Browse files
authored
🐛 fix: Preserve Default Model in Message Requests (danny-avila#1857)
* fix: do not remove default model from message request * chore: bump data-provider
1 parent dd8038b commit 1284466

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

packages/data-provider/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "librechat-data-provider",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "data services for librechat apps",
55
"main": "dist/index.js",
66
"module": "dist/index.es.js",

packages/data-provider/src/schemas.ts

-17
Original file line numberDiff line numberDiff line change
@@ -506,9 +506,6 @@ export const compactOpenAISchema = tConversationSchema
506506
})
507507
.transform((obj: Partial<TConversation>) => {
508508
const newObj: Partial<TConversation> = { ...obj };
509-
if (newObj.model === 'gpt-3.5-turbo') {
510-
delete newObj.model;
511-
}
512509
if (newObj.temperature === 1) {
513510
delete newObj.temperature;
514511
}
@@ -545,9 +542,6 @@ export const compactGoogleSchema = tConversationSchema
545542
})
546543
.transform((obj) => {
547544
const newObj: Partial<TConversation> = { ...obj };
548-
if (newObj.model === google.model.default) {
549-
delete newObj.model;
550-
}
551545
if (newObj.temperature === google.temperature.default) {
552546
delete newObj.temperature;
553547
}
@@ -577,9 +571,6 @@ export const compactAnthropicSchema = tConversationSchema
577571
})
578572
.transform((obj) => {
579573
const newObj: Partial<TConversation> = { ...obj };
580-
if (newObj.model === 'claude-1') {
581-
delete newObj.model;
582-
}
583574
if (newObj.temperature === 1) {
584575
delete newObj.temperature;
585576
}
@@ -603,11 +594,6 @@ export const compactChatGPTSchema = tConversationSchema
603594
})
604595
.transform((obj) => {
605596
const newObj: Partial<TConversation> = { ...obj };
606-
// model: obj.model ?? 'text-davinci-002-render-sha',
607-
if (newObj.model === 'text-davinci-002-render-sha') {
608-
delete newObj.model;
609-
}
610-
611597
return removeNullishValues(newObj);
612598
})
613599
.catch(() => ({}));
@@ -626,9 +612,6 @@ export const compactPluginsSchema = tConversationSchema
626612
})
627613
.transform((obj) => {
628614
const newObj: Partial<TConversation> = { ...obj };
629-
if (newObj.model === 'gpt-3.5-turbo') {
630-
delete newObj.model;
631-
}
632615
if (newObj.chatGptLabel === null) {
633616
delete newObj.chatGptLabel;
634617
}

0 commit comments

Comments
 (0)