mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-19 00:36:12 +01:00
🎉 feat: Optimizations and Anthropic Title Generation (#2184)
* feat: add claude-3-haiku-20240307 to default anthropic list * refactor: optimize `saveMessage` calls mid-stream via throttling * chore: remove addMetadata operations and consolidate in BaseClient * fix(listAssistantsForAzure): attempt to specify correct model mapping as accurately as possible (#2177) * refactor(client): update last conversation setup with current assistant model, call newConvo again when assistants load to allow fast initial load and ensure assistant model is always the default, not the last selected model * refactor(cache): explicitly add TTL of 2 minutes when setting titleCache and add default TTL of 10 minutes to abortKeys cache * feat(AnthropicClient): conversation titling using Anthropic Function Calling * chore: remove extraneous token usage logging * fix(convos): unhandled edge case for conversation grouping (undefined conversation) * style: Improved style of Search Bar after recent UI update * chore: remove unused code, content part helpers * feat: always show code option
This commit is contained in:
parent
8e7816468d
commit
1f0fb497f8
31 changed files with 426 additions and 188 deletions
|
|
@ -1,20 +0,0 @@
|
|||
import { ToolCallTypes } from 'librechat-data-provider';
|
||||
import type {
|
||||
ContentPart,
|
||||
CodeToolCall,
|
||||
ImageFile,
|
||||
Text,
|
||||
PartMetadata,
|
||||
} from 'librechat-data-provider';
|
||||
|
||||
export function isText(part: ContentPart): part is Text & PartMetadata {
|
||||
return (part as Text).value !== undefined;
|
||||
}
|
||||
|
||||
export function isCodeToolCall(part: ContentPart): part is CodeToolCall & PartMetadata {
|
||||
return (part as CodeToolCall).type === ToolCallTypes.CODE_INTERPRETER;
|
||||
}
|
||||
|
||||
export function isImageFile(part: ContentPart): part is ImageFile & PartMetadata {
|
||||
return (part as ImageFile).file_id !== undefined;
|
||||
}
|
||||
|
|
@ -42,6 +42,10 @@ export const groupConversationsByDate = (conversations: TConversation[]): Groupe
|
|||
|
||||
const seenConversationIds = new Set();
|
||||
const groups = conversations.reduce((acc, conversation) => {
|
||||
if (!conversation) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
if (seenConversationIds.has(conversation.conversationId)) {
|
||||
return acc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,12 @@ export function updateLastSelectedModel({
|
|||
if (!model) {
|
||||
return;
|
||||
}
|
||||
const lastConversationSetup = JSON.parse(localStorage.getItem('lastConversationSetup') || '{}');
|
||||
const lastSelectedModels = JSON.parse(localStorage.getItem('lastSelectedModel') || '{}');
|
||||
if (lastConversationSetup.endpoint === endpoint) {
|
||||
lastConversationSetup.model = model;
|
||||
localStorage.setItem('lastConversationSetup', JSON.stringify(lastConversationSetup));
|
||||
}
|
||||
lastSelectedModels[endpoint] = model;
|
||||
localStorage.setItem('lastSelectedModel', JSON.stringify(lastSelectedModels));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ export * from './files';
|
|||
export * from './latex';
|
||||
export * from './convos';
|
||||
export * from './presets';
|
||||
export * from './content';
|
||||
export * from './languages';
|
||||
export * from './endpoints';
|
||||
export { default as cn } from './cn';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue