@assistant-ui/react 0.5.71 → 0.5.73
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-5KIEXJRK.js → chunk-KVXP3Q6K.js} +60 -21
- package/dist/chunk-KVXP3Q6K.js.map +1 -0
- package/dist/{chunk-DC342I2Q.mjs → chunk-SNNYBBO6.mjs} +57 -18
- package/dist/chunk-SNNYBBO6.mjs.map +1 -0
- package/dist/{edge-DRioHVD9.d.mts → edge-rTP-G718.d.mts} +17 -6
- package/dist/{edge-DRioHVD9.d.ts → edge-rTP-G718.d.ts} +17 -6
- package/dist/edge.d.mts +9 -2
- package/dist/edge.d.ts +9 -2
- package/dist/edge.js +56 -17
- package/dist/edge.js.map +1 -1
- package/dist/edge.mjs +56 -17
- package/dist/edge.mjs.map +1 -1
- package/dist/index.d.mts +28 -19
- package/dist/index.d.ts +28 -19
- package/dist/index.js +131 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -51
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/tailwindcss/thread.css +1 -1
- package/package.json +4 -4
- package/dist/chunk-5KIEXJRK.js.map +0 -1
- package/dist/chunk-DC342I2Q.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { A as Attachment, P as PendingAttachment, T as ThreadMessage, C as CoreMessage, a as AppendMessage, M as ModelConfig, b as ModelConfigProvider, c as ThreadAssistantContentPart, d as MessageStatus, e as
|
2
|
-
export { q as AttachmentStatus, v as CoreAssistantContentPart, y as CoreAssistantMessage, w as CoreSystemMessage, u as CoreUserContentPart, x as CoreUserMessage, E as EdgeRuntimeRequestOptions, s as ThreadAssistantMessage, r as ThreadSystemMessage, t as ThreadUserMessage } from './edge-
|
1
|
+
import { A as Attachment, P as PendingAttachment, T as ThreadMessage, C as CoreMessage, a as AppendMessage, M as ModelConfig, b as ModelConfigProvider, c as ThreadAssistantContentPart, d as MessageStatus, e as ThreadStep, f as PendingAttachmentStatus, g as CompleteAttachment, h as CompleteAttachmentStatus, i as Tool, j as TextContentPart, I as ImageContentPart, k as ToolCallContentPart, l as CoreToolCallContentPart, U as UIContentPart, m as CreateEdgeRuntimeAPIOptions, n as ThreadUserContentPart, o as ContentPartStatus, p as ToolCallContentPartStatus } from './edge-rTP-G718.js';
|
2
|
+
export { q as AttachmentStatus, v as CoreAssistantContentPart, y as CoreAssistantMessage, w as CoreSystemMessage, u as CoreUserContentPart, x as CoreUserMessage, E as EdgeRuntimeRequestOptions, s as ThreadAssistantMessage, r as ThreadSystemMessage, t as ThreadUserMessage } from './edge-rTP-G718.js';
|
3
3
|
import * as react from 'react';
|
4
4
|
import { ComponentType, PropsWithChildren, FC, ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
|
5
5
|
import { StoreApi, UseBoundStore } from 'zustand';
|
@@ -159,7 +159,11 @@ type ChatModelRunResult = {
|
|
159
159
|
content?: ThreadAssistantContentPart[];
|
160
160
|
status?: MessageStatus;
|
161
161
|
metadata?: {
|
162
|
-
|
162
|
+
/**
|
163
|
+
* @deprecated Use `steps` instead. This field will be removed in v0.6.
|
164
|
+
*/
|
165
|
+
roundtrips?: ThreadStep[];
|
166
|
+
steps?: ThreadStep[];
|
163
167
|
custom?: Record<string, unknown>;
|
164
168
|
};
|
165
169
|
};
|
@@ -280,6 +284,10 @@ type FeedbackAdapter = {
|
|
280
284
|
|
281
285
|
type LocalRuntimeOptions = {
|
282
286
|
initialMessages?: readonly CoreMessage[] | undefined;
|
287
|
+
maxSteps?: number | undefined;
|
288
|
+
/**
|
289
|
+
* @deprecated Use `maxSteps` (which is `maxToolRoundtrips` + 1; if you set `maxToolRoundtrips` to 2, set `maxSteps` to 3) instead. This field will be removed in v0.6.
|
290
|
+
*/
|
283
291
|
maxToolRoundtrips?: number | undefined;
|
284
292
|
adapters?: {
|
285
293
|
attachments?: AttachmentAdapter | undefined;
|
@@ -401,9 +409,9 @@ declare const useLocalRuntime: (adapter: ChatModelAdapter, options?: LocalRuntim
|
|
401
409
|
declare function toLanguageModelMessages(message: readonly CoreMessage[] | readonly ThreadMessage[]): LanguageModelV1Message[];
|
402
410
|
|
403
411
|
type fromLanguageModelMessagesOptions = {
|
404
|
-
|
412
|
+
mergeSteps: boolean;
|
405
413
|
};
|
406
|
-
declare const fromLanguageModelMessages: (lm: LanguageModelV1Message[], {
|
414
|
+
declare const fromLanguageModelMessages: (lm: LanguageModelV1Message[], { mergeSteps }: fromLanguageModelMessagesOptions) => CoreMessage[];
|
407
415
|
|
408
416
|
declare const fromCoreMessages: (message: readonly CoreMessage[]) => ThreadMessage[];
|
409
417
|
declare const fromCoreMessage: (message: CoreMessage, { id, status, attachments, }?: {
|
@@ -455,7 +463,7 @@ declare class EdgeChatAdapter implements ChatModelAdapter {
|
|
455
463
|
}
|
456
464
|
|
457
465
|
type EdgeRuntimeOptions = EdgeChatAdapterOptions & LocalRuntimeOptions;
|
458
|
-
declare const useEdgeRuntime: (
|
466
|
+
declare const useEdgeRuntime: (options: EdgeRuntimeOptions) => LocalRuntime;
|
459
467
|
|
460
468
|
type ThreadMessageLike = {
|
461
469
|
role: "assistant" | "user" | "system";
|
@@ -519,7 +527,7 @@ declare const useExternalMessageConverter: <T extends WeakKey>({ callback, messa
|
|
519
527
|
type DangerousInBrowserAdapterOptions = CreateEdgeRuntimeAPIOptions;
|
520
528
|
|
521
529
|
type DangerousInBrowserRuntimeOptions = DangerousInBrowserAdapterOptions & LocalRuntimeOptions;
|
522
|
-
declare const useDangerousInBrowserRuntime: (
|
530
|
+
declare const useDangerousInBrowserRuntime: (options: DangerousInBrowserRuntimeOptions) => LocalRuntime;
|
523
531
|
|
524
532
|
type Subscribable = {
|
525
533
|
subscribe: (callback: () => void) => Unsubscribe;
|
@@ -2165,7 +2173,7 @@ type AvatarProps = {
|
|
2165
2173
|
};
|
2166
2174
|
|
2167
2175
|
type SuggestionConfig = {
|
2168
|
-
text?: ReactNode;
|
2176
|
+
text?: ReactNode | undefined;
|
2169
2177
|
prompt: string;
|
2170
2178
|
};
|
2171
2179
|
type ThreadWelcomeConfig = {
|
@@ -2279,18 +2287,19 @@ type StringsConfig = {
|
|
2279
2287
|
};
|
2280
2288
|
};
|
2281
2289
|
type ThreadConfig = {
|
2282
|
-
runtime?: AssistantRuntime;
|
2283
|
-
assistantAvatar?: AvatarProps;
|
2284
|
-
welcome?: ThreadWelcomeConfig;
|
2285
|
-
assistantMessage?: AssistantMessageConfig;
|
2286
|
-
userMessage?: UserMessageConfig;
|
2287
|
-
branchPicker?: BranchPickerConfig;
|
2288
|
-
composer?: ComposerConfig;
|
2289
|
-
strings?: StringsConfig;
|
2290
|
-
tools?: AssistantToolUI[];
|
2290
|
+
runtime?: AssistantRuntime | undefined;
|
2291
|
+
assistantAvatar?: AvatarProps | undefined;
|
2292
|
+
welcome?: ThreadWelcomeConfig | undefined;
|
2293
|
+
assistantMessage?: AssistantMessageConfig | undefined;
|
2294
|
+
userMessage?: UserMessageConfig | undefined;
|
2295
|
+
branchPicker?: BranchPickerConfig | undefined;
|
2296
|
+
composer?: ComposerConfig | undefined;
|
2297
|
+
strings?: StringsConfig | undefined;
|
2298
|
+
tools?: AssistantToolUI[] | undefined;
|
2291
2299
|
components?: {
|
2292
|
-
Composer
|
2293
|
-
|
2300
|
+
Composer?: ComponentType | undefined;
|
2301
|
+
ThreadWelcome?: ComponentType | undefined;
|
2302
|
+
} | undefined;
|
2294
2303
|
};
|
2295
2304
|
declare const useThreadConfig: () => Omit<ThreadConfig, "runtime">;
|
2296
2305
|
type ThreadConfigProviderProps = PropsWithChildren<{
|