mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-03 00:58:50 +01:00
🤖 refactor: Side Panel Agent UI To Account For Ephemeral Agents (#9763)
* refactor: Remove unused imports and consolidate ephemeral agent logic * refactor: Side Panel agent handling to account for ephemeral agents for UI * refactor: Replace Constants.EPHEMERAL_AGENT_ID checks with isEphemeralAgent utility for consistency * ci: AgentPanel tests with additional mock configurations and utility functions
This commit is contained in:
parent
a6bf2b6ce3
commit
8a60e8990f
20 changed files with 87 additions and 77 deletions
|
|
@ -1,10 +1,10 @@
|
|||
import {
|
||||
Constants,
|
||||
isAgentsEndpoint,
|
||||
tQueryParamsSchema,
|
||||
isAssistantsEndpoint,
|
||||
} from 'librechat-data-provider';
|
||||
import type { TConversation, TPreset } from 'librechat-data-provider';
|
||||
import { isEphemeralAgent } from '~/common';
|
||||
|
||||
const allowedParams = Object.keys(tQueryParamsSchema.shape);
|
||||
export default function createChatSearchParams(
|
||||
|
|
@ -33,7 +33,7 @@ export default function createChatSearchParams(
|
|||
if (
|
||||
isAgentsEndpoint(endpoint) &&
|
||||
conversation.agent_id &&
|
||||
conversation.agent_id !== Constants.EPHEMERAL_AGENT_ID
|
||||
!isEphemeralAgent(conversation.agent_id)
|
||||
) {
|
||||
return new URLSearchParams({ agent_id: String(conversation.agent_id) });
|
||||
} else if (isAssistantsEndpoint(endpoint) && conversation.assistant_id) {
|
||||
|
|
@ -53,7 +53,7 @@ export default function createChatSearchParams(
|
|||
|
||||
const paramMap: Record<string, any> = {};
|
||||
allowedParams.forEach((key) => {
|
||||
if (key === 'agent_id' && conversation.agent_id === Constants.EPHEMERAL_AGENT_ID) {
|
||||
if (key === 'agent_id' && isEphemeralAgent(conversation.agent_id)) {
|
||||
return;
|
||||
}
|
||||
if (key !== 'endpoint' && key !== 'model') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue