@base44-preview/platform 0.2.0-pr.315.9332712 → 0.2.0-pr.315.b2d4aaf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/chat-items.d.ts +30 -30
- package/dist/react/chat-items.js +122 -89
- package/dist/react/chat.types.d.ts +185 -101
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/useBase44Chat.d.ts +15 -13
- package/dist/react/useBase44Chat.js +225 -170
- package/package.json +1 -1
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
import type { SocketSession } from "../client/modules/builder.types.js";
|
|
2
|
-
/** An app the
|
|
2
|
+
/** An app the AI chat works on. */
|
|
3
3
|
export interface Base44App {
|
|
4
|
-
/**
|
|
4
|
+
/** ID of the app, 24 lowercase hexadecimal characters. */
|
|
5
5
|
id: string;
|
|
6
|
-
/** Display name. */
|
|
6
|
+
/** Display name of the app. */
|
|
7
7
|
name: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/** An answer to a question the AI waits on. Declining is `approve: false`. */
|
|
10
10
|
export interface ToolCallAnswer {
|
|
11
|
-
/**
|
|
11
|
+
/** ID of the tool call being answered. */
|
|
12
12
|
toolCallId: string;
|
|
13
|
-
/**
|
|
13
|
+
/** ID of the assistant message that holds the tool call. */
|
|
14
14
|
messageId: string;
|
|
15
|
-
/** Whether to let the call run (`true`) or turn it down (`false`). */
|
|
15
|
+
/** Whether to let the tool call run (`true`) or turn it down (`false`). */
|
|
16
16
|
approve: boolean;
|
|
17
|
-
/**
|
|
17
|
+
/** What the question asked for. A choice sends `{ answers }`, and a secrets question sends `{ secrets }`. */
|
|
18
18
|
extraUserInput?: Record<string, unknown>;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* The four calls your backend
|
|
22
|
-
* credentials, so the hook never holds a workspace key or an access token, and the
|
|
23
|
-
* backend can be written in any language:
|
|
21
|
+
* The four calls your backend makes to Base44 for the chat.
|
|
24
22
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* Base44's response body unchanged. Called again whenever the session expires; sessions last
|
|
28
|
-
* one hour. The body holds a session token, never the workspace key.
|
|
29
|
-
* - `sendMessage`: `POST /api/apps/{id}/chat/message`. Base44 queues a prompt sent while the
|
|
30
|
-
* builder is busy, or refuses it with a 409 where the app has no queue: reject then.
|
|
31
|
-
* - `submitToolCallInput`: `POST /api/apps/{id}/chat/submit-tool-call-input`, with an
|
|
32
|
-
* `X-Request-ID` derived from the tool call id so a retry resumes the turn only once.
|
|
23
|
+
* Each call wraps one Base44 API request with your credentials, so the browser never holds a
|
|
24
|
+
* workspace API key or an access token. Your backend can be written in any language.
|
|
33
25
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
26
|
+
* - `createApp`: [Create app](/api-reference/create-app), with the first prompt as `initial_message`.
|
|
27
|
+
* - `openLiveSession`: [Create socket session](/api-reference/create-socket-session) with `{ app_ids: [appId] }`.
|
|
28
|
+
* Return the response body unchanged. It holds a session token, never the workspace API key.
|
|
29
|
+
* - `sendMessage`: [Send chat message](/api-reference/send-chat-message).
|
|
30
|
+
* - `submitToolCallInput`: [Submit tool-call input](/api-reference/submit-tool-call-input). Send an
|
|
31
|
+
* `X-Request-ID` built from the tool call ID, so a retry resumes the turn only once.
|
|
32
|
+
*
|
|
33
|
+
* Base44 keeps the Send chat message and Submit tool-call input requests open until the AI
|
|
34
|
+
* finishes the turn. Resolve your call once Base44 accepts the request, not when it returns. The
|
|
35
|
+
* chat follows the rest live. A rejected promise from any call sets {@link Base44Chat.error}.
|
|
37
36
|
*
|
|
38
37
|
* @example
|
|
39
38
|
* ```typescript
|
|
@@ -53,166 +52,251 @@ export interface ToolCallAnswer {
|
|
|
53
52
|
* ```
|
|
54
53
|
*/
|
|
55
54
|
export interface Base44ChatBackend {
|
|
56
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Creates an app from its first prompt. The AI starts building inside this call.
|
|
57
|
+
*
|
|
58
|
+
* @param prompt - The first prompt, which describes the app.
|
|
59
|
+
* @returns Promise resolving to the new app.
|
|
60
|
+
*/
|
|
57
61
|
createApp(prompt: string): Promise<Base44App>;
|
|
58
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Opens a read-only socket session for one app. The chat calls it on the first connect and again
|
|
64
|
+
* whenever the session expires. Sessions last one hour.
|
|
65
|
+
*
|
|
66
|
+
* @param appId - ID of the app to follow.
|
|
67
|
+
* @returns Promise resolving to the Create socket session response body, unchanged.
|
|
68
|
+
*/
|
|
59
69
|
openLiveSession(appId: string): Promise<SocketSession>;
|
|
60
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Sends a prompt to an existing app. Base44 queues a prompt sent while the AI is working. When the
|
|
72
|
+
* app has no queue, Base44 refuses it with a 409, so reject the promise.
|
|
73
|
+
*
|
|
74
|
+
* @param appId - ID of the app.
|
|
75
|
+
* @param content - The prompt.
|
|
76
|
+
* @returns Promise resolving once Base44 accepts the prompt.
|
|
77
|
+
*/
|
|
61
78
|
sendMessage(appId: string, content: string): Promise<void>;
|
|
62
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Answers or declines a question the AI waits on.
|
|
81
|
+
*
|
|
82
|
+
* @param appId - ID of the app.
|
|
83
|
+
* @param answer - The tool call and the answer to it.
|
|
84
|
+
* @returns Promise resolving once Base44 accepts the answer.
|
|
85
|
+
*/
|
|
63
86
|
submitToolCallInput(appId: string, answer: ToolCallAnswer): Promise<void>;
|
|
64
87
|
}
|
|
65
|
-
/** One message of the chat,
|
|
88
|
+
/** One message of the chat, shaped for rendering. */
|
|
66
89
|
export interface ChatItem {
|
|
67
|
-
/**
|
|
90
|
+
/** ID of the message. */
|
|
68
91
|
id: string;
|
|
69
|
-
/** Who wrote
|
|
92
|
+
/** Who wrote the message. */
|
|
70
93
|
role: "user" | "assistant";
|
|
71
|
-
/**
|
|
94
|
+
/** The message text, as raw markdown. It comes before the steps, and is empty when the message only holds tool calls. */
|
|
72
95
|
text: string;
|
|
73
|
-
/** When the message was created, as an ISO timestamp
|
|
74
|
-
* time zone and are UTC, and the browser's for a pending prompt. */
|
|
96
|
+
/** When the message was created, as an ISO timestamp. Base44's timestamps are UTC with no time zone. A pending prompt carries the browser's time. */
|
|
75
97
|
createdAt: string;
|
|
76
|
-
/** One per tool call, in order. */
|
|
98
|
+
/** One step per tool call, in order. */
|
|
77
99
|
steps: ChatStep[];
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
100
|
+
/**
|
|
101
|
+
* Whether this is a prompt sent from this chat that Base44 hasn't confirmed yet. It shows at once,
|
|
102
|
+
* and Base44's own message replaces it. A failed send removes it. A prompt sent while the AI is
|
|
103
|
+
* working waits in Base44's queue and stays pending until it runs.
|
|
104
|
+
*/
|
|
81
105
|
pending: boolean;
|
|
82
106
|
}
|
|
83
107
|
/** One tool call, as a line of activity. */
|
|
84
108
|
export interface ChatStep {
|
|
85
|
-
/**
|
|
109
|
+
/** ID of the tool call. */
|
|
86
110
|
id: string;
|
|
87
|
-
/**
|
|
111
|
+
/** Name of the tool, such as `write_file`. */
|
|
88
112
|
tool: string;
|
|
89
|
-
/** The paths
|
|
113
|
+
/** The file paths the tool call touched. */
|
|
90
114
|
files: string[];
|
|
91
|
-
/**
|
|
115
|
+
/** The tool name and its files, ready to show. */
|
|
92
116
|
label: string;
|
|
93
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Where the tool call is. A `waiting` step waits on the user. A `stopped` step was declined, or the
|
|
119
|
+
* turn was stopped.
|
|
120
|
+
*/
|
|
94
121
|
status: "running" | "waiting" | "done" | "stopped" | "error";
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
122
|
+
/**
|
|
123
|
+
* The question this step waits on, with the actions that answer it. Present only while the step is
|
|
124
|
+
* `waiting` in the last assistant message, which is the one that makes the chat wait. It goes away
|
|
125
|
+
* once answered, and is absent for a question kind this release doesn't know.
|
|
126
|
+
*/
|
|
98
127
|
question?: ChatQuestion;
|
|
99
128
|
}
|
|
100
129
|
/**
|
|
101
130
|
* An open question, with the actions that answer this question and no other.
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
131
|
+
*
|
|
132
|
+
* Each kind carries only the actions that make sense for it, and every kind can be declined. The
|
|
133
|
+
* actions never throw. A failure sets {@link Base44Chat.error}, and the question opens again.
|
|
134
|
+
*
|
|
135
|
+
* The chat declines a question kind this release doesn't know, once per tool call, when Base44
|
|
136
|
+
* names that kind on the last assistant message. If the decline fails, {@link Base44Chat.error} says
|
|
137
|
+
* so, and the chat tries again after it reconnects.
|
|
106
138
|
*/
|
|
107
139
|
export type ChatQuestion = ChoiceQuestion | SecretsQuestion | ApprovalQuestion;
|
|
108
|
-
/** One of the questions a
|
|
140
|
+
/** One of the questions in a {@link ChoiceQuestion}. */
|
|
109
141
|
export interface ChoiceEntry {
|
|
110
142
|
/** The question text. */
|
|
111
143
|
text: string;
|
|
112
|
-
/**
|
|
144
|
+
/** Supporting text for the question. */
|
|
113
145
|
description?: string;
|
|
146
|
+
/** Base44's type of question, such as `text_input` for one that takes only a free-text answer. */
|
|
147
|
+
type?: string;
|
|
114
148
|
/** The option labels to pick from. */
|
|
115
149
|
options: string[];
|
|
116
|
-
/** Whether more than one option
|
|
150
|
+
/** Whether more than one option can be picked. */
|
|
117
151
|
multi: boolean;
|
|
118
152
|
}
|
|
119
|
-
/** The
|
|
153
|
+
/** The AI offers options and waits for the user to pick. */
|
|
120
154
|
export interface ChoiceQuestion {
|
|
121
|
-
/**
|
|
155
|
+
/** Kind of question. */
|
|
122
156
|
kind: "choice";
|
|
123
|
-
/** The questions
|
|
157
|
+
/** The questions, in order. */
|
|
124
158
|
questions: ChoiceEntry[];
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Answers with the picked labels, and free text where the user wrote some.
|
|
161
|
+
*
|
|
162
|
+
* @param picked - One list of picked labels per question, in the order of `questions`.
|
|
163
|
+
* @param texts - One free-text answer per question, in the same order. Use it for a `text_input` question, or as a note beside a pick. A question with no pick and no text is skipped.
|
|
164
|
+
* @returns Promise resolving once the answer is sent.
|
|
165
|
+
*/
|
|
166
|
+
answer(picked: string[][], texts?: string[]): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Declines the question. The AI continues without the answer.
|
|
169
|
+
*
|
|
170
|
+
* @returns Promise resolving once the decline is sent.
|
|
171
|
+
*/
|
|
128
172
|
decline(): Promise<void>;
|
|
129
173
|
}
|
|
130
|
-
/** A value the
|
|
174
|
+
/** A value the AI needs, such as an API key. */
|
|
131
175
|
export interface SecretField {
|
|
132
|
-
/**
|
|
176
|
+
/** Name of the field, used as its key in `submit`. */
|
|
133
177
|
name: string;
|
|
134
|
-
/**
|
|
178
|
+
/** Where to get the value. */
|
|
135
179
|
description?: string;
|
|
136
180
|
}
|
|
137
|
-
/** The
|
|
181
|
+
/** The AI needs secrets, such as API keys. The values go to Base44 and the chat keeps none of them. */
|
|
138
182
|
export interface SecretsQuestion {
|
|
139
|
-
/**
|
|
183
|
+
/** Kind of question. */
|
|
140
184
|
kind: "secrets";
|
|
141
185
|
/** The fields to fill. */
|
|
142
186
|
fields: SecretField[];
|
|
143
|
-
/**
|
|
187
|
+
/**
|
|
188
|
+
* Submits the values.
|
|
189
|
+
*
|
|
190
|
+
* @param values - The values, keyed by field name.
|
|
191
|
+
* @returns Promise resolving once the values are sent.
|
|
192
|
+
*/
|
|
144
193
|
submit(values: Record<string, string>): Promise<void>;
|
|
145
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Declines the question. The AI continues without the values.
|
|
196
|
+
*
|
|
197
|
+
* @returns Promise resolving once the decline is sent.
|
|
198
|
+
*/
|
|
146
199
|
decline(): Promise<void>;
|
|
147
200
|
}
|
|
148
|
-
/** The
|
|
201
|
+
/** The AI asks for permission to run an action. */
|
|
149
202
|
export interface ApprovalQuestion {
|
|
150
|
-
/**
|
|
203
|
+
/** Kind of question. */
|
|
151
204
|
kind: "approval";
|
|
152
|
-
/**
|
|
205
|
+
/** Name of the tool that wants to run. */
|
|
153
206
|
action: string;
|
|
154
|
-
/** Why
|
|
207
|
+
/** Why the action needs approval, when Base44 gives a reason. Empty otherwise. */
|
|
155
208
|
reason: string;
|
|
156
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* Lets the action run.
|
|
211
|
+
*
|
|
212
|
+
* @returns Promise resolving once the approval is sent.
|
|
213
|
+
*/
|
|
157
214
|
approve(): Promise<void>;
|
|
158
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* Declines the action. It never runs, and the AI continues.
|
|
217
|
+
*
|
|
218
|
+
* @returns Promise resolving once the decline is sent.
|
|
219
|
+
*/
|
|
159
220
|
decline(): Promise<void>;
|
|
160
221
|
}
|
|
161
222
|
/**
|
|
162
|
-
* What the
|
|
223
|
+
* What the AI is doing. When several hold at once, the first in this list wins.
|
|
163
224
|
*
|
|
164
|
-
* - `error`: Base44 reports the
|
|
165
|
-
* - `waiting`: a
|
|
166
|
-
* - `building`: the
|
|
167
|
-
* - `submitted`: a prompt, a new app or an answer is on its way
|
|
168
|
-
*
|
|
169
|
-
* - `ready`: everything else.
|
|
170
|
-
|
|
225
|
+
* - `error`: Base44 reports that the last build failed.
|
|
226
|
+
* - `waiting`: a question waits on the user.
|
|
227
|
+
* - `building`: the AI is working.
|
|
228
|
+
* - `submitted`: a prompt, a new app or an answer is on its way. It lasts until Base44 reports work, a reply or a queue change, or the call fails.
|
|
229
|
+
* - `ready`: none of the above.
|
|
171
230
|
*/
|
|
172
231
|
export type ChatStatus = "ready" | "submitted" | "building" | "waiting" | "error";
|
|
173
|
-
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
232
|
+
/**
|
|
233
|
+
* Whether the chat follows the app live.
|
|
234
|
+
*
|
|
235
|
+
* - `connecting`: until the first snapshot arrives.
|
|
236
|
+
* - `connected`: after the first snapshot.
|
|
237
|
+
* - `disconnected`: live updates stopped for good. The session couldn't open, the retries ran out,
|
|
238
|
+
* or Base44 ended the session or the app's subscription. {@link Base44Chat.error} says why.
|
|
239
|
+
*
|
|
240
|
+
* Watching another app, or mounting the chat again, starts over.
|
|
241
|
+
*/
|
|
177
242
|
export type ChatConnection = "connecting" | "connected" | "disconnected";
|
|
178
|
-
/** A failure
|
|
243
|
+
/** A failure of a call, of the live connection, or of the build. */
|
|
179
244
|
export interface ChatError {
|
|
180
245
|
/** What went wrong, for people. */
|
|
181
246
|
message: string;
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
247
|
+
/**
|
|
248
|
+
* What went wrong, for code. A connection error carries a `PlatformSocketErrorCode`, and a failed
|
|
249
|
+
* build carries `build_failed`. A failed call to your backend carries none.
|
|
250
|
+
*/
|
|
184
251
|
code?: string;
|
|
185
252
|
/** The original error, for logging. */
|
|
186
253
|
cause?: unknown;
|
|
187
254
|
}
|
|
188
|
-
/** Options
|
|
255
|
+
/** Options for {@link useBase44Chat}. */
|
|
189
256
|
export interface Base44ChatOptions {
|
|
190
|
-
/**
|
|
191
|
-
* app
|
|
257
|
+
/**
|
|
258
|
+
* ID of the app to follow, or `null` until an app exists. While it's `null`, the chat follows the
|
|
259
|
+
* app {@link Base44Chat.create} made. Any change to `appId` forgets that app.
|
|
260
|
+
*/
|
|
192
261
|
appId: string | null;
|
|
193
|
-
/**
|
|
262
|
+
/** The four calls your backend makes to Base44. The chat reads the latest on every action, so an inline object works. */
|
|
194
263
|
backend: Base44ChatBackend;
|
|
195
|
-
/**
|
|
196
|
-
*
|
|
264
|
+
/**
|
|
265
|
+
* Called with the new app after {@link Base44Chat.create} succeeds. The chat already follows it.
|
|
266
|
+
* Pass its ID back as `appId` to keep it in your own state.
|
|
267
|
+
*/
|
|
197
268
|
onAppCreated?: (app: Base44App) => void;
|
|
198
269
|
}
|
|
199
|
-
/**
|
|
270
|
+
/** The chat that {@link useBase44Chat} returns. */
|
|
200
271
|
export interface Base44Chat {
|
|
201
272
|
/** The conversation, oldest first, with open questions bound to their steps. */
|
|
202
273
|
items: ChatItem[];
|
|
203
|
-
/** What the
|
|
274
|
+
/** What the AI is doing. */
|
|
204
275
|
status: ChatStatus;
|
|
205
|
-
/** Whether the chat
|
|
276
|
+
/** Whether the chat follows the app live. */
|
|
206
277
|
connection: ChatConnection;
|
|
207
|
-
/**
|
|
208
|
-
*
|
|
278
|
+
/**
|
|
279
|
+
* The last failure. It's set whenever `status` is `error`, and on any failed call or connection
|
|
280
|
+
* error. A failed call's error clears on the next action. A connection error stays until
|
|
281
|
+
* {@link Base44Chat.clearError}. A failed build stays while Base44 reports it.
|
|
282
|
+
*/
|
|
209
283
|
error: ChatError | null;
|
|
210
|
-
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
284
|
+
/**
|
|
285
|
+
* Sends a prompt to the current app. Base44 queues it while the AI is working. The prompt shows
|
|
286
|
+
* at once as a pending item, and the reply arrives through `items`. Without an app, it sets
|
|
287
|
+
* `error`. Use {@link Base44Chat.create} for the first prompt.
|
|
288
|
+
*
|
|
289
|
+
* @param prompt - The prompt to send.
|
|
290
|
+
* @returns Promise resolving once Base44 accepts the prompt. It never rejects.
|
|
291
|
+
*/
|
|
213
292
|
send(prompt: string): Promise<void>;
|
|
214
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* Creates an app from its first prompt and reports it through `onAppCreated`.
|
|
295
|
+
*
|
|
296
|
+
* @param prompt - The first prompt, which describes the app.
|
|
297
|
+
* @returns Promise resolving once the app exists. It never rejects.
|
|
298
|
+
*/
|
|
215
299
|
create(prompt: string): Promise<void>;
|
|
216
|
-
/** Clears
|
|
300
|
+
/** Clears {@link Base44Chat.error}. A failed build's error stays while Base44 reports it. */
|
|
217
301
|
clearError(): void;
|
|
218
302
|
}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The `@base44/platform/react` entry: one app
|
|
1
|
+
/** The `@base44/platform/react` entry: the AI chat for one app, as a React hook. React is an optional peer, loaded only here. */
|
|
2
2
|
export { useBase44Chat } from "./useBase44Chat.js";
|
|
3
3
|
export type { ApprovalQuestion, Base44App, Base44Chat, Base44ChatOptions, Base44ChatBackend, ChatConnection, ChatError, ChatItem, ChatQuestion, ChatStatus, ChatStep, ChoiceEntry, ChoiceQuestion, SecretField, SecretsQuestion, ToolCallAnswer, } from "./chat.types.js";
|
|
4
4
|
export type { SocketSession } from "../client/modules/builder.types.js";
|
package/dist/react/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** The `@base44/platform/react` entry: one app
|
|
1
|
+
/** The `@base44/platform/react` entry: the AI chat for one app, as a React hook. React is an optional peer, loaded only here. */
|
|
2
2
|
export { useBase44Chat } from "./useBase44Chat.js";
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import type { Base44Chat, Base44ChatOptions } from "./chat.types.js";
|
|
2
2
|
/**
|
|
3
|
-
* Runs
|
|
4
|
-
* the platform client, turns Base44's messages into {@link ChatItem | items}, binds
|
|
5
|
-
* every open question to the step it belongs to. You render the items.
|
|
3
|
+
* Runs the AI chat for one app in your own UI.
|
|
6
4
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* {@link
|
|
10
|
-
*
|
|
5
|
+
* The hook renders nothing. It gives you the conversation and the actions, and you draw them:
|
|
6
|
+
* - Follows the app live, and renews its socket session when it expires.
|
|
7
|
+
* - Turns Base44's messages into {@link ChatItem | items}, with each open question bound to the step it belongs to.
|
|
8
|
+
* - Reports what the AI is doing in {@link Base44Chat.status}, and the live connection in {@link Base44Chat.connection}.
|
|
9
|
+
* - Sends prompts, creates apps and answers questions through the {@link Base44ChatBackend | backend} you pass, so no credential reaches the browser.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* The actions never throw. A failure sets {@link Base44Chat.error}, and a question whose answer
|
|
12
|
+
* failed opens again. The chat declines a question kind this release doesn't know.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
* {@link Base44Chat.create} just made, so passing the new id back is optional; any change to
|
|
17
|
-
* `appId` forgets that app, so setting `appId` back to `null` starts a new chat.
|
|
14
|
+
* Requires a browser environment and can't be used in the backend.
|
|
18
15
|
*
|
|
19
|
-
*
|
|
16
|
+
* The chat follows `appId` when it's set. While `appId` is `null`, it follows the app
|
|
17
|
+
* {@link Base44Chat.create} made, so passing the new ID back is optional. Any change to `appId`
|
|
18
|
+
* forgets that app, so setting it back to `null` starts a new chat. Switching apps closes the old
|
|
19
|
+
* session and starts over.
|
|
20
|
+
*
|
|
21
|
+
* @param options - The app to follow, your backend's calls, and what to do with a created app.
|
|
20
22
|
* @returns The conversation, its status, connection and error, and the actions `send`, `create` and `clearError`.
|
|
21
23
|
*
|
|
22
24
|
* @example
|