Skip to content

Commit

Permalink
refine agent
Browse files Browse the repository at this point in the history
  • Loading branch information
Jicheng Lu committed Dec 13, 2024
1 parent 22f588c commit 27b5a04
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lib/helpers/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const agentType = {
Routing: 'routing',
Task: 'task',
Static: 'static',
Evaluating: 'evaluating'
Evaluating: 'evaluating',
Planning: 'planning'
};
export const AgentType = Object.freeze(agentType);

Expand Down
1 change: 1 addition & 0 deletions src/lib/helpers/types/agentTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/routes/page/agent/[agentId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
19 changes: 18 additions & 1 deletion src/routes/page/agent/[agentId]/agent-overview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
<td>
{#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}
Expand Down Expand Up @@ -139,7 +141,6 @@
</div>
</td>
</tr>
<tr>
<th class="agent-prop-key">Status</th>
<td>
Expand All @@ -149,6 +150,22 @@
</div>
</td>
</tr>
<tr>
<th class="agent-prop-key">Max message count</th>
<td>
<div class="mb-3">
<Input
type="number"
style="width: 50%; min-width: 100px;"
class="text-center"
min={1}
max={1000}
step={1}
bind:value={agent.max_message_count}
/>
</div>
</td>
</tr>
<tr>
<th class="agent-prop-key">Created Date</th>
<td>{format(agent.created_datetime, 'time')}</td>
Expand Down

0 comments on commit 27b5a04

Please sign in to comment.