@effect/ai-anthropic 0.22.0 → 4.0.0-beta.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 (104) hide show
  1. package/dist/AnthropicClient.d.ts +196 -0
  2. package/dist/AnthropicClient.d.ts.map +1 -0
  3. package/dist/AnthropicClient.js +142 -0
  4. package/dist/AnthropicClient.js.map +1 -0
  5. package/dist/{dts/AnthropicConfig.d.ts → AnthropicConfig.d.ts} +9 -9
  6. package/dist/AnthropicConfig.d.ts.map +1 -0
  7. package/dist/{esm/AnthropicConfig.js → AnthropicConfig.js} +8 -5
  8. package/dist/AnthropicConfig.js.map +1 -0
  9. package/dist/AnthropicError.d.ts +102 -0
  10. package/dist/AnthropicError.d.ts.map +1 -0
  11. package/dist/AnthropicError.js +10 -0
  12. package/dist/AnthropicError.js.map +1 -0
  13. package/dist/AnthropicLanguageModel.d.ts +522 -0
  14. package/dist/AnthropicLanguageModel.d.ts.map +1 -0
  15. package/dist/AnthropicLanguageModel.js +2107 -0
  16. package/dist/AnthropicLanguageModel.js.map +1 -0
  17. package/dist/AnthropicTelemetry.d.ts +101 -0
  18. package/dist/AnthropicTelemetry.d.ts.map +1 -0
  19. package/dist/AnthropicTelemetry.js +35 -0
  20. package/dist/AnthropicTelemetry.js.map +1 -0
  21. package/dist/AnthropicTool.d.ts +2153 -0
  22. package/dist/AnthropicTool.d.ts.map +1 -0
  23. package/dist/AnthropicTool.js +1168 -0
  24. package/dist/AnthropicTool.js.map +1 -0
  25. package/dist/Generated.d.ts +25233 -0
  26. package/dist/Generated.d.ts.map +1 -0
  27. package/dist/Generated.js +7649 -0
  28. package/dist/Generated.js.map +1 -0
  29. package/dist/index.d.ts +53 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +54 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/internal/errors.d.ts +2 -0
  34. package/dist/internal/errors.d.ts.map +1 -0
  35. package/dist/internal/errors.js +344 -0
  36. package/dist/internal/errors.js.map +1 -0
  37. package/dist/{dts/internal → internal}/utilities.d.ts.map +1 -1
  38. package/dist/internal/utilities.js.map +1 -0
  39. package/package.json +45 -81
  40. package/src/AnthropicClient.ts +327 -683
  41. package/src/AnthropicConfig.ts +20 -34
  42. package/src/AnthropicError.ts +111 -0
  43. package/src/AnthropicLanguageModel.ts +2039 -993
  44. package/src/AnthropicTelemetry.ts +138 -0
  45. package/src/AnthropicTool.ts +1500 -475
  46. package/src/Generated.ts +9798 -6359
  47. package/src/index.ts +38 -6
  48. package/src/internal/errors.ts +368 -0
  49. package/src/internal/utilities.ts +1 -1
  50. package/AnthropicClient/package.json +0 -6
  51. package/AnthropicConfig/package.json +0 -6
  52. package/AnthropicLanguageModel/package.json +0 -6
  53. package/AnthropicTokenizer/package.json +0 -6
  54. package/AnthropicTool/package.json +0 -6
  55. package/Generated/package.json +0 -6
  56. package/README.md +0 -5
  57. package/dist/cjs/AnthropicClient.js +0 -344
  58. package/dist/cjs/AnthropicClient.js.map +0 -1
  59. package/dist/cjs/AnthropicConfig.js +0 -30
  60. package/dist/cjs/AnthropicConfig.js.map +0 -1
  61. package/dist/cjs/AnthropicLanguageModel.js +0 -1322
  62. package/dist/cjs/AnthropicLanguageModel.js.map +0 -1
  63. package/dist/cjs/AnthropicTokenizer.js +0 -52
  64. package/dist/cjs/AnthropicTokenizer.js.map +0 -1
  65. package/dist/cjs/AnthropicTool.js +0 -461
  66. package/dist/cjs/AnthropicTool.js.map +0 -1
  67. package/dist/cjs/Generated.js +0 -6578
  68. package/dist/cjs/Generated.js.map +0 -1
  69. package/dist/cjs/index.js +0 -20
  70. package/dist/cjs/index.js.map +0 -1
  71. package/dist/cjs/internal/utilities.js +0 -29
  72. package/dist/cjs/internal/utilities.js.map +0 -1
  73. package/dist/dts/AnthropicClient.d.ts +0 -730
  74. package/dist/dts/AnthropicClient.d.ts.map +0 -1
  75. package/dist/dts/AnthropicConfig.d.ts.map +0 -1
  76. package/dist/dts/AnthropicLanguageModel.d.ts +0 -304
  77. package/dist/dts/AnthropicLanguageModel.d.ts.map +0 -1
  78. package/dist/dts/AnthropicTokenizer.d.ts +0 -13
  79. package/dist/dts/AnthropicTokenizer.d.ts.map +0 -1
  80. package/dist/dts/AnthropicTool.d.ts +0 -548
  81. package/dist/dts/AnthropicTool.d.ts.map +0 -1
  82. package/dist/dts/Generated.d.ts +0 -12504
  83. package/dist/dts/Generated.d.ts.map +0 -1
  84. package/dist/dts/index.d.ts +0 -25
  85. package/dist/dts/index.d.ts.map +0 -1
  86. package/dist/esm/AnthropicClient.js +0 -317
  87. package/dist/esm/AnthropicClient.js.map +0 -1
  88. package/dist/esm/AnthropicConfig.js.map +0 -1
  89. package/dist/esm/AnthropicLanguageModel.js +0 -1309
  90. package/dist/esm/AnthropicLanguageModel.js.map +0 -1
  91. package/dist/esm/AnthropicTokenizer.js +0 -44
  92. package/dist/esm/AnthropicTokenizer.js.map +0 -1
  93. package/dist/esm/AnthropicTool.js +0 -452
  94. package/dist/esm/AnthropicTool.js.map +0 -1
  95. package/dist/esm/Generated.js +0 -6247
  96. package/dist/esm/Generated.js.map +0 -1
  97. package/dist/esm/index.js +0 -25
  98. package/dist/esm/index.js.map +0 -1
  99. package/dist/esm/internal/utilities.js.map +0 -1
  100. package/dist/esm/package.json +0 -4
  101. package/index/package.json +0 -6
  102. package/src/AnthropicTokenizer.ts +0 -59
  103. /package/dist/{dts/internal → internal}/utilities.d.ts +0 -0
  104. /package/dist/{esm/internal → internal}/utilities.js +0 -0
@@ -0,0 +1,522 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Layer from "effect/Layer";
3
+ import * as Schema from "effect/Schema";
4
+ import * as ServiceMap from "effect/ServiceMap";
5
+ import * as LanguageModel from "effect/unstable/ai/LanguageModel";
6
+ import * as AiModel from "effect/unstable/ai/Model";
7
+ import { AnthropicClient } from "./AnthropicClient.ts";
8
+ import type * as Generated from "./Generated.ts";
9
+ /**
10
+ * The available Anthropic Claude model identifiers.
11
+ *
12
+ * @since 1.0.0
13
+ * @category models
14
+ */
15
+ export type Model = typeof Generated.Model.Type;
16
+ declare const Config_base: ServiceMap.ServiceClass<Config, "@effect/ai-anthropic/AnthropicLanguageModel/Config", {
17
+ readonly model?: "claude-opus-4-6" | "claude-opus-4-5-20251101" | "claude-opus-4-5" | "claude-3-7-sonnet-latest" | "claude-3-7-sonnet-20250219" | "claude-3-5-haiku-latest" | "claude-3-5-haiku-20241022" | "claude-haiku-4-5" | "claude-haiku-4-5-20251001" | "claude-sonnet-4-20250514" | "claude-sonnet-4-0" | "claude-4-sonnet-20250514" | "claude-sonnet-4-5" | "claude-sonnet-4-5-20250929" | "claude-opus-4-0" | "claude-opus-4-20250514" | "claude-4-opus-20250514" | "claude-opus-4-1-20250805" | "claude-3-opus-latest" | "claude-3-opus-20240229" | "claude-3-haiku-20240307";
18
+ readonly thinking?: {
19
+ readonly type: "adaptive";
20
+ } | {
21
+ readonly type: "disabled";
22
+ } | {
23
+ readonly type: "enabled";
24
+ readonly budget_tokens: number;
25
+ };
26
+ readonly max_tokens?: number;
27
+ readonly context_management?: {
28
+ readonly edits?: readonly ({
29
+ readonly type: "compact_20260112";
30
+ readonly instructions?: string | null;
31
+ readonly pause_after_compaction?: boolean;
32
+ readonly trigger?: {
33
+ readonly type: "input_tokens";
34
+ readonly value: number;
35
+ } | null;
36
+ } | {
37
+ readonly type: "clear_thinking_20251015";
38
+ readonly keep?: "all" | {
39
+ readonly type: "all";
40
+ } | {
41
+ readonly type: "thinking_turns";
42
+ readonly value: number;
43
+ };
44
+ } | {
45
+ readonly type: "clear_tool_uses_20250919";
46
+ readonly trigger?: {
47
+ readonly type: "input_tokens";
48
+ readonly value: number;
49
+ } | {
50
+ readonly type: "tool_uses";
51
+ readonly value: number;
52
+ };
53
+ readonly keep?: {
54
+ readonly type: "tool_uses";
55
+ readonly value: number;
56
+ };
57
+ readonly clear_at_least?: {
58
+ readonly type: "input_tokens";
59
+ readonly value: number;
60
+ } | null;
61
+ readonly clear_tool_inputs?: boolean | readonly string[] | null;
62
+ readonly exclude_tools?: readonly string[] | null;
63
+ })[];
64
+ } | null;
65
+ readonly stop_sequences?: readonly string[];
66
+ readonly temperature?: number;
67
+ readonly top_p?: number;
68
+ readonly top_k?: number;
69
+ readonly metadata?: {
70
+ readonly user_id?: string | null;
71
+ };
72
+ readonly container?: string | {
73
+ readonly id?: string | null;
74
+ readonly skills?: readonly {
75
+ readonly type: "anthropic" | "custom";
76
+ readonly skill_id: string;
77
+ readonly version?: string;
78
+ }[] | null;
79
+ } | null;
80
+ readonly inference_geo?: string | null;
81
+ readonly service_tier?: "auto" | "standard_only";
82
+ readonly speed?: "standard" | "fast" | null;
83
+ readonly system?: string | readonly {
84
+ readonly type: "text";
85
+ readonly text: string;
86
+ readonly cache_control?: {
87
+ readonly type: "ephemeral";
88
+ readonly ttl?: "5m" | "1h";
89
+ } | null;
90
+ readonly citations?: readonly ({
91
+ readonly type: "char_location";
92
+ readonly cited_text: string;
93
+ readonly document_index: number;
94
+ readonly document_title: string | null;
95
+ readonly end_char_index: number;
96
+ readonly start_char_index: number;
97
+ } | {
98
+ readonly type: "content_block_location";
99
+ readonly cited_text: string;
100
+ readonly document_index: number;
101
+ readonly document_title: string | null;
102
+ readonly end_block_index: number;
103
+ readonly start_block_index: number;
104
+ } | {
105
+ readonly type: "page_location";
106
+ readonly cited_text: string;
107
+ readonly document_index: number;
108
+ readonly document_title: string | null;
109
+ readonly end_page_number: number;
110
+ readonly start_page_number: number;
111
+ } | {
112
+ readonly title: string | null;
113
+ readonly type: "search_result_location";
114
+ readonly source: string;
115
+ readonly cited_text: string;
116
+ readonly end_block_index: number;
117
+ readonly start_block_index: number;
118
+ readonly search_result_index: number;
119
+ } | {
120
+ readonly title: string | null;
121
+ readonly type: "web_search_result_location";
122
+ readonly cited_text: string;
123
+ readonly url: string;
124
+ readonly encrypted_index: string;
125
+ })[] | null;
126
+ }[];
127
+ readonly mcp_servers?: readonly {
128
+ readonly type: "url";
129
+ readonly name: string;
130
+ readonly url: string;
131
+ readonly authorization_token?: string | null;
132
+ readonly tool_configuration?: {
133
+ readonly enabled?: boolean | null;
134
+ readonly allowed_tools?: readonly string[] | null;
135
+ } | null;
136
+ }[];
137
+ readonly output_format?: {
138
+ readonly type: "json_schema";
139
+ readonly schema: {
140
+ readonly [x: string]: Schema.Json;
141
+ };
142
+ } | null;
143
+ readonly output_config?: {
144
+ readonly effort?: "low" | "medium" | "high" | null;
145
+ };
146
+ readonly disableParallelToolCalls?: boolean | undefined
147
+ /**
148
+ * Whether to use strict JSON schema validation for tool calls.
149
+ *
150
+ * Only applies to models that support structured outputs. Defaults to
151
+ * `true` when structured outputs are supported.
152
+ */
153
+ | undefined;
154
+ readonly strictJsonSchema?: boolean | undefined | undefined;
155
+ }>;
156
+ /**
157
+ * Configuration options for the Anthropic language model.
158
+ *
159
+ * This service can be used to provide default configuration values or to
160
+ * override configuration on a per-request basis.
161
+ *
162
+ * @since 1.0.0
163
+ * @category configuration
164
+ */
165
+ export declare class Config extends Config_base {
166
+ }
167
+ declare module "effect/unstable/ai/Prompt" {
168
+ interface SystemMessageOptions extends ProviderOptions {
169
+ readonly anthropic?: {
170
+ /**
171
+ * A breakpoint which marks the end of reusable content eligible for caching.
172
+ */
173
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
174
+ } | null;
175
+ }
176
+ interface UserMessageOptions extends ProviderOptions {
177
+ readonly anthropic?: {
178
+ /**
179
+ * A breakpoint which marks the end of reusable content eligible for caching.
180
+ */
181
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
182
+ } | null;
183
+ }
184
+ interface AssistantMessageOptions extends ProviderOptions {
185
+ readonly anthropic?: {
186
+ /**
187
+ * A breakpoint which marks the end of reusable content eligible for caching.
188
+ */
189
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
190
+ } | null;
191
+ }
192
+ interface ToolMessageOptions extends ProviderOptions {
193
+ readonly anthropic?: {
194
+ /**
195
+ * A breakpoint which marks the end of reusable content eligible for caching.
196
+ */
197
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
198
+ } | null;
199
+ }
200
+ interface TextPartOptions extends ProviderOptions {
201
+ readonly anthropic?: {
202
+ /**
203
+ * A breakpoint which marks the end of reusable content eligible for caching.
204
+ */
205
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
206
+ } | null;
207
+ }
208
+ interface ReasoningPartOptions extends ProviderOptions {
209
+ readonly anthropic?: {
210
+ readonly info?: {
211
+ readonly type: "thinking";
212
+ /**
213
+ * Thinking content as an encrypted string, which is used to verify
214
+ * that thinking content was indeed generated by Anthropic's API.
215
+ */
216
+ readonly signature: typeof Generated.ResponseThinkingBlock.fields.thinking.Encoded;
217
+ } | {
218
+ readonly type: "redacted_thinking";
219
+ /**
220
+ * Thinking content which was flagged by Anthropic's safety systems, and
221
+ * was therefore encrypted.
222
+ */
223
+ readonly redactedData: typeof Generated.ResponseRedactedThinkingBlock.fields.data.Encoded;
224
+ } | null;
225
+ /**
226
+ * A breakpoint which marks the end of reusable content eligible for caching.
227
+ */
228
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
229
+ } | null;
230
+ }
231
+ interface FilePartOptions extends ProviderOptions {
232
+ readonly anthropic?: {
233
+ /**
234
+ * A breakpoint which marks the end of reusable content eligible for caching.
235
+ */
236
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
237
+ /**
238
+ * Whether or not citations should be enabled for the file part.
239
+ */
240
+ readonly citations?: typeof Generated.RequestCitationsConfig.Encoded | null;
241
+ /**
242
+ * A custom title to provide to the document. If omitted, the file part's
243
+ * `fileName` property will be used.
244
+ */
245
+ readonly documentTitle?: string | null;
246
+ /**
247
+ * Additional context about the document that will be forwarded to the
248
+ * large language model, but will not be used towards cited content.
249
+ *
250
+ * Useful for storing additional document metadata as text or stringified JSON.
251
+ */
252
+ readonly documentContext?: string | null;
253
+ } | null;
254
+ }
255
+ interface ToolCallPartOptions extends ProviderOptions {
256
+ readonly anthropic?: {
257
+ readonly caller?: {
258
+ readonly type: string;
259
+ readonly toolId?: string | null;
260
+ } | null;
261
+ /**
262
+ * Contains details about the MCP tool that was called.
263
+ */
264
+ readonly mcp_tool?: {
265
+ /**
266
+ * The name of the MCP server
267
+ */
268
+ readonly server: string;
269
+ } | null;
270
+ /**
271
+ * A breakpoint which marks the end of reusable content eligible for caching.
272
+ */
273
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
274
+ } | null;
275
+ }
276
+ interface ToolResultPartOptions extends ProviderOptions {
277
+ readonly anthropic?: {
278
+ /**
279
+ * A breakpoint which marks the end of reusable content eligible for caching.
280
+ */
281
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
282
+ } | null;
283
+ }
284
+ interface ToolApprovalRequestPartOptions extends ProviderOptions {
285
+ readonly anthropic?: {
286
+ /**
287
+ * A breakpoint which marks the end of reusable content eligible for caching.
288
+ */
289
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
290
+ } | null;
291
+ }
292
+ interface ToolApprovalResponsePartOptions extends ProviderOptions {
293
+ readonly anthropic?: {
294
+ /**
295
+ * A breakpoint which marks the end of reusable content eligible for caching.
296
+ */
297
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
298
+ } | null;
299
+ }
300
+ interface ToolApprovalResponsePartOptions extends ProviderOptions {
301
+ readonly anthropic?: {
302
+ /**
303
+ * A breakpoint which marks the end of reusable content eligible for caching.
304
+ */
305
+ readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
306
+ } | null;
307
+ }
308
+ }
309
+ declare module "effect/unstable/ai/Response" {
310
+ interface ReasoningStartPartMetadata extends ProviderMetadata {
311
+ readonly anthropic?: {
312
+ readonly info?: {
313
+ readonly type: "thinking";
314
+ /**
315
+ * Thinking content as an encrypted string, which is used to verify
316
+ * that thinking content was indeed generated by Anthropic's API.
317
+ */
318
+ readonly signature: typeof Generated.ResponseThinkingBlock.fields.thinking.Encoded;
319
+ } | {
320
+ readonly type: "redacted_thinking";
321
+ /**
322
+ * Thinking content which was flagged by Anthropic's safety systems, and
323
+ * was therefore encrypted.
324
+ */
325
+ readonly redactedData: typeof Generated.ResponseRedactedThinkingBlock.fields.data.Encoded;
326
+ } | null;
327
+ } | null;
328
+ }
329
+ interface ReasoningDeltaPartMetadata extends ProviderMetadata {
330
+ readonly anthropic?: {
331
+ readonly info?: {
332
+ readonly type: "thinking";
333
+ /**
334
+ * Thinking content as an encrypted string, which is used to verify
335
+ * that thinking content was indeed generated by Anthropic's API.
336
+ */
337
+ readonly signature: typeof Generated.ResponseThinkingBlock.fields.thinking.Encoded;
338
+ } | null;
339
+ } | null;
340
+ }
341
+ interface ReasoningPartMetadata extends ProviderMetadata {
342
+ readonly anthropic?: {
343
+ readonly info?: {
344
+ readonly type: "thinking";
345
+ /**
346
+ * Thinking content as an encrypted string, which is used to verify
347
+ * that thinking content was indeed generated by Anthropic's API.
348
+ */
349
+ readonly signature: typeof Generated.ResponseThinkingBlock.fields.thinking.Encoded;
350
+ } | {
351
+ readonly type: "redacted_thinking";
352
+ /**
353
+ * Thinking content which was flagged by Anthropic's safety systems, and
354
+ * was therefore encrypted.
355
+ */
356
+ readonly redactedData: typeof Generated.ResponseRedactedThinkingBlock.fields.data.Encoded;
357
+ } | null;
358
+ } | null;
359
+ }
360
+ interface ToolCallPartMetadata extends ProviderMetadata {
361
+ readonly anthropic?: {
362
+ readonly caller?: {
363
+ readonly type: string;
364
+ readonly toolId?: string | null;
365
+ } | null;
366
+ /**
367
+ * Contains details about the MCP tool that was called.
368
+ */
369
+ readonly mcp_tool?: {
370
+ /**
371
+ * The name of the MCP server
372
+ */
373
+ readonly server: string;
374
+ } | null;
375
+ } | null;
376
+ }
377
+ interface ToolResultPartMetadata extends ProviderMetadata {
378
+ readonly anthropic?: {
379
+ /**
380
+ * Contains details about the MCP tool that was called.
381
+ */
382
+ readonly mcp_tool?: {
383
+ /**
384
+ * The name of the MCP server
385
+ */
386
+ readonly server: string;
387
+ } | null;
388
+ } | null;
389
+ }
390
+ interface DocumentSourcePartMetadata extends ProviderMetadata {
391
+ readonly anthropic?: {
392
+ readonly source: "document";
393
+ readonly type: "char_location";
394
+ /**
395
+ * The text that was cited in the response.
396
+ */
397
+ readonly citedText: string;
398
+ /**
399
+ * The 0-indexed starting position of the characters that were cited.
400
+ */
401
+ readonly startCharIndex: number;
402
+ /**
403
+ * The exclusive ending position of the characters that were cited.
404
+ */
405
+ readonly endCharIndex: number;
406
+ } | {
407
+ readonly source: "document";
408
+ readonly type: "page_location";
409
+ /**
410
+ * The text that was cited in the response.
411
+ */
412
+ readonly citedText: string;
413
+ /**
414
+ * The 1-indexed starting page of pages that were cited.
415
+ */
416
+ readonly startPageNumber: number;
417
+ /**
418
+ * The exclusive ending position of the pages that were cited.
419
+ */
420
+ readonly endPageNumber: number;
421
+ } | null;
422
+ }
423
+ interface UrlSourcePartMetadata extends ProviderMetadata {
424
+ readonly anthropic?: {
425
+ readonly source: "url";
426
+ /**
427
+ * Up to 150 characters of the text content that was referenced from the
428
+ * URL source material.
429
+ */
430
+ readonly citedText: string;
431
+ /**
432
+ * An internal reference that must be passed back to the Anthropic API
433
+ * during multi-turn conversations.
434
+ */
435
+ readonly encryptedIndex: string;
436
+ } | {
437
+ readonly source: "web";
438
+ readonly pageAge: string | null;
439
+ } | null;
440
+ }
441
+ interface FinishPartMetadata extends ProviderMetadata {
442
+ readonly anthropic?: {
443
+ readonly container: typeof Generated.BetaContainer.Encoded | null;
444
+ readonly contextManagement: typeof Generated.BetaResponseContextManagement.Encoded | null;
445
+ readonly stopSequence: string | null;
446
+ readonly usage: typeof Generated.BetaMessage.Encoded["usage"] | null;
447
+ } | null;
448
+ }
449
+ interface ErrorPartMetadata extends ProviderMetadata {
450
+ readonly anthropic?: {
451
+ requestId?: string | null;
452
+ } | null;
453
+ }
454
+ }
455
+ /**
456
+ * Creates an Anthropic language model that can be used with `AiModel.provide`.
457
+ *
458
+ * @since 1.0.0
459
+ * @category constructors
460
+ */
461
+ export declare const model: (model: (string & {}) | Model, config?: Omit<typeof Config.Service, "model">) => AiModel.Model<"anthropic", LanguageModel.LanguageModel, AnthropicClient>;
462
+ /**
463
+ * Creates an Anthropic language model service.
464
+ *
465
+ * @since 1.0.0
466
+ * @category constructors
467
+ */
468
+ export declare const make: (args_0: {
469
+ readonly model: (string & {}) | Model;
470
+ readonly config?: Omit<typeof Config.Service, "model"> | undefined;
471
+ }) => Effect.Effect<LanguageModel.Service, never, AnthropicClient>;
472
+ /**
473
+ * Creates a layer for the Anthropic language model.
474
+ *
475
+ * @since 1.0.0
476
+ * @category layers
477
+ */
478
+ export declare const layer: (options: {
479
+ readonly model: (string & {}) | Model;
480
+ readonly config?: Omit<typeof Config.Service, "model"> | undefined;
481
+ }) => Layer.Layer<LanguageModel.LanguageModel, never, AnthropicClient>;
482
+ /**
483
+ * Provides config overrides for Anthropic language model operations.
484
+ *
485
+ * @since 1.0.0
486
+ * @category configuration
487
+ */
488
+ export declare const withConfigOverride: {
489
+ /**
490
+ * Provides config overrides for Anthropic language model operations.
491
+ *
492
+ * @since 1.0.0
493
+ * @category configuration
494
+ */
495
+ (overrides: typeof Config.Service): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Config>>;
496
+ /**
497
+ * Provides config overrides for Anthropic language model operations.
498
+ *
499
+ * @since 1.0.0
500
+ * @category configuration
501
+ */
502
+ <A, E, R>(self: Effect.Effect<A, E, R>, overrides: typeof Config.Service): Effect.Effect<A, E, Exclude<R, Config>>;
503
+ };
504
+ /**
505
+ * Represents a user-defined tool that can be passed to the Anthropic API.
506
+ *
507
+ * @since 1.0.0
508
+ * @category tools
509
+ */
510
+ export type AnthropicUserDefinedTool = typeof Generated.BetaTool.Encoded;
511
+ /**
512
+ * Represents a provider-defined tool that can be passed to the Anthropic API.
513
+ *
514
+ * These include Anthropic's built-in tools like computer use, code execution,
515
+ * web search, and text editing.
516
+ *
517
+ * @since 1.0.0
518
+ * @category tools
519
+ */
520
+ export type AnthropicProviderDefinedTool = typeof Generated.BetaBashTool_20241022.Encoded | typeof Generated.BetaBashTool_20250124.Encoded | typeof Generated.BetaCodeExecutionTool_20250522.Encoded | typeof Generated.BetaCodeExecutionTool_20250825.Encoded | typeof Generated.BetaComputerUseTool_20241022.Encoded | typeof Generated.BetaComputerUseTool_20250124.Encoded | typeof Generated.BetaComputerUseTool_20251124.Encoded | typeof Generated.BetaMemoryTool_20250818.Encoded | typeof Generated.BetaTextEditor_20241022.Encoded | typeof Generated.BetaTextEditor_20250124.Encoded | typeof Generated.BetaTextEditor_20250429.Encoded | typeof Generated.BetaTextEditor_20250728.Encoded | typeof Generated.BetaToolSearchToolBM25_20251119.Encoded | typeof Generated.BetaToolSearchToolRegex_20251119.Encoded | typeof Generated.BetaWebFetchTool_20250910.Encoded | typeof Generated.BetaWebSearchTool_20250305.Encoded;
521
+ export {};
522
+ //# sourceMappingURL=AnthropicLanguageModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnthropicLanguageModel.d.ts","sourceRoot":"","sources":["../src/AnthropicLanguageModel.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAA;AAO/C,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAA;AACjE,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AAMnD,OAAO,EAAE,eAAe,EAA2B,MAAM,sBAAsB,CAAA;AAG/E,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAGhD;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,SAAS,CAAC,KAAK,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