Skip to content

Commit 328611e

Browse files
committed
feat: Chat Embed - support @agent requests (#4154)
1 parent eb77876 commit 328611e

File tree

9 files changed

+519
-2
lines changed

9 files changed

+519
-2
lines changed

frontend/src/pages/GeneralSettings/ChatEmbedWidgets/EmbedConfigs/EmbedRow/EditEmbedModal/index.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ export default function EditEmbedModal({ embed, closeModal }) {
9494
hint="Allow setting of the system prompt to override the workspace default."
9595
defaultValue={embed.allow_prompt_override}
9696
/>
97+
<BooleanInput
98+
name="allow_agent"
99+
title="Enable Agent Support"
100+
hint="Allow users to invoke AI agents using @agent commands."
101+
defaultValue={embed.allow_agent}
102+
/>
97103

98104
{error && <p className="text-red-400 text-sm">Error: {error}</p>}
99105
<p className="text-white text-opacity-60 text-xs md:text-sm">

frontend/src/pages/GeneralSettings/ChatEmbedWidgets/EmbedConfigs/EmbedRow/index.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,17 @@ export default function EmbedRow({ embed }) {
7474
href={paths.workspace.chat(embed.workspace.slug)}
7575
target="_blank"
7676
rel="noreferrer"
77-
className="text-white flex items-center hover:underline"
77+
className="text-white flex items-center hover:underline gap-x-2"
7878
>
7979
{embed.workspace.name}
80+
{embed.allow_agent && (
81+
<span
82+
className="inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 border border-green-200"
83+
title="Agent support enabled"
84+
>
85+
@
86+
</span>
87+
)}
8088
</a>
8189
</th>
8290
<th scope="row" className="px-6 whitespace-nowrap">

frontend/src/pages/GeneralSettings/ChatEmbedWidgets/EmbedConfigs/NewEmbedModal/index.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export function enforceSubmissionSchema(form) {
2020
data.allow_temperature_override = false;
2121
if (!data.hasOwnProperty("allow_prompt_override"))
2222
data.allow_prompt_override = false;
23+
if (!data.hasOwnProperty("allow_agent"))
24+
data.allow_agent = false;
2325
if (!data.hasOwnProperty("message_limit")) data.message_limit = 20;
2426
return data;
2527
}
@@ -91,6 +93,11 @@ export default function NewEmbedModal({ closeModal }) {
9193
title="Enable Prompt Override"
9294
hint="Allow setting of the system prompt to override the workspace default."
9395
/>
96+
<BooleanInput
97+
name="allow_agent"
98+
title="Enable Agent Support"
99+
hint="Allow users to invoke AI agents using @agent commands. Requires the workspace to have agents configured."
100+
/>
94101

95102
{error && <p className="text-red-400 text-sm">Error: {error}</p>}
96103
<p className="text-white text-opacity-60 text-xs md:text-sm">
@@ -354,7 +361,7 @@ export const BooleanInput = ({ name, title, hint, defaultValue = null }) => {
354361
<input
355362
name={name}
356363
type="checkbox"
357-
onClick={() => setStatus(!status)}
364+
onChange={() => setStatus(!status)}
358365
checked={status}
359366
className="peer sr-only pointer-events-none"
360367
/>

0 commit comments

Comments
 (0)