@effect/ai-anthropic 4.0.0-beta.7 → 4.0.0-beta.70
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 +40 -66
- package/dist/AnthropicClient.d.ts.map +1 -1
- package/dist/AnthropicClient.js +12 -14
- package/dist/AnthropicClient.js.map +1 -1
- package/dist/AnthropicConfig.d.ts +46 -10
- package/dist/AnthropicConfig.d.ts.map +1 -1
- package/dist/AnthropicConfig.js +31 -7
- package/dist/AnthropicConfig.js.map +1 -1
- package/dist/AnthropicError.d.ts +128 -37
- package/dist/AnthropicError.d.ts.map +1 -1
- package/dist/AnthropicError.js +1 -1
- package/dist/AnthropicLanguageModel.d.ts +281 -66
- package/dist/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/AnthropicLanguageModel.js +50 -14
- package/dist/AnthropicLanguageModel.js.map +1 -1
- package/dist/AnthropicTelemetry.d.ts +23 -16
- package/dist/AnthropicTelemetry.d.ts.map +1 -1
- package/dist/AnthropicTelemetry.js +6 -4
- package/dist/AnthropicTelemetry.js.map +1 -1
- package/dist/AnthropicTool.d.ts +298 -138
- package/dist/AnthropicTool.d.ts.map +1 -1
- package/dist/AnthropicTool.js +141 -87
- package/dist/AnthropicTool.js.map +1 -1
- package/dist/Generated.d.ts +11661 -5260
- package/dist/Generated.d.ts.map +1 -1
- package/dist/Generated.js +2318 -915
- package/dist/Generated.js.map +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/dist/internal/errors.js +7 -7
- package/dist/internal/errors.js.map +1 -1
- package/package.json +3 -3
- package/src/AnthropicClient.ts +41 -67
- package/src/AnthropicConfig.ts +47 -11
- package/src/AnthropicError.ts +130 -37
- package/src/AnthropicLanguageModel.ts +274 -33
- package/src/AnthropicTelemetry.ts +24 -17
- package/src/AnthropicTool.ts +293 -133
- package/src/Generated.ts +3751 -1815
- package/src/index.ts +52 -8
- package/src/internal/errors.ts +9 -7
package/dist/AnthropicError.d.ts
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Provides Anthropic-specific metadata fields for AI error types through module
|
|
5
5
|
* augmentation, enabling typed access to Anthropic error details.
|
|
6
6
|
*
|
|
7
|
-
* @since
|
|
7
|
+
* @since 4.0.0
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Anthropic-specific error metadata fields.
|
|
11
11
|
*
|
|
12
|
-
* @since 1.0.0
|
|
13
12
|
* @category models
|
|
13
|
+
* @since 4.0.0
|
|
14
14
|
*/
|
|
15
15
|
export type AnthropicErrorMetadata = {
|
|
16
16
|
/**
|
|
@@ -25,11 +25,12 @@ export type AnthropicErrorMetadata = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Anthropic-specific rate limit metadata fields.
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* **Details**
|
|
29
|
+
*
|
|
30
|
+
* Extends base error metadata with rate limit-specific information from Anthropic's rate limit headers.
|
|
30
31
|
*
|
|
31
|
-
* @since 1.0.0
|
|
32
32
|
* @category models
|
|
33
|
+
* @since 4.0.0
|
|
33
34
|
*/
|
|
34
35
|
export type AnthropicRateLimitMetadata = AnthropicErrorMetadata & {
|
|
35
36
|
/**
|
|
@@ -58,45 +59,135 @@ export type AnthropicRateLimitMetadata = AnthropicErrorMetadata & {
|
|
|
58
59
|
readonly tokensReset: string | null;
|
|
59
60
|
};
|
|
60
61
|
declare module "effect/unstable/ai/AiError" {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Anthropic metadata attached to `RateLimitError` values.
|
|
64
|
+
*
|
|
65
|
+
* **Details**
|
|
66
|
+
*
|
|
67
|
+
* Includes request identifiers, Anthropic error types, and parsed request or token limit headers when the provider rejects a request due to rate limits.
|
|
68
|
+
*
|
|
69
|
+
* @category configuration
|
|
70
|
+
* @since 4.0.0
|
|
71
|
+
*/
|
|
72
|
+
interface RateLimitErrorMetadata {
|
|
73
|
+
readonly anthropic?: AnthropicRateLimitMetadata | null;
|
|
65
74
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Anthropic metadata attached to `QuotaExhaustedError` values.
|
|
77
|
+
*
|
|
78
|
+
* **Details**
|
|
79
|
+
*
|
|
80
|
+
* Captures the Anthropic error type and request identifier for failures where the account or workspace has exhausted its available quota.
|
|
81
|
+
*
|
|
82
|
+
* @category configuration
|
|
83
|
+
* @since 4.0.0
|
|
84
|
+
*/
|
|
85
|
+
interface QuotaExhaustedErrorMetadata {
|
|
86
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
70
87
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Anthropic metadata attached to `AuthenticationError` values.
|
|
90
|
+
*
|
|
91
|
+
* **Details**
|
|
92
|
+
*
|
|
93
|
+
* Preserves Anthropic error details for missing, invalid, or unauthorized API credentials while keeping the error in the shared AI error model.
|
|
94
|
+
*
|
|
95
|
+
* @category configuration
|
|
96
|
+
* @since 4.0.0
|
|
97
|
+
*/
|
|
98
|
+
interface AuthenticationErrorMetadata {
|
|
99
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
75
100
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Anthropic metadata attached to `ContentPolicyError` values.
|
|
103
|
+
*
|
|
104
|
+
* **Details**
|
|
105
|
+
*
|
|
106
|
+
* Records Anthropic error details returned when a request or response is rejected by Anthropic safety or content policy enforcement.
|
|
107
|
+
*
|
|
108
|
+
* @category configuration
|
|
109
|
+
* @since 4.0.0
|
|
110
|
+
*/
|
|
111
|
+
interface ContentPolicyErrorMetadata {
|
|
112
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
80
113
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Anthropic metadata attached to `InvalidRequestError` values.
|
|
116
|
+
*
|
|
117
|
+
* **Details**
|
|
118
|
+
*
|
|
119
|
+
* Provides the Anthropic error type and request identifier for malformed or unsupported requests rejected before model execution.
|
|
120
|
+
*
|
|
121
|
+
* @category configuration
|
|
122
|
+
* @since 4.0.0
|
|
123
|
+
*/
|
|
124
|
+
interface InvalidRequestErrorMetadata {
|
|
125
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
85
126
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Anthropic metadata attached to `InternalProviderError` values.
|
|
129
|
+
*
|
|
130
|
+
* **Details**
|
|
131
|
+
*
|
|
132
|
+
* Preserves Anthropic request correlation data for provider-side failures that should be reported or investigated with Anthropic support.
|
|
133
|
+
*
|
|
134
|
+
* @category configuration
|
|
135
|
+
* @since 4.0.0
|
|
136
|
+
*/
|
|
137
|
+
interface InternalProviderErrorMetadata {
|
|
138
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Anthropic metadata attached to `InvalidOutputError` values.
|
|
142
|
+
*
|
|
143
|
+
* **Details**
|
|
144
|
+
*
|
|
145
|
+
* Describes Anthropic-specific context for responses that could not be decoded or interpreted as valid AI output.
|
|
146
|
+
*
|
|
147
|
+
* @category configuration
|
|
148
|
+
* @since 4.0.0
|
|
149
|
+
*/
|
|
150
|
+
interface InvalidOutputErrorMetadata {
|
|
151
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
90
152
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
153
|
+
/**
|
|
154
|
+
* Anthropic metadata attached to `StructuredOutputError` values.
|
|
155
|
+
*
|
|
156
|
+
* **Details**
|
|
157
|
+
*
|
|
158
|
+
* Captures Anthropic error details for structured-output failures, including request correlation data useful when diagnosing schema-related responses.
|
|
159
|
+
*
|
|
160
|
+
* @category configuration
|
|
161
|
+
* @since 4.0.0
|
|
162
|
+
*/
|
|
163
|
+
interface StructuredOutputErrorMetadata {
|
|
164
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
95
165
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Anthropic metadata attached to `UnsupportedSchemaError` values.
|
|
168
|
+
*
|
|
169
|
+
* **Details**
|
|
170
|
+
*
|
|
171
|
+
* Provides Anthropic error details for schemas that cannot be represented by or submitted to the Anthropic API.
|
|
172
|
+
*
|
|
173
|
+
* @category configuration
|
|
174
|
+
* @since 4.0.0
|
|
175
|
+
*/
|
|
176
|
+
interface UnsupportedSchemaErrorMetadata {
|
|
177
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Anthropic metadata attached to `UnknownError` values.
|
|
181
|
+
*
|
|
182
|
+
* **Details**
|
|
183
|
+
*
|
|
184
|
+
* Retains the Anthropic error type and request identifier when a provider response cannot be classified as a more specific AI error.
|
|
185
|
+
*
|
|
186
|
+
* @category configuration
|
|
187
|
+
* @since 4.0.0
|
|
188
|
+
*/
|
|
189
|
+
interface UnknownErrorMetadata {
|
|
190
|
+
readonly anthropic?: AnthropicErrorMetadata | null;
|
|
100
191
|
}
|
|
101
192
|
}
|
|
102
193
|
//# sourceMappingURL=AnthropicError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnthropicError.d.ts","sourceRoot":"","sources":["../src/AnthropicError.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,QAAQ,CAAC,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