@assistant-ui/react 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/edge.d.mts CHANGED
@@ -1,8 +1,99 @@
1
- import { LanguageModelV1 } from '@ai-sdk/provider';
1
+ import { LanguageModelV1, LanguageModelV1ToolChoice, LanguageModelV1FinishReason, LanguageModelV1LogProbs, LanguageModelV1CallWarning } from '@ai-sdk/provider';
2
+ import { z } from 'zod';
3
+ import { JSONSchema7 } from 'json-schema';
2
4
 
3
- declare const createEdgeRuntimeAPI: ({ model }: {
5
+ type TextContentPart = {
6
+ type: "text";
7
+ text: string;
8
+ };
9
+ type ImageContentPart = {
10
+ type: "image";
11
+ image: string;
12
+ };
13
+ type ToolCallContentPart<TArgs = unknown, TResult = unknown> = {
14
+ type: "tool-call";
15
+ toolCallId: string;
16
+ toolName: string;
17
+ argsText: string;
18
+ args: TArgs;
19
+ result?: TResult;
20
+ isError?: boolean;
21
+ };
22
+ /** Core Message Types (without UI content parts) */
23
+ type CoreUserContentPart = TextContentPart | ImageContentPart;
24
+ type CoreAssistantContentPart = TextContentPart | ToolCallContentPart;
25
+ type CoreSystemMessage = {
26
+ role: "system";
27
+ content: [TextContentPart];
28
+ };
29
+ type CoreUserMessage = {
30
+ role: "user";
31
+ content: CoreUserContentPart[];
32
+ };
33
+ type CoreAssistantMessage = {
34
+ role: "assistant";
35
+ content: CoreAssistantContentPart[];
36
+ };
37
+ type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage;
38
+
39
+ type ToolExecuteFunction<TArgs, TResult> = (args: TArgs) => TResult | Promise<TResult>;
40
+ type Tool<TArgs = unknown, TResult = unknown> = {
41
+ description?: string | undefined;
42
+ parameters: z.ZodSchema<TArgs> | JSONSchema7;
43
+ execute?: ToolExecuteFunction<TArgs, TResult>;
44
+ };
45
+
46
+ declare const LanguageModelSettingsSchema: z.ZodObject<{
47
+ maxTokens: z.ZodOptional<z.ZodNumber>;
48
+ temperature: z.ZodOptional<z.ZodNumber>;
49
+ topP: z.ZodOptional<z.ZodNumber>;
50
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
51
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
52
+ seed: z.ZodOptional<z.ZodNumber>;
53
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ maxTokens?: number | undefined;
56
+ temperature?: number | undefined;
57
+ topP?: number | undefined;
58
+ presencePenalty?: number | undefined;
59
+ frequencyPenalty?: number | undefined;
60
+ seed?: number | undefined;
61
+ headers?: Record<string, string | undefined> | undefined;
62
+ }, {
63
+ maxTokens?: number | undefined;
64
+ temperature?: number | undefined;
65
+ topP?: number | undefined;
66
+ presencePenalty?: number | undefined;
67
+ frequencyPenalty?: number | undefined;
68
+ seed?: number | undefined;
69
+ headers?: Record<string, string | undefined> | undefined;
70
+ }>;
71
+ type LanguageModelSettings = z.infer<typeof LanguageModelSettingsSchema>;
72
+ type FinishResult = {
73
+ finishReason: LanguageModelV1FinishReason;
74
+ usage: {
75
+ promptTokens: number;
76
+ completionTokens: number;
77
+ };
78
+ logProbs?: LanguageModelV1LogProbs | undefined;
79
+ messages: CoreMessage[];
80
+ rawCall: {
81
+ rawPrompt: unknown;
82
+ rawSettings: Record<string, unknown>;
83
+ };
84
+ warnings?: LanguageModelV1CallWarning[] | undefined;
85
+ rawResponse?: {
86
+ headers?: Record<string, string>;
87
+ } | undefined;
88
+ };
89
+ type CreateEdgeRuntimeAPIOptions = LanguageModelSettings & {
4
90
  model: LanguageModelV1;
5
- }) => {
91
+ system?: string;
92
+ tools?: Record<string, Tool<any, any>>;
93
+ toolChoice?: LanguageModelV1ToolChoice;
94
+ onFinish?: (result: FinishResult) => void;
95
+ };
96
+ declare const createEdgeRuntimeAPI: ({ model, system: serverSystem, tools: serverTools, toolChoice, onFinish, ...unsafeSettings }: CreateEdgeRuntimeAPIOptions) => {
6
97
  POST: (request: Request) => Promise<Response>;
7
98
  };
8
99
 
package/dist/edge.d.ts CHANGED
@@ -1,8 +1,99 @@
1
- import { LanguageModelV1 } from '@ai-sdk/provider';
1
+ import { LanguageModelV1, LanguageModelV1ToolChoice, LanguageModelV1FinishReason, LanguageModelV1LogProbs, LanguageModelV1CallWarning } from '@ai-sdk/provider';
2
+ import { z } from 'zod';
3
+ import { JSONSchema7 } from 'json-schema';
2
4
 
3
- declare const createEdgeRuntimeAPI: ({ model }: {
5
+ type TextContentPart = {
6
+ type: "text";
7
+ text: string;
8
+ };
9
+ type ImageContentPart = {
10
+ type: "image";
11
+ image: string;
12
+ };
13
+ type ToolCallContentPart<TArgs = unknown, TResult = unknown> = {
14
+ type: "tool-call";
15
+ toolCallId: string;
16
+ toolName: string;
17
+ argsText: string;
18
+ args: TArgs;
19
+ result?: TResult;
20
+ isError?: boolean;
21
+ };
22
+ /** Core Message Types (without UI content parts) */
23
+ type CoreUserContentPart = TextContentPart | ImageContentPart;
24
+ type CoreAssistantContentPart = TextContentPart | ToolCallContentPart;
25
+ type CoreSystemMessage = {
26
+ role: "system";
27
+ content: [TextContentPart];
28
+ };
29
+ type CoreUserMessage = {
30
+ role: "user";
31
+ content: CoreUserContentPart[];
32
+ };
33
+ type CoreAssistantMessage = {
34
+ role: "assistant";
35
+ content: CoreAssistantContentPart[];
36
+ };
37
+ type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage;
38
+
39
+ type ToolExecuteFunction<TArgs, TResult> = (args: TArgs) => TResult | Promise<TResult>;
40
+ type Tool<TArgs = unknown, TResult = unknown> = {
41
+ description?: string | undefined;
42
+ parameters: z.ZodSchema<TArgs> | JSONSchema7;
43
+ execute?: ToolExecuteFunction<TArgs, TResult>;
44
+ };
45
+
46
+ declare const LanguageModelSettingsSchema: z.ZodObject<{
47
+ maxTokens: z.ZodOptional<z.ZodNumber>;
48
+ temperature: z.ZodOptional<z.ZodNumber>;
49
+ topP: z.ZodOptional<z.ZodNumber>;
50
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
51
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
52
+ seed: z.ZodOptional<z.ZodNumber>;
53
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ maxTokens?: number | undefined;
56
+ temperature?: number | undefined;
57
+ topP?: number | undefined;
58
+ presencePenalty?: number | undefined;
59
+ frequencyPenalty?: number | undefined;
60
+ seed?: number | undefined;
61
+ headers?: Record<string, string | undefined> | undefined;
62
+ }, {
63
+ maxTokens?: number | undefined;
64
+ temperature?: number | undefined;
65
+ topP?: number | undefined;
66
+ presencePenalty?: number | undefined;
67
+ frequencyPenalty?: number | undefined;
68
+ seed?: number | undefined;
69
+ headers?: Record<string, string | undefined> | undefined;
70
+ }>;
71
+ type LanguageModelSettings = z.infer<typeof LanguageModelSettingsSchema>;
72
+ type FinishResult = {
73
+ finishReason: LanguageModelV1FinishReason;
74
+ usage: {
75
+ promptTokens: number;
76
+ completionTokens: number;
77
+ };
78
+ logProbs?: LanguageModelV1LogProbs | undefined;
79
+ messages: CoreMessage[];
80
+ rawCall: {
81
+ rawPrompt: unknown;
82
+ rawSettings: Record<string, unknown>;
83
+ };
84
+ warnings?: LanguageModelV1CallWarning[] | undefined;
85
+ rawResponse?: {
86
+ headers?: Record<string, string>;
87
+ } | undefined;
88
+ };
89
+ type CreateEdgeRuntimeAPIOptions = LanguageModelSettings & {
4
90
  model: LanguageModelV1;
5
- }) => {
91
+ system?: string;
92
+ tools?: Record<string, Tool<any, any>>;
93
+ toolChoice?: LanguageModelV1ToolChoice;
94
+ onFinish?: (result: FinishResult) => void;
95
+ };
96
+ declare const createEdgeRuntimeAPI: ({ model, system: serverSystem, tools: serverTools, toolChoice, onFinish, ...unsafeSettings }: CreateEdgeRuntimeAPIOptions) => {
6
97
  POST: (request: Request) => Promise<Response>;
7
98
  };
8
99