@ai-sdk/togetherai 1.0.0-canary.9 → 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 +567 -0
- package/README.md +2 -2
- package/dist/index.d.mts +7 -13
- package/dist/index.d.ts +7 -13
- package/dist/index.js +12 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,572 @@
|
|
|
1
1
|
# @ai-sdk/togetherai
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [0e8ed8e]
|
|
8
|
+
- @ai-sdk/openai-compatible@1.0.1
|
|
9
|
+
|
|
10
|
+
## 1.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- d5f588f: AI SDK 5
|
|
15
|
+
- 516be5b: ### Move Image Model Settings into generate options
|
|
16
|
+
|
|
17
|
+
Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
|
|
18
|
+
|
|
19
|
+
Before
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
await generateImage({
|
|
23
|
+
model: luma.image('photon-flash-1', {
|
|
24
|
+
maxImagesPerCall: 5,
|
|
25
|
+
pollIntervalMillis: 500,
|
|
26
|
+
}),
|
|
27
|
+
prompt,
|
|
28
|
+
n: 10,
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
await generateImage({
|
|
36
|
+
model: luma.image('photon-flash-1'),
|
|
37
|
+
prompt,
|
|
38
|
+
n: 10,
|
|
39
|
+
maxImagesPerCall: 5,
|
|
40
|
+
providerOptions: {
|
|
41
|
+
luma: { pollIntervalMillis: 5 },
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Pull Request: https://github.com/vercel/ai/pull/6180
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- fa49207: feat(providers/openai-compatible): convert to providerOptions
|
|
51
|
+
- e2aceaf: feat: add raw chunk support
|
|
52
|
+
- eb173f1: chore (providers): remove model shorthand deprecation warnings
|
|
53
|
+
- 26735b5: chore(embedding-model): add v2 interface
|
|
54
|
+
- d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
|
|
55
|
+
- 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
|
|
56
|
+
- d1a034f: feature: using Zod 4 for internal stuff
|
|
57
|
+
- 205077b: fix: improve Zod compatibility
|
|
58
|
+
- Updated dependencies [a571d6e]
|
|
59
|
+
- Updated dependencies [742b7be]
|
|
60
|
+
- Updated dependencies [e7fcc86]
|
|
61
|
+
- Updated dependencies [7cddb72]
|
|
62
|
+
- Updated dependencies [ccce59b]
|
|
63
|
+
- Updated dependencies [e2b9e4b]
|
|
64
|
+
- Updated dependencies [95857aa]
|
|
65
|
+
- Updated dependencies [45c1ea2]
|
|
66
|
+
- Updated dependencies [6f6bb89]
|
|
67
|
+
- Updated dependencies [060370c]
|
|
68
|
+
- Updated dependencies [dc714f3]
|
|
69
|
+
- Updated dependencies [b5da06a]
|
|
70
|
+
- Updated dependencies [d1a1aa1]
|
|
71
|
+
- Updated dependencies [63f9e9b]
|
|
72
|
+
- Updated dependencies [5d142ab]
|
|
73
|
+
- Updated dependencies [d5f588f]
|
|
74
|
+
- Updated dependencies [e025824]
|
|
75
|
+
- Updated dependencies [0571b98]
|
|
76
|
+
- Updated dependencies [6db02c9]
|
|
77
|
+
- Updated dependencies [b6b43c7]
|
|
78
|
+
- Updated dependencies [4fef487]
|
|
79
|
+
- Updated dependencies [48d257a]
|
|
80
|
+
- Updated dependencies [0c0c0b3]
|
|
81
|
+
- Updated dependencies [0d2c085]
|
|
82
|
+
- Updated dependencies [fa49207]
|
|
83
|
+
- Updated dependencies [40acf9b]
|
|
84
|
+
- Updated dependencies [cf8280e]
|
|
85
|
+
- Updated dependencies [9222aeb]
|
|
86
|
+
- Updated dependencies [b9a6121]
|
|
87
|
+
- Updated dependencies [e2aceaf]
|
|
88
|
+
- Updated dependencies [411e483]
|
|
89
|
+
- Updated dependencies [8ba77a7]
|
|
90
|
+
- Updated dependencies [db72adc]
|
|
91
|
+
- Updated dependencies [7b3ae3f]
|
|
92
|
+
- Updated dependencies [a166433]
|
|
93
|
+
- Updated dependencies [26735b5]
|
|
94
|
+
- Updated dependencies [443d8ec]
|
|
95
|
+
- Updated dependencies [42e32b0]
|
|
96
|
+
- Updated dependencies [a8c8bd5]
|
|
97
|
+
- Updated dependencies [abf9a79]
|
|
98
|
+
- Updated dependencies [14c9410]
|
|
99
|
+
- Updated dependencies [e86be6f]
|
|
100
|
+
- Updated dependencies [9bf7291]
|
|
101
|
+
- Updated dependencies [2e13791]
|
|
102
|
+
- Updated dependencies [7b069ed]
|
|
103
|
+
- Updated dependencies [9f95b35]
|
|
104
|
+
- Updated dependencies [66962ed]
|
|
105
|
+
- Updated dependencies [0d06df6]
|
|
106
|
+
- Updated dependencies [472524a]
|
|
107
|
+
- Updated dependencies [dd3ff01]
|
|
108
|
+
- Updated dependencies [d9209ca]
|
|
109
|
+
- Updated dependencies [d9c98f4]
|
|
110
|
+
- Updated dependencies [05d2819]
|
|
111
|
+
- Updated dependencies [9301f86]
|
|
112
|
+
- Updated dependencies [0a87932]
|
|
113
|
+
- Updated dependencies [737f1e2]
|
|
114
|
+
- Updated dependencies [c4a2fec]
|
|
115
|
+
- Updated dependencies [957b739]
|
|
116
|
+
- Updated dependencies [79457bd]
|
|
117
|
+
- Updated dependencies [a3f768e]
|
|
118
|
+
- Updated dependencies [7435eb5]
|
|
119
|
+
- Updated dependencies [8aa9e20]
|
|
120
|
+
- Updated dependencies [4617fab]
|
|
121
|
+
- Updated dependencies [516be5b]
|
|
122
|
+
- Updated dependencies [ac34802]
|
|
123
|
+
- Updated dependencies [0054544]
|
|
124
|
+
- Updated dependencies [cb68df0]
|
|
125
|
+
- Updated dependencies [ad80501]
|
|
126
|
+
- Updated dependencies [68ecf2f]
|
|
127
|
+
- Updated dependencies [9e9c809]
|
|
128
|
+
- Updated dependencies [32831c6]
|
|
129
|
+
- Updated dependencies [6dc848c]
|
|
130
|
+
- Updated dependencies [6b98118]
|
|
131
|
+
- Updated dependencies [d0f9495]
|
|
132
|
+
- Updated dependencies [63d791d]
|
|
133
|
+
- Updated dependencies [87b828f]
|
|
134
|
+
- Updated dependencies [3f2f00c]
|
|
135
|
+
- Updated dependencies [bfdca8d]
|
|
136
|
+
- Updated dependencies [0ff02bb]
|
|
137
|
+
- Updated dependencies [7979f7f]
|
|
138
|
+
- Updated dependencies [39a4fab]
|
|
139
|
+
- Updated dependencies [44f4aba]
|
|
140
|
+
- Updated dependencies [9bd5ab5]
|
|
141
|
+
- Updated dependencies [57edfcb]
|
|
142
|
+
- Updated dependencies [faf8446]
|
|
143
|
+
- Updated dependencies [7ea4132]
|
|
144
|
+
- Updated dependencies [d1a034f]
|
|
145
|
+
- Updated dependencies [5c56081]
|
|
146
|
+
- Updated dependencies [fd65bc6]
|
|
147
|
+
- Updated dependencies [023ba40]
|
|
148
|
+
- Updated dependencies [ea7a7c9]
|
|
149
|
+
- Updated dependencies [1b101e1]
|
|
150
|
+
- Updated dependencies [26535e0]
|
|
151
|
+
- Updated dependencies [e030615]
|
|
152
|
+
- Updated dependencies [5e57fae]
|
|
153
|
+
- Updated dependencies [393138b]
|
|
154
|
+
- Updated dependencies [c57e248]
|
|
155
|
+
- Updated dependencies [88a8ee5]
|
|
156
|
+
- Updated dependencies [41fa418]
|
|
157
|
+
- Updated dependencies [205077b]
|
|
158
|
+
- Updated dependencies [71f938d]
|
|
159
|
+
- Updated dependencies [3795467]
|
|
160
|
+
- Updated dependencies [28a5ed5]
|
|
161
|
+
- Updated dependencies [7182d14]
|
|
162
|
+
- Updated dependencies [c1e6647]
|
|
163
|
+
- Updated dependencies [1766ede]
|
|
164
|
+
- Updated dependencies [811dff3]
|
|
165
|
+
- Updated dependencies [f10304b]
|
|
166
|
+
- Updated dependencies [dd5fd43]
|
|
167
|
+
- Updated dependencies [33f4a6a]
|
|
168
|
+
- Updated dependencies [383cbfa]
|
|
169
|
+
- Updated dependencies [27deb4d]
|
|
170
|
+
- Updated dependencies [c4df419]
|
|
171
|
+
- Updated dependencies [281bb1c]
|
|
172
|
+
- @ai-sdk/provider-utils@3.0.0
|
|
173
|
+
- @ai-sdk/provider@2.0.0
|
|
174
|
+
- @ai-sdk/openai-compatible@1.0.0
|
|
175
|
+
|
|
176
|
+
## 1.0.0-beta.13
|
|
177
|
+
|
|
178
|
+
### Patch Changes
|
|
179
|
+
|
|
180
|
+
- Updated dependencies [88a8ee5]
|
|
181
|
+
- @ai-sdk/provider-utils@3.0.0-beta.10
|
|
182
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.13
|
|
183
|
+
|
|
184
|
+
## 1.0.0-beta.12
|
|
185
|
+
|
|
186
|
+
### Patch Changes
|
|
187
|
+
|
|
188
|
+
- Updated dependencies [27deb4d]
|
|
189
|
+
- @ai-sdk/provider@2.0.0-beta.2
|
|
190
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.12
|
|
191
|
+
- @ai-sdk/provider-utils@3.0.0-beta.9
|
|
192
|
+
|
|
193
|
+
## 1.0.0-beta.11
|
|
194
|
+
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- eb173f1: chore (providers): remove model shorthand deprecation warnings
|
|
198
|
+
- Updated dependencies [dd5fd43]
|
|
199
|
+
- @ai-sdk/provider-utils@3.0.0-beta.8
|
|
200
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.11
|
|
201
|
+
|
|
202
|
+
## 1.0.0-beta.10
|
|
203
|
+
|
|
204
|
+
### Patch Changes
|
|
205
|
+
|
|
206
|
+
- Updated dependencies [e7fcc86]
|
|
207
|
+
- @ai-sdk/provider-utils@3.0.0-beta.7
|
|
208
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.10
|
|
209
|
+
|
|
210
|
+
## 1.0.0-beta.9
|
|
211
|
+
|
|
212
|
+
### Patch Changes
|
|
213
|
+
|
|
214
|
+
- Updated dependencies [737f1e2]
|
|
215
|
+
- Updated dependencies [ac34802]
|
|
216
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.9
|
|
217
|
+
- @ai-sdk/provider-utils@3.0.0-beta.6
|
|
218
|
+
|
|
219
|
+
## 1.0.0-beta.8
|
|
220
|
+
|
|
221
|
+
### Patch Changes
|
|
222
|
+
|
|
223
|
+
- Updated dependencies [57edfcb]
|
|
224
|
+
- Updated dependencies [383cbfa]
|
|
225
|
+
- @ai-sdk/provider-utils@3.0.0-beta.5
|
|
226
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.8
|
|
227
|
+
|
|
228
|
+
## 1.0.0-beta.7
|
|
229
|
+
|
|
230
|
+
### Patch Changes
|
|
231
|
+
|
|
232
|
+
- 205077b: fix: improve Zod compatibility
|
|
233
|
+
- Updated dependencies [205077b]
|
|
234
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.7
|
|
235
|
+
- @ai-sdk/provider-utils@3.0.0-beta.4
|
|
236
|
+
|
|
237
|
+
## 1.0.0-beta.6
|
|
238
|
+
|
|
239
|
+
### Patch Changes
|
|
240
|
+
|
|
241
|
+
- Updated dependencies [281bb1c]
|
|
242
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.6
|
|
243
|
+
|
|
244
|
+
## 1.0.0-beta.5
|
|
245
|
+
|
|
246
|
+
### Patch Changes
|
|
247
|
+
|
|
248
|
+
- Updated dependencies [05d2819]
|
|
249
|
+
- @ai-sdk/provider-utils@3.0.0-beta.3
|
|
250
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.5
|
|
251
|
+
|
|
252
|
+
## 1.0.0-beta.4
|
|
253
|
+
|
|
254
|
+
### Patch Changes
|
|
255
|
+
|
|
256
|
+
- Updated dependencies [1b101e1]
|
|
257
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.4
|
|
258
|
+
|
|
259
|
+
## 1.0.0-beta.3
|
|
260
|
+
|
|
261
|
+
### Patch Changes
|
|
262
|
+
|
|
263
|
+
- Updated dependencies [7b069ed]
|
|
264
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.3
|
|
265
|
+
|
|
266
|
+
## 1.0.0-beta.2
|
|
267
|
+
|
|
268
|
+
### Patch Changes
|
|
269
|
+
|
|
270
|
+
- d1a034f: feature: using Zod 4 for internal stuff
|
|
271
|
+
- Updated dependencies [0571b98]
|
|
272
|
+
- Updated dependencies [39a4fab]
|
|
273
|
+
- Updated dependencies [d1a034f]
|
|
274
|
+
- @ai-sdk/provider-utils@3.0.0-beta.2
|
|
275
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.2
|
|
276
|
+
|
|
277
|
+
## 1.0.0-beta.1
|
|
278
|
+
|
|
279
|
+
### Patch Changes
|
|
280
|
+
|
|
281
|
+
- Updated dependencies [742b7be]
|
|
282
|
+
- Updated dependencies [7cddb72]
|
|
283
|
+
- Updated dependencies [ccce59b]
|
|
284
|
+
- Updated dependencies [e2b9e4b]
|
|
285
|
+
- Updated dependencies [45c1ea2]
|
|
286
|
+
- Updated dependencies [e025824]
|
|
287
|
+
- Updated dependencies [0d06df6]
|
|
288
|
+
- Updated dependencies [472524a]
|
|
289
|
+
- Updated dependencies [dd3ff01]
|
|
290
|
+
- Updated dependencies [7435eb5]
|
|
291
|
+
- Updated dependencies [cb68df0]
|
|
292
|
+
- Updated dependencies [bfdca8d]
|
|
293
|
+
- Updated dependencies [44f4aba]
|
|
294
|
+
- Updated dependencies [023ba40]
|
|
295
|
+
- Updated dependencies [5e57fae]
|
|
296
|
+
- Updated dependencies [71f938d]
|
|
297
|
+
- Updated dependencies [28a5ed5]
|
|
298
|
+
- @ai-sdk/provider@2.0.0-beta.1
|
|
299
|
+
- @ai-sdk/provider-utils@3.0.0-beta.1
|
|
300
|
+
- @ai-sdk/openai-compatible@1.0.0-beta.1
|
|
301
|
+
|
|
302
|
+
## 1.0.0-alpha.15
|
|
303
|
+
|
|
304
|
+
### Patch Changes
|
|
305
|
+
|
|
306
|
+
- Updated dependencies [48d257a]
|
|
307
|
+
- Updated dependencies [8ba77a7]
|
|
308
|
+
- @ai-sdk/provider@2.0.0-alpha.15
|
|
309
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.15
|
|
310
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.15
|
|
311
|
+
|
|
312
|
+
## 1.0.0-alpha.14
|
|
313
|
+
|
|
314
|
+
### Patch Changes
|
|
315
|
+
|
|
316
|
+
- Updated dependencies [b5da06a]
|
|
317
|
+
- Updated dependencies [63f9e9b]
|
|
318
|
+
- Updated dependencies [2e13791]
|
|
319
|
+
- @ai-sdk/provider@2.0.0-alpha.14
|
|
320
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.14
|
|
321
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.14
|
|
322
|
+
|
|
323
|
+
## 1.0.0-alpha.13
|
|
324
|
+
|
|
325
|
+
### Patch Changes
|
|
326
|
+
|
|
327
|
+
- Updated dependencies [68ecf2f]
|
|
328
|
+
- @ai-sdk/provider@2.0.0-alpha.13
|
|
329
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.13
|
|
330
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.13
|
|
331
|
+
|
|
332
|
+
## 1.0.0-alpha.12
|
|
333
|
+
|
|
334
|
+
### Patch Changes
|
|
335
|
+
|
|
336
|
+
- e2aceaf: feat: add raw chunk support
|
|
337
|
+
- Updated dependencies [e2aceaf]
|
|
338
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.12
|
|
339
|
+
- @ai-sdk/provider@2.0.0-alpha.12
|
|
340
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.12
|
|
341
|
+
|
|
342
|
+
## 1.0.0-alpha.11
|
|
343
|
+
|
|
344
|
+
### Patch Changes
|
|
345
|
+
|
|
346
|
+
- Updated dependencies [c1e6647]
|
|
347
|
+
- @ai-sdk/provider@2.0.0-alpha.11
|
|
348
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.11
|
|
349
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.11
|
|
350
|
+
|
|
351
|
+
## 1.0.0-alpha.10
|
|
352
|
+
|
|
353
|
+
### Patch Changes
|
|
354
|
+
|
|
355
|
+
- Updated dependencies [c4df419]
|
|
356
|
+
- @ai-sdk/provider@2.0.0-alpha.10
|
|
357
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.10
|
|
358
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.10
|
|
359
|
+
|
|
360
|
+
## 1.0.0-alpha.9
|
|
361
|
+
|
|
362
|
+
### Patch Changes
|
|
363
|
+
|
|
364
|
+
- Updated dependencies [811dff3]
|
|
365
|
+
- @ai-sdk/provider@2.0.0-alpha.9
|
|
366
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.9
|
|
367
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.9
|
|
368
|
+
|
|
369
|
+
## 1.0.0-alpha.8
|
|
370
|
+
|
|
371
|
+
### Patch Changes
|
|
372
|
+
|
|
373
|
+
- Updated dependencies [4fef487]
|
|
374
|
+
- Updated dependencies [9222aeb]
|
|
375
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.8
|
|
376
|
+
- @ai-sdk/provider@2.0.0-alpha.8
|
|
377
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.8
|
|
378
|
+
|
|
379
|
+
## 1.0.0-alpha.7
|
|
380
|
+
|
|
381
|
+
### Patch Changes
|
|
382
|
+
|
|
383
|
+
- Updated dependencies [5c56081]
|
|
384
|
+
- @ai-sdk/provider@2.0.0-alpha.7
|
|
385
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.7
|
|
386
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.7
|
|
387
|
+
|
|
388
|
+
## 1.0.0-alpha.6
|
|
389
|
+
|
|
390
|
+
### Patch Changes
|
|
391
|
+
|
|
392
|
+
- Updated dependencies [0d2c085]
|
|
393
|
+
- @ai-sdk/provider@2.0.0-alpha.6
|
|
394
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.6
|
|
395
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.6
|
|
396
|
+
|
|
397
|
+
## 1.0.0-alpha.4
|
|
398
|
+
|
|
399
|
+
### Patch Changes
|
|
400
|
+
|
|
401
|
+
- Updated dependencies [dc714f3]
|
|
402
|
+
- @ai-sdk/provider@2.0.0-alpha.4
|
|
403
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.4
|
|
404
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.4
|
|
405
|
+
|
|
406
|
+
## 1.0.0-alpha.3
|
|
407
|
+
|
|
408
|
+
### Patch Changes
|
|
409
|
+
|
|
410
|
+
- Updated dependencies [6b98118]
|
|
411
|
+
- @ai-sdk/provider@2.0.0-alpha.3
|
|
412
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.3
|
|
413
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.3
|
|
414
|
+
|
|
415
|
+
## 1.0.0-alpha.2
|
|
416
|
+
|
|
417
|
+
### Patch Changes
|
|
418
|
+
|
|
419
|
+
- Updated dependencies [26535e0]
|
|
420
|
+
- @ai-sdk/provider@2.0.0-alpha.2
|
|
421
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.2
|
|
422
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.2
|
|
423
|
+
|
|
424
|
+
## 1.0.0-alpha.1
|
|
425
|
+
|
|
426
|
+
### Patch Changes
|
|
427
|
+
|
|
428
|
+
- Updated dependencies [3f2f00c]
|
|
429
|
+
- @ai-sdk/provider@2.0.0-alpha.1
|
|
430
|
+
- @ai-sdk/openai-compatible@1.0.0-alpha.1
|
|
431
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.1
|
|
432
|
+
|
|
433
|
+
## 1.0.0-canary.19
|
|
434
|
+
|
|
435
|
+
### Patch Changes
|
|
436
|
+
|
|
437
|
+
- Updated dependencies [faf8446]
|
|
438
|
+
- @ai-sdk/provider-utils@3.0.0-canary.19
|
|
439
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.19
|
|
440
|
+
|
|
441
|
+
## 1.0.0-canary.18
|
|
442
|
+
|
|
443
|
+
### Patch Changes
|
|
444
|
+
|
|
445
|
+
- Updated dependencies [40acf9b]
|
|
446
|
+
- @ai-sdk/provider-utils@3.0.0-canary.18
|
|
447
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.18
|
|
448
|
+
|
|
449
|
+
## 1.0.0-canary.17
|
|
450
|
+
|
|
451
|
+
### Major Changes
|
|
452
|
+
|
|
453
|
+
- 516be5b: ### Move Image Model Settings into generate options
|
|
454
|
+
|
|
455
|
+
Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
|
|
456
|
+
|
|
457
|
+
Before
|
|
458
|
+
|
|
459
|
+
```js
|
|
460
|
+
await generateImage({
|
|
461
|
+
model: luma.image('photon-flash-1', {
|
|
462
|
+
maxImagesPerCall: 5,
|
|
463
|
+
pollIntervalMillis: 500,
|
|
464
|
+
}),
|
|
465
|
+
prompt,
|
|
466
|
+
n: 10,
|
|
467
|
+
});
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
After
|
|
471
|
+
|
|
472
|
+
```js
|
|
473
|
+
await generateImage({
|
|
474
|
+
model: luma.image('photon-flash-1'),
|
|
475
|
+
prompt,
|
|
476
|
+
n: 10,
|
|
477
|
+
maxImagesPerCall: 5,
|
|
478
|
+
providerOptions: {
|
|
479
|
+
luma: { pollIntervalMillis: 5 },
|
|
480
|
+
},
|
|
481
|
+
});
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
Pull Request: https://github.com/vercel/ai/pull/6180
|
|
485
|
+
|
|
486
|
+
### Patch Changes
|
|
487
|
+
|
|
488
|
+
- Updated dependencies [516be5b]
|
|
489
|
+
- Updated dependencies [ea7a7c9]
|
|
490
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.17
|
|
491
|
+
- @ai-sdk/provider-utils@3.0.0-canary.17
|
|
492
|
+
|
|
493
|
+
## 1.0.0-canary.16
|
|
494
|
+
|
|
495
|
+
### Patch Changes
|
|
496
|
+
|
|
497
|
+
- Updated dependencies [87b828f]
|
|
498
|
+
- @ai-sdk/provider-utils@3.0.0-canary.16
|
|
499
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.16
|
|
500
|
+
|
|
501
|
+
## 1.0.0-canary.15
|
|
502
|
+
|
|
503
|
+
### Patch Changes
|
|
504
|
+
|
|
505
|
+
- Updated dependencies [a571d6e]
|
|
506
|
+
- Updated dependencies [a8c8bd5]
|
|
507
|
+
- Updated dependencies [7979f7f]
|
|
508
|
+
- Updated dependencies [41fa418]
|
|
509
|
+
- @ai-sdk/provider-utils@3.0.0-canary.15
|
|
510
|
+
- @ai-sdk/provider@2.0.0-canary.14
|
|
511
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.15
|
|
512
|
+
|
|
513
|
+
## 1.0.0-canary.14
|
|
514
|
+
|
|
515
|
+
### Patch Changes
|
|
516
|
+
|
|
517
|
+
- Updated dependencies [957b739]
|
|
518
|
+
- Updated dependencies [9bd5ab5]
|
|
519
|
+
- @ai-sdk/provider-utils@3.0.0-canary.14
|
|
520
|
+
- @ai-sdk/provider@2.0.0-canary.13
|
|
521
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.14
|
|
522
|
+
|
|
523
|
+
## 1.0.0-canary.13
|
|
524
|
+
|
|
525
|
+
### Patch Changes
|
|
526
|
+
|
|
527
|
+
- d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
|
|
528
|
+
- Updated dependencies [7b3ae3f]
|
|
529
|
+
- Updated dependencies [d9209ca]
|
|
530
|
+
- Updated dependencies [0ff02bb]
|
|
531
|
+
- @ai-sdk/provider@2.0.0-canary.12
|
|
532
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.13
|
|
533
|
+
- @ai-sdk/provider-utils@3.0.0-canary.13
|
|
534
|
+
|
|
535
|
+
## 1.0.0-canary.12
|
|
536
|
+
|
|
537
|
+
### Patch Changes
|
|
538
|
+
|
|
539
|
+
- Updated dependencies [9bf7291]
|
|
540
|
+
- Updated dependencies [4617fab]
|
|
541
|
+
- Updated dependencies [e030615]
|
|
542
|
+
- @ai-sdk/provider@2.0.0-canary.11
|
|
543
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.12
|
|
544
|
+
- @ai-sdk/provider-utils@3.0.0-canary.12
|
|
545
|
+
|
|
546
|
+
## 1.0.0-canary.11
|
|
547
|
+
|
|
548
|
+
### Patch Changes
|
|
549
|
+
|
|
550
|
+
- 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
|
|
551
|
+
- Updated dependencies [db72adc]
|
|
552
|
+
- Updated dependencies [42e32b0]
|
|
553
|
+
- Updated dependencies [66962ed]
|
|
554
|
+
- Updated dependencies [9301f86]
|
|
555
|
+
- Updated dependencies [a3f768e]
|
|
556
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.11
|
|
557
|
+
- @ai-sdk/provider-utils@3.0.0-canary.11
|
|
558
|
+
- @ai-sdk/provider@2.0.0-canary.10
|
|
559
|
+
|
|
560
|
+
## 1.0.0-canary.10
|
|
561
|
+
|
|
562
|
+
### Patch Changes
|
|
563
|
+
|
|
564
|
+
- Updated dependencies [cf8280e]
|
|
565
|
+
- Updated dependencies [e86be6f]
|
|
566
|
+
- @ai-sdk/openai-compatible@1.0.0-canary.10
|
|
567
|
+
- @ai-sdk/provider@2.0.0-canary.9
|
|
568
|
+
- @ai-sdk/provider-utils@3.0.0-canary.10
|
|
569
|
+
|
|
3
570
|
## 1.0.0-canary.9
|
|
4
571
|
|
|
5
572
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AI SDK - Together.ai Provider
|
|
2
2
|
|
|
3
|
-
The **[Together.ai provider](https://sdk.
|
|
3
|
+
The **[Together.ai provider](https://ai-sdk.dev/providers/ai-sdk-providers/togetherai)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the [Together.ai](https://together.ai) platform.
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
6
|
|
|
@@ -32,4 +32,4 @@ const { text } = await generateText({
|
|
|
32
32
|
|
|
33
33
|
## Documentation
|
|
34
34
|
|
|
35
|
-
Please check out the **[Together.ai provider](https://sdk.
|
|
35
|
+
Please check out the **[Together.ai provider](https://ai-sdk.dev/providers/ai-sdk-providers/togetherai)** for more information.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProviderV2, LanguageModelV2, EmbeddingModelV2,
|
|
1
|
+
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2 } from '@ai-sdk/provider';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
export { OpenAICompatibleErrorData as TogetherAIErrorData } from '@ai-sdk/openai-compatible';
|
|
4
4
|
|
|
@@ -9,12 +9,6 @@ type TogetherAIEmbeddingModelId = 'togethercomputer/m2-bert-80M-2k-retrieval' |
|
|
|
9
9
|
type TogetherAICompletionModelId = 'meta-llama/Llama-2-70b-hf' | 'mistralai/Mistral-7B-v0.1' | 'mistralai/Mixtral-8x7B-v0.1' | 'Meta-Llama/Llama-Guard-7b' | 'codellama/CodeLlama-34b-Instruct-hf' | 'Qwen/Qwen2.5-Coder-32B-Instruct' | (string & {});
|
|
10
10
|
|
|
11
11
|
type TogetherAIImageModelId = 'stabilityai/stable-diffusion-xl-base-1.0' | 'black-forest-labs/FLUX.1-dev' | 'black-forest-labs/FLUX.1-dev-lora' | 'black-forest-labs/FLUX.1-schnell' | 'black-forest-labs/FLUX.1-canny' | 'black-forest-labs/FLUX.1-depth' | 'black-forest-labs/FLUX.1-redux' | 'black-forest-labs/FLUX.1.1-pro' | 'black-forest-labs/FLUX.1-pro' | 'black-forest-labs/FLUX.1-schnell-Free' | (string & {});
|
|
12
|
-
interface TogetherAIImageSettings {
|
|
13
|
-
/**
|
|
14
|
-
Override the maximum number of images per call (default 1)
|
|
15
|
-
*/
|
|
16
|
-
maxImagesPerCall?: number;
|
|
17
|
-
}
|
|
18
12
|
|
|
19
13
|
interface TogetherAIProviderSettings {
|
|
20
14
|
/**
|
|
@@ -57,13 +51,13 @@ interface TogetherAIProvider extends ProviderV2 {
|
|
|
57
51
|
*/
|
|
58
52
|
textEmbeddingModel(modelId: TogetherAIEmbeddingModelId): EmbeddingModelV2<string>;
|
|
59
53
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
image(modelId: TogetherAIImageModelId
|
|
54
|
+
Creates a model for image generation.
|
|
55
|
+
*/
|
|
56
|
+
image(modelId: TogetherAIImageModelId): ImageModelV2;
|
|
63
57
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
imageModel(modelId: TogetherAIImageModelId):
|
|
58
|
+
Creates a model for image generation.
|
|
59
|
+
*/
|
|
60
|
+
imageModel(modelId: TogetherAIImageModelId): ImageModelV2;
|
|
67
61
|
}
|
|
68
62
|
declare function createTogetherAI(options?: TogetherAIProviderSettings): TogetherAIProvider;
|
|
69
63
|
declare const togetherai: TogetherAIProvider;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ProviderV2, LanguageModelV2, EmbeddingModelV2,
|
|
1
|
+
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2 } from '@ai-sdk/provider';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
export { OpenAICompatibleErrorData as TogetherAIErrorData } from '@ai-sdk/openai-compatible';
|
|
4
4
|
|
|
@@ -9,12 +9,6 @@ type TogetherAIEmbeddingModelId = 'togethercomputer/m2-bert-80M-2k-retrieval' |
|
|
|
9
9
|
type TogetherAICompletionModelId = 'meta-llama/Llama-2-70b-hf' | 'mistralai/Mistral-7B-v0.1' | 'mistralai/Mixtral-8x7B-v0.1' | 'Meta-Llama/Llama-Guard-7b' | 'codellama/CodeLlama-34b-Instruct-hf' | 'Qwen/Qwen2.5-Coder-32B-Instruct' | (string & {});
|
|
10
10
|
|
|
11
11
|
type TogetherAIImageModelId = 'stabilityai/stable-diffusion-xl-base-1.0' | 'black-forest-labs/FLUX.1-dev' | 'black-forest-labs/FLUX.1-dev-lora' | 'black-forest-labs/FLUX.1-schnell' | 'black-forest-labs/FLUX.1-canny' | 'black-forest-labs/FLUX.1-depth' | 'black-forest-labs/FLUX.1-redux' | 'black-forest-labs/FLUX.1.1-pro' | 'black-forest-labs/FLUX.1-pro' | 'black-forest-labs/FLUX.1-schnell-Free' | (string & {});
|
|
12
|
-
interface TogetherAIImageSettings {
|
|
13
|
-
/**
|
|
14
|
-
Override the maximum number of images per call (default 1)
|
|
15
|
-
*/
|
|
16
|
-
maxImagesPerCall?: number;
|
|
17
|
-
}
|
|
18
12
|
|
|
19
13
|
interface TogetherAIProviderSettings {
|
|
20
14
|
/**
|
|
@@ -57,13 +51,13 @@ interface TogetherAIProvider extends ProviderV2 {
|
|
|
57
51
|
*/
|
|
58
52
|
textEmbeddingModel(modelId: TogetherAIEmbeddingModelId): EmbeddingModelV2<string>;
|
|
59
53
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
image(modelId: TogetherAIImageModelId
|
|
54
|
+
Creates a model for image generation.
|
|
55
|
+
*/
|
|
56
|
+
image(modelId: TogetherAIImageModelId): ImageModelV2;
|
|
63
57
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
imageModel(modelId: TogetherAIImageModelId):
|
|
58
|
+
Creates a model for image generation.
|
|
59
|
+
*/
|
|
60
|
+
imageModel(modelId: TogetherAIImageModelId): ImageModelV2;
|
|
67
61
|
}
|
|
68
62
|
declare function createTogetherAI(options?: TogetherAIProviderSettings): TogetherAIProvider;
|
|
69
63
|
declare const togetherai: TogetherAIProvider;
|
package/dist/index.js
CHANGED
|
@@ -31,21 +31,17 @@ var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
|
|
31
31
|
|
|
32
32
|
// src/togetherai-image-model.ts
|
|
33
33
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
34
|
-
var
|
|
34
|
+
var import_v4 = require("zod/v4");
|
|
35
35
|
var TogetherAIImageModel = class {
|
|
36
|
-
constructor(modelId,
|
|
36
|
+
constructor(modelId, config) {
|
|
37
37
|
this.modelId = modelId;
|
|
38
|
-
this.settings = settings;
|
|
39
38
|
this.config = config;
|
|
40
|
-
this.specificationVersion = "
|
|
39
|
+
this.specificationVersion = "v2";
|
|
40
|
+
this.maxImagesPerCall = 1;
|
|
41
41
|
}
|
|
42
42
|
get provider() {
|
|
43
43
|
return this.config.provider;
|
|
44
44
|
}
|
|
45
|
-
get maxImagesPerCall() {
|
|
46
|
-
var _a;
|
|
47
|
-
return (_a = this.settings.maxImagesPerCall) != null ? _a : 1;
|
|
48
|
-
}
|
|
49
45
|
async doGenerate({
|
|
50
46
|
prompt,
|
|
51
47
|
n,
|
|
@@ -102,16 +98,16 @@ var TogetherAIImageModel = class {
|
|
|
102
98
|
};
|
|
103
99
|
}
|
|
104
100
|
};
|
|
105
|
-
var togetheraiImageResponseSchema =
|
|
106
|
-
data:
|
|
107
|
-
|
|
108
|
-
b64_json:
|
|
101
|
+
var togetheraiImageResponseSchema = import_v4.z.object({
|
|
102
|
+
data: import_v4.z.array(
|
|
103
|
+
import_v4.z.object({
|
|
104
|
+
b64_json: import_v4.z.string()
|
|
109
105
|
})
|
|
110
106
|
)
|
|
111
107
|
});
|
|
112
|
-
var togetheraiErrorSchema =
|
|
113
|
-
error:
|
|
114
|
-
message:
|
|
108
|
+
var togetheraiErrorSchema = import_v4.z.object({
|
|
109
|
+
error: import_v4.z.object({
|
|
110
|
+
message: import_v4.z.string()
|
|
115
111
|
})
|
|
116
112
|
});
|
|
117
113
|
|
|
@@ -149,7 +145,7 @@ function createTogetherAI(options = {}) {
|
|
|
149
145
|
modelId,
|
|
150
146
|
getCommonModelConfig("embedding")
|
|
151
147
|
);
|
|
152
|
-
const createImageModel = (modelId
|
|
148
|
+
const createImageModel = (modelId) => new TogetherAIImageModel(modelId, {
|
|
153
149
|
...getCommonModelConfig("image"),
|
|
154
150
|
baseURL: baseURL != null ? baseURL : "https://api.together.xyz/v1/"
|
|
155
151
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/togetherai-provider.ts","../src/togetherai-image-model.ts"],"sourcesContent":["export { createTogetherAI, togetherai } from './togetherai-provider';\nexport type {\n TogetherAIProvider,\n TogetherAIProviderSettings,\n} from './togetherai-provider';\nexport type { OpenAICompatibleErrorData as TogetherAIErrorData } from '@ai-sdk/openai-compatible';\n","import {\n LanguageModelV2,\n EmbeddingModelV2,\n ProviderV2,\n ImageModelV1,\n} from '@ai-sdk/provider';\nimport {\n OpenAICompatibleChatLanguageModel,\n OpenAICompatibleCompletionLanguageModel,\n OpenAICompatibleEmbeddingModel,\n} from '@ai-sdk/openai-compatible';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n} from '@ai-sdk/provider-utils';\nimport { TogetherAIChatModelId } from './togetherai-chat-settings';\nimport { TogetherAIEmbeddingModelId } from './togetherai-embedding-settings';\nimport { TogetherAICompletionModelId } from './togetherai-completion-settings';\nimport { TogetherAIImageModel } from './togetherai-image-model';\nimport {\n TogetherAIImageModelId,\n TogetherAIImageSettings,\n} from './togetherai-image-settings';\n\nexport interface TogetherAIProviderSettings {\n /**\nTogetherAI API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface TogetherAIProvider extends ProviderV2 {\n /**\nCreates a model for text generation.\n*/\n (modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n chatModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n languageModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a completion model for text generation.\n*/\n completionModel(modelId: TogetherAICompletionModelId): LanguageModelV2;\n\n /**\nCreates a text embedding model for text generation.\n*/\n textEmbeddingModel(\n modelId: TogetherAIEmbeddingModelId,\n ): EmbeddingModelV2<string>;\n\n /**\n Creates a model for image generation.\n */\n image(\n modelId: TogetherAIImageModelId,\n settings?: TogetherAIImageSettings,\n ): ImageModelV1;\n\n /**\n Creates a model for image generation.\n */\n imageModel(modelId: TogetherAIImageModelId): ImageModelV1;\n}\n\nexport function createTogetherAI(\n options: TogetherAIProviderSettings = {},\n): TogetherAIProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.together.xyz/v1/',\n );\n const getHeaders = () => ({\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'TOGETHER_AI_API_KEY',\n description: 'TogetherAI',\n })}`,\n ...options.headers,\n });\n\n interface CommonModelConfig {\n provider: string;\n url: ({ path }: { path: string }) => string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n }\n\n const getCommonModelConfig = (modelType: string): CommonModelConfig => ({\n provider: `togetherai.${modelType}`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createChatModel = (modelId: TogetherAIChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(\n modelId,\n getCommonModelConfig('chat'),\n );\n };\n\n const createCompletionModel = (modelId: TogetherAICompletionModelId) =>\n new OpenAICompatibleCompletionLanguageModel(\n modelId,\n getCommonModelConfig('completion'),\n );\n\n const createTextEmbeddingModel = (modelId: TogetherAIEmbeddingModelId) =>\n new OpenAICompatibleEmbeddingModel(\n modelId,\n getCommonModelConfig('embedding'),\n );\n\n const createImageModel = (\n modelId: TogetherAIImageModelId,\n settings: TogetherAIImageSettings = {},\n ) =>\n new TogetherAIImageModel(modelId, settings, {\n ...getCommonModelConfig('image'),\n baseURL: baseURL ?? 'https://api.together.xyz/v1/',\n });\n\n const provider = (modelId: TogetherAIChatModelId) => createChatModel(modelId);\n\n provider.completionModel = createCompletionModel;\n provider.languageModel = createChatModel;\n provider.chatModel = createChatModel;\n provider.textEmbeddingModel = createTextEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n\n return provider;\n}\n\nexport const togetherai = createTogetherAI();\n","import { ImageModelV1, ImageModelV1CallWarning } from '@ai-sdk/provider';\nimport {\n combineHeaders,\n createJsonResponseHandler,\n createJsonErrorResponseHandler,\n FetchFunction,\n postJsonToApi,\n} from '@ai-sdk/provider-utils';\nimport {\n TogetherAIImageModelId,\n TogetherAIImageSettings,\n} from './togetherai-image-settings';\nimport { z } from 'zod';\n\ninterface TogetherAIImageModelConfig {\n provider: string;\n baseURL: string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n _internal?: {\n currentDate?: () => Date;\n };\n}\n\nexport class TogetherAIImageModel implements ImageModelV1 {\n readonly specificationVersion = 'v1';\n\n get provider(): string {\n return this.config.provider;\n }\n\n get maxImagesPerCall(): number {\n return this.settings.maxImagesPerCall ?? 1;\n }\n\n constructor(\n readonly modelId: TogetherAIImageModelId,\n readonly settings: TogetherAIImageSettings,\n private config: TogetherAIImageModelConfig,\n ) {}\n\n async doGenerate({\n prompt,\n n,\n size,\n seed,\n providerOptions,\n headers,\n abortSignal,\n }: Parameters<ImageModelV1['doGenerate']>[0]): Promise<\n Awaited<ReturnType<ImageModelV1['doGenerate']>>\n > {\n const warnings: Array<ImageModelV1CallWarning> = [];\n\n if (size != null) {\n warnings.push({\n type: 'unsupported-setting',\n setting: 'aspectRatio',\n details:\n 'This model does not support the `aspectRatio` option. Use `size` instead.',\n });\n }\n\n const currentDate = this.config._internal?.currentDate?.() ?? new Date();\n const splitSize = size?.split('x');\n // https://docs.together.ai/reference/post_images-generations\n const { value: response, responseHeaders } = await postJsonToApi({\n url: `${this.config.baseURL}/images/generations`,\n headers: combineHeaders(this.config.headers(), headers),\n body: {\n model: this.modelId,\n prompt,\n seed,\n n,\n ...(splitSize && {\n width: parseInt(splitSize[0]),\n height: parseInt(splitSize[1]),\n }),\n response_format: 'base64',\n ...(providerOptions.togetherai ?? {}),\n },\n failedResponseHandler: createJsonErrorResponseHandler({\n errorSchema: togetheraiErrorSchema,\n errorToMessage: data => data.error.message,\n }),\n successfulResponseHandler: createJsonResponseHandler(\n togetheraiImageResponseSchema,\n ),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n return {\n images: response.data.map(item => item.b64_json),\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n}\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiImageResponseSchema = z.object({\n data: z.array(\n z.object({\n b64_json: z.string(),\n }),\n ),\n});\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiErrorSchema = z.object({\n error: z.object({\n message: z.string(),\n }),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,+BAIO;AACP,IAAAA,yBAIO;;;ACdP,4BAMO;AAKP,iBAAkB;AAYX,IAAM,uBAAN,MAAmD;AAAA,EAWxD,YACW,SACA,UACD,QACR;AAHS;AACA;AACD;AAbV,SAAS,uBAAuB;AAAA,EAc7B;AAAA,EAZH,IAAI,WAAmB;AACrB,WAAO,KAAK,OAAO;AAAA,E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AAW;AAAA,EACtB,CAAC;AAEH,QAAM,WAAW,CAAC,YAAmC,gBAAgB,OAAO;AAE5E,WAAS,kBAAkB;AAC3B,WAAS,gBAAgB;AACzB,WAAS,YAAY;AACrB,WAAS,qBAAqB;AAC9B,WAAS,QAAQ;AACjB,WAAS,aAAa;AAEtB,SAAO;AACT;AAEO,IAAM,aAAa,iBAAiB;","names":["import_provider_utils"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/togetherai-provider.ts","../src/togetherai-image-model.ts"],"sourcesContent":["export { createTogetherAI, togetherai } from './togetherai-provider';\nexport type {\n TogetherAIProvider,\n TogetherAIProviderSettings,\n} from './togetherai-provider';\nexport type { OpenAICompatibleErrorData as TogetherAIErrorData } from '@ai-sdk/openai-compatible';\n","import {\n LanguageModelV2,\n EmbeddingModelV2,\n ProviderV2,\n ImageModelV2,\n} from '@ai-sdk/provider';\nimport {\n OpenAICompatibleChatLanguageModel,\n OpenAICompatibleCompletionLanguageModel,\n OpenAICompatibleEmbeddingModel,\n} from '@ai-sdk/openai-compatible';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n} from '@ai-sdk/provider-utils';\nimport { TogetherAIChatModelId } from './togetherai-chat-options';\nimport { TogetherAIEmbeddingModelId } from './togetherai-embedding-options';\nimport { TogetherAICompletionModelId } from './togetherai-completion-options';\nimport { TogetherAIImageModel } from './togetherai-image-model';\nimport { TogetherAIImageModelId } from './togetherai-image-settings';\n\nexport interface TogetherAIProviderSettings {\n /**\nTogetherAI API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface TogetherAIProvider extends ProviderV2 {\n /**\nCreates a model for text generation.\n*/\n (modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n chatModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n languageModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a completion model for text generation.\n*/\n completionModel(modelId: TogetherAICompletionModelId): LanguageModelV2;\n\n /**\nCreates a text embedding model for text generation.\n*/\n textEmbeddingModel(\n modelId: TogetherAIEmbeddingModelId,\n ): EmbeddingModelV2<string>;\n\n /**\nCreates a model for image generation.\n*/\n image(modelId: TogetherAIImageModelId): ImageModelV2;\n\n /**\nCreates a model for image generation.\n*/\n imageModel(modelId: TogetherAIImageModelId): ImageModelV2;\n}\n\nexport function createTogetherAI(\n options: TogetherAIProviderSettings = {},\n): TogetherAIProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.together.xyz/v1/',\n );\n const getHeaders = () => ({\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'TOGETHER_AI_API_KEY',\n description: 'TogetherAI',\n })}`,\n ...options.headers,\n });\n\n interface CommonModelConfig {\n provider: string;\n url: ({ path }: { path: string }) => string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n }\n\n const getCommonModelConfig = (modelType: string): CommonModelConfig => ({\n provider: `togetherai.${modelType}`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createChatModel = (modelId: TogetherAIChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(\n modelId,\n getCommonModelConfig('chat'),\n );\n };\n\n const createCompletionModel = (modelId: TogetherAICompletionModelId) =>\n new OpenAICompatibleCompletionLanguageModel(\n modelId,\n getCommonModelConfig('completion'),\n );\n\n const createTextEmbeddingModel = (modelId: TogetherAIEmbeddingModelId) =>\n new OpenAICompatibleEmbeddingModel(\n modelId,\n getCommonModelConfig('embedding'),\n );\n\n const createImageModel = (modelId: TogetherAIImageModelId) =>\n new TogetherAIImageModel(modelId, {\n ...getCommonModelConfig('image'),\n baseURL: baseURL ?? 'https://api.together.xyz/v1/',\n });\n\n const provider = (modelId: TogetherAIChatModelId) => createChatModel(modelId);\n\n provider.completionModel = createCompletionModel;\n provider.languageModel = createChatModel;\n provider.chatModel = createChatModel;\n provider.textEmbeddingModel = createTextEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n\n return provider;\n}\n\nexport const togetherai = createTogetherAI();\n","import { ImageModelV2, ImageModelV2CallWarning } from '@ai-sdk/provider';\nimport {\n combineHeaders,\n createJsonResponseHandler,\n createJsonErrorResponseHandler,\n FetchFunction,\n postJsonToApi,\n} from '@ai-sdk/provider-utils';\nimport { TogetherAIImageModelId } from './togetherai-image-settings';\nimport { z } from 'zod/v4';\n\ninterface TogetherAIImageModelConfig {\n provider: string;\n baseURL: string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n _internal?: {\n currentDate?: () => Date;\n };\n}\n\nexport class TogetherAIImageModel implements ImageModelV2 {\n readonly specificationVersion = 'v2';\n readonly maxImagesPerCall = 1;\n\n get provider(): string {\n return this.config.provider;\n }\n\n constructor(\n readonly modelId: TogetherAIImageModelId,\n private config: TogetherAIImageModelConfig,\n ) {}\n\n async doGenerate({\n prompt,\n n,\n size,\n seed,\n providerOptions,\n headers,\n abortSignal,\n }: Parameters<ImageModelV2['doGenerate']>[0]): Promise<\n Awaited<ReturnType<ImageModelV2['doGenerate']>>\n > {\n const warnings: Array<ImageModelV2CallWarning> = [];\n\n if (size != null) {\n warnings.push({\n type: 'unsupported-setting',\n setting: 'aspectRatio',\n details:\n 'This model does not support the `aspectRatio` option. Use `size` instead.',\n });\n }\n\n const currentDate = this.config._internal?.currentDate?.() ?? new Date();\n const splitSize = size?.split('x');\n // https://docs.together.ai/reference/post_images-generations\n const { value: response, responseHeaders } = await postJsonToApi({\n url: `${this.config.baseURL}/images/generations`,\n headers: combineHeaders(this.config.headers(), headers),\n body: {\n model: this.modelId,\n prompt,\n seed,\n n,\n ...(splitSize && {\n width: parseInt(splitSize[0]),\n height: parseInt(splitSize[1]),\n }),\n response_format: 'base64',\n ...(providerOptions.togetherai ?? {}),\n },\n failedResponseHandler: createJsonErrorResponseHandler({\n errorSchema: togetheraiErrorSchema,\n errorToMessage: data => data.error.message,\n }),\n successfulResponseHandler: createJsonResponseHandler(\n togetheraiImageResponseSchema,\n ),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n return {\n images: response.data.map(item => item.b64_json),\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n}\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiImageResponseSchema = z.object({\n data: z.array(\n z.object({\n b64_json: z.string(),\n }),\n ),\n});\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiErrorSchema = z.object({\n error: z.object({\n message: z.string(),\n }),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,+BAIO;AACP,IAAAA,yBAIO;;;ACdP,4BAMO;AAEP,gBAAkB;AAYX,IAAM,uBAAN,MAAmD;AAAA,EAQxD,YACW,SACD,QACR;AAFS;AACD;AATV,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAAA,EASzB;AAAA,EAPH,IAAI,WAAmB;AACrB,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAOA,MAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAEE;AA5CJ;AA6CI,UAAM,WAA2C,CAAC;AAElD,QAAI,QAAQ,MAAM;AAChB,eAAS,KAAK;AAAA,QACZ,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SACE;AAAA,MACJ,CAAC;AAAA,IACH;AAEA,UAAM,eAAc,sBAAK,OAAO,cAAZ,mBAAuB,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,KACd,aAAQ,YAAR,YAAmB;AAAA,EACrB;AACA,QAAM,aAAa,OAAO;AAAA,IACxB,eAAe,cAAU,mCAAW;AAAA,MAClC,QAAQ,QAAQ;AAAA,MAChB,yBAAyB;AAAA,MACzB,aAAa;AAAA,IACf,CAAC,CAAC;AAAA,IACF,GAAG,QAAQ;AAAA,EACb;AASA,QAAM,uBAAuB,CAAC,eAA0C;AAAA,IACtE,UAAU,cAAc,SAAS;AAAA,IACjC,KAAK,CAAC,EAAE,KAAK,MAAM,GAAG,OAAO,GAAG,IAAI;AAAA,IACpC,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,EACjB;AAEA,QAAM,kBAAkB,CAAC,YAAmC;AAC1D,WAAO,IAAI;AAAA,MACT;AAAA,MACA,qBAAqB,MAAM;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,wBAAwB,CAAC,YAC7B,IAAI;AAAA,IACF;AAAA,IACA,qBAAqB,YAAY;AAAA,EACnC;AAEF,QAAM,2BAA2B,CAAC,YAChC,IAAI;AAAA,IACF;AAAA,IACA,qBAAqB,WAAW;AAAA,EAClC;AAEF,QAAM,mBAAmB,CAAC,YACxB,IAAI,qBAAqB,SAAS;AAAA,IAChC,GAAG,qBAAqB,OAAO;AAAA,IAC/B,SAAS,4BAAW;AAAA,EACtB,CAAC;AAEH,QAAM,WAAW,CAAC,YAAmC,gBAAgB,OAAO;AAE5E,WAAS,kBAAkB;AAC3B,WAAS,gBAAgB;AACzB,WAAS,YAAY;AACrB,WAAS,qBAAqB;AAC9B,WAAS,QAAQ;AACjB,WAAS,aAAa;AAEtB,SAAO;AACT;AAEO,IAAM,aAAa,iBAAiB;","names":["import_provider_utils"]}
|
package/dist/index.mjs
CHANGED
|
@@ -16,21 +16,17 @@ import {
|
|
|
16
16
|
createJsonErrorResponseHandler,
|
|
17
17
|
postJsonToApi
|
|
18
18
|
} from "@ai-sdk/provider-utils";
|
|
19
|
-
import { z } from "zod";
|
|
19
|
+
import { z } from "zod/v4";
|
|
20
20
|
var TogetherAIImageModel = class {
|
|
21
|
-
constructor(modelId,
|
|
21
|
+
constructor(modelId, config) {
|
|
22
22
|
this.modelId = modelId;
|
|
23
|
-
this.settings = settings;
|
|
24
23
|
this.config = config;
|
|
25
|
-
this.specificationVersion = "
|
|
24
|
+
this.specificationVersion = "v2";
|
|
25
|
+
this.maxImagesPerCall = 1;
|
|
26
26
|
}
|
|
27
27
|
get provider() {
|
|
28
28
|
return this.config.provider;
|
|
29
29
|
}
|
|
30
|
-
get maxImagesPerCall() {
|
|
31
|
-
var _a;
|
|
32
|
-
return (_a = this.settings.maxImagesPerCall) != null ? _a : 1;
|
|
33
|
-
}
|
|
34
30
|
async doGenerate({
|
|
35
31
|
prompt,
|
|
36
32
|
n,
|
|
@@ -134,7 +130,7 @@ function createTogetherAI(options = {}) {
|
|
|
134
130
|
modelId,
|
|
135
131
|
getCommonModelConfig("embedding")
|
|
136
132
|
);
|
|
137
|
-
const createImageModel = (modelId
|
|
133
|
+
const createImageModel = (modelId) => new TogetherAIImageModel(modelId, {
|
|
138
134
|
...getCommonModelConfig("image"),
|
|
139
135
|
baseURL: baseURL != null ? baseURL : "https://api.together.xyz/v1/"
|
|
140
136
|
});
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/togetherai-provider.ts","../src/togetherai-image-model.ts"],"sourcesContent":["import {\n LanguageModelV2,\n EmbeddingModelV2,\n ProviderV2,\n ImageModelV1,\n} from '@ai-sdk/provider';\nimport {\n OpenAICompatibleChatLanguageModel,\n OpenAICompatibleCompletionLanguageModel,\n OpenAICompatibleEmbeddingModel,\n} from '@ai-sdk/openai-compatible';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n} from '@ai-sdk/provider-utils';\nimport { TogetherAIChatModelId } from './togetherai-chat-settings';\nimport { TogetherAIEmbeddingModelId } from './togetherai-embedding-settings';\nimport { TogetherAICompletionModelId } from './togetherai-completion-settings';\nimport { TogetherAIImageModel } from './togetherai-image-model';\nimport {\n TogetherAIImageModelId,\n TogetherAIImageSettings,\n} from './togetherai-image-settings';\n\nexport interface TogetherAIProviderSettings {\n /**\nTogetherAI API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface TogetherAIProvider extends ProviderV2 {\n /**\nCreates a model for text generation.\n*/\n (modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n chatModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n languageModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a completion model for text generation.\n*/\n completionModel(modelId: TogetherAICompletionModelId): LanguageModelV2;\n\n /**\nCreates a text embedding model for text generation.\n*/\n textEmbeddingModel(\n modelId: TogetherAIEmbeddingModelId,\n ): EmbeddingModelV2<string>;\n\n /**\n Creates a model for image generation.\n */\n image(\n modelId: TogetherAIImageModelId,\n settings?: TogetherAIImageSettings,\n ): ImageModelV1;\n\n /**\n Creates a model for image generation.\n */\n imageModel(modelId: TogetherAIImageModelId): ImageModelV1;\n}\n\nexport function createTogetherAI(\n options: TogetherAIProviderSettings = {},\n): TogetherAIProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.together.xyz/v1/',\n );\n const getHeaders = () => ({\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'TOGETHER_AI_API_KEY',\n description: 'TogetherAI',\n })}`,\n ...options.headers,\n });\n\n interface CommonModelConfig {\n provider: string;\n url: ({ path }: { path: string }) => string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n }\n\n const getCommonModelConfig = (modelType: string): CommonModelConfig => ({\n provider: `togetherai.${modelType}`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createChatModel = (modelId: TogetherAIChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(\n modelId,\n getCommonModelConfig('chat'),\n );\n };\n\n const createCompletionModel = (modelId: TogetherAICompletionModelId) =>\n new OpenAICompatibleCompletionLanguageModel(\n modelId,\n getCommonModelConfig('completion'),\n );\n\n const createTextEmbeddingModel = (modelId: TogetherAIEmbeddingModelId) =>\n new OpenAICompatibleEmbeddingModel(\n modelId,\n getCommonModelConfig('embedding'),\n );\n\n const createImageModel = (\n modelId: TogetherAIImageModelId,\n settings: TogetherAIImageSettings = {},\n ) =>\n new TogetherAIImageModel(modelId, settings, {\n ...getCommonModelConfig('image'),\n baseURL: baseURL ?? 'https://api.together.xyz/v1/',\n });\n\n const provider = (modelId: TogetherAIChatModelId) => createChatModel(modelId);\n\n provider.completionModel = createCompletionModel;\n provider.languageModel = createChatModel;\n provider.chatModel = createChatModel;\n provider.textEmbeddingModel = createTextEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n\n return provider;\n}\n\nexport const togetherai = createTogetherAI();\n","import { ImageModelV1, ImageModelV1CallWarning } from '@ai-sdk/provider';\nimport {\n combineHeaders,\n createJsonResponseHandler,\n createJsonErrorResponseHandler,\n FetchFunction,\n postJsonToApi,\n} from '@ai-sdk/provider-utils';\nimport {\n TogetherAIImageModelId,\n TogetherAIImageSettings,\n} from './togetherai-image-settings';\nimport { z } from 'zod';\n\ninterface TogetherAIImageModelConfig {\n provider: string;\n baseURL: string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n _internal?: {\n currentDate?: () => Date;\n };\n}\n\nexport class TogetherAIImageModel implements ImageModelV1 {\n readonly specificationVersion = 'v1';\n\n get provider(): string {\n return this.config.provider;\n }\n\n get maxImagesPerCall(): number {\n return this.settings.maxImagesPerCall ?? 1;\n }\n\n constructor(\n readonly modelId: TogetherAIImageModelId,\n readonly settings: TogetherAIImageSettings,\n private config: TogetherAIImageModelConfig,\n ) {}\n\n async doGenerate({\n prompt,\n n,\n size,\n seed,\n providerOptions,\n headers,\n abortSignal,\n }: Parameters<ImageModelV1['doGenerate']>[0]): Promise<\n Awaited<ReturnType<ImageModelV1['doGenerate']>>\n > {\n const warnings: Array<ImageModelV1CallWarning> = [];\n\n if (size != null) {\n warnings.push({\n type: 'unsupported-setting',\n setting: 'aspectRatio',\n details:\n 'This model does not support the `aspectRatio` option. Use `size` instead.',\n });\n }\n\n const currentDate = this.config._internal?.currentDate?.() ?? new Date();\n const splitSize = size?.split('x');\n // https://docs.together.ai/reference/post_images-generations\n const { value: response, responseHeaders } = await postJsonToApi({\n url: `${this.config.baseURL}/images/generations`,\n headers: combineHeaders(this.config.headers(), headers),\n body: {\n model: this.modelId,\n prompt,\n seed,\n n,\n ...(splitSize && {\n width: parseInt(splitSize[0]),\n height: parseInt(splitSize[1]),\n }),\n response_format: 'base64',\n ...(providerOptions.togetherai ?? {}),\n },\n failedResponseHandler: createJsonErrorResponseHandler({\n errorSchema: togetheraiErrorSchema,\n errorToMessage: data => data.error.message,\n }),\n successfulResponseHandler: createJsonResponseHandler(\n togetheraiImageResponseSchema,\n ),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n return {\n images: response.data.map(item => item.b64_json),\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n}\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiImageResponseSchema = z.object({\n data: z.array(\n z.object({\n b64_json: z.string(),\n }),\n ),\n});\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiErrorSchema = z.object({\n error: z.object({\n message: z.string(),\n }),\n});\n"],"mappings":";AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EAEE;AAAA,EAC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AAAA,IACA,qBAAqB,YAAY;AAAA,EACnC;AAEF,QAAM,2BAA2B,CAAC,YAChC,IAAI;AAAA,IACF;AAAA,IACA,qBAAqB,WAAW;AAAA,EAClC;AAEF,QAAM,mBAAmB,CACvB,SACA,WAAoC,CAAC,MAErC,IAAI,qBAAqB,SAAS,UAAU;AAAA,IAC1C,GAAG,qBAAqB,OAAO;AAAA,IAC/B,SAAS,4BAAW;AAAA,EACtB,CAAC;AAEH,QAAM,WAAW,CAAC,YAAmC,gBAAgB,OAAO;AAE5E,WAAS,kBAAkB;AAC3B,WAAS,gBAAgB;AACzB,WAAS,YAAY;AACrB,WAAS,qBAAqB;AAC9B,WAAS,QAAQ;AACjB,WAAS,aAAa;AAEtB,SAAO;AACT;AAEO,IAAM,aAAa,iBAAiB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/togetherai-provider.ts","../src/togetherai-image-model.ts"],"sourcesContent":["import {\n LanguageModelV2,\n EmbeddingModelV2,\n ProviderV2,\n ImageModelV2,\n} from '@ai-sdk/provider';\nimport {\n OpenAICompatibleChatLanguageModel,\n OpenAICompatibleCompletionLanguageModel,\n OpenAICompatibleEmbeddingModel,\n} from '@ai-sdk/openai-compatible';\nimport {\n FetchFunction,\n loadApiKey,\n withoutTrailingSlash,\n} from '@ai-sdk/provider-utils';\nimport { TogetherAIChatModelId } from './togetherai-chat-options';\nimport { TogetherAIEmbeddingModelId } from './togetherai-embedding-options';\nimport { TogetherAICompletionModelId } from './togetherai-completion-options';\nimport { TogetherAIImageModel } from './togetherai-image-model';\nimport { TogetherAIImageModelId } from './togetherai-image-settings';\n\nexport interface TogetherAIProviderSettings {\n /**\nTogetherAI API key.\n*/\n apiKey?: string;\n /**\nBase URL for the API calls.\n*/\n baseURL?: string;\n /**\nCustom headers to include in the requests.\n*/\n headers?: Record<string, string>;\n /**\nCustom fetch implementation. You can use it as a middleware to intercept requests,\nor to provide a custom fetch implementation for e.g. testing.\n*/\n fetch?: FetchFunction;\n}\n\nexport interface TogetherAIProvider extends ProviderV2 {\n /**\nCreates a model for text generation.\n*/\n (modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n chatModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a chat model for text generation.\n*/\n languageModel(modelId: TogetherAIChatModelId): LanguageModelV2;\n\n /**\nCreates a completion model for text generation.\n*/\n completionModel(modelId: TogetherAICompletionModelId): LanguageModelV2;\n\n /**\nCreates a text embedding model for text generation.\n*/\n textEmbeddingModel(\n modelId: TogetherAIEmbeddingModelId,\n ): EmbeddingModelV2<string>;\n\n /**\nCreates a model for image generation.\n*/\n image(modelId: TogetherAIImageModelId): ImageModelV2;\n\n /**\nCreates a model for image generation.\n*/\n imageModel(modelId: TogetherAIImageModelId): ImageModelV2;\n}\n\nexport function createTogetherAI(\n options: TogetherAIProviderSettings = {},\n): TogetherAIProvider {\n const baseURL = withoutTrailingSlash(\n options.baseURL ?? 'https://api.together.xyz/v1/',\n );\n const getHeaders = () => ({\n Authorization: `Bearer ${loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'TOGETHER_AI_API_KEY',\n description: 'TogetherAI',\n })}`,\n ...options.headers,\n });\n\n interface CommonModelConfig {\n provider: string;\n url: ({ path }: { path: string }) => string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n }\n\n const getCommonModelConfig = (modelType: string): CommonModelConfig => ({\n provider: `togetherai.${modelType}`,\n url: ({ path }) => `${baseURL}${path}`,\n headers: getHeaders,\n fetch: options.fetch,\n });\n\n const createChatModel = (modelId: TogetherAIChatModelId) => {\n return new OpenAICompatibleChatLanguageModel(\n modelId,\n getCommonModelConfig('chat'),\n );\n };\n\n const createCompletionModel = (modelId: TogetherAICompletionModelId) =>\n new OpenAICompatibleCompletionLanguageModel(\n modelId,\n getCommonModelConfig('completion'),\n );\n\n const createTextEmbeddingModel = (modelId: TogetherAIEmbeddingModelId) =>\n new OpenAICompatibleEmbeddingModel(\n modelId,\n getCommonModelConfig('embedding'),\n );\n\n const createImageModel = (modelId: TogetherAIImageModelId) =>\n new TogetherAIImageModel(modelId, {\n ...getCommonModelConfig('image'),\n baseURL: baseURL ?? 'https://api.together.xyz/v1/',\n });\n\n const provider = (modelId: TogetherAIChatModelId) => createChatModel(modelId);\n\n provider.completionModel = createCompletionModel;\n provider.languageModel = createChatModel;\n provider.chatModel = createChatModel;\n provider.textEmbeddingModel = createTextEmbeddingModel;\n provider.image = createImageModel;\n provider.imageModel = createImageModel;\n\n return provider;\n}\n\nexport const togetherai = createTogetherAI();\n","import { ImageModelV2, ImageModelV2CallWarning } from '@ai-sdk/provider';\nimport {\n combineHeaders,\n createJsonResponseHandler,\n createJsonErrorResponseHandler,\n FetchFunction,\n postJsonToApi,\n} from '@ai-sdk/provider-utils';\nimport { TogetherAIImageModelId } from './togetherai-image-settings';\nimport { z } from 'zod/v4';\n\ninterface TogetherAIImageModelConfig {\n provider: string;\n baseURL: string;\n headers: () => Record<string, string>;\n fetch?: FetchFunction;\n _internal?: {\n currentDate?: () => Date;\n };\n}\n\nexport class TogetherAIImageModel implements ImageModelV2 {\n readonly specificationVersion = 'v2';\n readonly maxImagesPerCall = 1;\n\n get provider(): string {\n return this.config.provider;\n }\n\n constructor(\n readonly modelId: TogetherAIImageModelId,\n private config: TogetherAIImageModelConfig,\n ) {}\n\n async doGenerate({\n prompt,\n n,\n size,\n seed,\n providerOptions,\n headers,\n abortSignal,\n }: Parameters<ImageModelV2['doGenerate']>[0]): Promise<\n Awaited<ReturnType<ImageModelV2['doGenerate']>>\n > {\n const warnings: Array<ImageModelV2CallWarning> = [];\n\n if (size != null) {\n warnings.push({\n type: 'unsupported-setting',\n setting: 'aspectRatio',\n details:\n 'This model does not support the `aspectRatio` option. Use `size` instead.',\n });\n }\n\n const currentDate = this.config._internal?.currentDate?.() ?? new Date();\n const splitSize = size?.split('x');\n // https://docs.together.ai/reference/post_images-generations\n const { value: response, responseHeaders } = await postJsonToApi({\n url: `${this.config.baseURL}/images/generations`,\n headers: combineHeaders(this.config.headers(), headers),\n body: {\n model: this.modelId,\n prompt,\n seed,\n n,\n ...(splitSize && {\n width: parseInt(splitSize[0]),\n height: parseInt(splitSize[1]),\n }),\n response_format: 'base64',\n ...(providerOptions.togetherai ?? {}),\n },\n failedResponseHandler: createJsonErrorResponseHandler({\n errorSchema: togetheraiErrorSchema,\n errorToMessage: data => data.error.message,\n }),\n successfulResponseHandler: createJsonResponseHandler(\n togetheraiImageResponseSchema,\n ),\n abortSignal,\n fetch: this.config.fetch,\n });\n\n return {\n images: response.data.map(item => item.b64_json),\n warnings,\n response: {\n timestamp: currentDate,\n modelId: this.modelId,\n headers: responseHeaders,\n },\n };\n }\n}\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiImageResponseSchema = z.object({\n data: z.array(\n z.object({\n b64_json: z.string(),\n }),\n ),\n});\n\n// limited version of the schema, focussed on what is needed for the implementation\n// this approach limits breakages when the API changes and increases efficiency\nconst togetheraiErrorSchema = z.object({\n error: z.object({\n message: z.string(),\n }),\n});\n"],"mappings":";AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,OACK;;;ACdP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,SAAS;AAYX,IAAM,uBAAN,MAAmD;AAAA,EAQxD,YACW,SACD,QACR;AAFS;AACD;AATV,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAAA,EASzB;AAAA,EAPH,IAAI,WAAmB;AACrB,WAAO,KAAK,OAAO;AAAA,EACrB;AAAA,EAOA,MAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAEE;AA5CJ;AA6CI,UAAM,WAA2C,CAAC;AAElD,QAAI,QAAQ,MAAM;AAChB,eA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|
"name": "@ai-sdk/togetherai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@ai-sdk/openai-compatible": "1.0.
|
|
23
|
-
"@ai-sdk/provider": "2.0.0
|
|
24
|
-
"@ai-sdk/provider-utils": "3.0.0
|
|
22
|
+
"@ai-sdk/openai-compatible": "1.0.1",
|
|
23
|
+
"@ai-sdk/provider": "2.0.0",
|
|
24
|
+
"@ai-sdk/provider-utils": "3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "20.17.24",
|
|
28
28
|
"tsup": "^8",
|
|
29
29
|
"typescript": "5.8.3",
|
|
30
|
-
"zod": "3.
|
|
30
|
+
"zod": "3.25.76",
|
|
31
31
|
"@vercel/ai-tsconfig": "0.0.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"zod": "^3.
|
|
34
|
+
"zod": "^3.25.76 || ^4"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=18"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"homepage": "https://sdk.
|
|
42
|
+
"homepage": "https://ai-sdk.dev/docs",
|
|
43
43
|
"repository": {
|
|
44
44
|
"type": "git",
|
|
45
45
|
"url": "git+https://github.com/vercel/ai.git"
|