mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
🤖 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:
parent
65888c274a
commit
b85c6206ab
3 changed files with 26 additions and 16 deletions
|
@ -842,6 +842,7 @@ class OpenAIClient extends BaseClient {
|
|||
}
|
||||
|
||||
const titleChatCompletion = async () => {
|
||||
try {
|
||||
modelOptions.model = model;
|
||||
|
||||
if (this.azure) {
|
||||
|
@ -862,7 +863,6 @@ ${convo}
|
|||
|
||||
const promptTokens = this.getTokenCountForMessage(instructionsPayload[0]);
|
||||
|
||||
try {
|
||||
let useChatCompletion = true;
|
||||
|
||||
if (this.options.reverseProxyUrl === CohereConstants.API_URL) {
|
||||
|
|
|
@ -329,7 +329,7 @@ class StreamRunManager {
|
|||
}
|
||||
} else if (typeof delta[key] === 'string' && typeof data[key] === 'string') {
|
||||
// Concatenate strings
|
||||
data[key] += delta[key];
|
||||
// data[key] += delta[key];
|
||||
} else if (
|
||||
typeof delta[key] === 'object' &&
|
||||
delta[key] !== null &&
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue