From c4f1406444877887bd9fea64f06ce707c1744410 Mon Sep 17 00:00:00 2001 From: ramnique <30795890+ramnique@users.noreply.github.com> Date: Thu, 20 Feb 2025 13:54:11 +0530 Subject: [PATCH] support @mentions in agent examples --- apps/rowboat/app/lib/types/agents_api_types.ts | 4 +++- .../app/projects/[projectId]/workflow/agent_config.tsx | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/rowboat/app/lib/types/agents_api_types.ts b/apps/rowboat/app/lib/types/agents_api_types.ts index 9b34f84f..42e9e950 100644 --- a/apps/rowboat/app/lib/types/agents_api_types.ts +++ b/apps/rowboat/app/lib/types/agents_api_types.ts @@ -72,7 +72,9 @@ export function convertWorkflowToAgenticAPI(workflow: z.infer): agents: workflow.agents .filter(agent => !agent.disabled) .map(agent => { - const { sanitized, entities } = sanitizeTextWithMentions(agent.instructions, workflow); + const compiledInstructions = agent.instructions + + (agent.examples ? '\n\n# Examples\n' + agent.examples : ''); + const { sanitized, entities } = sanitizeTextWithMentions(compiledInstructions, workflow); const agenticAgent: z.infer = { name: agent.name, diff --git a/apps/rowboat/app/projects/[projectId]/workflow/agent_config.tsx b/apps/rowboat/app/projects/[projectId]/workflow/agent_config.tsx index b9050712..09a897ec 100644 --- a/apps/rowboat/app/projects/[projectId]/workflow/agent_config.tsx +++ b/apps/rowboat/app/projects/[projectId]/workflow/agent_config.tsx @@ -147,6 +147,8 @@ export function AgentConfig({ markdown label="Examples" multiline + mentions + mentionsAtValues={atMentions} />