🤖 feat: Support o4-mini and o3 Models (#6928)

* feat: Add support for new OpenAI models (o4-mini, o3) and update related logic

* 🔧 fix: Rename 'resubmitFiles' to 'isResubmission' for consistency across types and hooks

* 🔧 fix: Replace hardcoded 'pending_req' with CacheKeys.PENDING_REQ for consistency in cache handling

* 🔧 fix: Update cache handling to use Time.ONE_MINUTE instead of hardcoded TTL and streamline imports

* 🔧 fix: Enhance message handling logic to correctly identify parent messages and streamline imports in useSSE
This commit is contained in:
Danny Avila 2025-04-17 00:40:26 -04:00 committed by GitHub
parent 88f4ad7c47
commit 52f146dd97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 69 additions and 53 deletions

View file

@ -1,7 +1,8 @@
import debounce from 'lodash/debounce';
import { SetterOrUpdater, useRecoilValue } from 'recoil';
import { useState, useEffect, useMemo, useCallback } from 'react';
import { LocalStorageKeys, TFile } from 'librechat-data-provider';
import { LocalStorageKeys, Constants } from 'librechat-data-provider';
import type { TFile } from 'librechat-data-provider';
import type { ExtendedFile } from '~/common';
import { useChatFormContext } from '~/Providers';
import { useGetFiles } from '~/data-provider';
@ -34,11 +35,13 @@ const decodeBase64 = (base64String: string): string => {
};
export const useAutoSave = ({
conversationId,
isSubmitting,
conversationId: _conversationId,
textAreaRef,
setFiles,
files,
}: {
isSubmitting?: boolean;
conversationId?: string | null;
textAreaRef?: React.RefObject<HTMLTextAreaElement>;
files: Map<string, ExtendedFile>;
@ -47,6 +50,7 @@ export const useAutoSave = ({
// setting for auto-save
const { setValue } = useChatFormContext();
const saveDrafts = useRecoilValue<boolean>(store.saveDrafts);
const conversationId = isSubmitting ? Constants.PENDING_CONVO : _conversationId;
const [currentConversationId, setCurrentConversationId] = useState<string | null>(null);
const fileIds = useMemo(() => Array.from(files.keys()), [files]);