From 27b5a048b05c4ee692624b356b0f38d8cc888af0 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Fri, 13 Dec 2024 14:58:05 -0600 Subject: [PATCH] refine agent --- src/lib/helpers/enums.js | 3 ++- src/lib/helpers/types/agentTypes.js | 1 + src/routes/page/agent/[agentId]/+page.svelte | 3 ++- .../agent/[agentId]/agent-overview.svelte | 19 ++++++++++++++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/lib/helpers/enums.js b/src/lib/helpers/enums.js index af4db401..569a39ce 100644 --- a/src/lib/helpers/enums.js +++ b/src/lib/helpers/enums.js @@ -66,7 +66,8 @@ const agentType = { Routing: 'routing', Task: 'task', Static: 'static', - Evaluating: 'evaluating' + Evaluating: 'evaluating', + Planning: 'planning' }; export const AgentType = Object.freeze(agentType); diff --git a/src/lib/helpers/types/agentTypes.js b/src/lib/helpers/types/agentTypes.js index 1059e53a..8e8c10e4 100644 --- a/src/lib/helpers/types/agentTypes.js +++ b/src/lib/helpers/types/agentTypes.js @@ -50,6 +50,7 @@ * @property {string} icon_url - Icon * @property {string[]} profiles - The agent profiles. * @property {boolean} merge_utility - Merge utility + * @property {number?} [max_message_count] * @property {AgentUtility[]} utilities - The agent utilities. * @property {Date} created_datetime * @property {Date} updated_datetime diff --git a/src/routes/page/agent/[agentId]/+page.svelte b/src/routes/page/agent/[agentId]/+page.svelte index 89421c4d..3a8781a2 100644 --- a/src/routes/page/agent/[agentId]/+page.svelte +++ b/src/routes/page/agent/[agentId]/+page.svelte @@ -77,7 +77,8 @@ instruction: agent.instruction || '', channel_instructions: agent.channel_instructions || [], profiles: agent.profiles?.filter((x, idx, self) => x?.trim()?.length > 0 && self.indexOf(x) === idx) || [], - utilities: agent.utilities || [] + utilities: agent.utilities || [], + max_message_count: Number(agent.max_message_count) > 0 ? Number(agent.max_message_count) : null }; isLoading = true; saveAgent(agent).then(res => { diff --git a/src/routes/page/agent/[agentId]/agent-overview.svelte b/src/routes/page/agent/[agentId]/agent-overview.svelte index 08f2eb53..577771a5 100644 --- a/src/routes/page/agent/[agentId]/agent-overview.svelte +++ b/src/routes/page/agent/[agentId]/agent-overview.svelte @@ -72,6 +72,8 @@ {#if agent.type == AgentType.Routing} Routing Agent + {:else if agent.type == AgentType.Planning} + Planning Agent {:else if agent.type == AgentType.Evaluating} Evaluation Agent {:else if agent.type == AgentType.Static} @@ -139,7 +141,6 @@ - Status @@ -149,6 +150,22 @@ + + Max message count + +
+ +
+ + Created Date {format(agent.created_datetime, 'time')}