@effect/ai-anthropic 4.0.0-beta.74 → 4.0.0-beta.75
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/AnthropicConfig.d.ts +2 -2
- package/dist/AnthropicConfig.js +2 -2
- package/dist/AnthropicLanguageModel.d.ts +7 -6
- package/dist/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.js +13 -13
- package/dist/AnthropicLanguageModel.js.map +1 -1
- package/dist/AnthropicTool.d.ts +78 -30
- package/dist/AnthropicTool.d.ts.map +1 -1
- package/dist/AnthropicTool.js +43 -27
- package/dist/AnthropicTool.js.map +1 -1
- package/package.json +3 -3
- package/src/AnthropicConfig.ts +2 -2
- package/src/AnthropicLanguageModel.ts +13 -13
- package/src/AnthropicTool.ts +78 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/ai-anthropic",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.75",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "An Anthropic provider integration for Effect AI SDK",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"provenance": true
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"effect": "^4.0.0-beta.
|
|
46
|
+
"effect": "^4.0.0-beta.75"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"effect": "^4.0.0-beta.
|
|
49
|
+
"effect": "^4.0.0-beta.75"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"codegen": "effect-utils codegen",
|
package/src/AnthropicConfig.ts
CHANGED
|
@@ -29,8 +29,8 @@ import type { HttpClient } from "effect/unstable/http/HttpClient"
|
|
|
29
29
|
*
|
|
30
30
|
* **When to use**
|
|
31
31
|
*
|
|
32
|
-
* Use when
|
|
33
|
-
*
|
|
32
|
+
* Use when you need to provide or read Anthropic client configuration through
|
|
33
|
+
* Effect's context from a layer or integration.
|
|
34
34
|
*
|
|
35
35
|
* @see {@link withClientTransform} for scoping an HTTP client transformation
|
|
36
36
|
*
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
*
|
|
8
8
|
* **When to use**
|
|
9
9
|
*
|
|
10
|
-
* Use when
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* reasoning signatures, MCP metadata, and server-side tools
|
|
10
|
+
* Use when you need an Anthropic-backed model. Create a model with {@link model},
|
|
11
|
+
* build or provide a `LanguageModel.LanguageModel` layer with {@link layer} or
|
|
12
|
+
* {@link make}, supply default request options through {@link Config}, override
|
|
13
|
+
* configuration for a scoped operation with {@link withConfigOverride}, or attach
|
|
14
|
+
* Anthropic provider options for prompt caching, document citations, reasoning
|
|
15
|
+
* signatures, MCP metadata, and server-side tools.
|
|
17
16
|
*
|
|
18
17
|
* **Gotchas**
|
|
19
18
|
*
|
|
@@ -82,13 +81,14 @@ export type Model = typeof Generated.Model.Type
|
|
|
82
81
|
*
|
|
83
82
|
* **When to use**
|
|
84
83
|
*
|
|
85
|
-
* Use when you need
|
|
86
|
-
*
|
|
84
|
+
* Use when you need scoped Anthropic model request defaults or per-operation
|
|
85
|
+
* overrides from Effect context.
|
|
87
86
|
*
|
|
88
87
|
* **Details**
|
|
89
88
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
89
|
+
* The service stores request fields that are merged into Anthropic Messages API
|
|
90
|
+
* requests. Scoped configuration overrides defaults supplied to `model`,
|
|
91
|
+
* `make`, or `layer`.
|
|
92
92
|
*
|
|
93
93
|
* @category configuration
|
|
94
94
|
* @since 4.0.0
|
|
@@ -669,8 +669,8 @@ export const model = (
|
|
|
669
669
|
*
|
|
670
670
|
* **When to use**
|
|
671
671
|
*
|
|
672
|
-
* Use when
|
|
673
|
-
*
|
|
672
|
+
* Use when you need to construct a `LanguageModel.Service` value backed by
|
|
673
|
+
* `AnthropicClient` inside an Effect.
|
|
674
674
|
*
|
|
675
675
|
* **Details**
|
|
676
676
|
*
|
package/src/AnthropicTool.ts
CHANGED
|
@@ -104,8 +104,8 @@ export type AnthropicTool =
|
|
|
104
104
|
*
|
|
105
105
|
* **When to use**
|
|
106
106
|
*
|
|
107
|
-
* Use when you
|
|
108
|
-
*
|
|
107
|
+
* Use when you want the model to execute bash commands with the 2024-10-22
|
|
108
|
+
* Anthropic computer-use beta.
|
|
109
109
|
*
|
|
110
110
|
* **Details**
|
|
111
111
|
*
|
|
@@ -134,8 +134,8 @@ export const Bash_20241022 = Tool.providerDefined({
|
|
|
134
134
|
*
|
|
135
135
|
* **When to use**
|
|
136
136
|
*
|
|
137
|
-
* Use when you
|
|
138
|
-
*
|
|
137
|
+
* Use when you want the model to execute bash commands with the 2025-01-24
|
|
138
|
+
* Anthropic computer-use beta.
|
|
139
139
|
*
|
|
140
140
|
* **Details**
|
|
141
141
|
*
|
|
@@ -250,8 +250,8 @@ export type CodeExecutionBashCommand = typeof CodeExecutionBashCommand.Type
|
|
|
250
250
|
*
|
|
251
251
|
* **When to use**
|
|
252
252
|
*
|
|
253
|
-
* Use
|
|
254
|
-
* text
|
|
253
|
+
* Use when you need the schema for provider-bound code-execution view requests
|
|
254
|
+
* before distinguishing them from create or replace text-editor commands.
|
|
255
255
|
*
|
|
256
256
|
* **Details**
|
|
257
257
|
*
|
|
@@ -277,8 +277,8 @@ export const CodeExecutionTextEditorView = Schema.Struct({
|
|
|
277
277
|
*
|
|
278
278
|
* **When to use**
|
|
279
279
|
*
|
|
280
|
-
* Use when
|
|
281
|
-
* editor
|
|
280
|
+
* Use when working at the Anthropic protocol boundary and the code-execution
|
|
281
|
+
* view request must be distinguished from standalone text-editor view requests.
|
|
282
282
|
*
|
|
283
283
|
* **Details**
|
|
284
284
|
*
|
|
@@ -400,8 +400,8 @@ const CodeExecution_20250522_Parameters = Schema.Union([
|
|
|
400
400
|
*
|
|
401
401
|
* **When to use**
|
|
402
402
|
*
|
|
403
|
-
* Use when
|
|
404
|
-
*
|
|
403
|
+
* Use when you need the schema for code-execution input at the Anthropic
|
|
404
|
+
* protocol boundary before sending source code to the 2025-08-25 tool.
|
|
405
405
|
*
|
|
406
406
|
* @see {@link CodeExecution_20250825} for the provider-defined tool that consumes this schema
|
|
407
407
|
*
|
|
@@ -419,7 +419,8 @@ export const CodeExecution_20250825_Parameters = Schema.Struct({
|
|
|
419
419
|
*
|
|
420
420
|
* **When to use**
|
|
421
421
|
*
|
|
422
|
-
* Use when
|
|
422
|
+
* Use when exposing the 2025-08-25 code-execution payload separately from the
|
|
423
|
+
* provider tool definition, such as at a transport or persistence boundary.
|
|
423
424
|
*
|
|
424
425
|
* **Details**
|
|
425
426
|
*
|
|
@@ -442,8 +443,8 @@ export type CodeExecution_20250825_Parameters = typeof CodeExecution_20250825_Pa
|
|
|
442
443
|
*
|
|
443
444
|
* **When to use**
|
|
444
445
|
*
|
|
445
|
-
* Use when you
|
|
446
|
-
*
|
|
446
|
+
* Use when you want the model to execute code in a sandboxed environment with
|
|
447
|
+
* the 2025-05-22 Anthropic code-execution beta.
|
|
447
448
|
*
|
|
448
449
|
* **Details**
|
|
449
450
|
*
|
|
@@ -470,8 +471,8 @@ export const CodeExecution_20250522 = Tool.providerDefined({
|
|
|
470
471
|
*
|
|
471
472
|
* **When to use**
|
|
472
473
|
*
|
|
473
|
-
* Use when you
|
|
474
|
-
*
|
|
474
|
+
* Use when you want the model to execute code in a sandboxed environment with
|
|
475
|
+
* the 2025-08-25 Anthropic code-execution beta.
|
|
475
476
|
*
|
|
476
477
|
* **Details**
|
|
477
478
|
*
|
|
@@ -514,6 +515,11 @@ export const CodeExecution_20250825 = Tool.providerDefined({
|
|
|
514
515
|
/**
|
|
515
516
|
* Schema for an `[x, y]` screen coordinate in pixels.
|
|
516
517
|
*
|
|
518
|
+
* **When to use**
|
|
519
|
+
*
|
|
520
|
+
* Use when validating computer-use action payloads that carry a single screen
|
|
521
|
+
* position and provider-side bounds checks remain acceptable.
|
|
522
|
+
*
|
|
517
523
|
* **Details**
|
|
518
524
|
*
|
|
519
525
|
* This is a two-number tuple used by computer-use actions that accept screen
|
|
@@ -538,6 +544,11 @@ export type Coordinate = typeof Coordinate.Type
|
|
|
538
544
|
/**
|
|
539
545
|
* Schema for an `[x1, y1, x2, y2]` screen region in pixels.
|
|
540
546
|
*
|
|
547
|
+
* **When to use**
|
|
548
|
+
*
|
|
549
|
+
* Use when validating computer-use action payloads that carry a rectangular
|
|
550
|
+
* screen region and provider-side bounds checks remain acceptable.
|
|
551
|
+
*
|
|
541
552
|
* **Details**
|
|
542
553
|
*
|
|
543
554
|
* The tuple represents top-left and bottom-right corners.
|
|
@@ -656,6 +667,12 @@ export const ComputerUseKeyAction = Schema.Struct({
|
|
|
656
667
|
/**
|
|
657
668
|
* Computer-use action payload for pressing a key or key combination.
|
|
658
669
|
*
|
|
670
|
+
* **When to use**
|
|
671
|
+
*
|
|
672
|
+
* Use when typing parsed computer-use key action payloads after schema
|
|
673
|
+
* validation, where provider-specific key-name validation is handled outside
|
|
674
|
+
* TypeScript.
|
|
675
|
+
*
|
|
659
676
|
* **Details**
|
|
660
677
|
*
|
|
661
678
|
* The payload uses `action: "key"` and stores the key or key combination to
|
|
@@ -1250,6 +1267,11 @@ const ComputerUse_20250124_Actions = Schema.Union([
|
|
|
1250
1267
|
/**
|
|
1251
1268
|
* Zooms into a specific region of the screen at full resolution.
|
|
1252
1269
|
*
|
|
1270
|
+
* **When to use**
|
|
1271
|
+
*
|
|
1272
|
+
* Use when building or validating the 2025-11-24 computer-use action for a
|
|
1273
|
+
* zoom-enabled tool definition.
|
|
1274
|
+
*
|
|
1253
1275
|
* **Details**
|
|
1254
1276
|
*
|
|
1255
1277
|
* The encoded payload uses `action: "zoom"` and a `region` tuple.
|
|
@@ -1322,7 +1344,7 @@ export const ComputerUse_20241022 = Tool.providerDefined({
|
|
|
1322
1344
|
*
|
|
1323
1345
|
* **When to use**
|
|
1324
1346
|
*
|
|
1325
|
-
* Use when
|
|
1347
|
+
* Use when you need Anthropic computer use for Claude 4 models or Claude
|
|
1326
1348
|
* Sonnet 3.7 with the 2025-01-24 action set.
|
|
1327
1349
|
*
|
|
1328
1350
|
* **Details**
|
|
@@ -1353,7 +1375,7 @@ export const ComputerUse_20250124 = Tool.providerDefined({
|
|
|
1353
1375
|
*
|
|
1354
1376
|
* **When to use**
|
|
1355
1377
|
*
|
|
1356
|
-
* Use when
|
|
1378
|
+
* Use when you need Anthropic computer use for Claude Opus 4.5 with the
|
|
1357
1379
|
* 2025-11-24 action set and zoom-capable screen inspection.
|
|
1358
1380
|
*
|
|
1359
1381
|
* **Details**
|
|
@@ -1734,6 +1756,11 @@ export const TextEditorCreateCommand = Schema.Struct({
|
|
|
1734
1756
|
/**
|
|
1735
1757
|
* Text editor command payload for creating a new file with the specified content.
|
|
1736
1758
|
*
|
|
1759
|
+
* **When to use**
|
|
1760
|
+
*
|
|
1761
|
+
* Use when typing parsed text-editor create command payloads after schema
|
|
1762
|
+
* validation and before dispatching to Anthropic tool handlers.
|
|
1763
|
+
*
|
|
1737
1764
|
* **Gotchas**
|
|
1738
1765
|
*
|
|
1739
1766
|
* The command fails if the file already exists or if parent directories are missing.
|
|
@@ -1785,6 +1812,11 @@ export const TextEditorStrReplaceCommand = Schema.Struct({
|
|
|
1785
1812
|
/**
|
|
1786
1813
|
* Text editor command payload for replacing one exact, unique string in a file.
|
|
1787
1814
|
*
|
|
1815
|
+
* **When to use**
|
|
1816
|
+
*
|
|
1817
|
+
* Use when typing parsed text-editor replace command payloads that must carry
|
|
1818
|
+
* one exact `old_str` match.
|
|
1819
|
+
*
|
|
1788
1820
|
* **Gotchas**
|
|
1789
1821
|
*
|
|
1790
1822
|
* The `old_str` must match exactly, including whitespace and indentation, and
|
|
@@ -1902,8 +1934,8 @@ const TextEditor_StrReplaceBasedEdit_Args = Schema.Struct({
|
|
|
1902
1934
|
*
|
|
1903
1935
|
* **When to use**
|
|
1904
1936
|
*
|
|
1905
|
-
* Use when
|
|
1906
|
-
*
|
|
1937
|
+
* Use when you need the 2024-10-22 `str_replace_editor` compatibility path for
|
|
1938
|
+
* Claude 3.5 Sonnet.
|
|
1907
1939
|
*
|
|
1908
1940
|
* **Details**
|
|
1909
1941
|
*
|
|
@@ -1930,7 +1962,7 @@ export const TextEditor_20241022 = Tool.providerDefined({
|
|
|
1930
1962
|
*
|
|
1931
1963
|
* **When to use**
|
|
1932
1964
|
*
|
|
1933
|
-
* Use when
|
|
1965
|
+
* Use when you need the 2025-01-24 Claude Sonnet 3.7 text editor tool using
|
|
1934
1966
|
* `str_replace_editor`.
|
|
1935
1967
|
*
|
|
1936
1968
|
* **Details**
|
|
@@ -1958,7 +1990,7 @@ export const TextEditor_20250124 = Tool.providerDefined({
|
|
|
1958
1990
|
*
|
|
1959
1991
|
* **When to use**
|
|
1960
1992
|
*
|
|
1961
|
-
* Use when
|
|
1993
|
+
* Use when you need the 2025-04-29 Claude 4 `str_replace_based_edit_tool`
|
|
1962
1994
|
* version.
|
|
1963
1995
|
*
|
|
1964
1996
|
* **Details**
|
|
@@ -2023,8 +2055,8 @@ export const TextEditor_20250728 = Tool.providerDefined({
|
|
|
2023
2055
|
*
|
|
2024
2056
|
* **When to use**
|
|
2025
2057
|
*
|
|
2026
|
-
* Use when
|
|
2027
|
-
*
|
|
2058
|
+
* Use when you need to localize search results for location-dependent queries
|
|
2059
|
+
* like weather, local businesses, or events.
|
|
2028
2060
|
*
|
|
2029
2061
|
* **Details**
|
|
2030
2062
|
*
|
|
@@ -2069,8 +2101,8 @@ export const WebSearchUserLocation = Schema.Struct({
|
|
|
2069
2101
|
*
|
|
2070
2102
|
* **When to use**
|
|
2071
2103
|
*
|
|
2072
|
-
* Use when
|
|
2073
|
-
* or user location.
|
|
2104
|
+
* Use when you need to configure `WebSearch_20250305` with search limits,
|
|
2105
|
+
* domain filters, or user location.
|
|
2074
2106
|
*
|
|
2075
2107
|
* **Details**
|
|
2076
2108
|
*
|
|
@@ -2167,7 +2199,7 @@ export type WebSearchParameters = typeof WebSearchParameters.Type
|
|
|
2167
2199
|
*
|
|
2168
2200
|
* **When to use**
|
|
2169
2201
|
*
|
|
2170
|
-
* Use when Claude
|
|
2202
|
+
* Use when you want Claude to search the web for real-time information.
|
|
2171
2203
|
*
|
|
2172
2204
|
* **Details**
|
|
2173
2205
|
*
|
|
@@ -2203,7 +2235,7 @@ export const WebSearch_20250305 = Tool.providerDefined({
|
|
|
2203
2235
|
*
|
|
2204
2236
|
* **When to use**
|
|
2205
2237
|
*
|
|
2206
|
-
* Use when
|
|
2238
|
+
* Use when you need to enable or disable citations on web fetch results.
|
|
2207
2239
|
*
|
|
2208
2240
|
* **Details**
|
|
2209
2241
|
*
|
|
@@ -2224,6 +2256,11 @@ export const WebFetchCitationsConfig = Schema.Struct({
|
|
|
2224
2256
|
/**
|
|
2225
2257
|
* Configuration payload for enabling or disabling citations on web fetch results.
|
|
2226
2258
|
*
|
|
2259
|
+
* **When to use**
|
|
2260
|
+
*
|
|
2261
|
+
* Use when typing parsed web-fetch citation configuration shared between
|
|
2262
|
+
* request arguments and handler code.
|
|
2263
|
+
*
|
|
2227
2264
|
* **Details**
|
|
2228
2265
|
*
|
|
2229
2266
|
* The payload contains the `enabled` flag. `citations` is optional on
|
|
@@ -2245,8 +2282,8 @@ export type WebFetchCitationsConfig = typeof WebFetchCitationsConfig.Type
|
|
|
2245
2282
|
*
|
|
2246
2283
|
* **When to use**
|
|
2247
2284
|
*
|
|
2248
|
-
* Use when
|
|
2249
|
-
* citations, or content token limits.
|
|
2285
|
+
* Use when you need to configure `WebFetch_20250910` with usage limits, domain
|
|
2286
|
+
* filters, citations, or content token limits.
|
|
2250
2287
|
*
|
|
2251
2288
|
* **Details**
|
|
2252
2289
|
*
|
|
@@ -2294,6 +2331,11 @@ export const WebFetch_20250910_Args = Schema.Struct({
|
|
|
2294
2331
|
/**
|
|
2295
2332
|
* Configuration arguments for the Anthropic web fetch tool, including usage limits, domain filters, citation settings, and token limits.
|
|
2296
2333
|
*
|
|
2334
|
+
* **When to use**
|
|
2335
|
+
*
|
|
2336
|
+
* Use when typing parsed web-fetch tool configuration shared by the
|
|
2337
|
+
* provider-defined tool and request-building code.
|
|
2338
|
+
*
|
|
2297
2339
|
* **Gotchas**
|
|
2298
2340
|
*
|
|
2299
2341
|
* `allowedDomains` and `blockedDomains` are mutually exclusive.
|
|
@@ -2341,6 +2383,11 @@ export const WebFetchParameters = Schema.Struct({
|
|
|
2341
2383
|
/**
|
|
2342
2384
|
* Type of the parameters Claude supplies when invoking the Anthropic web fetch tool.
|
|
2343
2385
|
*
|
|
2386
|
+
* **When to use**
|
|
2387
|
+
*
|
|
2388
|
+
* Use when typing Claude-supplied web-fetch tool parameters after schema
|
|
2389
|
+
* validation, before enforcing URL provenance or length constraints.
|
|
2390
|
+
*
|
|
2344
2391
|
* **Details**
|
|
2345
2392
|
*
|
|
2346
2393
|
* The payload contains the single `url` parameter for Anthropic web fetch.
|
|
@@ -2364,7 +2411,8 @@ export type WebFetchParameters = typeof WebFetchParameters.Type
|
|
|
2364
2411
|
*
|
|
2365
2412
|
* **When to use**
|
|
2366
2413
|
*
|
|
2367
|
-
* Use when Claude
|
|
2414
|
+
* Use when you want Claude to retrieve the content of a specific web page or
|
|
2415
|
+
* PDF.
|
|
2368
2416
|
*
|
|
2369
2417
|
* **Details**
|
|
2370
2418
|
*
|