@tinyweb_dev/agent-framework-llm 0.2.0 → 0.4.0
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/cache-policy.d.ts +3 -0
- package/dist/cache-policy.d.ts.map +1 -0
- package/dist/index.cjs +2968 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2843 -0
- package/dist/index.js.map +1 -0
- package/dist/llm.cjs +1718 -0
- package/dist/llm.cjs.map +1 -0
- package/dist/llm.d.ts +284 -0
- package/dist/llm.d.ts.map +1 -0
- package/dist/llm.js +1692 -0
- package/dist/llm.js.map +1 -0
- package/dist/protocols/openai-chat.cjs +2455 -0
- package/dist/protocols/openai-chat.cjs.map +1 -0
- package/dist/protocols/openai-chat.d.ts +359 -0
- package/dist/protocols/openai-chat.d.ts.map +1 -0
- package/dist/protocols/openai-chat.js +2426 -0
- package/dist/protocols/openai-chat.js.map +1 -0
- package/dist/protocols/openai-compatible-chat.cjs +2455 -0
- package/dist/protocols/openai-compatible-chat.cjs.map +1 -0
- package/dist/protocols/openai-compatible-chat.d.ts +77 -0
- package/dist/protocols/openai-compatible-chat.d.ts.map +1 -0
- package/dist/protocols/openai-compatible-chat.js +2431 -0
- package/dist/protocols/openai-compatible-chat.js.map +1 -0
- package/dist/protocols/shared.cjs +904 -0
- package/dist/protocols/shared.cjs.map +1 -0
- package/dist/protocols/shared.d.ts +51 -0
- package/dist/protocols/shared.d.ts.map +1 -0
- package/dist/protocols/shared.js +857 -0
- package/dist/protocols/shared.js.map +1 -0
- package/dist/protocols/utils/openai-options.d.ts +15 -0
- package/dist/protocols/utils/openai-options.d.ts.map +1 -0
- package/dist/protocols/utils/tool-stream.d.ts +78 -0
- package/dist/protocols/utils/tool-stream.d.ts.map +1 -0
- package/dist/provider.cjs +20 -0
- package/dist/provider.cjs.map +1 -0
- package/dist/provider.d.ts +19 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +17 -0
- package/dist/provider.js.map +1 -0
- package/{src/providers/openai-compatible-profile.ts → dist/providers/openai-compatible-profile.cjs} +12 -12
- package/dist/providers/openai-compatible-profile.cjs.map +1 -0
- package/dist/providers/openai-compatible-profile.d.ts +52 -0
- package/dist/providers/openai-compatible-profile.d.ts.map +1 -0
- package/dist/providers/openai-compatible-profile.js +21 -0
- package/dist/providers/openai-compatible-profile.js.map +1 -0
- package/dist/providers/openai-compatible.cjs +2545 -0
- package/dist/providers/openai-compatible.cjs.map +1 -0
- package/dist/providers/openai-compatible.d.ts +128 -0
- package/dist/providers/openai-compatible.d.ts.map +1 -0
- package/dist/providers/openai-compatible.js +2507 -0
- package/dist/providers/openai-compatible.js.map +1 -0
- package/dist/providers/openai-options.cjs +797 -0
- package/dist/providers/openai-options.cjs.map +1 -0
- package/dist/providers/openai-options.d.ts +29 -0
- package/dist/providers/openai-options.d.ts.map +1 -0
- package/dist/providers/openai-options.js +792 -0
- package/dist/providers/openai-options.js.map +1 -0
- package/dist/providers/openai.cjs +2529 -0
- package/dist/providers/openai.cjs.map +1 -0
- package/dist/providers/openai.d.ts +87 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +2501 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/route/auth-options.cjs +855 -0
- package/dist/route/auth-options.cjs.map +1 -0
- package/dist/route/auth-options.d.ts +25 -0
- package/dist/route/auth-options.d.ts.map +1 -0
- package/dist/route/auth-options.js +852 -0
- package/dist/route/auth-options.js.map +1 -0
- package/dist/route/auth.cjs +855 -0
- package/dist/route/auth.cjs.map +1 -0
- package/dist/route/auth.d.ts +51 -0
- package/dist/route/auth.d.ts.map +1 -0
- package/dist/route/auth.js +836 -0
- package/dist/route/auth.js.map +1 -0
- package/dist/route/client.cjs +1844 -0
- package/dist/route/client.cjs.map +1 -0
- package/dist/route/client.d.ts +268 -0
- package/dist/route/client.d.ts.map +1 -0
- package/dist/route/client.js +1830 -0
- package/dist/route/client.js.map +1 -0
- package/dist/route/endpoint.cjs +756 -0
- package/dist/route/endpoint.cjs.map +1 -0
- package/dist/route/endpoint.d.ts +13 -0
- package/dist/route/endpoint.d.ts.map +1 -0
- package/dist/route/endpoint.js +752 -0
- package/dist/route/endpoint.js.map +1 -0
- package/dist/route/executor.cjs +1077 -0
- package/dist/route/executor.cjs.map +1 -0
- package/dist/route/executor.d.ts +13 -0
- package/dist/route/executor.d.ts.map +1 -0
- package/dist/route/executor.js +1072 -0
- package/dist/route/executor.js.map +1 -0
- package/dist/route/framing.cjs +773 -0
- package/dist/route/framing.cjs.map +1 -0
- package/dist/route/framing.d.ts +9 -0
- package/dist/route/framing.d.ts.map +1 -0
- package/dist/route/framing.js +750 -0
- package/dist/route/framing.js.map +1 -0
- package/dist/route/overflow-detect.d.ts +18 -0
- package/dist/route/overflow-detect.d.ts.map +1 -0
- package/dist/route/protocol.cjs +25 -0
- package/dist/route/protocol.cjs.map +1 -0
- package/dist/route/protocol.d.ts +40 -0
- package/dist/route/protocol.d.ts.map +1 -0
- package/dist/route/protocol.js +21 -0
- package/dist/route/protocol.js.map +1 -0
- package/dist/route/transport/http.d.ts +48 -0
- package/dist/route/transport/http.d.ts.map +1 -0
- package/dist/route/transport/index.cjs +969 -0
- package/dist/route/transport/index.cjs.map +1 -0
- package/dist/route/transport/index.d.ts +13 -0
- package/dist/route/transport/index.d.ts.map +1 -0
- package/dist/route/transport/index.js +967 -0
- package/dist/route/transport/index.js.map +1 -0
- package/dist/schema/errors.d.ts +181 -0
- package/dist/schema/errors.d.ts.map +1 -0
- package/dist/schema/events.d.ts +3224 -0
- package/dist/schema/events.d.ts.map +1 -0
- package/dist/schema/ids.d.ts +31 -0
- package/dist/schema/ids.d.ts.map +1 -0
- package/dist/schema/index.cjs +847 -0
- package/dist/schema/index.cjs.map +1 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +777 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/messages.d.ts +292 -0
- package/dist/schema/messages.d.ts.map +1 -0
- package/dist/schema/options.d.ts +123 -0
- package/dist/schema/options.d.ts.map +1 -0
- package/dist/tool-runtime.cjs +907 -0
- package/dist/tool-runtime.cjs.map +1 -0
- package/dist/tool-runtime.d.ts +50 -0
- package/dist/tool-runtime.d.ts.map +1 -0
- package/dist/tool-runtime.js +901 -0
- package/dist/tool-runtime.js.map +1 -0
- package/dist/tool.cjs +802 -0
- package/dist/tool.cjs.map +1 -0
- package/dist/tool.d.ts +111 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +796 -0
- package/dist/tool.js.map +1 -0
- package/package.json +112 -29
- package/src/cache-policy.ts +0 -92
- package/src/index.ts +0 -62
- package/src/llm.ts +0 -210
- package/src/protocols/openai-chat.ts +0 -464
- package/src/protocols/openai-compatible-chat.ts +0 -29
- package/src/protocols/shared.ts +0 -204
- package/src/protocols/utils/openai-options.ts +0 -56
- package/src/protocols/utils/tool-stream.ts +0 -135
- package/src/provider.ts +0 -32
- package/src/providers/openai-compatible.ts +0 -69
- package/src/providers/openai-options.ts +0 -71
- package/src/providers/openai.ts +0 -39
- package/src/route/auth-options.ts +0 -48
- package/src/route/auth.ts +0 -198
- package/src/route/client.ts +0 -459
- package/src/route/endpoint.ts +0 -28
- package/src/route/executor.ts +0 -396
- package/src/route/framing.ts +0 -13
- package/src/route/overflow-detect.ts +0 -74
- package/src/route/protocol.ts +0 -48
- package/src/route/transport/http.ts +0 -123
- package/src/route/transport/index.ts +0 -21
- package/src/schema/errors.ts +0 -225
- package/src/schema/events.ts +0 -335
- package/src/schema/ids.ts +0 -44
- package/src/schema/index.ts +0 -6
- package/src/schema/messages.ts +0 -250
- package/src/schema/options.ts +0 -231
- package/src/tool-runtime.ts +0 -301
- package/src/tool.ts +0 -212
package/dist/llm.d.ts
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { Effect, JsonSchema, Schema } from "effect";
|
|
2
|
+
import { type ModelRefInput } from "./route/client";
|
|
3
|
+
import { GenerationOptions, HttpOptions, LLMError, LLMRequest, LLMResponse, Message, SystemPart, ToolChoice, ToolDefinition, type ContentPart, ToolCallPart, ToolResultPart } from "./schema";
|
|
4
|
+
import { type ToolSchema } from "./tool";
|
|
5
|
+
export type ModelInput = ModelRefInput;
|
|
6
|
+
export type MessageInput = Message.Input;
|
|
7
|
+
export type ToolChoiceInput = ToolChoice.Input;
|
|
8
|
+
export type ToolChoiceMode = ToolChoice.Mode;
|
|
9
|
+
export type ToolResultInput = Parameters<typeof ToolResultPart.make>[0];
|
|
10
|
+
export type RequestInput = Omit<ConstructorParameters<typeof LLMRequest>[0], "system" | "messages" | "tools" | "toolChoice" | "generation" | "http" | "providerOptions"> & {
|
|
11
|
+
readonly system?: string | SystemPart | ReadonlyArray<SystemPart>;
|
|
12
|
+
readonly prompt?: string | ContentPart | ReadonlyArray<ContentPart>;
|
|
13
|
+
readonly messages?: ReadonlyArray<Message | MessageInput>;
|
|
14
|
+
readonly tools?: ReadonlyArray<ToolDefinition.Input>;
|
|
15
|
+
readonly toolChoice?: ToolChoiceInput;
|
|
16
|
+
readonly generation?: GenerationOptions.Input;
|
|
17
|
+
readonly providerOptions?: ConstructorParameters<typeof LLMRequest>[0]["providerOptions"];
|
|
18
|
+
readonly http?: HttpOptions.Input;
|
|
19
|
+
};
|
|
20
|
+
export declare const limits: (input: import("./schema").ModelLimits.Input | undefined) => import("./schema").ModelLimits;
|
|
21
|
+
export declare const text: (value: string) => ContentPart;
|
|
22
|
+
export declare const system: ((input: {
|
|
23
|
+
readonly type: "text";
|
|
24
|
+
readonly text: string;
|
|
25
|
+
readonly cache?: import("./schema").CacheHint | undefined;
|
|
26
|
+
readonly metadata?: {
|
|
27
|
+
readonly [x: string]: unknown;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}, options?: Schema.MakeOptions) => {
|
|
30
|
+
readonly type: "text";
|
|
31
|
+
readonly text: string;
|
|
32
|
+
readonly cache?: import("./schema").CacheHint | undefined;
|
|
33
|
+
readonly metadata?: {
|
|
34
|
+
readonly [x: string]: unknown;
|
|
35
|
+
} | undefined;
|
|
36
|
+
}) & ((text: string) => SystemPart);
|
|
37
|
+
export declare const message: (input: Message | Message.Input) => Message;
|
|
38
|
+
export declare const user: (content: Message.ContentInput) => Message;
|
|
39
|
+
export declare const assistant: (content: Message.ContentInput) => Message;
|
|
40
|
+
export declare const model: (input: ModelRefInput) => import("./schema").ModelRef;
|
|
41
|
+
export declare const toolDefinition: (input: ToolDefinition.Input) => ToolDefinition;
|
|
42
|
+
export declare const toolCall: ((input: {
|
|
43
|
+
readonly type: "tool-call";
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly input: unknown;
|
|
47
|
+
readonly providerExecuted?: boolean | undefined;
|
|
48
|
+
readonly metadata?: {
|
|
49
|
+
readonly [x: string]: unknown;
|
|
50
|
+
} | undefined;
|
|
51
|
+
readonly providerMetadata?: {
|
|
52
|
+
readonly [x: string]: {
|
|
53
|
+
readonly [x: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
} | undefined;
|
|
56
|
+
}, options?: Schema.MakeOptions) => {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly type: "tool-call";
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly input: unknown;
|
|
61
|
+
readonly metadata?: {
|
|
62
|
+
readonly [x: string]: unknown;
|
|
63
|
+
} | undefined;
|
|
64
|
+
readonly providerMetadata?: {
|
|
65
|
+
readonly [x: string]: {
|
|
66
|
+
readonly [x: string]: unknown;
|
|
67
|
+
};
|
|
68
|
+
} | undefined;
|
|
69
|
+
readonly providerExecuted?: boolean | undefined;
|
|
70
|
+
}) & ((input: Omit<ToolCallPart, "type">) => ToolCallPart);
|
|
71
|
+
export declare const toolResult: ((input: {
|
|
72
|
+
readonly type: "tool-result";
|
|
73
|
+
readonly id: string;
|
|
74
|
+
readonly name: string;
|
|
75
|
+
readonly result: {
|
|
76
|
+
readonly type: "error" | "text" | "json";
|
|
77
|
+
readonly value: unknown;
|
|
78
|
+
readonly metadata?: {
|
|
79
|
+
readonly [x: string]: unknown;
|
|
80
|
+
} | undefined;
|
|
81
|
+
};
|
|
82
|
+
readonly providerExecuted?: boolean | undefined;
|
|
83
|
+
readonly cache?: import("./schema").CacheHint | undefined;
|
|
84
|
+
readonly metadata?: {
|
|
85
|
+
readonly [x: string]: unknown;
|
|
86
|
+
} | undefined;
|
|
87
|
+
readonly providerMetadata?: {
|
|
88
|
+
readonly [x: string]: {
|
|
89
|
+
readonly [x: string]: unknown;
|
|
90
|
+
};
|
|
91
|
+
} | undefined;
|
|
92
|
+
}, options?: Schema.MakeOptions) => {
|
|
93
|
+
readonly id: string;
|
|
94
|
+
readonly type: "tool-result";
|
|
95
|
+
readonly name: string;
|
|
96
|
+
readonly result: {
|
|
97
|
+
readonly type: "error" | "text" | "json";
|
|
98
|
+
readonly value: unknown;
|
|
99
|
+
readonly metadata?: {
|
|
100
|
+
readonly [x: string]: unknown;
|
|
101
|
+
} | undefined;
|
|
102
|
+
};
|
|
103
|
+
readonly cache?: import("./schema").CacheHint | undefined;
|
|
104
|
+
readonly metadata?: {
|
|
105
|
+
readonly [x: string]: unknown;
|
|
106
|
+
} | undefined;
|
|
107
|
+
readonly providerMetadata?: {
|
|
108
|
+
readonly [x: string]: {
|
|
109
|
+
readonly [x: string]: unknown;
|
|
110
|
+
};
|
|
111
|
+
} | undefined;
|
|
112
|
+
readonly providerExecuted?: boolean | undefined;
|
|
113
|
+
}) & ((input: Omit<ToolResultPart, "type" | "result"> & {
|
|
114
|
+
readonly result: unknown;
|
|
115
|
+
readonly resultType?: import("./schema").ToolResultValue["type"];
|
|
116
|
+
}) => ToolResultPart);
|
|
117
|
+
export declare const toolMessage: (result: ToolResultPart | Parameters<typeof ToolResultPart.make>[0]) => Message;
|
|
118
|
+
export declare const toolChoiceName: (value: string) => ToolChoice;
|
|
119
|
+
export declare const toolChoice: (input: ToolChoice.Input) => ToolChoice;
|
|
120
|
+
export declare const generation: (input?: GenerationOptions.Input) => GenerationOptions;
|
|
121
|
+
export declare const generate: typeof import("./route/client").generate;
|
|
122
|
+
export declare const stream: typeof import("./route/client").stream;
|
|
123
|
+
export declare const stepCountIs: (count: number) => import("./tool-runtime").StopCondition;
|
|
124
|
+
export { hasToolCall, stopWhenAny } from "./tool-runtime";
|
|
125
|
+
export declare const requestInput: (input: LLMRequest) => RequestInput;
|
|
126
|
+
export declare const request: (input: RequestInput) => LLMRequest;
|
|
127
|
+
export declare const updateRequest: (input: LLMRequest, patch: Partial<RequestInput>) => LLMRequest;
|
|
128
|
+
type GenerateObjectBase = Omit<RequestInput, "tools" | "toolChoice" | "responseFormat">;
|
|
129
|
+
export declare class GenerateObjectResponse<T> {
|
|
130
|
+
readonly object: T;
|
|
131
|
+
readonly response: LLMResponse;
|
|
132
|
+
constructor(object: T, response: LLMResponse);
|
|
133
|
+
get events(): readonly ({
|
|
134
|
+
readonly id: string;
|
|
135
|
+
readonly type: "request-start";
|
|
136
|
+
readonly model: import("./schema").ModelRef;
|
|
137
|
+
} | {
|
|
138
|
+
readonly type: "step-start";
|
|
139
|
+
readonly index: number;
|
|
140
|
+
} | {
|
|
141
|
+
readonly id: string;
|
|
142
|
+
readonly type: "text-start";
|
|
143
|
+
readonly providerMetadata?: {
|
|
144
|
+
readonly [x: string]: {
|
|
145
|
+
readonly [x: string]: unknown;
|
|
146
|
+
};
|
|
147
|
+
} | undefined;
|
|
148
|
+
} | {
|
|
149
|
+
readonly id: string;
|
|
150
|
+
readonly type: "text-delta";
|
|
151
|
+
readonly text: string;
|
|
152
|
+
} | {
|
|
153
|
+
readonly id: string;
|
|
154
|
+
readonly type: "text-end";
|
|
155
|
+
readonly providerMetadata?: {
|
|
156
|
+
readonly [x: string]: {
|
|
157
|
+
readonly [x: string]: unknown;
|
|
158
|
+
};
|
|
159
|
+
} | undefined;
|
|
160
|
+
} | {
|
|
161
|
+
readonly id: string;
|
|
162
|
+
readonly type: "reasoning-start";
|
|
163
|
+
readonly providerMetadata?: {
|
|
164
|
+
readonly [x: string]: {
|
|
165
|
+
readonly [x: string]: unknown;
|
|
166
|
+
};
|
|
167
|
+
} | undefined;
|
|
168
|
+
} | {
|
|
169
|
+
readonly id: string;
|
|
170
|
+
readonly type: "reasoning-delta";
|
|
171
|
+
readonly text: string;
|
|
172
|
+
} | {
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly type: "reasoning-end";
|
|
175
|
+
readonly providerMetadata?: {
|
|
176
|
+
readonly [x: string]: {
|
|
177
|
+
readonly [x: string]: unknown;
|
|
178
|
+
};
|
|
179
|
+
} | undefined;
|
|
180
|
+
} | {
|
|
181
|
+
readonly id: string;
|
|
182
|
+
readonly type: "tool-input-start";
|
|
183
|
+
readonly name: string;
|
|
184
|
+
readonly providerMetadata?: {
|
|
185
|
+
readonly [x: string]: {
|
|
186
|
+
readonly [x: string]: unknown;
|
|
187
|
+
};
|
|
188
|
+
} | undefined;
|
|
189
|
+
} | {
|
|
190
|
+
readonly id: string;
|
|
191
|
+
readonly type: "tool-input-delta";
|
|
192
|
+
readonly text: string;
|
|
193
|
+
readonly name: string;
|
|
194
|
+
} | {
|
|
195
|
+
readonly id: string;
|
|
196
|
+
readonly type: "tool-input-end";
|
|
197
|
+
readonly name: string;
|
|
198
|
+
readonly providerMetadata?: {
|
|
199
|
+
readonly [x: string]: {
|
|
200
|
+
readonly [x: string]: unknown;
|
|
201
|
+
};
|
|
202
|
+
} | undefined;
|
|
203
|
+
} | {
|
|
204
|
+
readonly id: string;
|
|
205
|
+
readonly type: "tool-call";
|
|
206
|
+
readonly name: string;
|
|
207
|
+
readonly input: unknown;
|
|
208
|
+
readonly providerMetadata?: {
|
|
209
|
+
readonly [x: string]: {
|
|
210
|
+
readonly [x: string]: unknown;
|
|
211
|
+
};
|
|
212
|
+
} | undefined;
|
|
213
|
+
readonly providerExecuted?: boolean | undefined;
|
|
214
|
+
} | {
|
|
215
|
+
readonly id: string;
|
|
216
|
+
readonly type: "tool-result";
|
|
217
|
+
readonly name: string;
|
|
218
|
+
readonly result: {
|
|
219
|
+
readonly type: "error" | "text" | "json";
|
|
220
|
+
readonly value: unknown;
|
|
221
|
+
readonly metadata?: {
|
|
222
|
+
readonly [x: string]: unknown;
|
|
223
|
+
} | undefined;
|
|
224
|
+
};
|
|
225
|
+
readonly providerMetadata?: {
|
|
226
|
+
readonly [x: string]: {
|
|
227
|
+
readonly [x: string]: unknown;
|
|
228
|
+
};
|
|
229
|
+
} | undefined;
|
|
230
|
+
readonly providerExecuted?: boolean | undefined;
|
|
231
|
+
} | {
|
|
232
|
+
readonly id: string;
|
|
233
|
+
readonly type: "tool-error";
|
|
234
|
+
readonly name: string;
|
|
235
|
+
readonly message: string;
|
|
236
|
+
readonly metadata?: {
|
|
237
|
+
readonly [x: string]: unknown;
|
|
238
|
+
} | undefined;
|
|
239
|
+
readonly providerMetadata?: {
|
|
240
|
+
readonly [x: string]: {
|
|
241
|
+
readonly [x: string]: unknown;
|
|
242
|
+
};
|
|
243
|
+
} | undefined;
|
|
244
|
+
} | {
|
|
245
|
+
readonly type: "step-finish";
|
|
246
|
+
readonly index: number;
|
|
247
|
+
readonly reason: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
248
|
+
readonly providerMetadata?: {
|
|
249
|
+
readonly [x: string]: {
|
|
250
|
+
readonly [x: string]: unknown;
|
|
251
|
+
};
|
|
252
|
+
} | undefined;
|
|
253
|
+
readonly usage?: import("./schema").Usage | undefined;
|
|
254
|
+
} | {
|
|
255
|
+
readonly type: "request-finish";
|
|
256
|
+
readonly reason: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
257
|
+
readonly providerMetadata?: {
|
|
258
|
+
readonly [x: string]: {
|
|
259
|
+
readonly [x: string]: unknown;
|
|
260
|
+
};
|
|
261
|
+
} | undefined;
|
|
262
|
+
readonly usage?: import("./schema").Usage | undefined;
|
|
263
|
+
} | {
|
|
264
|
+
readonly type: "provider-error";
|
|
265
|
+
readonly message: string;
|
|
266
|
+
readonly providerMetadata?: {
|
|
267
|
+
readonly [x: string]: {
|
|
268
|
+
readonly [x: string]: unknown;
|
|
269
|
+
};
|
|
270
|
+
} | undefined;
|
|
271
|
+
readonly retryable?: boolean | undefined;
|
|
272
|
+
})[];
|
|
273
|
+
get usage(): import("./schema").Usage | undefined;
|
|
274
|
+
}
|
|
275
|
+
export interface GenerateObjectOptions<S extends ToolSchema<any>> extends GenerateObjectBase {
|
|
276
|
+
readonly schema: S;
|
|
277
|
+
}
|
|
278
|
+
export interface GenerateObjectDynamicOptions extends GenerateObjectBase {
|
|
279
|
+
readonly jsonSchema: JsonSchema.JsonSchema;
|
|
280
|
+
}
|
|
281
|
+
export declare function generateObject<S extends ToolSchema<any>>(options: GenerateObjectOptions<S>): Effect.Effect<GenerateObjectResponse<Schema.Schema.Type<S>>, LLMError>;
|
|
282
|
+
export declare function generateObject(options: GenerateObjectDynamicOptions): Effect.Effect<GenerateObjectResponse<unknown>, LLMError>;
|
|
283
|
+
export * as LLM from "./llm";
|
|
284
|
+
//# sourceMappingURL=llm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../src/llm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,EAAoC,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACrF,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEX,QAAQ,EAER,UAAU,EACV,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,cAAc,EACd,KAAK,WAAW,EAChB,YAAY,EACZ,cAAc,EACf,MAAM,UAAU,CAAA;AACjB,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAA;AAE1D,MAAM,MAAM,UAAU,GAAG,aAAa,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