@langchain/anthropic 1.0.0-alpha.2 → 1.0.1
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/CHANGELOG.md +43 -0
- package/LICENSE +6 -6
- package/dist/chat_models.cjs +54 -18
- package/dist/chat_models.cjs.map +1 -1
- package/dist/chat_models.d.cts +41 -26
- package/dist/chat_models.d.cts.map +1 -1
- package/dist/chat_models.d.ts +41 -26
- package/dist/chat_models.d.ts.map +1 -1
- package/dist/chat_models.js +54 -18
- package/dist/chat_models.js.map +1 -1
- package/dist/profiles.cjs +332 -0
- package/dist/profiles.cjs.map +1 -0
- package/dist/profiles.js +331 -0
- package/dist/profiles.js.map +1 -0
- package/dist/utils/errors.cjs +1 -1
- package/dist/utils/errors.cjs.map +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/prompts.cjs +1 -1
- package/dist/utils/prompts.cjs.map +1 -1
- package/dist/utils/prompts.d.cts +1 -1
- package/dist/utils/prompts.d.cts.map +1 -1
- package/dist/utils/prompts.d.ts +1 -1
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +1 -1
- package/dist/utils/prompts.js.map +1 -1
- package/package.json +17 -11
package/dist/profiles.js
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
//#region src/profiles.ts
|
|
2
|
+
const PROFILES = {
|
|
3
|
+
"claude-opus-4-0": {
|
|
4
|
+
maxInputTokens: 2e5,
|
|
5
|
+
imageInputs: true,
|
|
6
|
+
audioInputs: false,
|
|
7
|
+
pdfInputs: true,
|
|
8
|
+
videoInputs: false,
|
|
9
|
+
maxOutputTokens: 32e3,
|
|
10
|
+
reasoningOutput: true,
|
|
11
|
+
imageOutputs: false,
|
|
12
|
+
audioOutputs: false,
|
|
13
|
+
videoOutputs: false,
|
|
14
|
+
toolCalling: true,
|
|
15
|
+
structuredOutput: false,
|
|
16
|
+
imageUrlInputs: true,
|
|
17
|
+
pdfToolMessage: true,
|
|
18
|
+
imageToolMessage: true
|
|
19
|
+
},
|
|
20
|
+
"claude-3-5-sonnet-20241022": {
|
|
21
|
+
maxInputTokens: 2e5,
|
|
22
|
+
imageInputs: true,
|
|
23
|
+
audioInputs: false,
|
|
24
|
+
pdfInputs: true,
|
|
25
|
+
videoInputs: false,
|
|
26
|
+
maxOutputTokens: 8192,
|
|
27
|
+
reasoningOutput: false,
|
|
28
|
+
imageOutputs: false,
|
|
29
|
+
audioOutputs: false,
|
|
30
|
+
videoOutputs: false,
|
|
31
|
+
toolCalling: true,
|
|
32
|
+
structuredOutput: false,
|
|
33
|
+
imageUrlInputs: true,
|
|
34
|
+
pdfToolMessage: true,
|
|
35
|
+
imageToolMessage: true
|
|
36
|
+
},
|
|
37
|
+
"claude-opus-4-1": {
|
|
38
|
+
maxInputTokens: 2e5,
|
|
39
|
+
imageInputs: true,
|
|
40
|
+
audioInputs: false,
|
|
41
|
+
pdfInputs: true,
|
|
42
|
+
videoInputs: false,
|
|
43
|
+
maxOutputTokens: 32e3,
|
|
44
|
+
reasoningOutput: true,
|
|
45
|
+
imageOutputs: false,
|
|
46
|
+
audioOutputs: false,
|
|
47
|
+
videoOutputs: false,
|
|
48
|
+
toolCalling: true,
|
|
49
|
+
structuredOutput: false,
|
|
50
|
+
imageUrlInputs: true,
|
|
51
|
+
pdfToolMessage: true,
|
|
52
|
+
imageToolMessage: true
|
|
53
|
+
},
|
|
54
|
+
"claude-haiku-4-5": {
|
|
55
|
+
maxInputTokens: 2e5,
|
|
56
|
+
imageInputs: true,
|
|
57
|
+
audioInputs: false,
|
|
58
|
+
pdfInputs: true,
|
|
59
|
+
videoInputs: false,
|
|
60
|
+
maxOutputTokens: 64e3,
|
|
61
|
+
reasoningOutput: true,
|
|
62
|
+
imageOutputs: false,
|
|
63
|
+
audioOutputs: false,
|
|
64
|
+
videoOutputs: false,
|
|
65
|
+
toolCalling: true,
|
|
66
|
+
structuredOutput: false,
|
|
67
|
+
imageUrlInputs: true,
|
|
68
|
+
pdfToolMessage: true,
|
|
69
|
+
imageToolMessage: true
|
|
70
|
+
},
|
|
71
|
+
"claude-3-5-sonnet-20240620": {
|
|
72
|
+
maxInputTokens: 2e5,
|
|
73
|
+
imageInputs: true,
|
|
74
|
+
audioInputs: false,
|
|
75
|
+
pdfInputs: true,
|
|
76
|
+
videoInputs: false,
|
|
77
|
+
maxOutputTokens: 8192,
|
|
78
|
+
reasoningOutput: false,
|
|
79
|
+
imageOutputs: false,
|
|
80
|
+
audioOutputs: false,
|
|
81
|
+
videoOutputs: false,
|
|
82
|
+
toolCalling: true,
|
|
83
|
+
structuredOutput: false,
|
|
84
|
+
imageUrlInputs: true,
|
|
85
|
+
pdfToolMessage: true,
|
|
86
|
+
imageToolMessage: true
|
|
87
|
+
},
|
|
88
|
+
"claude-3-5-haiku-latest": {
|
|
89
|
+
maxInputTokens: 2e5,
|
|
90
|
+
imageInputs: true,
|
|
91
|
+
audioInputs: false,
|
|
92
|
+
pdfInputs: true,
|
|
93
|
+
videoInputs: false,
|
|
94
|
+
maxOutputTokens: 8192,
|
|
95
|
+
reasoningOutput: false,
|
|
96
|
+
imageOutputs: false,
|
|
97
|
+
audioOutputs: false,
|
|
98
|
+
videoOutputs: false,
|
|
99
|
+
toolCalling: true,
|
|
100
|
+
structuredOutput: false,
|
|
101
|
+
imageUrlInputs: true,
|
|
102
|
+
pdfToolMessage: true,
|
|
103
|
+
imageToolMessage: true
|
|
104
|
+
},
|
|
105
|
+
"claude-3-opus-20240229": {
|
|
106
|
+
maxInputTokens: 2e5,
|
|
107
|
+
imageInputs: true,
|
|
108
|
+
audioInputs: false,
|
|
109
|
+
pdfInputs: true,
|
|
110
|
+
videoInputs: false,
|
|
111
|
+
maxOutputTokens: 4096,
|
|
112
|
+
reasoningOutput: false,
|
|
113
|
+
imageOutputs: false,
|
|
114
|
+
audioOutputs: false,
|
|
115
|
+
videoOutputs: false,
|
|
116
|
+
toolCalling: true,
|
|
117
|
+
structuredOutput: false,
|
|
118
|
+
imageUrlInputs: true,
|
|
119
|
+
pdfToolMessage: true,
|
|
120
|
+
imageToolMessage: true
|
|
121
|
+
},
|
|
122
|
+
"claude-sonnet-4-5": {
|
|
123
|
+
maxInputTokens: 2e5,
|
|
124
|
+
imageInputs: true,
|
|
125
|
+
audioInputs: false,
|
|
126
|
+
pdfInputs: true,
|
|
127
|
+
videoInputs: false,
|
|
128
|
+
maxOutputTokens: 64e3,
|
|
129
|
+
reasoningOutput: true,
|
|
130
|
+
imageOutputs: false,
|
|
131
|
+
audioOutputs: false,
|
|
132
|
+
videoOutputs: false,
|
|
133
|
+
toolCalling: true,
|
|
134
|
+
structuredOutput: false,
|
|
135
|
+
imageUrlInputs: true,
|
|
136
|
+
pdfToolMessage: true,
|
|
137
|
+
imageToolMessage: true
|
|
138
|
+
},
|
|
139
|
+
"claude-sonnet-4-5-20250929": {
|
|
140
|
+
maxInputTokens: 2e5,
|
|
141
|
+
imageInputs: true,
|
|
142
|
+
audioInputs: false,
|
|
143
|
+
pdfInputs: true,
|
|
144
|
+
videoInputs: false,
|
|
145
|
+
maxOutputTokens: 64e3,
|
|
146
|
+
reasoningOutput: true,
|
|
147
|
+
imageOutputs: false,
|
|
148
|
+
audioOutputs: false,
|
|
149
|
+
videoOutputs: false,
|
|
150
|
+
toolCalling: true,
|
|
151
|
+
structuredOutput: false,
|
|
152
|
+
imageUrlInputs: true,
|
|
153
|
+
pdfToolMessage: true,
|
|
154
|
+
imageToolMessage: true
|
|
155
|
+
},
|
|
156
|
+
"claude-sonnet-4-20250514": {
|
|
157
|
+
maxInputTokens: 2e5,
|
|
158
|
+
imageInputs: true,
|
|
159
|
+
audioInputs: false,
|
|
160
|
+
pdfInputs: true,
|
|
161
|
+
videoInputs: false,
|
|
162
|
+
maxOutputTokens: 64e3,
|
|
163
|
+
reasoningOutput: true,
|
|
164
|
+
imageOutputs: false,
|
|
165
|
+
audioOutputs: false,
|
|
166
|
+
videoOutputs: false,
|
|
167
|
+
toolCalling: true,
|
|
168
|
+
structuredOutput: false,
|
|
169
|
+
imageUrlInputs: true,
|
|
170
|
+
pdfToolMessage: true,
|
|
171
|
+
imageToolMessage: true
|
|
172
|
+
},
|
|
173
|
+
"claude-opus-4-20250514": {
|
|
174
|
+
maxInputTokens: 2e5,
|
|
175
|
+
imageInputs: true,
|
|
176
|
+
audioInputs: false,
|
|
177
|
+
pdfInputs: true,
|
|
178
|
+
videoInputs: false,
|
|
179
|
+
maxOutputTokens: 32e3,
|
|
180
|
+
reasoningOutput: true,
|
|
181
|
+
imageOutputs: false,
|
|
182
|
+
audioOutputs: false,
|
|
183
|
+
videoOutputs: false,
|
|
184
|
+
toolCalling: true,
|
|
185
|
+
structuredOutput: false,
|
|
186
|
+
imageUrlInputs: true,
|
|
187
|
+
pdfToolMessage: true,
|
|
188
|
+
imageToolMessage: true
|
|
189
|
+
},
|
|
190
|
+
"claude-3-5-haiku-20241022": {
|
|
191
|
+
maxInputTokens: 2e5,
|
|
192
|
+
imageInputs: true,
|
|
193
|
+
audioInputs: false,
|
|
194
|
+
pdfInputs: true,
|
|
195
|
+
videoInputs: false,
|
|
196
|
+
maxOutputTokens: 8192,
|
|
197
|
+
reasoningOutput: false,
|
|
198
|
+
imageOutputs: false,
|
|
199
|
+
audioOutputs: false,
|
|
200
|
+
videoOutputs: false,
|
|
201
|
+
toolCalling: true,
|
|
202
|
+
structuredOutput: false,
|
|
203
|
+
imageUrlInputs: true,
|
|
204
|
+
pdfToolMessage: true,
|
|
205
|
+
imageToolMessage: true
|
|
206
|
+
},
|
|
207
|
+
"claude-3-haiku-20240307": {
|
|
208
|
+
maxInputTokens: 2e5,
|
|
209
|
+
imageInputs: true,
|
|
210
|
+
audioInputs: false,
|
|
211
|
+
pdfInputs: true,
|
|
212
|
+
videoInputs: false,
|
|
213
|
+
maxOutputTokens: 4096,
|
|
214
|
+
reasoningOutput: false,
|
|
215
|
+
imageOutputs: false,
|
|
216
|
+
audioOutputs: false,
|
|
217
|
+
videoOutputs: false,
|
|
218
|
+
toolCalling: true,
|
|
219
|
+
structuredOutput: false,
|
|
220
|
+
imageUrlInputs: true,
|
|
221
|
+
pdfToolMessage: true,
|
|
222
|
+
imageToolMessage: true
|
|
223
|
+
},
|
|
224
|
+
"claude-3-7-sonnet-20250219": {
|
|
225
|
+
maxInputTokens: 2e5,
|
|
226
|
+
imageInputs: true,
|
|
227
|
+
audioInputs: false,
|
|
228
|
+
pdfInputs: true,
|
|
229
|
+
videoInputs: false,
|
|
230
|
+
maxOutputTokens: 64e3,
|
|
231
|
+
reasoningOutput: true,
|
|
232
|
+
imageOutputs: false,
|
|
233
|
+
audioOutputs: false,
|
|
234
|
+
videoOutputs: false,
|
|
235
|
+
toolCalling: true,
|
|
236
|
+
structuredOutput: false,
|
|
237
|
+
imageUrlInputs: true,
|
|
238
|
+
pdfToolMessage: true,
|
|
239
|
+
imageToolMessage: true
|
|
240
|
+
},
|
|
241
|
+
"claude-3-7-sonnet-latest": {
|
|
242
|
+
maxInputTokens: 2e5,
|
|
243
|
+
imageInputs: true,
|
|
244
|
+
audioInputs: false,
|
|
245
|
+
pdfInputs: true,
|
|
246
|
+
videoInputs: false,
|
|
247
|
+
maxOutputTokens: 64e3,
|
|
248
|
+
reasoningOutput: true,
|
|
249
|
+
imageOutputs: false,
|
|
250
|
+
audioOutputs: false,
|
|
251
|
+
videoOutputs: false,
|
|
252
|
+
toolCalling: true,
|
|
253
|
+
structuredOutput: false,
|
|
254
|
+
imageUrlInputs: true,
|
|
255
|
+
pdfToolMessage: true,
|
|
256
|
+
imageToolMessage: true
|
|
257
|
+
},
|
|
258
|
+
"claude-sonnet-4-0": {
|
|
259
|
+
maxInputTokens: 2e5,
|
|
260
|
+
imageInputs: true,
|
|
261
|
+
audioInputs: false,
|
|
262
|
+
pdfInputs: true,
|
|
263
|
+
videoInputs: false,
|
|
264
|
+
maxOutputTokens: 64e3,
|
|
265
|
+
reasoningOutput: true,
|
|
266
|
+
imageOutputs: false,
|
|
267
|
+
audioOutputs: false,
|
|
268
|
+
videoOutputs: false,
|
|
269
|
+
toolCalling: true,
|
|
270
|
+
structuredOutput: false,
|
|
271
|
+
imageUrlInputs: true,
|
|
272
|
+
pdfToolMessage: true,
|
|
273
|
+
imageToolMessage: true
|
|
274
|
+
},
|
|
275
|
+
"claude-opus-4-1-20250805": {
|
|
276
|
+
maxInputTokens: 2e5,
|
|
277
|
+
imageInputs: true,
|
|
278
|
+
audioInputs: false,
|
|
279
|
+
pdfInputs: true,
|
|
280
|
+
videoInputs: false,
|
|
281
|
+
maxOutputTokens: 32e3,
|
|
282
|
+
reasoningOutput: true,
|
|
283
|
+
imageOutputs: false,
|
|
284
|
+
audioOutputs: false,
|
|
285
|
+
videoOutputs: false,
|
|
286
|
+
toolCalling: true,
|
|
287
|
+
structuredOutput: false,
|
|
288
|
+
imageUrlInputs: true,
|
|
289
|
+
pdfToolMessage: true,
|
|
290
|
+
imageToolMessage: true
|
|
291
|
+
},
|
|
292
|
+
"claude-3-sonnet-20240229": {
|
|
293
|
+
maxInputTokens: 2e5,
|
|
294
|
+
imageInputs: true,
|
|
295
|
+
audioInputs: false,
|
|
296
|
+
pdfInputs: true,
|
|
297
|
+
videoInputs: false,
|
|
298
|
+
maxOutputTokens: 4096,
|
|
299
|
+
reasoningOutput: false,
|
|
300
|
+
imageOutputs: false,
|
|
301
|
+
audioOutputs: false,
|
|
302
|
+
videoOutputs: false,
|
|
303
|
+
toolCalling: true,
|
|
304
|
+
structuredOutput: false,
|
|
305
|
+
imageUrlInputs: true,
|
|
306
|
+
pdfToolMessage: true,
|
|
307
|
+
imageToolMessage: true
|
|
308
|
+
},
|
|
309
|
+
"claude-haiku-4-5-20251001": {
|
|
310
|
+
maxInputTokens: 2e5,
|
|
311
|
+
imageInputs: true,
|
|
312
|
+
audioInputs: false,
|
|
313
|
+
pdfInputs: true,
|
|
314
|
+
videoInputs: false,
|
|
315
|
+
maxOutputTokens: 64e3,
|
|
316
|
+
reasoningOutput: true,
|
|
317
|
+
imageOutputs: false,
|
|
318
|
+
audioOutputs: false,
|
|
319
|
+
videoOutputs: false,
|
|
320
|
+
toolCalling: true,
|
|
321
|
+
structuredOutput: false,
|
|
322
|
+
imageUrlInputs: true,
|
|
323
|
+
pdfToolMessage: true,
|
|
324
|
+
imageToolMessage: true
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
var profiles_default = PROFILES;
|
|
328
|
+
|
|
329
|
+
//#endregion
|
|
330
|
+
export { profiles_default as default };
|
|
331
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.js","names":["PROFILES: Record<string, ModelProfile>"],"sources":["../src/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"claude-opus-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20240620\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-opus-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5-20250929\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-haiku-20240307\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-20250219\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1-20250805\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-sonnet-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5-20251001\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n};\nexport default PROFILES;\n"],"mappings":"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"}
|
package/dist/utils/errors.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//#region src/utils/errors.ts
|
|
3
3
|
function addLangChainErrorFields(error, lc_error_code) {
|
|
4
4
|
error.lc_error_code = lc_error_code;
|
|
5
|
-
error.message = `${error.message}\n\nTroubleshooting URL: https://
|
|
5
|
+
error.message = `${error.message}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\n`;
|
|
6
6
|
return error;
|
|
7
7
|
}
|
|
8
8
|
function wrapAnthropicClientError(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://
|
|
1
|
+
{"version":3,"file":"errors.cjs","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrapAnthropicClientError(e: any) {\n let error;\n if (e.status === 400 && e.message.includes(\"tool\")) {\n error = addLangChainErrorFields(e, \"INVALID_TOOL_RESULTS\");\n } else if (e.status === 401) {\n error = addLangChainErrorFields(e, \"MODEL_AUTHENTICATION\");\n } else if (e.status === 404) {\n error = addLangChainErrorFields(e, \"MODEL_NOT_FOUND\");\n } else if (e.status === 429) {\n error = addLangChainErrorFields(e, \"MODEL_RATE_LIMIT\");\n } else {\n error = e;\n }\n return error;\n}\n"],"mappings":";;AAcA,SAAgB,wBACdA,OACAC,eACA;CACC,MAAc,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,oFAAoF,EAAE,cAAc,GAAG,CAAC;AACzI,QAAO;AACR;AAGD,SAAgB,yBAAyBC,GAAQ;CAC/C,IAAI;AACJ,KAAI,EAAE,WAAW,OAAO,EAAE,QAAQ,SAAS,OAAO,EAChD,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,kBAAkB;UAC5C,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,mBAAmB;MAEtD,QAAQ;AAEV,QAAO;AACR"}
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region src/utils/errors.ts
|
|
2
2
|
function addLangChainErrorFields(error, lc_error_code) {
|
|
3
3
|
error.lc_error_code = lc_error_code;
|
|
4
|
-
error.message = `${error.message}\n\nTroubleshooting URL: https://
|
|
4
|
+
error.message = `${error.message}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\n`;
|
|
5
5
|
return error;
|
|
6
6
|
}
|
|
7
7
|
function wrapAnthropicClientError(e) {
|
package/dist/utils/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://
|
|
1
|
+
{"version":3,"file":"errors.js","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrapAnthropicClientError(e: any) {\n let error;\n if (e.status === 400 && e.message.includes(\"tool\")) {\n error = addLangChainErrorFields(e, \"INVALID_TOOL_RESULTS\");\n } else if (e.status === 401) {\n error = addLangChainErrorFields(e, \"MODEL_AUTHENTICATION\");\n } else if (e.status === 404) {\n error = addLangChainErrorFields(e, \"MODEL_NOT_FOUND\");\n } else if (e.status === 429) {\n error = addLangChainErrorFields(e, \"MODEL_RATE_LIMIT\");\n } else {\n error = e;\n }\n return error;\n}\n"],"mappings":";AAcA,SAAgB,wBACdA,OACAC,eACA;CACC,MAAc,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,oFAAoF,EAAE,cAAc,GAAG,CAAC;AACzI,QAAO;AACR;AAGD,SAAgB,yBAAyBC,GAAQ;CAC/C,IAAI;AACJ,KAAI,EAAE,WAAW,OAAO,EAAE,QAAQ,SAAS,OAAO,EAChD,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,kBAAkB;UAC5C,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,mBAAmB;MAEtD,QAAQ;AAEV,QAAO;AACR"}
|
package/dist/utils/prompts.cjs
CHANGED
|
@@ -27,7 +27,7 @@ const require_message_inputs = require('./message_inputs.cjs');
|
|
|
27
27
|
* });
|
|
28
28
|
*
|
|
29
29
|
* const anthropicResponse = await anthropicClient.messages.create({
|
|
30
|
-
* model: "claude-
|
|
30
|
+
* model: "claude-sonnet-4-5-20250929",
|
|
31
31
|
* max_tokens: 1024,
|
|
32
32
|
* stream: false,
|
|
33
33
|
* system,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.cjs","names":["formattedPrompt: BasePromptValue","_convertMessagesToAnthropicPayload"],"sources":["../../src/utils/prompts.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n\nimport { _convertMessagesToAnthropicPayload } from \"./message_inputs.js\";\n\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-
|
|
1
|
+
{"version":3,"file":"prompts.cjs","names":["formattedPrompt: BasePromptValue","_convertMessagesToAnthropicPayload"],"sources":["../../src/utils/prompts.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n\nimport { _convertMessagesToAnthropicPayload } from \"./message_inputs.js\";\n\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-sonnet-4-5-20250929\",\n * max_tokens: 1024,\n * stream: false,\n * system,\n * messages,\n * });\n * ```\n * @param formattedPrompt\n * @returns A partial Anthropic payload.\n */\nexport function convertPromptToAnthropic(\n formattedPrompt: BasePromptValue\n): Anthropic.Messages.MessageCreateParams {\n const messages = formattedPrompt.toChatMessages();\n const anthropicBody = _convertMessagesToAnthropicPayload(messages);\n if (anthropicBody.messages === undefined) {\n anthropicBody.messages = [];\n }\n return anthropicBody;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,yBACdA,iBACwC;CACxC,MAAM,WAAW,gBAAgB,gBAAgB;CACjD,MAAM,gBAAgBC,0DAAmC,SAAS;AAClE,KAAI,cAAc,aAAa,QAC7B,cAAc,WAAW,CAAE;AAE7B,QAAO;AACR"}
|
package/dist/utils/prompts.d.cts
CHANGED
|
@@ -29,7 +29,7 @@ import { BasePromptValue } from "@langchain/core/prompt_values";
|
|
|
29
29
|
* });
|
|
30
30
|
*
|
|
31
31
|
* const anthropicResponse = await anthropicClient.messages.create({
|
|
32
|
-
* model: "claude-
|
|
32
|
+
* model: "claude-sonnet-4-5-20250929",
|
|
33
33
|
* max_tokens: 1024,
|
|
34
34
|
* stream: false,
|
|
35
35
|
* system,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.cts","names":["BasePromptValue","Anthropic","convertPromptToAnthropic","Messages","MessageCreateParams"],"sources":["../../src/utils/prompts.d.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-
|
|
1
|
+
{"version":3,"file":"prompts.d.cts","names":["BasePromptValue","Anthropic","convertPromptToAnthropic","Messages","MessageCreateParams"],"sources":["../../src/utils/prompts.d.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-sonnet-4-5-20250929\",\n * max_tokens: 1024,\n * stream: false,\n * system,\n * messages,\n * });\n * ```\n * @param formattedPrompt\n * @returns A partial Anthropic payload.\n */\nexport declare function convertPromptToAnthropic(formattedPrompt: BasePromptValue): Anthropic.Messages.MessageCreateParams;\n"],"mappings":";;;;;;;AAsCA;;;;AAA0H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAlGE,wBAAAA,kBAA0CF,kBAAkBC,SAAAA,CAAUE,QAAAA,CAASC"}
|
package/dist/utils/prompts.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ import { BasePromptValue } from "@langchain/core/prompt_values";
|
|
|
29
29
|
* });
|
|
30
30
|
*
|
|
31
31
|
* const anthropicResponse = await anthropicClient.messages.create({
|
|
32
|
-
* model: "claude-
|
|
32
|
+
* model: "claude-sonnet-4-5-20250929",
|
|
33
33
|
* max_tokens: 1024,
|
|
34
34
|
* stream: false,
|
|
35
35
|
* system,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","names":["BasePromptValue","Anthropic","convertPromptToAnthropic","Messages","MessageCreateParams"],"sources":["../../src/utils/prompts.d.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","names":["BasePromptValue","Anthropic","convertPromptToAnthropic","Messages","MessageCreateParams"],"sources":["../../src/utils/prompts.d.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-sonnet-4-5-20250929\",\n * max_tokens: 1024,\n * stream: false,\n * system,\n * messages,\n * });\n * ```\n * @param formattedPrompt\n * @returns A partial Anthropic payload.\n */\nexport declare function convertPromptToAnthropic(formattedPrompt: BasePromptValue): Anthropic.Messages.MessageCreateParams;\n"],"mappings":";;;;;;;AAsCA;;;;AAA0H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAlGE,wBAAAA,kBAA0CF,kBAAkBC,SAAAA,CAAUE,QAAAA,CAASC"}
|
package/dist/utils/prompts.js
CHANGED
|
@@ -27,7 +27,7 @@ import { _convertMessagesToAnthropicPayload } from "./message_inputs.js";
|
|
|
27
27
|
* });
|
|
28
28
|
*
|
|
29
29
|
* const anthropicResponse = await anthropicClient.messages.create({
|
|
30
|
-
* model: "claude-
|
|
30
|
+
* model: "claude-sonnet-4-5-20250929",
|
|
31
31
|
* max_tokens: 1024,
|
|
32
32
|
* stream: false,
|
|
33
33
|
* system,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","names":["formattedPrompt: BasePromptValue"],"sources":["../../src/utils/prompts.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n\nimport { _convertMessagesToAnthropicPayload } from \"./message_inputs.js\";\n\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-
|
|
1
|
+
{"version":3,"file":"prompts.js","names":["formattedPrompt: BasePromptValue"],"sources":["../../src/utils/prompts.ts"],"sourcesContent":["import type { BasePromptValue } from \"@langchain/core/prompt_values\";\nimport Anthropic from \"@anthropic-ai/sdk\";\n\nimport { _convertMessagesToAnthropicPayload } from \"./message_inputs.js\";\n\n/**\n * Convert a formatted LangChain prompt (e.g. pulled from the hub) into\n * a format expected by Anthropic's JS SDK.\n *\n * Requires the \"@langchain/anthropic\" package to be installed in addition\n * to the Anthropic SDK.\n *\n * @example\n * ```ts\n * import { convertPromptToAnthropic } from \"langsmith/utils/hub/anthropic\";\n * import { pull } from \"langchain/hub\";\n *\n * import Anthropic from '@anthropic-ai/sdk';\n *\n * const prompt = await pull(\"jacob/joke-generator\");\n * const formattedPrompt = await prompt.invoke({\n * topic: \"cats\",\n * });\n *\n * const { system, messages } = convertPromptToAnthropic(formattedPrompt);\n *\n * const anthropicClient = new Anthropic({\n * apiKey: 'your_api_key',\n * });\n *\n * const anthropicResponse = await anthropicClient.messages.create({\n * model: \"claude-sonnet-4-5-20250929\",\n * max_tokens: 1024,\n * stream: false,\n * system,\n * messages,\n * });\n * ```\n * @param formattedPrompt\n * @returns A partial Anthropic payload.\n */\nexport function convertPromptToAnthropic(\n formattedPrompt: BasePromptValue\n): Anthropic.Messages.MessageCreateParams {\n const messages = formattedPrompt.toChatMessages();\n const anthropicBody = _convertMessagesToAnthropicPayload(messages);\n if (anthropicBody.messages === undefined) {\n anthropicBody.messages = [];\n }\n return anthropicBody;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,yBACdA,iBACwC;CACxC,MAAM,WAAW,gBAAgB,gBAAgB;CACjD,MAAM,gBAAgB,mCAAmC,SAAS;AAClE,KAAI,cAAc,aAAa,QAC7B,cAAc,WAAW,CAAE;AAE7B,QAAO;AACR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/anthropic",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Anthropic integrations for LangChain.js",
|
|
5
5
|
"author": "LangChain",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"@anthropic-ai/sdk": "^0.65.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@langchain/core": "^1.0.0
|
|
20
|
+
"@langchain/core": "^1.0.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@anthropic-ai/vertex-sdk": "^0.11.5",
|
|
24
|
+
"@cfworker/json-schema": "^4.1.1",
|
|
24
25
|
"@tsconfig/recommended": "^1.0.10",
|
|
25
26
|
"@vitest/coverage-v8": "^3.2.4",
|
|
26
27
|
"dotenv": "^17.2.1",
|
|
27
28
|
"dpdm": "^3.14.0",
|
|
28
29
|
"eslint": "^9.34.0",
|
|
29
30
|
"prettier": "^2.8.3",
|
|
30
|
-
"release-it": "^19.0.4",
|
|
31
|
-
"release-it-pnpm": "^4.6.6",
|
|
32
31
|
"rimraf": "^5.0.1",
|
|
33
32
|
"typescript": "~5.8.3",
|
|
33
|
+
"uuid": "^13.0.0",
|
|
34
34
|
"vitest": "^3.2.4",
|
|
35
35
|
"zod": "3.25.76",
|
|
36
|
-
"@langchain/
|
|
36
|
+
"@langchain/core": "1.0.5",
|
|
37
37
|
"@langchain/eslint": "0.1.0",
|
|
38
|
-
"@langchain/
|
|
38
|
+
"@langchain/standard-tests": "0.0.1"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"types": "./dist/index.d.ts",
|
|
59
59
|
"exports": {
|
|
60
60
|
".": {
|
|
61
|
+
"input": "./src/index.ts",
|
|
61
62
|
"import": {
|
|
62
63
|
"types": "./dist/index.d.ts",
|
|
63
64
|
"default": "./dist/index.js"
|
|
@@ -65,16 +66,19 @@
|
|
|
65
66
|
"require": {
|
|
66
67
|
"types": "./dist/index.d.cts",
|
|
67
68
|
"default": "./dist/index.cjs"
|
|
68
|
-
}
|
|
69
|
-
"input": "./src/index.ts"
|
|
69
|
+
}
|
|
70
70
|
},
|
|
71
71
|
"./package.json": "./package.json"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
|
-
"dist/"
|
|
74
|
+
"dist/",
|
|
75
|
+
"CHANGELOG.md",
|
|
76
|
+
"README.md",
|
|
77
|
+
"LICENSE"
|
|
75
78
|
],
|
|
76
79
|
"scripts": {
|
|
77
|
-
"build": "
|
|
80
|
+
"build": "turbo build:compile --filter @langchain/anthropic",
|
|
81
|
+
"build:compile": "pnpm --filter @langchain/build compile @langchain/anthropic",
|
|
78
82
|
"lint:eslint": "eslint --cache src/",
|
|
79
83
|
"lint:dpdm": "dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
|
|
80
84
|
"lint": "pnpm lint:eslint && pnpm lint:dpdm",
|
|
@@ -87,6 +91,8 @@
|
|
|
87
91
|
"test:standard:int": "vitest run --mode standard-int",
|
|
88
92
|
"test:standard": "pnpm test:standard:unit && pnpm test:standard:int",
|
|
89
93
|
"format": "prettier --config .prettierrc --write \"src\"",
|
|
90
|
-
"format:check": "prettier --config .prettierrc --check \"src\""
|
|
94
|
+
"format:check": "prettier --config .prettierrc --check \"src\"",
|
|
95
|
+
"typegen": "pnpm run typegen:profiles",
|
|
96
|
+
"typegen:profiles": "pnpm --filter @langchain/model-profiles make --config profiles.toml"
|
|
91
97
|
}
|
|
92
98
|
}
|