@effect/ai-anthropic 4.0.0-beta.66 → 4.0.0-beta.68
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/AnthropicClient.d.ts +8 -8
- package/dist/AnthropicClient.js +6 -6
- package/dist/AnthropicConfig.d.ts +43 -8
- package/dist/AnthropicConfig.d.ts.map +1 -1
- package/dist/AnthropicConfig.js +28 -4
- package/dist/AnthropicConfig.js.map +1 -1
- package/dist/AnthropicError.d.ts +93 -3
- package/dist/AnthropicError.d.ts.map +1 -1
- package/dist/AnthropicError.js +1 -1
- package/dist/AnthropicLanguageModel.d.ts +181 -10
- package/dist/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.js +32 -6
- package/dist/AnthropicLanguageModel.js.map +1 -1
- package/dist/AnthropicTelemetry.d.ts +13 -11
- package/dist/AnthropicTelemetry.d.ts.map +1 -1
- package/dist/AnthropicTelemetry.js +3 -3
- package/dist/AnthropicTelemetry.js.map +1 -1
- package/dist/AnthropicTool.d.ts +224 -118
- package/dist/AnthropicTool.d.ts.map +1 -1
- package/dist/AnthropicTool.js +76 -72
- package/dist/AnthropicTool.js.map +1 -1
- package/dist/Generated.d.ts +1 -1
- package/dist/Generated.js +1 -1
- package/dist/index.d.ts +52 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/AnthropicClient.ts +9 -9
- package/src/AnthropicConfig.ts +43 -8
- package/src/AnthropicError.ts +93 -3
- package/src/AnthropicLanguageModel.ts +210 -13
- package/src/AnthropicTelemetry.ts +14 -12
- package/src/AnthropicTool.ts +224 -118
- package/src/Generated.ts +1 -1
- package/src/index.ts +52 -8
|
@@ -9,8 +9,8 @@ import type * as Generated from "./Generated.ts";
|
|
|
9
9
|
/**
|
|
10
10
|
* The available Anthropic Claude model identifiers.
|
|
11
11
|
*
|
|
12
|
-
* @since 1.0.0
|
|
13
12
|
* @category models
|
|
13
|
+
* @since 4.0.0
|
|
14
14
|
*/
|
|
15
15
|
export type Model = typeof Generated.Model.Type;
|
|
16
16
|
declare const Config_base: Context.ServiceClass<Config, "@effect/ai-anthropic/AnthropicLanguageModel/Config", {
|
|
@@ -163,12 +163,21 @@ declare const Config_base: Context.ServiceClass<Config, "@effect/ai-anthropic/An
|
|
|
163
163
|
* This service can be used to provide default configuration values or to
|
|
164
164
|
* override configuration on a per-request basis.
|
|
165
165
|
*
|
|
166
|
-
* @since 1.0.0
|
|
167
166
|
* @category configuration
|
|
167
|
+
* @since 4.0.0
|
|
168
168
|
*/
|
|
169
169
|
export declare class Config extends Config_base {
|
|
170
170
|
}
|
|
171
171
|
declare module "effect/unstable/ai/Prompt" {
|
|
172
|
+
/**
|
|
173
|
+
* Anthropic-specific options for system messages.
|
|
174
|
+
*
|
|
175
|
+
* These options are used when translating system messages into Anthropic
|
|
176
|
+
* request content.
|
|
177
|
+
*
|
|
178
|
+
* @category request
|
|
179
|
+
* @since 4.0.0
|
|
180
|
+
*/
|
|
172
181
|
interface SystemMessageOptions extends ProviderOptions {
|
|
173
182
|
readonly anthropic?: {
|
|
174
183
|
/**
|
|
@@ -177,6 +186,15 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
177
186
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
178
187
|
} | null;
|
|
179
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Anthropic-specific options for user messages.
|
|
191
|
+
*
|
|
192
|
+
* These options are used when translating user messages into Anthropic
|
|
193
|
+
* request content.
|
|
194
|
+
*
|
|
195
|
+
* @category request
|
|
196
|
+
* @since 4.0.0
|
|
197
|
+
*/
|
|
180
198
|
interface UserMessageOptions extends ProviderOptions {
|
|
181
199
|
readonly anthropic?: {
|
|
182
200
|
/**
|
|
@@ -185,6 +203,15 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
185
203
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
186
204
|
} | null;
|
|
187
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Anthropic-specific options for assistant messages.
|
|
208
|
+
*
|
|
209
|
+
* These options are used when replaying assistant messages in Anthropic
|
|
210
|
+
* conversation history.
|
|
211
|
+
*
|
|
212
|
+
* @category request
|
|
213
|
+
* @since 4.0.0
|
|
214
|
+
*/
|
|
188
215
|
interface AssistantMessageOptions extends ProviderOptions {
|
|
189
216
|
readonly anthropic?: {
|
|
190
217
|
/**
|
|
@@ -193,6 +220,15 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
193
220
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
194
221
|
} | null;
|
|
195
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Anthropic-specific options for tool messages.
|
|
225
|
+
*
|
|
226
|
+
* These options are used when converting tool results into Anthropic user
|
|
227
|
+
* content blocks.
|
|
228
|
+
*
|
|
229
|
+
* @category request
|
|
230
|
+
* @since 4.0.0
|
|
231
|
+
*/
|
|
196
232
|
interface ToolMessageOptions extends ProviderOptions {
|
|
197
233
|
readonly anthropic?: {
|
|
198
234
|
/**
|
|
@@ -201,6 +237,14 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
201
237
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
202
238
|
} | null;
|
|
203
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Anthropic-specific options for text prompt parts.
|
|
242
|
+
*
|
|
243
|
+
* Use these options to control how text blocks are sent to Anthropic.
|
|
244
|
+
*
|
|
245
|
+
* @category request
|
|
246
|
+
* @since 4.0.0
|
|
247
|
+
*/
|
|
204
248
|
interface TextPartOptions extends ProviderOptions {
|
|
205
249
|
readonly anthropic?: {
|
|
206
250
|
/**
|
|
@@ -209,6 +253,15 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
209
253
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
210
254
|
} | null;
|
|
211
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Anthropic-specific options for reasoning prompt parts.
|
|
258
|
+
*
|
|
259
|
+
* Preserves Claude thinking metadata when reasoning content is sent back to
|
|
260
|
+
* Anthropic in later turns.
|
|
261
|
+
*
|
|
262
|
+
* @category request
|
|
263
|
+
* @since 4.0.0
|
|
264
|
+
*/
|
|
212
265
|
interface ReasoningPartOptions extends ProviderOptions {
|
|
213
266
|
readonly anthropic?: {
|
|
214
267
|
readonly info?: {
|
|
@@ -232,6 +285,15 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
232
285
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
233
286
|
} | null;
|
|
234
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Anthropic-specific options for file prompt parts.
|
|
290
|
+
*
|
|
291
|
+
* Controls document metadata, citations, and prompt caching for files sent to
|
|
292
|
+
* Anthropic.
|
|
293
|
+
*
|
|
294
|
+
* @category request
|
|
295
|
+
* @since 4.0.0
|
|
296
|
+
*/
|
|
235
297
|
interface FilePartOptions extends ProviderOptions {
|
|
236
298
|
readonly anthropic?: {
|
|
237
299
|
/**
|
|
@@ -256,6 +318,15 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
256
318
|
readonly documentContext?: string | null;
|
|
257
319
|
} | null;
|
|
258
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Anthropic-specific options for tool call prompt parts.
|
|
323
|
+
*
|
|
324
|
+
* Carries Anthropic tool caller metadata, MCP metadata, and cache control for
|
|
325
|
+
* tool use blocks.
|
|
326
|
+
*
|
|
327
|
+
* @category request
|
|
328
|
+
* @since 4.0.0
|
|
329
|
+
*/
|
|
259
330
|
interface ToolCallPartOptions extends ProviderOptions {
|
|
260
331
|
readonly anthropic?: {
|
|
261
332
|
readonly caller?: {
|
|
@@ -277,6 +348,14 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
277
348
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
278
349
|
} | null;
|
|
279
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Anthropic-specific options for tool result prompt parts.
|
|
353
|
+
*
|
|
354
|
+
* Controls Anthropic prompt caching for tool result content.
|
|
355
|
+
*
|
|
356
|
+
* @category request
|
|
357
|
+
* @since 4.0.0
|
|
358
|
+
*/
|
|
280
359
|
interface ToolResultPartOptions extends ProviderOptions {
|
|
281
360
|
readonly anthropic?: {
|
|
282
361
|
/**
|
|
@@ -285,6 +364,14 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
285
364
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
286
365
|
} | null;
|
|
287
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* Anthropic-specific options for tool approval request prompt parts.
|
|
369
|
+
*
|
|
370
|
+
* Controls prompt caching for human approval requests in conversations.
|
|
371
|
+
*
|
|
372
|
+
* @category request
|
|
373
|
+
* @since 4.0.0
|
|
374
|
+
*/
|
|
288
375
|
interface ToolApprovalRequestPartOptions extends ProviderOptions {
|
|
289
376
|
readonly anthropic?: {
|
|
290
377
|
/**
|
|
@@ -293,6 +380,14 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
293
380
|
readonly cacheControl?: typeof Generated.CacheControlEphemeral.Encoded | null;
|
|
294
381
|
} | null;
|
|
295
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* Anthropic-specific options for tool approval response prompt parts.
|
|
385
|
+
*
|
|
386
|
+
* Controls prompt caching for human approval responses in conversations.
|
|
387
|
+
*
|
|
388
|
+
* @category request
|
|
389
|
+
* @since 4.0.0
|
|
390
|
+
*/
|
|
296
391
|
interface ToolApprovalResponsePartOptions extends ProviderOptions {
|
|
297
392
|
readonly anthropic?: {
|
|
298
393
|
/**
|
|
@@ -303,6 +398,15 @@ declare module "effect/unstable/ai/Prompt" {
|
|
|
303
398
|
}
|
|
304
399
|
}
|
|
305
400
|
declare module "effect/unstable/ai/Response" {
|
|
401
|
+
/**
|
|
402
|
+
* Anthropic metadata attached when a reasoning block begins.
|
|
403
|
+
*
|
|
404
|
+
* Includes Claude thinking metadata needed to continue reasoning-aware
|
|
405
|
+
* conversations.
|
|
406
|
+
*
|
|
407
|
+
* @category response
|
|
408
|
+
* @since 4.0.0
|
|
409
|
+
*/
|
|
306
410
|
interface ReasoningStartPartMetadata extends ProviderMetadata {
|
|
307
411
|
readonly anthropic?: {
|
|
308
412
|
readonly info?: {
|
|
@@ -322,6 +426,14 @@ declare module "effect/unstable/ai/Response" {
|
|
|
322
426
|
} | null;
|
|
323
427
|
} | null;
|
|
324
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* Anthropic metadata attached to streaming reasoning deltas.
|
|
431
|
+
*
|
|
432
|
+
* Includes the signature for streamed Claude thinking content when available.
|
|
433
|
+
*
|
|
434
|
+
* @category response
|
|
435
|
+
* @since 4.0.0
|
|
436
|
+
*/
|
|
325
437
|
interface ReasoningDeltaPartMetadata extends ProviderMetadata {
|
|
326
438
|
readonly anthropic?: {
|
|
327
439
|
readonly info?: {
|
|
@@ -334,6 +446,14 @@ declare module "effect/unstable/ai/Response" {
|
|
|
334
446
|
} | null;
|
|
335
447
|
} | null;
|
|
336
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* Anthropic metadata attached to completed reasoning parts.
|
|
451
|
+
*
|
|
452
|
+
* Preserves Claude thinking or redacted thinking information for later turns.
|
|
453
|
+
*
|
|
454
|
+
* @category response
|
|
455
|
+
* @since 4.0.0
|
|
456
|
+
*/
|
|
337
457
|
interface ReasoningPartMetadata extends ProviderMetadata {
|
|
338
458
|
readonly anthropic?: {
|
|
339
459
|
readonly info?: {
|
|
@@ -353,6 +473,15 @@ declare module "effect/unstable/ai/Response" {
|
|
|
353
473
|
} | null;
|
|
354
474
|
} | null;
|
|
355
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* Anthropic metadata attached to tool call response parts.
|
|
478
|
+
*
|
|
479
|
+
* Identifies Anthropic caller details and MCP tool metadata emitted by the
|
|
480
|
+
* provider.
|
|
481
|
+
*
|
|
482
|
+
* @category response
|
|
483
|
+
* @since 4.0.0
|
|
484
|
+
*/
|
|
356
485
|
interface ToolCallPartMetadata extends ProviderMetadata {
|
|
357
486
|
readonly anthropic?: {
|
|
358
487
|
readonly caller?: {
|
|
@@ -370,6 +499,15 @@ declare module "effect/unstable/ai/Response" {
|
|
|
370
499
|
} | null;
|
|
371
500
|
} | null;
|
|
372
501
|
}
|
|
502
|
+
/**
|
|
503
|
+
* Anthropic metadata attached to tool result response parts.
|
|
504
|
+
*
|
|
505
|
+
* Identifies MCP tool metadata associated with provider-executed tool
|
|
506
|
+
* results.
|
|
507
|
+
*
|
|
508
|
+
* @category response
|
|
509
|
+
* @since 4.0.0
|
|
510
|
+
*/
|
|
373
511
|
interface ToolResultPartMetadata extends ProviderMetadata {
|
|
374
512
|
readonly anthropic?: {
|
|
375
513
|
/**
|
|
@@ -383,6 +521,14 @@ declare module "effect/unstable/ai/Response" {
|
|
|
383
521
|
} | null;
|
|
384
522
|
} | null;
|
|
385
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* Anthropic metadata for document citations in model responses.
|
|
526
|
+
*
|
|
527
|
+
* Records the cited document span by character position or page number.
|
|
528
|
+
*
|
|
529
|
+
* @category response
|
|
530
|
+
* @since 4.0.0
|
|
531
|
+
*/
|
|
386
532
|
interface DocumentSourcePartMetadata extends ProviderMetadata {
|
|
387
533
|
readonly anthropic?: {
|
|
388
534
|
readonly source: "document";
|
|
@@ -416,6 +562,14 @@ declare module "effect/unstable/ai/Response" {
|
|
|
416
562
|
readonly endPageNumber: number;
|
|
417
563
|
} | null;
|
|
418
564
|
}
|
|
565
|
+
/**
|
|
566
|
+
* Anthropic metadata for URL and web citations in model responses.
|
|
567
|
+
*
|
|
568
|
+
* Records cited URL text or web-search source freshness information.
|
|
569
|
+
*
|
|
570
|
+
* @category response
|
|
571
|
+
* @since 4.0.0
|
|
572
|
+
*/
|
|
419
573
|
interface UrlSourcePartMetadata extends ProviderMetadata {
|
|
420
574
|
readonly anthropic?: {
|
|
421
575
|
readonly source: "url";
|
|
@@ -434,6 +588,15 @@ declare module "effect/unstable/ai/Response" {
|
|
|
434
588
|
readonly pageAge: string | null;
|
|
435
589
|
} | null;
|
|
436
590
|
}
|
|
591
|
+
/**
|
|
592
|
+
* Anthropic metadata attached to the finish part of a response.
|
|
593
|
+
*
|
|
594
|
+
* Includes container state, context management information, stop details, and
|
|
595
|
+
* token usage reported by Anthropic.
|
|
596
|
+
*
|
|
597
|
+
* @category response
|
|
598
|
+
* @since 4.0.0
|
|
599
|
+
*/
|
|
437
600
|
interface FinishPartMetadata extends ProviderMetadata {
|
|
438
601
|
readonly anthropic?: {
|
|
439
602
|
readonly container: typeof Generated.BetaContainer.Encoded | null;
|
|
@@ -442,6 +605,14 @@ declare module "effect/unstable/ai/Response" {
|
|
|
442
605
|
readonly usage: typeof Generated.BetaMessage.Encoded["usage"] | null;
|
|
443
606
|
} | null;
|
|
444
607
|
}
|
|
608
|
+
/**
|
|
609
|
+
* Anthropic metadata attached to error response parts.
|
|
610
|
+
*
|
|
611
|
+
* Includes the provider request identifier when Anthropic returns one.
|
|
612
|
+
*
|
|
613
|
+
* @category response
|
|
614
|
+
* @since 4.0.0
|
|
615
|
+
*/
|
|
445
616
|
interface ErrorPartMetadata extends ProviderMetadata {
|
|
446
617
|
readonly anthropic?: {
|
|
447
618
|
requestId?: string | null;
|
|
@@ -451,15 +622,15 @@ declare module "effect/unstable/ai/Response" {
|
|
|
451
622
|
/**
|
|
452
623
|
* Creates an Anthropic language model that can be used with `AiModel.provide`.
|
|
453
624
|
*
|
|
454
|
-
* @since 1.0.0
|
|
455
625
|
* @category constructors
|
|
626
|
+
* @since 4.0.0
|
|
456
627
|
*/
|
|
457
628
|
export declare const model: (model: (string & {}) | Model, config?: Omit<typeof Config.Service, "model">) => AiModel.Model<"anthropic", LanguageModel.LanguageModel, AnthropicClient>;
|
|
458
629
|
/**
|
|
459
630
|
* Creates an Anthropic language model service.
|
|
460
631
|
*
|
|
461
|
-
* @since 1.0.0
|
|
462
632
|
* @category constructors
|
|
633
|
+
* @since 4.0.0
|
|
463
634
|
*/
|
|
464
635
|
export declare const make: (args_0: {
|
|
465
636
|
readonly model: (string & {}) | Model;
|
|
@@ -468,8 +639,8 @@ export declare const make: (args_0: {
|
|
|
468
639
|
/**
|
|
469
640
|
* Creates a layer for the Anthropic language model.
|
|
470
641
|
*
|
|
471
|
-
* @since 1.0.0
|
|
472
642
|
* @category layers
|
|
643
|
+
* @since 4.0.0
|
|
473
644
|
*/
|
|
474
645
|
export declare const layer: (options: {
|
|
475
646
|
readonly model: (string & {}) | Model;
|
|
@@ -478,30 +649,30 @@ export declare const layer: (options: {
|
|
|
478
649
|
/**
|
|
479
650
|
* Provides config overrides for Anthropic language model operations.
|
|
480
651
|
*
|
|
481
|
-
* @since 1.0.0
|
|
482
652
|
* @category configuration
|
|
653
|
+
* @since 4.0.0
|
|
483
654
|
*/
|
|
484
655
|
export declare const withConfigOverride: {
|
|
485
656
|
/**
|
|
486
657
|
* Provides config overrides for Anthropic language model operations.
|
|
487
658
|
*
|
|
488
|
-
* @since 1.0.0
|
|
489
659
|
* @category configuration
|
|
660
|
+
* @since 4.0.0
|
|
490
661
|
*/
|
|
491
662
|
(overrides: typeof Config.Service): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Config>>;
|
|
492
663
|
/**
|
|
493
664
|
* Provides config overrides for Anthropic language model operations.
|
|
494
665
|
*
|
|
495
|
-
* @since 1.0.0
|
|
496
666
|
* @category configuration
|
|
667
|
+
* @since 4.0.0
|
|
497
668
|
*/
|
|
498
669
|
<A, E, R>(self: Effect.Effect<A, E, R>, overrides: typeof Config.Service): Effect.Effect<A, E, Exclude<R, Config>>;
|
|
499
670
|
};
|
|
500
671
|
/**
|
|
501
672
|
* Represents a user-defined tool that can be passed to the Anthropic API.
|
|
502
673
|
*
|
|
503
|
-
* @since 1.0.0
|
|
504
674
|
* @category tools
|
|
675
|
+
* @since 4.0.0
|
|
505
676
|
*/
|
|
506
677
|
export type AnthropicUserDefinedTool = typeof Generated.BetaTool.Encoded;
|
|
507
678
|
/**
|
|
@@ -510,8 +681,8 @@ export type AnthropicUserDefinedTool = typeof Generated.BetaTool.Encoded;
|
|
|
510
681
|
* These include Anthropic's built-in tools like computer use, code execution,
|
|
511
682
|
* web search, and text editing.
|
|
512
683
|
*
|
|
513
|
-
* @since 1.0.0
|
|
514
684
|
* @category tools
|
|
685
|
+
* @since 4.0.0
|
|
515
686
|
*/
|
|
516
687
|
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;
|
|
517
688
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnthropicLanguageModel.d.ts","sourceRoot":"","sources":["../src/AnthropicLanguageModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnthropicLanguageModel.d.ts","sourceRoot":"","sources":["../src/AnthropicLanguageModel.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,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AA4B,CAAC,OAAO,GACrD,OAAO,SAAS,CAAC,uBAAuB,CAAC,OAAO,GAChD,OAAO,SAAS,CAAC,uBAAuB,CAAC,OAAO,GAChD,OAAO,SAAS,CAAC,uBAAuB,CAAC,OAAO,GAChD,OAAO,SAAS,CAAC,uBAAuB,CAAC,OAAO,GAChD,OAAO,SAAS,CAAC,uBAAuB,CAAC,OAAO,GAChD,OAAO,SAAS,CAAC,+BAA+B,CAAC,OAAO,GACxD,OAAO,SAAS,CAAC,gCAAgC,CAAC,OAAO,GACzD,OAAO,SAAS,CAAC,yBAAyB,CAAC,OAAO,GAClD,OAAO,SAAS,CAAC,0BAA0B,CAAC,OAAO,CAAA"}
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The `AnthropicLanguageModel` module provides the Anthropic implementation of
|
|
3
|
+
* Effect AI's `LanguageModel` service. It turns Effect AI prompts, tools, files,
|
|
4
|
+
* reasoning parts, and provider options into Anthropic Messages API requests,
|
|
5
|
+
* and converts Anthropic responses and streams back into Effect AI response
|
|
6
|
+
* parts with Anthropic-specific metadata.
|
|
7
|
+
*
|
|
8
|
+
* **Common tasks**
|
|
9
|
+
*
|
|
10
|
+
* - Create an Anthropic-backed model with {@link model}
|
|
11
|
+
* - Build or provide a `LanguageModel.LanguageModel` layer with {@link layer}
|
|
12
|
+
* or {@link make}
|
|
13
|
+
* - Supply default request options through {@link Config}
|
|
14
|
+
* - Override configuration for a scoped operation with {@link withConfigOverride}
|
|
15
|
+
* - Attach Anthropic provider options for prompt caching, document citations,
|
|
16
|
+
* reasoning signatures, MCP metadata, and server-side tools
|
|
17
|
+
*
|
|
18
|
+
* **Gotchas**
|
|
19
|
+
*
|
|
20
|
+
* - Prompt files are translated to Anthropic image or document blocks; only the
|
|
21
|
+
* supported media types can be sent to the provider.
|
|
22
|
+
* - Structured output support depends on the selected Claude model, so this
|
|
23
|
+
* module may use Anthropic's native structured output or fall back to a JSON
|
|
24
|
+
* response tool.
|
|
25
|
+
* - Some features require Anthropic beta headers, which are added
|
|
26
|
+
* automatically from the selected tools, files, and model capabilities.
|
|
27
|
+
*
|
|
28
|
+
* @since 4.0.0
|
|
3
29
|
*/
|
|
4
30
|
/** @effect-diagnostics preferSchemaOverJson:skip-file */
|
|
5
31
|
import * as Arr from "effect/Array";
|
|
@@ -33,8 +59,8 @@ import * as InternalUtilities from "./internal/utilities.js";
|
|
|
33
59
|
* This service can be used to provide default configuration values or to
|
|
34
60
|
* override configuration on a per-request basis.
|
|
35
61
|
*
|
|
36
|
-
* @since 1.0.0
|
|
37
62
|
* @category configuration
|
|
63
|
+
* @since 4.0.0
|
|
38
64
|
*/
|
|
39
65
|
export class Config extends /*#__PURE__*/Context.Service()("@effect/ai-anthropic/AnthropicLanguageModel/Config") {}
|
|
40
66
|
// =============================================================================
|
|
@@ -43,8 +69,8 @@ export class Config extends /*#__PURE__*/Context.Service()("@effect/ai-anthropic
|
|
|
43
69
|
/**
|
|
44
70
|
* Creates an Anthropic language model that can be used with `AiModel.provide`.
|
|
45
71
|
*
|
|
46
|
-
* @since 1.0.0
|
|
47
72
|
* @category constructors
|
|
73
|
+
* @since 4.0.0
|
|
48
74
|
*/
|
|
49
75
|
export const model = (model, config) => AiModel.make("anthropic", model, layer({
|
|
50
76
|
model,
|
|
@@ -53,8 +79,8 @@ export const model = (model, config) => AiModel.make("anthropic", model, layer({
|
|
|
53
79
|
/**
|
|
54
80
|
* Creates an Anthropic language model service.
|
|
55
81
|
*
|
|
56
|
-
* @since 1.0.0
|
|
57
82
|
* @category constructors
|
|
83
|
+
* @since 4.0.0
|
|
58
84
|
*/
|
|
59
85
|
export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
|
60
86
|
model,
|
|
@@ -180,15 +206,15 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* ({
|
|
|
180
206
|
/**
|
|
181
207
|
* Creates a layer for the Anthropic language model.
|
|
182
208
|
*
|
|
183
|
-
* @since 1.0.0
|
|
184
209
|
* @category layers
|
|
210
|
+
* @since 4.0.0
|
|
185
211
|
*/
|
|
186
212
|
export const layer = options => Layer.effect(LanguageModel.LanguageModel, make(options));
|
|
187
213
|
/**
|
|
188
214
|
* Provides config overrides for Anthropic language model operations.
|
|
189
215
|
*
|
|
190
|
-
* @since 1.0.0
|
|
191
216
|
* @category configuration
|
|
217
|
+
* @since 4.0.0
|
|
192
218
|
*/
|
|
193
219
|
export const withConfigOverride = /*#__PURE__*/dual(2, (self, overrides) => Effect.flatMap(Effect.serviceOption(Config), config => Effect.provideService(self, Config, {
|
|
194
220
|
...(config._tag === "Some" ? config.value : {}),
|