Skip to content

Commit 9aae34e

Browse files
authored
Merge branch 'main' into feature/react-native-ui-kit-search-and-swipe-to-reply-new
2 parents d11e74e + 706494e commit 9aae34e

304 files changed

Lines changed: 30716 additions & 16744 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.DS_Store
22

3-
3+
.kiro/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2025 CometChat, Inc.
1+
Copyright (c) 2026 CometChat, Inc.
22

33
For full legal terms and privacy policy, please visit:
44
https://www.cometchat.com/legal-privacy-policy

ai-agents.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ description: "Build and ship AI agents in chat: pick a provider, connect your ag
66
canonical: "https://cometchat.com/docs/ai-agents"
77
---
88

9-
import { CardGroup, Card, Icon, Badge, Steps, Step, Columns, AccordionGroup, Accordion, Callout, Tabs, Tab } from 'mintlify';
109

1110
{/* Hero */}
12-
<div className="relative w-full flex items-center justify-center" style={{ height: '20rem', overflow: 'hidden' }}>
13-
<div className="absolute inset-0 bg-primary dark:bg-primary-light" style={{ opacity: 0.05 }}/>
11+
<div className="relative w-full flex items-center justify-center h-80 overflow-hidden">
12+
<div className="absolute inset-0 bg-primary dark:bg-primary-light opacity-[0.05]"/>
1413

15-
<div style={{maxWidth: '70rem', marginLeft: 'auto', marginRight: 'auto', paddingLeft: '1.25rem', paddingRight: '1.25rem' }}>
14+
<div className="max-w-[70rem] mx-auto px-5">
1615
<Columns cols={2} className="items-center gap-x-12">
1716
<div className="flex flex-col justify-center h-full text-center md:text-left">
18-
<h1 className="text-gray-700 dark:text-white" style={{ fontSize: '2.2rem', fontWeight: '600' }}>AI Agents</h1>
17+
<h1 className="text-gray-700 dark:text-white text-[2.2rem] font-semibold">AI Agents</h1>
1918
<p className="text-lg text-gray-600">
2019
Plug in your provider, wire actions, and ship chat UI — in minutes, not sprints.
2120
</p>
@@ -32,7 +31,7 @@ import { CardGroup, Card, Icon, Badge, Steps, Step, Columns, AccordionGroup, Acc
3231

3332
</div>
3433

35-
<div style={{marginTop: '2rem', marginBottom: '2rem', maxWidth: '70rem', marginLeft: 'auto', marginRight: 'auto', paddingLeft: '1.25rem', paddingRight: '1.25rem' }}>
34+
<div className="mt-8 mb-8 max-w-[70rem] mx-auto px-5">
3635

3736
{/* Overview */}
3837
<div className="mb-10">
@@ -131,10 +130,10 @@ Because CometChat AI Agents are model-agnostic, you can swap providers or upgrad
131130
</div>
132131

133132
{/* Footer */}
134-
<div className="flex flex-col w-full mt-8" style={{ background: 'black' }}>
133+
<div className="flex flex-col w-full mt-8 bg-black -mb-24">
135134
<div className="bg-black text-gray-400 py-6 px-8 flex flex-col md:flex-row justify-between items-center rounded-t-xl">
136135
<div className="mb-4 md:mb-0">
137-
2025 © CometChat
136+
2026 © CometChat
138137
</div>
139138
<div className="flex space-x-6 items-center">
140139
<a href="https://www.linkedin.com/company/cometchat" target="_blank" className="flex items-center space-x-1 hover:text-white transition-colors">

ai-agents/ag2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Choose how you’ll ship the experience (Widget or React UI Kit export).
156156
157157
<Steps>
158158
<Step title="Decide delivery mode">Pick <b>Chat Widget</b> (fastest) or export <b>React UI Kit</b> for code-level customization.</Step>
159-
<Step title="Widget path">Open <b>UI Kit Builder</b> → Get Embedded Code → copy script + credentials.</Step>
159+
<Step title="Widget path">Open <b>Widget Builder</b> → Get Embedded Code → copy script + credentials.</Step>
160160
<Step title="React UI Kit path">Export the variant as code (UI Kit) if you need deep theming or custom logic.</Step>
161161
<Step title="Verify agent inclusion">Preview: the AG2 agent should appear without extra config.</Step>
162162
</Steps>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: "Frontend Actions"
3+
sidebarTitle: "Frontend Actions"
4+
description: "Enable your agent to trigger client-side behaviors like opening modals, navigating pages, or displaying notifications."
5+
---
6+
7+
import { Callout } from 'mintlify';
8+
9+
## What are Frontend Actions?
10+
11+
Frontend Actions allow your AI agent to trigger client-side behaviors in your application. Instead of just responding with text, the agent can initiate UI interactions—opening modals, navigating to pages, showing notifications, or calling custom functions in your app.
12+
13+
## How Frontend Actions Work
14+
15+
When the agent determines a frontend action should be triggered, it invokes the action as a tool call. Your client application receives this via the SDK's real-time events. The tool call events include the trigger function identifier and any parameters, which your app interprets and executes.
16+
17+
## Adding a Frontend Action
18+
19+
1. In Agent Builder, open the **Tools** section.
20+
2. Switch to the **Frontend Actions** tab.
21+
3. Click **+ Add Frontend Action**.
22+
4. Configure the action:
23+
- **Name*** – display name for the action (e.g., "Open Settings Modal")
24+
- **Description*** – explain what the action does so the agent knows when to use it
25+
- **Trigger Function*** – the function or method identifier your client app will handle (e.g., `openSettingsModal`)
26+
- **Parameters** – optional parameters the action accepts
27+
5. Save to register the action.
28+
29+
## Using Frontend Actions
30+
31+
### Enable/Disable per Agent
32+
33+
Each frontend action has a toggle to enable or disable it for the current agent. Once enabled, the agent can use the action based on its description—even without explicit mention in instructions.
34+
35+
### Referencing in Instructions (Optional)
36+
37+
While enabled actions are automatically available to the agent, you can reference them in instructions to provide additional context about when to use them. This helps the agent make better decisions, especially when:
38+
39+
- Multiple actions could apply to similar situations
40+
- You want to specify exact conditions for triggering an action
41+
- The action description alone may not capture all nuances
42+
43+
To insert an action reference:
44+
45+
1. Type `@` in the Instructions Editor.
46+
2. Navigate to the **Frontend Actions** category.
47+
3. Select an action to insert a reference.
48+
49+
**Syntax:** `@action:triggerFunctionName` (e.g., `@action:openModal`)
50+
51+
<Callout type="tip">
52+
You can also copy the syntax from the Frontend Actions list and paste it directly into the Instructions Editor.
53+
</Callout>
54+
55+
## Registering Frontend Actions
56+
57+
To handle these tool calls, register your action handlers with the UIKit component. Create a mapping of action names to callback functions, where each key matches a trigger function defined in your agent's configuration, and each value is a function that executes when that action is invoked.
58+
59+
Pass this mapping to the message list or AI assistant chat component using the `aiAssistantTools` property (or equivalent setter method depending on your platform). When the agent triggers a tool call, UIKit automatically routes it to your registered handler, passing along any arguments the agent provided.
60+
61+
This approach lets you:
62+
63+
- Dynamically update UI elements based on agent decisions
64+
- Trigger navigation, modals, or other app-specific behaviors
65+
- Execute business logic in response to conversational context
66+
67+
68+
## Common Use Cases
69+
70+
- **Navigation** – guide users to specific pages or sections
71+
- **Modals/Dialogs** – open forms, confirmations, or detail views
72+
- **Notifications** – display success messages or alerts
73+
- **Form Actions** – pre-fill forms or trigger submissions
74+
- **UI State** – toggle sidebars, expand sections, or change views
75+
76+
## Orphaned Actions
77+
78+
If a frontend action is deleted, renamed, or disabled after being referenced in instructions, it will display with a warning indicator. Update your instructions to use the correct action name or remove the orphaned reference.
79+
80+
## Best Practices
81+
82+
- Write clear descriptions so the agent understands when to trigger each action.
83+
- Use consistent naming conventions for trigger functions across your app.
84+
- Handle missing or invalid parameters gracefully in your client code.
85+
- Test actions in the Test console to verify the agent triggers them appropriately.
86+
- Keep the number of actions manageable—too many options can confuse the agent's decision-making.

0 commit comments

Comments
 (0)