@effect/ai 0.26.0 → 0.27.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.
Files changed (188) hide show
  1. package/Chat/package.json +6 -0
  2. package/EmbeddingModel/package.json +6 -0
  3. package/IdGenerator/package.json +6 -0
  4. package/LanguageModel/package.json +6 -0
  5. package/Model/package.json +6 -0
  6. package/Prompt/package.json +6 -0
  7. package/Response/package.json +6 -0
  8. package/Telemetry/package.json +6 -0
  9. package/Tool/package.json +6 -0
  10. package/Toolkit/package.json +6 -0
  11. package/dist/cjs/AiError.js +575 -11
  12. package/dist/cjs/AiError.js.map +1 -1
  13. package/dist/cjs/Chat.js +302 -0
  14. package/dist/cjs/Chat.js.map +1 -0
  15. package/dist/cjs/EmbeddingModel.js +184 -0
  16. package/dist/cjs/EmbeddingModel.js.map +1 -0
  17. package/dist/cjs/IdGenerator.js +255 -0
  18. package/dist/cjs/IdGenerator.js.map +1 -0
  19. package/dist/cjs/LanguageModel.js +584 -0
  20. package/dist/cjs/LanguageModel.js.map +1 -0
  21. package/dist/cjs/McpServer.js +12 -4
  22. package/dist/cjs/McpServer.js.map +1 -1
  23. package/dist/cjs/Model.js +118 -0
  24. package/dist/cjs/Model.js.map +1 -0
  25. package/dist/cjs/Prompt.js +649 -0
  26. package/dist/cjs/Prompt.js.map +1 -0
  27. package/dist/cjs/Response.js +635 -0
  28. package/dist/cjs/Response.js.map +1 -0
  29. package/dist/cjs/Telemetry.js +176 -0
  30. package/dist/cjs/Telemetry.js.map +1 -0
  31. package/dist/cjs/Tokenizer.js +87 -8
  32. package/dist/cjs/Tokenizer.js.map +1 -1
  33. package/dist/cjs/Tool.js +556 -0
  34. package/dist/cjs/Tool.js.map +1 -0
  35. package/dist/cjs/Toolkit.js +279 -0
  36. package/dist/cjs/Toolkit.js.map +1 -0
  37. package/dist/cjs/index.js +21 -19
  38. package/dist/dts/AiError.d.ts +577 -9
  39. package/dist/dts/AiError.d.ts.map +1 -1
  40. package/dist/dts/Chat.d.ts +356 -0
  41. package/dist/dts/Chat.d.ts.map +1 -0
  42. package/dist/dts/EmbeddingModel.d.ts +153 -0
  43. package/dist/dts/EmbeddingModel.d.ts.map +1 -0
  44. package/dist/dts/IdGenerator.d.ts +272 -0
  45. package/dist/dts/IdGenerator.d.ts.map +1 -0
  46. package/dist/dts/LanguageModel.d.ts +458 -0
  47. package/dist/dts/LanguageModel.d.ts.map +1 -0
  48. package/dist/dts/McpSchema.d.ts +25 -25
  49. package/dist/dts/McpServer.d.ts +6 -4
  50. package/dist/dts/McpServer.d.ts.map +1 -1
  51. package/dist/dts/Model.d.ts +124 -0
  52. package/dist/dts/Model.d.ts.map +1 -0
  53. package/dist/dts/Prompt.d.ts +1119 -0
  54. package/dist/dts/Prompt.d.ts.map +1 -0
  55. package/dist/dts/Response.d.ts +1519 -0
  56. package/dist/dts/Response.d.ts.map +1 -0
  57. package/dist/dts/Telemetry.d.ts +520 -0
  58. package/dist/dts/Telemetry.d.ts.map +1 -0
  59. package/dist/dts/Tokenizer.d.ts +131 -13
  60. package/dist/dts/Tokenizer.d.ts.map +1 -1
  61. package/dist/dts/Tool.d.ts +876 -0
  62. package/dist/dts/Tool.d.ts.map +1 -0
  63. package/dist/dts/Toolkit.d.ts +310 -0
  64. package/dist/dts/Toolkit.d.ts.map +1 -0
  65. package/dist/dts/index.d.ts +498 -13
  66. package/dist/dts/index.d.ts.map +1 -1
  67. package/dist/esm/AiError.js +570 -10
  68. package/dist/esm/AiError.js.map +1 -1
  69. package/dist/esm/Chat.js +291 -0
  70. package/dist/esm/Chat.js.map +1 -0
  71. package/dist/esm/EmbeddingModel.js +173 -0
  72. package/dist/esm/EmbeddingModel.js.map +1 -0
  73. package/dist/esm/IdGenerator.js +245 -0
  74. package/dist/esm/IdGenerator.js.map +1 -0
  75. package/dist/esm/LanguageModel.js +572 -0
  76. package/dist/esm/LanguageModel.js.map +1 -0
  77. package/dist/esm/McpServer.js +12 -4
  78. package/dist/esm/McpServer.js.map +1 -1
  79. package/dist/esm/Model.js +108 -0
  80. package/dist/esm/Model.js.map +1 -0
  81. package/dist/esm/Prompt.js +633 -0
  82. package/dist/esm/Prompt.js.map +1 -0
  83. package/dist/esm/Response.js +619 -0
  84. package/dist/esm/Response.js.map +1 -0
  85. package/dist/esm/Telemetry.js +166 -0
  86. package/dist/esm/Telemetry.js.map +1 -0
  87. package/dist/esm/Tokenizer.js +87 -8
  88. package/dist/esm/Tokenizer.js.map +1 -1
  89. package/dist/esm/Tool.js +534 -0
  90. package/dist/esm/Tool.js.map +1 -0
  91. package/dist/esm/Toolkit.js +269 -0
  92. package/dist/esm/Toolkit.js.map +1 -0
  93. package/dist/esm/index.js +498 -13
  94. package/dist/esm/index.js.map +1 -1
  95. package/package.json +76 -68
  96. package/src/AiError.ts +739 -9
  97. package/src/Chat.ts +546 -0
  98. package/src/EmbeddingModel.ts +311 -0
  99. package/src/IdGenerator.ts +320 -0
  100. package/src/LanguageModel.ts +1074 -0
  101. package/src/McpServer.ts +337 -194
  102. package/src/Model.ts +155 -0
  103. package/src/Prompt.ts +1616 -0
  104. package/src/Response.ts +2131 -0
  105. package/src/Telemetry.ts +655 -0
  106. package/src/Tokenizer.ts +145 -24
  107. package/src/Tool.ts +1267 -0
  108. package/src/Toolkit.ts +516 -0
  109. package/src/index.ts +499 -13
  110. package/AiChat/package.json +0 -6
  111. package/AiEmbeddingModel/package.json +0 -6
  112. package/AiInput/package.json +0 -6
  113. package/AiLanguageModel/package.json +0 -6
  114. package/AiModel/package.json +0 -6
  115. package/AiResponse/package.json +0 -6
  116. package/AiTelemetry/package.json +0 -6
  117. package/AiTool/package.json +0 -6
  118. package/AiToolkit/package.json +0 -6
  119. package/dist/cjs/AiChat.js +0 -122
  120. package/dist/cjs/AiChat.js.map +0 -1
  121. package/dist/cjs/AiEmbeddingModel.js +0 -109
  122. package/dist/cjs/AiEmbeddingModel.js.map +0 -1
  123. package/dist/cjs/AiInput.js +0 -458
  124. package/dist/cjs/AiInput.js.map +0 -1
  125. package/dist/cjs/AiLanguageModel.js +0 -351
  126. package/dist/cjs/AiLanguageModel.js.map +0 -1
  127. package/dist/cjs/AiModel.js +0 -37
  128. package/dist/cjs/AiModel.js.map +0 -1
  129. package/dist/cjs/AiResponse.js +0 -681
  130. package/dist/cjs/AiResponse.js.map +0 -1
  131. package/dist/cjs/AiTelemetry.js +0 -58
  132. package/dist/cjs/AiTelemetry.js.map +0 -1
  133. package/dist/cjs/AiTool.js +0 -150
  134. package/dist/cjs/AiTool.js.map +0 -1
  135. package/dist/cjs/AiToolkit.js +0 -157
  136. package/dist/cjs/AiToolkit.js.map +0 -1
  137. package/dist/cjs/internal/common.js +0 -21
  138. package/dist/cjs/internal/common.js.map +0 -1
  139. package/dist/dts/AiChat.d.ts +0 -101
  140. package/dist/dts/AiChat.d.ts.map +0 -1
  141. package/dist/dts/AiEmbeddingModel.d.ts +0 -65
  142. package/dist/dts/AiEmbeddingModel.d.ts.map +0 -1
  143. package/dist/dts/AiInput.d.ts +0 -590
  144. package/dist/dts/AiInput.d.ts.map +0 -1
  145. package/dist/dts/AiLanguageModel.d.ts +0 -302
  146. package/dist/dts/AiLanguageModel.d.ts.map +0 -1
  147. package/dist/dts/AiModel.d.ts +0 -25
  148. package/dist/dts/AiModel.d.ts.map +0 -1
  149. package/dist/dts/AiResponse.d.ts +0 -863
  150. package/dist/dts/AiResponse.d.ts.map +0 -1
  151. package/dist/dts/AiTelemetry.d.ts +0 -242
  152. package/dist/dts/AiTelemetry.d.ts.map +0 -1
  153. package/dist/dts/AiTool.d.ts +0 -334
  154. package/dist/dts/AiTool.d.ts.map +0 -1
  155. package/dist/dts/AiToolkit.d.ts +0 -96
  156. package/dist/dts/AiToolkit.d.ts.map +0 -1
  157. package/dist/dts/internal/common.d.ts +0 -2
  158. package/dist/dts/internal/common.d.ts.map +0 -1
  159. package/dist/esm/AiChat.js +0 -111
  160. package/dist/esm/AiChat.js.map +0 -1
  161. package/dist/esm/AiEmbeddingModel.js +0 -98
  162. package/dist/esm/AiEmbeddingModel.js.map +0 -1
  163. package/dist/esm/AiInput.js +0 -433
  164. package/dist/esm/AiInput.js.map +0 -1
  165. package/dist/esm/AiLanguageModel.js +0 -340
  166. package/dist/esm/AiLanguageModel.js.map +0 -1
  167. package/dist/esm/AiModel.js +0 -29
  168. package/dist/esm/AiModel.js.map +0 -1
  169. package/dist/esm/AiResponse.js +0 -657
  170. package/dist/esm/AiResponse.js.map +0 -1
  171. package/dist/esm/AiTelemetry.js +0 -48
  172. package/dist/esm/AiTelemetry.js.map +0 -1
  173. package/dist/esm/AiTool.js +0 -134
  174. package/dist/esm/AiTool.js.map +0 -1
  175. package/dist/esm/AiToolkit.js +0 -147
  176. package/dist/esm/AiToolkit.js.map +0 -1
  177. package/dist/esm/internal/common.js +0 -14
  178. package/dist/esm/internal/common.js.map +0 -1
  179. package/src/AiChat.ts +0 -251
  180. package/src/AiEmbeddingModel.ts +0 -169
  181. package/src/AiInput.ts +0 -602
  182. package/src/AiLanguageModel.ts +0 -685
  183. package/src/AiModel.ts +0 -53
  184. package/src/AiResponse.ts +0 -986
  185. package/src/AiTelemetry.ts +0 -333
  186. package/src/AiTool.ts +0 -579
  187. package/src/AiToolkit.ts +0 -265
  188. package/src/internal/common.ts +0 -12
@@ -1,590 +0,0 @@
1
- import * as Schema from "effect/Schema";
2
- import * as AiResponse from "./AiResponse.js";
3
- /**
4
- * @since 1.0.0
5
- * @category Type Ids
6
- */
7
- export declare const TypeId: unique symbol;
8
- /**
9
- * @since 1.0.0
10
- * @category Type Ids
11
- */
12
- export type TypeId = typeof TypeId;
13
- declare const AiInput_base: Schema.Class<AiInput, {
14
- messages: Schema.Array$<Schema.suspend<UserMessage | AssistantMessage | ToolMessage, {
15
- readonly _tag: "UserMessage";
16
- readonly parts: readonly ({
17
- readonly _tag: "TextPart";
18
- readonly text: string;
19
- } | {
20
- readonly _tag: "ImagePart";
21
- readonly data: string;
22
- readonly mediaType?: string | undefined;
23
- } | {
24
- readonly _tag: "ImageUrlPart";
25
- readonly url: string;
26
- } | {
27
- readonly _tag: "FilePart";
28
- readonly data: string;
29
- readonly name?: string | undefined;
30
- readonly mediaType?: string | undefined;
31
- } | {
32
- readonly _tag: "FileUrlPart";
33
- readonly url: string;
34
- })[];
35
- readonly userName?: string | undefined;
36
- } | {
37
- readonly _tag: "AssistantMessage";
38
- readonly parts: readonly ({
39
- readonly _tag: "TextPart";
40
- readonly text: string;
41
- } | {
42
- readonly _tag: "ReasoningPart";
43
- readonly reasoningText: string;
44
- readonly signature?: string | undefined;
45
- } | {
46
- readonly _tag: "RedactedReasoningPart";
47
- readonly redactedText: string;
48
- } | {
49
- readonly _tag: "ToolCallPart";
50
- readonly name: string;
51
- readonly id: string;
52
- readonly params: unknown;
53
- })[];
54
- } | {
55
- readonly _tag: "ToolMessage";
56
- readonly parts: readonly {
57
- readonly _tag: "ToolCallResultPart";
58
- readonly name: string;
59
- readonly id: string;
60
- readonly result: unknown;
61
- }[];
62
- }, never>>;
63
- }, Schema.Struct.Encoded<{
64
- messages: Schema.Array$<Schema.suspend<UserMessage | AssistantMessage | ToolMessage, {
65
- readonly _tag: "UserMessage";
66
- readonly parts: readonly ({
67
- readonly _tag: "TextPart";
68
- readonly text: string;
69
- } | {
70
- readonly _tag: "ImagePart";
71
- readonly data: string;
72
- readonly mediaType?: string | undefined;
73
- } | {
74
- readonly _tag: "ImageUrlPart";
75
- readonly url: string;
76
- } | {
77
- readonly _tag: "FilePart";
78
- readonly data: string;
79
- readonly name?: string | undefined;
80
- readonly mediaType?: string | undefined;
81
- } | {
82
- readonly _tag: "FileUrlPart";
83
- readonly url: string;
84
- })[];
85
- readonly userName?: string | undefined;
86
- } | {
87
- readonly _tag: "AssistantMessage";
88
- readonly parts: readonly ({
89
- readonly _tag: "TextPart";
90
- readonly text: string;
91
- } | {
92
- readonly _tag: "ReasoningPart";
93
- readonly reasoningText: string;
94
- readonly signature?: string | undefined;
95
- } | {
96
- readonly _tag: "RedactedReasoningPart";
97
- readonly redactedText: string;
98
- } | {
99
- readonly _tag: "ToolCallPart";
100
- readonly name: string;
101
- readonly id: string;
102
- readonly params: unknown;
103
- })[];
104
- } | {
105
- readonly _tag: "ToolMessage";
106
- readonly parts: readonly {
107
- readonly _tag: "ToolCallResultPart";
108
- readonly name: string;
109
- readonly id: string;
110
- readonly result: unknown;
111
- }[];
112
- }, never>>;
113
- }>, never, {
114
- readonly messages: readonly (UserMessage | AssistantMessage | ToolMessage)[];
115
- }, {}, {}>;
116
- /**
117
- * Represents input to a large language model.
118
- *
119
- * @since 1.0.0
120
- * @category Models
121
- */
122
- export declare class AiInput extends AiInput_base {
123
- /**
124
- * @since 1.0.0
125
- */
126
- readonly [TypeId]: TypeId;
127
- }
128
- /**
129
- * @since 1.0.0
130
- * @category Models
131
- */
132
- export declare const FromJson: Schema.transform<Schema.SchemaClass<unknown, string, never>, typeof AiInput>;
133
- /**
134
- * Represents raw input types that can be converted into an `AiInput`.
135
- *
136
- * @since 1.0.0
137
- * @category Models
138
- */
139
- export type Raw = string | Message | Iterable<Message> | AiInput | AiResponse.AiResponse | AiResponse.WithStructuredOutput<any> | AiResponse.WithToolCallResults<any>;
140
- /**
141
- * @since 1.0.0
142
- * @category Type Ids
143
- */
144
- export declare const MessageTypeId: unique symbol;
145
- /**
146
- * @since 1.0.0
147
- * @category Type Ids
148
- */
149
- export type MessageTypeId = typeof MessageTypeId;
150
- declare const UserMessage_base: Schema.TaggedClass<UserMessage, "UserMessage", {
151
- readonly _tag: Schema.tag<"UserMessage">;
152
- } & {
153
- parts: Schema.Array$<Schema.suspend<TextPart | ImagePart | ImageUrlPart | FilePart | FileUrlPart, {
154
- readonly _tag: "TextPart";
155
- readonly text: string;
156
- } | {
157
- readonly _tag: "ImagePart";
158
- readonly data: string;
159
- readonly mediaType?: string | undefined;
160
- } | {
161
- readonly _tag: "ImageUrlPart";
162
- readonly url: string;
163
- } | {
164
- readonly _tag: "FilePart";
165
- readonly data: string;
166
- readonly name?: string | undefined;
167
- readonly mediaType?: string | undefined;
168
- } | {
169
- readonly _tag: "FileUrlPart";
170
- readonly url: string;
171
- }, never>>;
172
- userName: Schema.optional<typeof Schema.String>;
173
- }>;
174
- /**
175
- * @since 1.0.0
176
- * @category Models
177
- */
178
- export declare class UserMessage extends UserMessage_base {
179
- /**
180
- * @since 1.0.0
181
- */
182
- readonly [MessageTypeId]: MessageTypeId;
183
- }
184
- declare const AssistantMessage_base: Schema.TaggedClass<AssistantMessage, "AssistantMessage", {
185
- readonly _tag: Schema.tag<"AssistantMessage">;
186
- } & {
187
- parts: Schema.Array$<Schema.suspend<TextPart | ReasoningPart | RedactedReasoningPart | ToolCallPart, {
188
- readonly _tag: "TextPart";
189
- readonly text: string;
190
- } | {
191
- readonly _tag: "ReasoningPart";
192
- readonly reasoningText: string;
193
- readonly signature?: string | undefined;
194
- } | {
195
- readonly _tag: "RedactedReasoningPart";
196
- readonly redactedText: string;
197
- } | {
198
- readonly _tag: "ToolCallPart";
199
- readonly name: string;
200
- readonly id: string;
201
- readonly params: unknown;
202
- }, never>>;
203
- }>;
204
- /**
205
- * @since 1.0.0
206
- * @category Models
207
- */
208
- export declare class AssistantMessage extends AssistantMessage_base {
209
- /**
210
- * @since 1.0.0
211
- */
212
- readonly [MessageTypeId]: MessageTypeId;
213
- }
214
- declare const ToolMessage_base: Schema.TaggedClass<ToolMessage, "ToolMessage", {
215
- readonly _tag: Schema.tag<"ToolMessage">;
216
- } & {
217
- parts: Schema.Array$<Schema.suspend<ToolCallResultPart, {
218
- readonly _tag: "ToolCallResultPart";
219
- readonly name: string;
220
- readonly id: string;
221
- readonly result: unknown;
222
- }, never>>;
223
- }>;
224
- /**
225
- * @since 1.0.0
226
- * @category Models
227
- */
228
- export declare class ToolMessage extends ToolMessage_base {
229
- /**
230
- * @since 1.0.0
231
- */
232
- readonly [MessageTypeId]: MessageTypeId;
233
- }
234
- /**
235
- * @since 1.0.0
236
- * @category Models
237
- */
238
- export declare const Message: Schema.Union<[
239
- typeof UserMessage,
240
- typeof AssistantMessage,
241
- typeof ToolMessage
242
- ]>;
243
- /**
244
- * @since 1.0.0
245
- * @category Models
246
- */
247
- export type Message = typeof Message.Type;
248
- /**
249
- * @since 1.0.0
250
- * @category Type Ids
251
- */
252
- export declare const PartTypeId: unique symbol;
253
- /**
254
- * @since 1.0.0
255
- * @category Type Ids
256
- */
257
- export type PartTypeId = typeof PartTypeId;
258
- declare const TextPart_base: Schema.TaggedClass<TextPart, "TextPart", {
259
- readonly _tag: Schema.tag<"TextPart">;
260
- } & {
261
- /**
262
- * The text content.
263
- */
264
- text: typeof Schema.String;
265
- }>;
266
- /**
267
- * Represents a text part of a message.
268
- *
269
- * @since 1.0.0
270
- * @category Models
271
- */
272
- export declare class TextPart extends TextPart_base {
273
- /**
274
- * @since 1.0.0
275
- */
276
- readonly [PartTypeId]: PartTypeId;
277
- }
278
- declare const ImagePart_base: Schema.TaggedClass<ImagePart, "ImagePart", {
279
- readonly _tag: Schema.tag<"ImagePart">;
280
- } & {
281
- /**
282
- * The binary image data.
283
- */
284
- data: Schema.Schema<Uint8Array<ArrayBufferLike>, string, never>;
285
- /**
286
- * The optional MIME type for the image.
287
- */
288
- mediaType: Schema.optional<typeof Schema.String>;
289
- }>;
290
- /**
291
- * Represents an image part of a message with binary image data.
292
- *
293
- * @since 1.0.0
294
- * @category Models
295
- */
296
- export declare class ImagePart extends ImagePart_base {
297
- /**
298
- * @since 1.0.0
299
- */
300
- readonly [PartTypeId]: PartTypeId;
301
- }
302
- declare const ImageUrlPart_base: Schema.TaggedClass<ImageUrlPart, "ImageUrlPart", {
303
- readonly _tag: Schema.tag<"ImageUrlPart">;
304
- } & {
305
- /**
306
- * The URL that points to the image.
307
- */
308
- url: typeof Schema.URL;
309
- }>;
310
- /**
311
- * Represents an image part of a message with a URL pointing to the image.
312
- *
313
- * @since 1.0.0
314
- * @category Models
315
- */
316
- export declare class ImageUrlPart extends ImageUrlPart_base {
317
- /**
318
- * @since 1.0.0
319
- */
320
- readonly [PartTypeId]: PartTypeId;
321
- }
322
- declare const FilePart_base: Schema.TaggedClass<FilePart, "FilePart", {
323
- readonly _tag: Schema.tag<"FilePart">;
324
- } & {
325
- /**
326
- * The binary file data.
327
- */
328
- data: Schema.Schema<Uint8Array<ArrayBufferLike>, string, never>;
329
- /**
330
- * The optional name of the file.
331
- */
332
- name: Schema.optional<typeof Schema.String>;
333
- /**
334
- * The optional MIME type for the image.
335
- */
336
- mediaType: Schema.optional<typeof Schema.String>;
337
- }>;
338
- /**
339
- * Represents a file part of a message with binary file data.
340
- *
341
- * @since 1.0.0
342
- * @category Models
343
- */
344
- export declare class FilePart extends FilePart_base {
345
- /**
346
- * @since 1.0.0
347
- */
348
- readonly [PartTypeId]: PartTypeId;
349
- }
350
- declare const FileUrlPart_base: Schema.TaggedClass<FileUrlPart, "FileUrlPart", {
351
- readonly _tag: Schema.tag<"FileUrlPart">;
352
- } & {
353
- /**
354
- * The URL that points to the file.
355
- */
356
- url: typeof Schema.URL;
357
- }>;
358
- /**
359
- * Represents a file part of a message with a URL pointing to the file.
360
- *
361
- * @since 1.0.0
362
- * @category Models
363
- */
364
- export declare class FileUrlPart extends FileUrlPart_base {
365
- /**
366
- * @since 1.0.0
367
- */
368
- readonly [PartTypeId]: PartTypeId;
369
- }
370
- declare const ReasoningPart_base: Schema.TaggedClass<ReasoningPart, "ReasoningPart", {
371
- readonly _tag: Schema.tag<"ReasoningPart">;
372
- } & {
373
- /**
374
- * The reasoning text that the model used to return the output.
375
- */
376
- reasoningText: typeof Schema.String;
377
- /**
378
- * An optional signature which verifies that the reasoning text was generated
379
- * by the model.
380
- */
381
- signature: Schema.optional<typeof Schema.String>;
382
- }>;
383
- /**
384
- * Represents a part of a message containing reasoning that the model used to
385
- * generate its output.
386
- *
387
- * @since 1.0.0
388
- * @category Models
389
- */
390
- export declare class ReasoningPart extends ReasoningPart_base {
391
- /**
392
- * @since 1.0.0
393
- */
394
- readonly [PartTypeId]: PartTypeId;
395
- }
396
- declare const RedactedReasoningPart_base: Schema.TaggedClass<RedactedReasoningPart, "RedactedReasoningPart", {
397
- readonly _tag: Schema.tag<"RedactedReasoningPart">;
398
- } & {
399
- /**
400
- * The content in the reasoning that was encrypted by the model provider for
401
- * safety reasons.
402
- */
403
- redactedText: typeof Schema.String;
404
- }>;
405
- /**
406
- * Represents a part of a message containing content in the model's reasoning
407
- * that was encrypted by the model provider for safety reasons.
408
- *
409
- * @since 1.0.0
410
- * @category Models
411
- */
412
- export declare class RedactedReasoningPart extends RedactedReasoningPart_base {
413
- /**
414
- * @since 1.0.0
415
- */
416
- readonly [PartTypeId]: PartTypeId;
417
- }
418
- /**
419
- * Represents the identifier generated by a model when a tool call is requested.
420
- *
421
- * @since 1.0.0
422
- * @category Models
423
- */
424
- export declare const ToolCallId: Schema.brand<typeof Schema.String, "@effect/ai/ToolCallId">;
425
- /**
426
- * @since 1.0.0
427
- * @category Models
428
- */
429
- export type ToolCallId = typeof ToolCallId.Type;
430
- declare const ToolCallPart_base: Schema.TaggedClass<ToolCallPart, "ToolCallPart", {
431
- readonly _tag: Schema.tag<"ToolCallPart">;
432
- } & {
433
- /**
434
- * The identifier generated by a model when requesting a tool call.
435
- */
436
- id: Schema.brand<typeof Schema.String, "@effect/ai/ToolCallId">;
437
- /**
438
- * The name of the tool to call.
439
- */
440
- name: typeof Schema.String;
441
- /**
442
- * The arguments to call the tool with as a JSON-serializable object that
443
- * matches the tool call input schema.
444
- */
445
- params: typeof Schema.Unknown;
446
- }>;
447
- /**
448
- * Represents a part of a message containing a tool call that the model has
449
- * requested invocation of.
450
- *
451
- * @since 1.0.0
452
- * @category Models
453
- */
454
- export declare class ToolCallPart extends ToolCallPart_base {
455
- /**
456
- * @since 1.0.0
457
- */
458
- readonly [PartTypeId]: PartTypeId;
459
- constructor(props: any, options?: Schema.MakeOptions);
460
- }
461
- declare const ToolCallResultPart_base: Schema.TaggedClass<ToolCallResultPart, "ToolCallResultPart", {
462
- readonly _tag: Schema.tag<"ToolCallResultPart">;
463
- } & {
464
- /**
465
- * The identifier generated by a model when requesting a tool call.
466
- */
467
- id: Schema.brand<typeof Schema.String, "@effect/ai/ToolCallId">;
468
- /**
469
- * The name of the tool that was called.
470
- */
471
- name: typeof Schema.String;
472
- /**
473
- * The result of the tool call as a JSON-serializable object.
474
- */
475
- result: typeof Schema.Unknown;
476
- }>;
477
- /**
478
- * Represents a part of a message containing the results of tool calls that the
479
- * model requested invocation of.
480
- *
481
- * @since 1.0.0
482
- * @category Models
483
- */
484
- export declare class ToolCallResultPart extends ToolCallResultPart_base {
485
- /**
486
- * @since 1.0.0
487
- */
488
- readonly [PartTypeId]: PartTypeId;
489
- }
490
- /**
491
- * The valid parts of a user message.
492
- *
493
- * @since 1.0.0
494
- * @category Models
495
- */
496
- export declare const UserMessagePart: Schema.Union<[
497
- typeof TextPart,
498
- typeof ImagePart,
499
- typeof ImageUrlPart,
500
- typeof FilePart,
501
- typeof FileUrlPart
502
- ]>;
503
- /**
504
- * @since 1.0.0
505
- * @category Models
506
- */
507
- export type UserMessagePart = typeof UserMessagePart.Type;
508
- /**
509
- * The valid parts of an assistant message.
510
- *
511
- * @since 1.0.0
512
- * @category Models
513
- */
514
- export declare const AssistantMessagePart: Schema.Union<[
515
- typeof TextPart,
516
- typeof ReasoningPart,
517
- typeof RedactedReasoningPart,
518
- typeof ToolCallPart
519
- ]>;
520
- /**
521
- * @since 1.0.0
522
- * @category Models
523
- */
524
- export type AssistantMessagePart = typeof AssistantMessagePart.Type;
525
- /**
526
- * The valid parts of a tool message.
527
- *
528
- * @since 1.0.0
529
- * @category Models
530
- */
531
- export declare const ToolMessagePart: typeof ToolCallResultPart;
532
- /**
533
- * @since 1.0.0
534
- * @category Models
535
- */
536
- export type ToolMessagePart = typeof ToolMessagePart.Type;
537
- /**
538
- * @since 1.0.0
539
- * @category Guards
540
- */
541
- export declare const is: (u: unknown) => u is AiInput;
542
- /**
543
- * @since 1.0.0
544
- * @category Guards
545
- */
546
- export declare const isMessage: (u: unknown) => u is Message;
547
- /**
548
- * @since 1.0.0
549
- * @category Guards
550
- */
551
- export declare const isPart: (u: unknown) => u is UserMessagePart | AssistantMessagePart | ToolMessagePart;
552
- /**
553
- * @since 1.0.0
554
- * @category Constructors
555
- */
556
- export declare const empty: AiInput;
557
- /**
558
- * Constructs a new `AiInput` from raw user input.
559
- *
560
- * @since 1.0.0
561
- * @category Constructors
562
- */
563
- export declare const make: (input: Raw) => AiInput;
564
- /**
565
- * Concatenates the messages of one `AiInput` onto the messages of another,
566
- * creating a new `AiInput` with the messages from both.
567
- *
568
- * @since 1.0.0
569
- * @category Combination
570
- */
571
- export declare const concat: {
572
- /**
573
- * Concatenates the messages of one `AiInput` onto the messages of another,
574
- * creating a new `AiInput` with the messages from both.
575
- *
576
- * @since 1.0.0
577
- * @category Combination
578
- */
579
- (other: AiInput): (self: AiInput) => AiInput;
580
- /**
581
- * Concatenates the messages of one `AiInput` onto the messages of another,
582
- * creating a new `AiInput` with the messages from both.
583
- *
584
- * @since 1.0.0
585
- * @category Combination
586
- */
587
- (self: AiInput, other: AiInput): AiInput;
588
- };
589
- export {};
590
- //# sourceMappingURL=AiInput.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AiInput.d.ts","sourceRoot":"","sources":["../../src/AiInput.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAG7C;;;GAGG;AACH,eAAO,MAAM,MAAM,eAAmC,CAAA;AAEtD;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,YAI3B;IACA;;OAEG;IACH,QAAQ,CAAC,C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