🤖 fix: Minor Assistants Issues (#4436)

* refactor(OpenAIClient): titleChatCompletion try/catch

* fix: remove duplicate concatenation as seems to be handled by client SDK now

* fix: assistants image upload

* chore: imports order
This commit is contained in:
Danny Avila 2024-10-16 15:04:10 -04:00 committed by GitHub
parent 65888c274a
commit b85c6206ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 16 deletions

View file

@ -1,6 +1,12 @@
import { EToolResources } from 'librechat-data-provider';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { dataService, MutationKeys, QueryKeys, defaultOrderQuery } from 'librechat-data-provider';
import {
QueryKeys,
dataService,
MutationKeys,
defaultOrderQuery,
isAssistantsEndpoint,
} from 'librechat-data-provider';
import type * as t from 'librechat-data-provider';
import type { UseMutationResult } from '@tanstack/react-query';
@ -27,8 +33,12 @@ export const useUploadFileMutation = (
const width = body.get('width') ?? '';
const height = body.get('height') ?? '';
const version = body.get('version') ?? '';
const endpoint = (body.get('endpoint') ?? '') as string;
if (isAssistantsEndpoint(endpoint) && version === '2') {
return dataService.uploadFile(body, signal);
}
if (width !== '' && height !== '' && (version !== '' || version.toString() !== '2')) {
if (width !== '' && height !== '') {
return dataService.uploadImage(body, signal);
}