mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-25 11:46:12 +01:00
📛 feat: Chat Badges via Model Specs (#10272)
* refactor: remove `useChatContext` from `useSelectMention`, explicitly pass `conversation` object * feat: ephemeral agents via model specs * refactor: Sync Jotai state with ephemeral agent state, also when Ephemeral Agent has no MCP servers selected * refactor: move `useUpdateEphemeralAgent` to store and clean up imports * refactor: reorder imports and invalidate queries for mcpConnectionStatus in event handler * refactor: replace useApplyModelSpecEffects with useApplyModelSpecAgents and update event handlers to use new agent template logic * ci: update useMCPSelect test to verify mcpValues sync with empty ephemeralAgent.mcp
This commit is contained in:
parent
64df54528d
commit
33d6b337bc
17 changed files with 254 additions and 41 deletions
|
|
@ -29,6 +29,7 @@ import {
|
|||
import { useDeleteFilesMutation, useGetEndpointsQuery, useGetStartupConfig } from '~/data-provider';
|
||||
import useAssistantListMap from './Assistants/useAssistantListMap';
|
||||
import { useResetChatBadges } from './useChatBadges';
|
||||
import { useApplyModelSpecEffects } from './Agents';
|
||||
import { usePauseGlobalAudio } from './Audio';
|
||||
import { logger } from '~/utils';
|
||||
import store from '~/store';
|
||||
|
|
@ -37,6 +38,7 @@ const useNewConvo = (index = 0) => {
|
|||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
const { data: startupConfig } = useGetStartupConfig();
|
||||
const applyModelSpecEffects = useApplyModelSpecEffects();
|
||||
const clearAllConversations = store.useClearConvoState();
|
||||
const defaultPreset = useRecoilValue(store.defaultPreset);
|
||||
const { setConversation } = store.useCreateConversationAtom(index);
|
||||
|
|
@ -265,6 +267,12 @@ const useNewConvo = (index = 0) => {
|
|||
preset = getModelSpecPreset(defaultModelSpec);
|
||||
}
|
||||
|
||||
applyModelSpecEffects({
|
||||
startupConfig,
|
||||
specName: preset?.spec,
|
||||
convoId: conversation.conversationId,
|
||||
});
|
||||
|
||||
if (conversation.conversationId === Constants.NEW_CONVO && !modelsData) {
|
||||
const filesToDelete = Array.from(files.values())
|
||||
.filter(
|
||||
|
|
@ -311,6 +319,7 @@ const useNewConvo = (index = 0) => {
|
|||
saveBadgesState,
|
||||
pauseGlobalAudio,
|
||||
switchToConversation,
|
||||
applyModelSpecEffects,
|
||||
],
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue