@icanbwell/baileyai-chat-ui 1.1.0 → 1.1.2
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/README.md +3 -2
- package/dist/baileyai-chat-ui.cjs +3 -3
- package/dist/baileyai-chat-ui.js +726 -713
- package/dist/index.d.ts +10 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -224,8 +224,8 @@ export declare interface BaileyChatPanelProps extends BaileyMarkdownRenderers {
|
|
|
224
224
|
/** Thumbs up/down feedback on completed assistant messages. On by default whenever `chat` was
|
|
225
225
|
* created with a `client` (`chat.feedback`), a conversation id is held, and the message has a `serverMessageId`; the
|
|
226
226
|
* buttons render before `renderMessageActions`. Pass `false` to turn it off (e.g. when the
|
|
227
|
-
* host renders its own `BaileyFeedbackButtons
|
|
228
|
-
*
|
|
227
|
+
* host renders its own `BaileyFeedbackButtons`), or an object to tune the reason chips, comment
|
|
228
|
+
* limit or labels. The buttons hide for the session on a 503 or 405 from the feedback API. */
|
|
229
229
|
feedback?: false | Pick<BaileyFeedbackButtonsProps, 'reasonOptions' | 'maxCommentLength' | 'labels'>;
|
|
230
230
|
/** Overrides individual UI strings for localization — merged shallowly with English
|
|
231
231
|
* defaults, so a host only needs to supply the keys its i18n system actually translates.
|
|
@@ -331,7 +331,12 @@ export declare interface BaileyClientOptions {
|
|
|
331
331
|
/** Called before every request. The library never reads or stores tokens itself. */
|
|
332
332
|
getHeaders: () => Promise<Record<string, string>>;
|
|
333
333
|
fetch?: typeof fetch;
|
|
334
|
-
/**
|
|
334
|
+
/** Called after a 401 and before the one automatic retry, so the host can refresh an expired
|
|
335
|
+
* token. `getHeaders` is called again for the retry and must then return the fresh credentials.
|
|
336
|
+
* If this rejects, the retry is skipped and the 401 is reported as usual. */
|
|
337
|
+
refreshAuth?: () => Promise<void>;
|
|
338
|
+
/** Fired once on a 401/403 response, before the call rejects (or the stream call returns).
|
|
339
|
+
* A 401 is first retried once (see `refreshAuth`), so this fires only if the retry also fails. */
|
|
335
340
|
onAuthError?: (error: BaileyApiError) => void;
|
|
336
341
|
/** Called when a best-effort cleanup step fails (e.g. cancelling an unread response body).
|
|
337
342
|
* Never thrown to the caller; an exception thrown by this callback is also contained. */
|
|
@@ -1200,8 +1205,8 @@ export declare interface UseBaileyChatResult {
|
|
|
1200
1205
|
/** Feedback handlers bound to `client` and the held conversation id; present only when the hook
|
|
1201
1206
|
* was given a `client`. `BaileyChatPanel` uses them to show thumbs up/down on assistant
|
|
1202
1207
|
* messages by default. Becomes undefined once the feedback API answers 503 (disabled for the
|
|
1203
|
-
* environment), until `client` changes. Optional in
|
|
1204
|
-
* result objects still compile. */
|
|
1208
|
+
* environment) or 405 (route does not accept the method), until `client` changes. Optional in
|
|
1209
|
+
* the type so hosts that construct their own result objects still compile. */
|
|
1205
1210
|
feedback?: BaileyFeedbackHandlers;
|
|
1206
1211
|
}
|
|
1207
1212
|
|