You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
### Added
11
11
12
+
-**AI SDUI Chatbot integration** (`@object-ui/plugin-chatbot`): Refactored chatbot plugin to support full AI streaming via `service-ai` backend and `vercel/ai` SDK (`@ai-sdk/react`). New `useObjectChat` composable hook wraps `@ai-sdk/react`'s `useChat` for SSE streaming, tool-calling, and production-grade chat. Auto-detects API mode (when `api` schema field is set) vs legacy local auto-response mode. ChatbotEnhanced component now supports stop, reload, error display, and streaming state indicators. 44 unit tests (19 new hook tests, 10 new streaming tests).
13
+
14
+
-**New ChatbotSchema fields** (`@object-ui/types`): Extended `ChatbotSchema` with `api`, `conversationId`, `systemPrompt`, `model`, `streamingEnabled`, `headers`, `body`, `maxToolRoundtrips`, and `onError` fields for service-ai integration. Extended `ChatMessage` with `streaming`, `toolInvocations` fields and added `ChatToolInvocation` interface for tool-calling flows.
15
+
16
+
-**New Storybook stories for AI chatbot** (`@object-ui/components`): Added `AIStreamingMode`, `AIWithSystemPrompt`, and `AIWithToolCalls` stories demonstrating the new AI SDUI chat modes alongside existing local/demo stories.
17
+
12
18
-**Object Manager visual designer** (`@object-ui/plugin-designer`): Enterprise-grade object management interface for creating, editing, deleting, and configuring meta-object definitions. Uses standard ObjectGrid for the list view and ModalForm for create/edit operations. Features include property editing (name, label, plural label, description, icon, group, sort order, enabled toggle), object relationship display, search/filter, system object protection, confirm dialogs for destructive actions, and read-only mode. 18 unit tests.
13
19
14
20
-**Field Designer visual designer** (`@object-ui/plugin-designer`): Enterprise-grade field configuration wizard supporting 27 field types with full CRUD operations. Uses standard ObjectGrid for the list view with a specialized FieldEditor panel for advanced type-specific properties. Features include uniqueness constraints, default values, picklist/option set management, read-only, hidden, validation rules (min/max/length/pattern/custom), external ID, history tracking, and database indexing. Type-specific editors for lookup references, formula expressions, and select options. Field type filtering, search, system field protection, and read-only mode. 22 unit tests.
|`systemPrompt`| string | - | System prompt to configure assistant behavior |
222
+
|`model`| string | - | AI model identifier (e.g., `gpt-4o`) |
223
+
|`streamingEnabled`| boolean |`true`| Enable SSE streaming for AI responses |
224
+
|`headers`| object | - | Additional headers for API requests |
225
+
|`body`| object | - | Additional body params for API requests |
226
+
|`maxToolRoundtrips`| number |`5`| Max tool-calling round-trips per message |
227
+
|`onError`| function | - | Error callback for streaming/API errors |
228
+
229
+
## Operating Modes
230
+
231
+
The chatbot supports two modes, automatically selected based on the `api` field:
232
+
233
+
### Local/Demo Mode (default)
234
+
235
+
When `api` is not set, the chatbot operates in local mode with optional auto-response:
236
+
237
+
```tsx
238
+
const schema = {
239
+
type: 'chatbot',
240
+
messages: [...],
241
+
autoResponse: true,
242
+
autoResponseText: 'Thanks!',
243
+
autoResponseDelay: 1000,
244
+
};
245
+
```
246
+
247
+
### AI Streaming Mode (service-ai)
248
+
249
+
When `api` is set, the chatbot uses `@ai-sdk/react` for real SSE streaming:
250
+
251
+
```tsx
252
+
const schema = {
253
+
type: 'chatbot',
254
+
api: '/api/v1/ai/chat',
255
+
model: 'gpt-4o',
256
+
systemPrompt: 'You are a helpful assistant.',
257
+
streamingEnabled: true,
258
+
messages: [],
259
+
};
260
+
```
208
261
209
262
## Message Roles
210
263
@@ -246,6 +299,27 @@ System messages appear centered with muted styling:
246
299
}
247
300
```
248
301
302
+
### Tool Messages (AI Mode)
303
+
304
+
Tool messages represent results from tool invocations during AI streaming. They are generated automatically by the vercel/ai SDK when the backend performs tool calls (e.g., fetching weather, querying a database). The SDK may emit `role: 'tool'` messages as well as populate the assistant message's `toolInvocations` array. In the current chat UI, any non-`user` role (including `tool`) is rendered as an assistant bubble, so if you do not want raw tool messages to appear you should filter them out before rendering and instead rely on the assistant message's `toolInvocations`:
305
+
306
+
```tsx
307
+
{
308
+
id: '4',
309
+
role: 'assistant',
310
+
content: 'The weather in SF is 68°F.',
311
+
toolInvocations: [
312
+
{
313
+
toolCallId: 'tc-1',
314
+
toolName: 'getWeather',
315
+
args: { city: 'San Francisco' },
316
+
result: { temp: 68, condition: 'Sunny' },
317
+
state: 'result',
318
+
}
319
+
]
320
+
}
321
+
```
322
+
249
323
## Examples
250
324
251
325
### Simple AI Chat
@@ -445,8 +519,10 @@ const schema = {
445
519
## TypeScript Support
446
520
447
521
```plaintext
448
-
import type { ChatbotSchema, ChatMessage } from '@object-ui/types'
522
+
import type { ChatbotSchema, ChatMessage, ChatToolInvocation } from '@object-ui/types'
523
+
import { useObjectChat } from '@object-ui/plugin-chatbot'
0 commit comments