🔄 fix: Assistants Endpoint & Minor Issues (#7274)

* 🔄 fix: Include usage in stream options for OpenAI and Azure endpoints

* fix: Agents support for Azure serverless endpoints

* fix: Refactor condition for assistants and azureAssistants endpoint handling

* AWS Titan via Bedrock: model doesn't support system messages, Closes #6456

* fix: Add EndpointSchemaKey type to endpoint parameters in buildDefaultConvo and ensure assistantId is always defined

* fix: Handle new conversation state for assistants endpoint in finalHandler

* fix: Add spec and iconURL parameters to `saveAssistantMessage` to persist modelSpec fields

* fix: Handle assistant unlinking even if no valid files to delete

* chore: move type definitions from callbacks.js to typedefs.js

* chore: Add StandardGraph typedef to typedefs.js

* chore: Update parameter type for graph in ModelEndHandler to StandardGraph

---------

Co-authored-by: Andres Restrepo <andres@enric.ai>
This commit is contained in:
Danny Avila 2025-05-07 17:11:33 -04:00 committed by GitHub
parent 3606349a0f
commit 71105cd49c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 119 additions and 35 deletions

View file

@ -4,7 +4,7 @@ import {
isAssistantsEndpoint,
isAgentsEndpoint,
} from 'librechat-data-provider';
import type { TConversation } from 'librechat-data-provider';
import type { TConversation, EndpointSchemaKey } from 'librechat-data-provider';
import { getLocalStorageItems } from './localStorage';
const buildDefaultConvo = ({
@ -51,8 +51,8 @@ const buildDefaultConvo = ({
}
const convo = parseConvo({
endpoint,
endpointType,
endpoint: endpoint as EndpointSchemaKey,
endpointType: endpointType as EndpointSchemaKey,
conversation: lastConversationSetup,
possibleValues: {
models: possibleModels,
@ -68,7 +68,7 @@ const buildDefaultConvo = ({
};
// Ensures assistant_id is always defined
const assistantId = convo?.assistant_id ?? '';
const assistantId = convo?.assistant_id ?? conversation?.assistant_id ?? '';
const defaultAssistantId = lastConversationSetup?.assistant_id ?? '';
if (isAssistantsEndpoint(endpoint) && !defaultAssistantId && assistantId) {
defaultConvo.assistant_id = assistantId;