@assistant-ui/react 0.5.30 → 0.5.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/EdgeRuntimeRequestOptions-BD0mpoF6.d.mts +412 -0
- package/dist/EdgeRuntimeRequestOptions-BD0mpoF6.d.ts +412 -0
- package/dist/edge.d.mts +261 -3
- package/dist/edge.d.ts +261 -3
- package/dist/edge.js +98 -101
- package/dist/edge.js.map +1 -1
- package/dist/edge.mjs +96 -100
- package/dist/edge.mjs.map +1 -1
- package/dist/index.d.mts +50 -281
- package/dist/index.d.ts +50 -281
- package/dist/index.js +161 -124
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/AssistantTypes-Bo5YKjhV.d.mts +0 -162
- package/dist/AssistantTypes-Bo5YKjhV.d.ts +0 -162
package/package.json
CHANGED
@@ -29,7 +29,7 @@
|
|
29
29
|
"conversational-ui",
|
30
30
|
"conversational-ai"
|
31
31
|
],
|
32
|
-
"version": "0.5.
|
32
|
+
"version": "0.5.31",
|
33
33
|
"license": "MIT",
|
34
34
|
"exports": {
|
35
35
|
".": {
|
@@ -130,8 +130,8 @@
|
|
130
130
|
"tailwindcss-animate": "^1.0.7",
|
131
131
|
"tsup": "8.2.4",
|
132
132
|
"tsx": "^4.17.0",
|
133
|
-
"@assistant-ui/
|
134
|
-
"@assistant-ui/
|
133
|
+
"@assistant-ui/tailwindcss-transformer": "0.1.0",
|
134
|
+
"@assistant-ui/tsconfig": "0.0.0"
|
135
135
|
},
|
136
136
|
"publishConfig": {
|
137
137
|
"access": "public",
|
@@ -1,162 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { JSONSchema7 } from 'json-schema';
|
3
|
-
import { LanguageModelV1LogProbs } from '@ai-sdk/provider';
|
4
|
-
import { ReactNode } from 'react';
|
5
|
-
|
6
|
-
declare const LanguageModelV1CallSettingsSchema: z.ZodObject<{
|
7
|
-
maxTokens: z.ZodOptional<z.ZodNumber>;
|
8
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
9
|
-
topP: z.ZodOptional<z.ZodNumber>;
|
10
|
-
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
11
|
-
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
|
12
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
13
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
15
|
-
maxTokens?: number | undefined;
|
16
|
-
temperature?: number | undefined;
|
17
|
-
topP?: number | undefined;
|
18
|
-
presencePenalty?: number | undefined;
|
19
|
-
frequencyPenalty?: number | undefined;
|
20
|
-
seed?: number | undefined;
|
21
|
-
headers?: Record<string, string | undefined> | undefined;
|
22
|
-
}, {
|
23
|
-
maxTokens?: number | undefined;
|
24
|
-
temperature?: number | undefined;
|
25
|
-
topP?: number | undefined;
|
26
|
-
presencePenalty?: number | undefined;
|
27
|
-
frequencyPenalty?: number | undefined;
|
28
|
-
seed?: number | undefined;
|
29
|
-
headers?: Record<string, string | undefined> | undefined;
|
30
|
-
}>;
|
31
|
-
type LanguageModelV1CallSettings = z.infer<typeof LanguageModelV1CallSettingsSchema>;
|
32
|
-
declare const LanguageModelConfigSchema: z.ZodObject<{
|
33
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
34
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
35
|
-
modelName: z.ZodOptional<z.ZodString>;
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
37
|
-
apiKey?: string | undefined;
|
38
|
-
baseUrl?: string | undefined;
|
39
|
-
modelName?: string | undefined;
|
40
|
-
}, {
|
41
|
-
apiKey?: string | undefined;
|
42
|
-
baseUrl?: string | undefined;
|
43
|
-
modelName?: string | undefined;
|
44
|
-
}>;
|
45
|
-
type LanguageModelConfig = z.infer<typeof LanguageModelConfigSchema>;
|
46
|
-
type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: {
|
47
|
-
abortSignal: AbortSignal;
|
48
|
-
}) => TResult | Promise<TResult>;
|
49
|
-
type Tool<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
|
50
|
-
description?: string | undefined;
|
51
|
-
parameters: z.ZodSchema<TArgs> | JSONSchema7;
|
52
|
-
execute?: ToolExecuteFunction<TArgs, TResult>;
|
53
|
-
};
|
54
|
-
type ModelConfig = {
|
55
|
-
priority?: number | undefined;
|
56
|
-
system?: string | undefined;
|
57
|
-
tools?: Record<string, Tool<any, any>> | undefined;
|
58
|
-
callSettings?: LanguageModelV1CallSettings | undefined;
|
59
|
-
config?: LanguageModelConfig | undefined;
|
60
|
-
};
|
61
|
-
type ModelConfigProvider = {
|
62
|
-
getModelConfig: () => ModelConfig;
|
63
|
-
};
|
64
|
-
|
65
|
-
type TextContentPart = {
|
66
|
-
type: "text";
|
67
|
-
text: string;
|
68
|
-
};
|
69
|
-
type ImageContentPart = {
|
70
|
-
type: "image";
|
71
|
-
image: string;
|
72
|
-
};
|
73
|
-
type UIContentPart = {
|
74
|
-
type: "ui";
|
75
|
-
display: ReactNode;
|
76
|
-
};
|
77
|
-
type CoreToolCallContentPart<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
|
78
|
-
type: "tool-call";
|
79
|
-
toolCallId: string;
|
80
|
-
toolName: string;
|
81
|
-
args: TArgs;
|
82
|
-
result?: TResult | undefined;
|
83
|
-
isError?: boolean | undefined;
|
84
|
-
};
|
85
|
-
type ToolCallContentPart<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = CoreToolCallContentPart<TArgs, TResult> & {
|
86
|
-
argsText: string;
|
87
|
-
};
|
88
|
-
type ThreadUserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
89
|
-
type ThreadAssistantContentPart = TextContentPart | ToolCallContentPart | UIContentPart;
|
90
|
-
type MessageCommonProps = {
|
91
|
-
id: string;
|
92
|
-
createdAt: Date;
|
93
|
-
};
|
94
|
-
type ThreadRoundtrip = {
|
95
|
-
logprobs?: LanguageModelV1LogProbs | undefined;
|
96
|
-
usage?: {
|
97
|
-
promptTokens: number;
|
98
|
-
completionTokens: number;
|
99
|
-
} | undefined;
|
100
|
-
};
|
101
|
-
type ContentPartStatus = {
|
102
|
-
type: "running";
|
103
|
-
} | {
|
104
|
-
type: "complete";
|
105
|
-
} | {
|
106
|
-
type: "incomplete";
|
107
|
-
reason: "cancelled" | "length" | "content-filter" | "other" | "error";
|
108
|
-
error?: unknown;
|
109
|
-
};
|
110
|
-
type ToolCallContentPartStatus = {
|
111
|
-
type: "requires-action";
|
112
|
-
reason: "tool-calls";
|
113
|
-
} | ContentPartStatus;
|
114
|
-
type MessageStatus = {
|
115
|
-
type: "running";
|
116
|
-
} | {
|
117
|
-
type: "requires-action";
|
118
|
-
reason: "tool-calls";
|
119
|
-
} | {
|
120
|
-
type: "complete";
|
121
|
-
reason: "stop" | "unknown";
|
122
|
-
} | {
|
123
|
-
type: "incomplete";
|
124
|
-
reason: "cancelled" | "tool-calls" | "length" | "content-filter" | "other" | "error";
|
125
|
-
error?: unknown;
|
126
|
-
};
|
127
|
-
type ThreadSystemMessage = MessageCommonProps & {
|
128
|
-
role: "system";
|
129
|
-
content: [TextContentPart];
|
130
|
-
};
|
131
|
-
type ThreadUserMessage = MessageCommonProps & {
|
132
|
-
role: "user";
|
133
|
-
content: ThreadUserContentPart[];
|
134
|
-
};
|
135
|
-
type ThreadAssistantMessage = MessageCommonProps & {
|
136
|
-
role: "assistant";
|
137
|
-
content: ThreadAssistantContentPart[];
|
138
|
-
status: MessageStatus;
|
139
|
-
roundtrips?: ThreadRoundtrip[] | undefined;
|
140
|
-
};
|
141
|
-
type AppendMessage = CoreMessage & {
|
142
|
-
parentId: string | null;
|
143
|
-
};
|
144
|
-
type ThreadMessage = ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage;
|
145
|
-
/** Core Message Types (without UI content parts) */
|
146
|
-
type CoreUserContentPart = TextContentPart | ImageContentPart;
|
147
|
-
type CoreAssistantContentPart = TextContentPart | CoreToolCallContentPart;
|
148
|
-
type CoreSystemMessage = {
|
149
|
-
role: "system";
|
150
|
-
content: [TextContentPart];
|
151
|
-
};
|
152
|
-
type CoreUserMessage = {
|
153
|
-
role: "user";
|
154
|
-
content: CoreUserContentPart[];
|
155
|
-
};
|
156
|
-
type CoreAssistantMessage = {
|
157
|
-
role: "assistant";
|
158
|
-
content: CoreAssistantContentPart[];
|
159
|
-
};
|
160
|
-
type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage;
|
161
|
-
|
162
|
-
export type { AppendMessage as A, ContentPartStatus as C, ImageContentPart as I, LanguageModelV1CallSettings as L, MessageStatus as M, ThreadAssistantContentPart as T, UIContentPart as U, ThreadRoundtrip as a, ThreadMessage as b, ModelConfig as c, ModelConfigProvider as d, TextContentPart as e, ToolCallContentPart as f, ToolCallContentPartStatus as g, CoreMessage as h, Tool as i, CoreToolCallContentPart as j, ThreadUserContentPart as k, ThreadSystemMessage as l, ThreadAssistantMessage as m, ThreadUserMessage as n, CoreUserContentPart as o, CoreAssistantContentPart as p, CoreSystemMessage as q, CoreUserMessage as r, CoreAssistantMessage as s, LanguageModelConfig as t };
|
@@ -1,162 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
import { JSONSchema7 } from 'json-schema';
|
3
|
-
import { LanguageModelV1LogProbs } from '@ai-sdk/provider';
|
4
|
-
import { ReactNode } from 'react';
|
5
|
-
|
6
|
-
declare const LanguageModelV1CallSettingsSchema: z.ZodObject<{
|
7
|
-
maxTokens: z.ZodOptional<z.ZodNumber>;
|
8
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
9
|
-
topP: z.ZodOptional<z.ZodNumber>;
|
10
|
-
presencePenalty: z.ZodOptional<z.ZodNumber>;
|
11
|
-
frequencyPenalty: z.ZodOptional<z.ZodNumber>;
|
12
|
-
seed: z.ZodOptional<z.ZodNumber>;
|
13
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
15
|
-
maxTokens?: number | undefined;
|
16
|
-
temperature?: number | undefined;
|
17
|
-
topP?: number | undefined;
|
18
|
-
presencePenalty?: number | undefined;
|
19
|
-
frequencyPenalty?: number | undefined;
|
20
|
-
seed?: number | undefined;
|
21
|
-
headers?: Record<string, string | undefined> | undefined;
|
22
|
-
}, {
|
23
|
-
maxTokens?: number | undefined;
|
24
|
-
temperature?: number | undefined;
|
25
|
-
topP?: number | undefined;
|
26
|
-
presencePenalty?: number | undefined;
|
27
|
-
frequencyPenalty?: number | undefined;
|
28
|
-
seed?: number | undefined;
|
29
|
-
headers?: Record<string, string | undefined> | undefined;
|
30
|
-
}>;
|
31
|
-
type LanguageModelV1CallSettings = z.infer<typeof LanguageModelV1CallSettingsSchema>;
|
32
|
-
declare const LanguageModelConfigSchema: z.ZodObject<{
|
33
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
34
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
35
|
-
modelName: z.ZodOptional<z.ZodString>;
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
37
|
-
apiKey?: string | undefined;
|
38
|
-
baseUrl?: string | undefined;
|
39
|
-
modelName?: string | undefined;
|
40
|
-
}, {
|
41
|
-
apiKey?: string | undefined;
|
42
|
-
baseUrl?: string | undefined;
|
43
|
-
modelName?: string | undefined;
|
44
|
-
}>;
|
45
|
-
type LanguageModelConfig = z.infer<typeof LanguageModelConfigSchema>;
|
46
|
-
type ToolExecuteFunction<TArgs, TResult> = (args: TArgs, context: {
|
47
|
-
abortSignal: AbortSignal;
|
48
|
-
}) => TResult | Promise<TResult>;
|
49
|
-
type Tool<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
|
50
|
-
description?: string | undefined;
|
51
|
-
parameters: z.ZodSchema<TArgs> | JSONSchema7;
|
52
|
-
execute?: ToolExecuteFunction<TArgs, TResult>;
|
53
|
-
};
|
54
|
-
type ModelConfig = {
|
55
|
-
priority?: number | undefined;
|
56
|
-
system?: string | undefined;
|
57
|
-
tools?: Record<string, Tool<any, any>> | undefined;
|
58
|
-
callSettings?: LanguageModelV1CallSettings | undefined;
|
59
|
-
config?: LanguageModelConfig | undefined;
|
60
|
-
};
|
61
|
-
type ModelConfigProvider = {
|
62
|
-
getModelConfig: () => ModelConfig;
|
63
|
-
};
|
64
|
-
|
65
|
-
type TextContentPart = {
|
66
|
-
type: "text";
|
67
|
-
text: string;
|
68
|
-
};
|
69
|
-
type ImageContentPart = {
|
70
|
-
type: "image";
|
71
|
-
image: string;
|
72
|
-
};
|
73
|
-
type UIContentPart = {
|
74
|
-
type: "ui";
|
75
|
-
display: ReactNode;
|
76
|
-
};
|
77
|
-
type CoreToolCallContentPart<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = {
|
78
|
-
type: "tool-call";
|
79
|
-
toolCallId: string;
|
80
|
-
toolName: string;
|
81
|
-
args: TArgs;
|
82
|
-
result?: TResult | undefined;
|
83
|
-
isError?: boolean | undefined;
|
84
|
-
};
|
85
|
-
type ToolCallContentPart<TArgs extends Record<string, unknown> = Record<string | number, unknown>, TResult = unknown> = CoreToolCallContentPart<TArgs, TResult> & {
|
86
|
-
argsText: string;
|
87
|
-
};
|
88
|
-
type ThreadUserContentPart = TextContentPart | ImageContentPart | UIContentPart;
|
89
|
-
type ThreadAssistantContentPart = TextContentPart | ToolCallContentPart | UIContentPart;
|
90
|
-
type MessageCommonProps = {
|
91
|
-
id: string;
|
92
|
-
createdAt: Date;
|
93
|
-
};
|
94
|
-
type ThreadRoundtrip = {
|
95
|
-
logprobs?: LanguageModelV1LogProbs | undefined;
|
96
|
-
usage?: {
|
97
|
-
promptTokens: number;
|
98
|
-
completionTokens: number;
|
99
|
-
} | undefined;
|
100
|
-
};
|
101
|
-
type ContentPartStatus = {
|
102
|
-
type: "running";
|
103
|
-
} | {
|
104
|
-
type: "complete";
|
105
|
-
} | {
|
106
|
-
type: "incomplete";
|
107
|
-
reason: "cancelled" | "length" | "content-filter" | "other" | "error";
|
108
|
-
error?: unknown;
|
109
|
-
};
|
110
|
-
type ToolCallContentPartStatus = {
|
111
|
-
type: "requires-action";
|
112
|
-
reason: "tool-calls";
|
113
|
-
} | ContentPartStatus;
|
114
|
-
type MessageStatus = {
|
115
|
-
type: "running";
|
116
|
-
} | {
|
117
|
-
type: "requires-action";
|
118
|
-
reason: "tool-calls";
|
119
|
-
} | {
|
120
|
-
type: "complete";
|
121
|
-
reason: "stop" | "unknown";
|
122
|
-
} | {
|
123
|
-
type: "incomplete";
|
124
|
-
reason: "cancelled" | "tool-calls" | "length" | "content-filter" | "other" | "error";
|
125
|
-
error?: unknown;
|
126
|
-
};
|
127
|
-
type ThreadSystemMessage = MessageCommonProps & {
|
128
|
-
role: "system";
|
129
|
-
content: [TextContentPart];
|
130
|
-
};
|
131
|
-
type ThreadUserMessage = MessageCommonProps & {
|
132
|
-
role: "user";
|
133
|
-
content: ThreadUserContentPart[];
|
134
|
-
};
|
135
|
-
type ThreadAssistantMessage = MessageCommonProps & {
|
136
|
-
role: "assistant";
|
137
|
-
content: ThreadAssistantContentPart[];
|
138
|
-
status: MessageStatus;
|
139
|
-
roundtrips?: ThreadRoundtrip[] | undefined;
|
140
|
-
};
|
141
|
-
type AppendMessage = CoreMessage & {
|
142
|
-
parentId: string | null;
|
143
|
-
};
|
144
|
-
type ThreadMessage = ThreadSystemMessage | ThreadUserMessage | ThreadAssistantMessage;
|
145
|
-
/** Core Message Types (without UI content parts) */
|
146
|
-
type CoreUserContentPart = TextContentPart | ImageContentPart;
|
147
|
-
type CoreAssistantContentPart = TextContentPart | CoreToolCallContentPart;
|
148
|
-
type CoreSystemMessage = {
|
149
|
-
role: "system";
|
150
|
-
content: [TextContentPart];
|
151
|
-
};
|
152
|
-
type CoreUserMessage = {
|
153
|
-
role: "user";
|
154
|
-
content: CoreUserContentPart[];
|
155
|
-
};
|
156
|
-
type CoreAssistantMessage = {
|
157
|
-
role: "assistant";
|
158
|
-
content: CoreAssistantContentPart[];
|
159
|
-
};
|
160
|
-
type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage;
|
161
|
-
|
162
|
-
export type { AppendMessage as A, ContentPartStatus as C, ImageContentPart as I, LanguageModelV1CallSettings as L, MessageStatus as M, ThreadAssistantContentPart as T, UIContentPart as U, ThreadRoundtrip as a, ThreadMessage as b, ModelConfig as c, ModelConfigProvider as d, TextContentPart as e, ToolCallContentPart as f, ToolCallContentPartStatus as g, CoreMessage as h, Tool as i, CoreToolCallContentPart as j, ThreadUserContentPart as k, ThreadSystemMessage as l, ThreadAssistantMessage as m, ThreadUserMessage as n, CoreUserContentPart as o, CoreAssistantContentPart as p, CoreSystemMessage as q, CoreUserMessage as r, CoreAssistantMessage as s, LanguageModelConfig as t };
|