@xsai-ext/providers 0.4.0-beta.9 → 0.4.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/dist/anthropic-Bel15KQV.d.ts +111 -0
- package/dist/create.d.ts +201 -208
- package/dist/create.js +2 -42
- package/dist/index.d.ts +327 -237
- package/dist/index.js +51 -40
- package/dist/player2-D788vRq_.js +47 -0
- package/dist/special/create.d.ts +66 -0
- package/dist/special/create.js +37 -0
- package/dist/special/index.d.ts +12 -0
- package/dist/special/index.js +6 -0
- package/dist/{together-ai-DXREpfi4.js → together-ai-CzFuvpt-.js} +106 -59
- package/dist/types-Czo87gCh.d.ts +7 -0
- package/dist/types-DW1hvH0W.d.ts +38 -0
- package/dist/utils/index.d.ts +52 -0
- package/dist/utils/index.js +37 -0
- package/package.json +16 -4
- package/dist/openrouter-DCc0QhRt.d.ts +0 -104
|
@@ -1,110 +1,148 @@
|
|
|
1
|
-
import { merge,
|
|
1
|
+
import { merge, createModelProvider, createChatProvider, createEmbedProvider, createTranscriptionProvider, createSpeechProvider, createImageProvider, createChatProviderWithExtraOptions } from './utils/index.js';
|
|
2
2
|
import { objCamelToSnake } from '@xsai/shared';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const createAlibaba = (apiKey, baseURL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1") => merge(
|
|
5
5
|
createChatProvider({ apiKey, baseURL }),
|
|
6
6
|
createModelProvider({ apiKey, baseURL })
|
|
7
7
|
);
|
|
8
|
-
const
|
|
8
|
+
const createAlibabaCn = (apiKey, baseURL = "https://dashscope.aliyuncs.com/compatible-mode/v1") => merge(
|
|
9
9
|
createChatProvider({ apiKey, baseURL }),
|
|
10
10
|
createModelProvider({ apiKey, baseURL })
|
|
11
11
|
);
|
|
12
|
-
const
|
|
12
|
+
const createBailing = (apiKey, baseURL = "https://api.tbox.cn/api/llm/v1/chat/completions") => merge(
|
|
13
13
|
createChatProvider({ apiKey, baseURL }),
|
|
14
14
|
createModelProvider({ apiKey, baseURL })
|
|
15
15
|
);
|
|
16
|
-
const
|
|
16
|
+
const createBaseten = (apiKey, baseURL = "https://inference.baseten.co/v1") => merge(
|
|
17
17
|
createChatProvider({ apiKey, baseURL }),
|
|
18
18
|
createModelProvider({ apiKey, baseURL })
|
|
19
19
|
);
|
|
20
|
-
const
|
|
20
|
+
const createCerebras = (apiKey, baseURL = "https://api.cerebras.ai/v1/") => merge(
|
|
21
21
|
createChatProvider({ apiKey, baseURL }),
|
|
22
|
-
createModelProvider({ apiKey, baseURL })
|
|
22
|
+
createModelProvider({ apiKey, baseURL }),
|
|
23
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
23
24
|
);
|
|
24
|
-
const
|
|
25
|
+
const createChutes = (apiKey, baseURL = "https://llm.chutes.ai/v1") => merge(
|
|
25
26
|
createChatProvider({ apiKey, baseURL }),
|
|
26
27
|
createModelProvider({ apiKey, baseURL })
|
|
27
28
|
);
|
|
28
|
-
const
|
|
29
|
+
const createCortecs = (apiKey, baseURL = "https://api.cortecs.ai/v1") => merge(
|
|
29
30
|
createChatProvider({ apiKey, baseURL }),
|
|
30
31
|
createModelProvider({ apiKey, baseURL })
|
|
31
32
|
);
|
|
32
|
-
const
|
|
33
|
+
const createDeepinfra = (apiKey, baseURL = "https://api.deepinfra.com/v1/openai/") => merge(
|
|
34
|
+
createChatProvider({ apiKey, baseURL }),
|
|
35
|
+
createModelProvider({ apiKey, baseURL }),
|
|
36
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
37
|
+
);
|
|
38
|
+
const createDeepSeek = (apiKey, baseURL = "https://api.deepseek.com") => merge(
|
|
33
39
|
createChatProvider({ apiKey, baseURL }),
|
|
34
40
|
createModelProvider({ apiKey, baseURL })
|
|
35
41
|
);
|
|
36
|
-
const
|
|
42
|
+
const createFastrouter = (apiKey, baseURL = "https://go.fastrouter.ai/api/v1") => merge(
|
|
37
43
|
createChatProvider({ apiKey, baseURL }),
|
|
38
44
|
createModelProvider({ apiKey, baseURL })
|
|
39
45
|
);
|
|
40
|
-
const
|
|
46
|
+
const createFireworks = (apiKey, baseURL = "https://api.fireworks.ai/inference/v1/") => merge(
|
|
41
47
|
createChatProvider({ apiKey, baseURL }),
|
|
42
|
-
createModelProvider({ apiKey, baseURL })
|
|
43
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
48
|
+
createModelProvider({ apiKey, baseURL })
|
|
44
49
|
);
|
|
45
50
|
const createGithubCopilot = (apiKey, baseURL = "https://api.githubcopilot.com") => merge(
|
|
46
51
|
createChatProvider({ apiKey, baseURL }),
|
|
47
52
|
createModelProvider({ apiKey, baseURL })
|
|
48
53
|
);
|
|
49
|
-
const
|
|
54
|
+
const createGithubModels = (apiKey, baseURL = "https://models.github.ai/inference") => merge(
|
|
55
|
+
createChatProvider({ apiKey, baseURL }),
|
|
56
|
+
createModelProvider({ apiKey, baseURL })
|
|
57
|
+
);
|
|
58
|
+
const createGoogleGenerativeAI = (apiKey, baseURL = "https://generativelanguage.googleapis.com/v1beta/openai/") => merge(
|
|
50
59
|
createChatProvider({ apiKey, baseURL }),
|
|
51
60
|
createModelProvider({ apiKey, baseURL }),
|
|
52
61
|
createEmbedProvider({ apiKey, baseURL })
|
|
53
62
|
);
|
|
54
|
-
const
|
|
63
|
+
const createGroq = (apiKey, baseURL = "https://api.groq.com/openai/v1/") => merge(
|
|
64
|
+
createChatProvider({ apiKey, baseURL }),
|
|
65
|
+
createModelProvider({ apiKey, baseURL }),
|
|
66
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
67
|
+
);
|
|
68
|
+
const createHelicone = (apiKey, baseURL = "https://ai-gateway.helicone.ai/v1") => merge(
|
|
55
69
|
createChatProvider({ apiKey, baseURL }),
|
|
56
70
|
createModelProvider({ apiKey, baseURL })
|
|
57
71
|
);
|
|
58
|
-
const
|
|
72
|
+
const createHuggingface = (apiKey, baseURL = "https://router.huggingface.co/v1") => merge(
|
|
59
73
|
createChatProvider({ apiKey, baseURL }),
|
|
60
74
|
createModelProvider({ apiKey, baseURL })
|
|
61
75
|
);
|
|
62
|
-
const
|
|
76
|
+
const createIflowcn = (apiKey, baseURL = "https://apis.iflow.cn/v1") => merge(
|
|
63
77
|
createChatProvider({ apiKey, baseURL }),
|
|
64
78
|
createModelProvider({ apiKey, baseURL })
|
|
65
79
|
);
|
|
66
|
-
const
|
|
80
|
+
const createInception = (apiKey, baseURL = "https://api.inceptionlabs.ai/v1/") => merge(
|
|
67
81
|
createChatProvider({ apiKey, baseURL }),
|
|
68
82
|
createModelProvider({ apiKey, baseURL })
|
|
69
83
|
);
|
|
70
|
-
const
|
|
84
|
+
const createInference = (apiKey, baseURL = "https://inference.net/v1") => merge(
|
|
71
85
|
createChatProvider({ apiKey, baseURL }),
|
|
72
86
|
createModelProvider({ apiKey, baseURL })
|
|
73
87
|
);
|
|
74
|
-
const
|
|
88
|
+
const createIoNet = (apiKey, baseURL = "https://api.intelligence.io.solutions/api/v1") => merge(
|
|
75
89
|
createChatProvider({ apiKey, baseURL }),
|
|
76
90
|
createModelProvider({ apiKey, baseURL })
|
|
77
91
|
);
|
|
78
|
-
const
|
|
92
|
+
const createKimiForCoding = (apiKey, baseURL = "https://api.kimi.com/coding/v1") => merge(
|
|
79
93
|
createChatProvider({ apiKey, baseURL }),
|
|
80
94
|
createModelProvider({ apiKey, baseURL })
|
|
81
95
|
);
|
|
82
|
-
const
|
|
96
|
+
const createLlama = (apiKey, baseURL = "https://api.llama.com/compat/v1/") => merge(
|
|
83
97
|
createChatProvider({ apiKey, baseURL }),
|
|
84
98
|
createModelProvider({ apiKey, baseURL })
|
|
85
99
|
);
|
|
86
|
-
const
|
|
100
|
+
const createLmstudio = (apiKey, baseURL = "http://127.0.0.1:1234/v1") => merge(
|
|
87
101
|
createChatProvider({ apiKey, baseURL }),
|
|
88
102
|
createModelProvider({ apiKey, baseURL })
|
|
89
103
|
);
|
|
90
|
-
const
|
|
104
|
+
const createLucidquery = (apiKey, baseURL = "https://lucidquery.com/api/v1") => merge(
|
|
91
105
|
createChatProvider({ apiKey, baseURL }),
|
|
92
106
|
createModelProvider({ apiKey, baseURL })
|
|
93
107
|
);
|
|
94
|
-
const
|
|
108
|
+
const createMinimax = (apiKey, baseURL = "https://api.minimax.io/v1/") => merge(
|
|
95
109
|
createChatProvider({ apiKey, baseURL }),
|
|
96
110
|
createModelProvider({ apiKey, baseURL })
|
|
97
111
|
);
|
|
98
|
-
const
|
|
112
|
+
const createMinimaxCn = (apiKey, baseURL = "https://api.minimaxi.com/v1/") => merge(
|
|
113
|
+
createChatProvider({ apiKey, baseURL }),
|
|
114
|
+
createModelProvider({ apiKey, baseURL })
|
|
115
|
+
);
|
|
116
|
+
const createMistral = (apiKey, baseURL = "https://api.mistral.ai/v1/") => merge(
|
|
99
117
|
createChatProvider({ apiKey, baseURL }),
|
|
100
118
|
createModelProvider({ apiKey, baseURL }),
|
|
101
119
|
createEmbedProvider({ apiKey, baseURL })
|
|
102
120
|
);
|
|
103
|
-
const
|
|
121
|
+
const createModelscope = (apiKey, baseURL = "https://api-inference.modelscope.cn/v1") => merge(
|
|
104
122
|
createChatProvider({ apiKey, baseURL }),
|
|
105
123
|
createModelProvider({ apiKey, baseURL })
|
|
106
124
|
);
|
|
107
|
-
const
|
|
125
|
+
const createMoonshotai = (apiKey, baseURL = "https://api.moonshot.ai/v1") => merge(
|
|
126
|
+
createChatProvider({ apiKey, baseURL }),
|
|
127
|
+
createModelProvider({ apiKey, baseURL })
|
|
128
|
+
);
|
|
129
|
+
const createMoonshotaiCn = (apiKey, baseURL = "https://api.moonshot.cn/v1") => merge(
|
|
130
|
+
createChatProvider({ apiKey, baseURL }),
|
|
131
|
+
createModelProvider({ apiKey, baseURL })
|
|
132
|
+
);
|
|
133
|
+
const createMorph = (apiKey, baseURL = "https://api.morphllm.com/v1") => merge(
|
|
134
|
+
createChatProvider({ apiKey, baseURL }),
|
|
135
|
+
createModelProvider({ apiKey, baseURL })
|
|
136
|
+
);
|
|
137
|
+
const createNebius = (apiKey, baseURL = "https://api.tokenfactory.nebius.com/v1") => merge(
|
|
138
|
+
createChatProvider({ apiKey, baseURL }),
|
|
139
|
+
createModelProvider({ apiKey, baseURL })
|
|
140
|
+
);
|
|
141
|
+
const createNvidia = (apiKey, baseURL = "https://integrate.api.nvidia.com/v1") => merge(
|
|
142
|
+
createChatProvider({ apiKey, baseURL }),
|
|
143
|
+
createModelProvider({ apiKey, baseURL })
|
|
144
|
+
);
|
|
145
|
+
const createOllamaCloud = (apiKey, baseURL = "https://ollama.com/v1") => merge(
|
|
108
146
|
createChatProvider({ apiKey, baseURL }),
|
|
109
147
|
createModelProvider({ apiKey, baseURL })
|
|
110
148
|
);
|
|
@@ -116,7 +154,11 @@ const createOpenAI = (apiKey, baseURL = "https://api.openai.com/v1/") => merge(
|
|
|
116
154
|
createSpeechProvider({ apiKey, baseURL }),
|
|
117
155
|
createTranscriptionProvider({ apiKey, baseURL })
|
|
118
156
|
);
|
|
119
|
-
const
|
|
157
|
+
const createOpencode = (apiKey, baseURL = "https://opencode.ai/zen/v1") => merge(
|
|
158
|
+
createChatProvider({ apiKey, baseURL }),
|
|
159
|
+
createModelProvider({ apiKey, baseURL })
|
|
160
|
+
);
|
|
161
|
+
const createOvhcloud = (apiKey, baseURL = "https://oai.endpoints.kepler.ai.cloud.ovh.net/v1") => merge(
|
|
120
162
|
createChatProvider({ apiKey, baseURL }),
|
|
121
163
|
createModelProvider({ apiKey, baseURL })
|
|
122
164
|
);
|
|
@@ -124,24 +166,26 @@ const createPerplexity = (apiKey, baseURL = "https://api.perplexity.ai/") => mer
|
|
|
124
166
|
createChatProvider({ apiKey, baseURL }),
|
|
125
167
|
createModelProvider({ apiKey, baseURL })
|
|
126
168
|
);
|
|
127
|
-
const
|
|
169
|
+
const createPoe = (apiKey, baseURL = "https://api.poe.com/v1") => merge(
|
|
128
170
|
createChatProvider({ apiKey, baseURL }),
|
|
129
171
|
createModelProvider({ apiKey, baseURL })
|
|
130
172
|
);
|
|
131
|
-
const
|
|
173
|
+
const createRequesty = (apiKey, baseURL = "https://router.requesty.ai/v1") => merge(
|
|
132
174
|
createChatProvider({ apiKey, baseURL }),
|
|
133
175
|
createModelProvider({ apiKey, baseURL })
|
|
134
176
|
);
|
|
135
|
-
const
|
|
177
|
+
const createScaleway = (apiKey, baseURL = "https://api.scaleway.ai/v1") => merge(
|
|
136
178
|
createChatProvider({ apiKey, baseURL }),
|
|
137
179
|
createModelProvider({ apiKey, baseURL })
|
|
138
180
|
);
|
|
139
|
-
const
|
|
181
|
+
const createSiliconFlow = (apiKey, baseURL = "https://api.siliconflow.com/v1") => merge(
|
|
140
182
|
createChatProvider({ apiKey, baseURL }),
|
|
141
183
|
createModelProvider({ apiKey, baseURL }),
|
|
142
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
184
|
+
createEmbedProvider({ apiKey, baseURL }),
|
|
185
|
+
createSpeechProvider({ apiKey, baseURL }),
|
|
186
|
+
createTranscriptionProvider({ apiKey, baseURL })
|
|
143
187
|
);
|
|
144
|
-
const
|
|
188
|
+
const createSiliconflowCn = (apiKey, baseURL = "https://api.siliconflow.cn/v1") => merge(
|
|
145
189
|
createChatProvider({ apiKey, baseURL }),
|
|
146
190
|
createModelProvider({ apiKey, baseURL })
|
|
147
191
|
);
|
|
@@ -149,52 +193,51 @@ const createSubmodel = (apiKey, baseURL = "https://llm.submodel.ai/v1") => merge
|
|
|
149
193
|
createChatProvider({ apiKey, baseURL }),
|
|
150
194
|
createModelProvider({ apiKey, baseURL })
|
|
151
195
|
);
|
|
152
|
-
const
|
|
196
|
+
const createSynthetic = (apiKey, baseURL = "https://api.synthetic.new/v1") => merge(
|
|
153
197
|
createChatProvider({ apiKey, baseURL }),
|
|
154
198
|
createModelProvider({ apiKey, baseURL })
|
|
155
199
|
);
|
|
156
|
-
const
|
|
200
|
+
const createUpstage = (apiKey, baseURL = "https://api.upstage.ai") => merge(
|
|
157
201
|
createChatProvider({ apiKey, baseURL }),
|
|
158
202
|
createModelProvider({ apiKey, baseURL })
|
|
159
203
|
);
|
|
160
|
-
const
|
|
204
|
+
const createVenice = (apiKey, baseURL = "https://api.venice.ai/api/v1") => merge(
|
|
161
205
|
createChatProvider({ apiKey, baseURL }),
|
|
162
206
|
createModelProvider({ apiKey, baseURL })
|
|
163
207
|
);
|
|
164
|
-
const
|
|
208
|
+
const createVultr = (apiKey, baseURL = "https://api.vultrinference.com/v1") => merge(
|
|
165
209
|
createChatProvider({ apiKey, baseURL }),
|
|
166
210
|
createModelProvider({ apiKey, baseURL })
|
|
167
211
|
);
|
|
168
|
-
const
|
|
212
|
+
const createWandb = (apiKey, baseURL = "https://api.inference.wandb.ai/v1") => merge(
|
|
169
213
|
createChatProvider({ apiKey, baseURL }),
|
|
170
214
|
createModelProvider({ apiKey, baseURL })
|
|
171
215
|
);
|
|
172
|
-
const
|
|
216
|
+
const createXai = (apiKey, baseURL = "https://api.x.ai/v1/") => merge(
|
|
173
217
|
createChatProvider({ apiKey, baseURL }),
|
|
174
218
|
createModelProvider({ apiKey, baseURL })
|
|
175
219
|
);
|
|
176
|
-
const
|
|
220
|
+
const createXiaomi = (apiKey, baseURL = "https://api.xiaomimimo.com/v1") => merge(
|
|
177
221
|
createChatProvider({ apiKey, baseURL }),
|
|
178
222
|
createModelProvider({ apiKey, baseURL })
|
|
179
223
|
);
|
|
180
|
-
const
|
|
224
|
+
const createZai = (apiKey, baseURL = "https://api.z.ai/api/paas/v4") => merge(
|
|
181
225
|
createChatProvider({ apiKey, baseURL }),
|
|
182
226
|
createModelProvider({ apiKey, baseURL })
|
|
183
227
|
);
|
|
184
|
-
const
|
|
228
|
+
const createZaiCodingPlan = (apiKey, baseURL = "https://api.z.ai/api/coding/paas/v4") => merge(
|
|
185
229
|
createChatProvider({ apiKey, baseURL }),
|
|
186
230
|
createModelProvider({ apiKey, baseURL })
|
|
187
231
|
);
|
|
188
|
-
const
|
|
232
|
+
const createZenmux = (apiKey, baseURL = "https://zenmux.ai/api/v1") => merge(
|
|
189
233
|
createChatProvider({ apiKey, baseURL }),
|
|
190
|
-
createModelProvider({ apiKey, baseURL })
|
|
191
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
234
|
+
createModelProvider({ apiKey, baseURL })
|
|
192
235
|
);
|
|
193
|
-
const
|
|
236
|
+
const createZhipuai = (apiKey, baseURL = "https://open.bigmodel.cn/api/paas/v4") => merge(
|
|
194
237
|
createChatProvider({ apiKey, baseURL }),
|
|
195
238
|
createModelProvider({ apiKey, baseURL })
|
|
196
239
|
);
|
|
197
|
-
const
|
|
240
|
+
const createZhipuaiCodingPlan = (apiKey, baseURL = "https://open.bigmodel.cn/api/coding/paas/v4") => merge(
|
|
198
241
|
createChatProvider({ apiKey, baseURL }),
|
|
199
242
|
createModelProvider({ apiKey, baseURL })
|
|
200
243
|
);
|
|
@@ -202,29 +245,33 @@ const createNovita = (apiKey, baseURL = "https://api.novita.ai/v3/openai/") => m
|
|
|
202
245
|
createChatProvider({ apiKey, baseURL }),
|
|
203
246
|
createModelProvider({ apiKey, baseURL })
|
|
204
247
|
);
|
|
205
|
-
const
|
|
248
|
+
const createStepfun = (apiKey, baseURL = "https://api.stepfun.com/v1/") => merge(
|
|
206
249
|
createChatProvider({ apiKey, baseURL }),
|
|
207
250
|
createModelProvider({ apiKey, baseURL }),
|
|
208
251
|
createEmbedProvider({ apiKey, baseURL }),
|
|
209
252
|
createSpeechProvider({ apiKey, baseURL }),
|
|
210
253
|
createTranscriptionProvider({ apiKey, baseURL })
|
|
211
254
|
);
|
|
212
|
-
const
|
|
255
|
+
const createTencentHunyuan = (apiKey, baseURL = "https://api.hunyuan.cloud.tencent.com/v1/") => merge(
|
|
213
256
|
createChatProvider({ apiKey, baseURL }),
|
|
214
257
|
createModelProvider({ apiKey, baseURL }),
|
|
215
|
-
createEmbedProvider({ apiKey, baseURL })
|
|
216
|
-
createSpeechProvider({ apiKey, baseURL }),
|
|
217
|
-
createTranscriptionProvider({ apiKey, baseURL })
|
|
258
|
+
createEmbedProvider({ apiKey, baseURL })
|
|
218
259
|
);
|
|
219
|
-
const
|
|
260
|
+
const createOllama = (apiKey, baseURL = "http://localhost:11434/v1/") => merge(
|
|
220
261
|
createChatProvider({ apiKey, baseURL }),
|
|
221
262
|
createModelProvider({ apiKey, baseURL }),
|
|
222
263
|
createEmbedProvider({ apiKey, baseURL })
|
|
223
264
|
);
|
|
265
|
+
const createLitellm = (apiKey, baseURL = "http://localhost:4000/v1/") => merge(
|
|
266
|
+
createChatProvider({ apiKey, baseURL }),
|
|
267
|
+
createModelProvider({ apiKey, baseURL }),
|
|
268
|
+
createEmbedProvider({ apiKey, baseURL }),
|
|
269
|
+
createSpeechProvider({ apiKey, baseURL }),
|
|
270
|
+
createTranscriptionProvider({ apiKey, baseURL })
|
|
271
|
+
);
|
|
224
272
|
|
|
225
273
|
const createAnthropic = (apiKey, baseURL = "https://api.anthropic.com/v1/") => merge(
|
|
226
|
-
|
|
227
|
-
createChatProvider({ apiKey, baseURL }),
|
|
274
|
+
createChatProviderWithExtraOptions({ apiKey, baseURL }),
|
|
228
275
|
createModelProvider({ apiKey, baseURL })
|
|
229
276
|
);
|
|
230
277
|
|
|
@@ -274,4 +321,4 @@ const createTogetherAI = (apiKey, baseURL = "https://api.together.xyz/v1/") => m
|
|
|
274
321
|
})
|
|
275
322
|
);
|
|
276
323
|
|
|
277
|
-
export {
|
|
324
|
+
export { createZaiCodingPlan as $, createMinimaxCn as A, createMistral as B, createModelscope as C, createMoonshotai as D, createMoonshotaiCn as E, createMorph as F, createNebius as G, createNvidia as H, createOllamaCloud as I, createOpenAI as J, createOpencode as K, createOvhcloud as L, createPerplexity as M, createPoe as N, createRequesty as O, createScaleway as P, createSiliconFlow as Q, createSiliconflowCn as R, createSubmodel as S, createSynthetic as T, createUpstage as U, createVenice as V, createVultr as W, createWandb as X, createXai as Y, createXiaomi as Z, createZai as _, createAlibabaCn as a, createZenmux as a0, createZhipuai as a1, createZhipuaiCodingPlan as a2, createNovita as a3, createStepfun as a4, createTencentHunyuan as a5, createOllama as a6, createLitellm as a7, createAnthropic as a8, createFeatherless as a9, createOpenRouter as aa, createTogetherAI as ab, createBailing as b, createAlibaba as c, createBaseten as d, createCerebras as e, createChutes as f, createCortecs as g, createDeepinfra as h, createDeepSeek as i, createFastrouter as j, createFireworks as k, createGithubCopilot as l, createGithubModels as m, createGoogleGenerativeAI as n, createGroq as o, createHelicone as p, createHuggingface as q, createIflowcn as r, createInception as s, createInference as t, createIoNet as u, createKimiForCoding as v, createLlama as w, createLmstudio as x, createLucidquery as y, createMinimax as z };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type OpenrouterModels = 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-dev-72b:free' | 'moonshotai/kimi-k2-thinking' | 'moonshotai/kimi-k2-0905:exacto' | 'moonshotai/kimi-k2:free' | 'thudm/glm-z1-32b:free' | 'nousresearch/hermes-4-70b' | 'nousresearch/hermes-4-405b' | 'nousresearch/deephermes-3-llama-3-8b-preview' | 'nvidia/nemotron-nano-9b-v2' | 'x-ai/grok-4' | 'x-ai/grok-code-fast-1' | 'x-ai/grok-3' | 'x-ai/grok-4-fast' | 'x-ai/grok-3-beta' | 'x-ai/grok-3-mini-beta' | 'x-ai/grok-3-mini' | 'x-ai/grok-4.1-fast' | 'kwaipilot/kat-coder-pro:free' | 'cognitivecomputations/dolphin3.0-mistral-24b' | 'cognitivecomputations/dolphin3.0-r1-mistral-24b' | 'deepseek/deepseek-chat-v3.1' | 'deepseek/deepseek-r1:free' | 'deepseek/deepseek-v3.2-speciale' | 'deepseek/deepseek-v3-base:free' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-r1-0528-qwen3-8b:free' | 'deepseek/deepseek-chat-v3-0324' | 'deepseek/deepseek-r1-0528:free' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-r1-distill-qwen-14b' | 'deepseek/deepseek-v3.1-terminus:exacto' | 'deepseek/deepseek-v3.2' | 'featherless/qwerky-72b' | 'tngtech/deepseek-r1t2-chimera:free' | 'minimax/minimax-m1' | 'minimax/minimax-m2' | 'minimax/minimax-01' | 'google/gemini-2.0-flash-001' | 'google/gemma-2-9b-it:free' | 'google/gemini-3-flash-preview' | 'google/gemini-3-pro-preview' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-pro-preview-05-06' | 'google/gemma-3n-e4b-it' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro-preview-06-05' | 'google/gemini-2.5-flash-preview-09-2025' | 'google/gemini-2.5-pro' | 'google/gemma-3-12b-it' | 'google/gemma-3n-e4b-it:free' | 'google/gemini-2.5-flash-lite-preview-09-2025' | 'google/gemini-2.0-flash-exp:free' | 'google/gemma-3-27b-it' | 'microsoft/mai-ds-r1:free' | 'openai/gpt-oss-safeguard-20b' | 'openai/gpt-5.1-codex' | 'openai/gpt-4.1-mini' | 'openai/gpt-5-chat' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.2-chat-latest' | 'openai/gpt-5.1' | 'openai/gpt-5-nano' | 'openai/gpt-5-codex' | 'openai/gpt-4.1' | 'openai/gpt-oss-120b:exacto' | 'openai/o4-mini' | 'openai/gpt-5.1-chat' | 'openai/gpt-5-mini' | 'openai/gpt-5-image' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-120b' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-pro' | 'openai/gpt-5.2' | 'openrouter/sherlock-think-alpha' | 'openrouter/sherlock-dash-alpha' | 'z-ai/glm-4.5' | 'z-ai/glm-4.5-air' | 'z-ai/glm-4.5v' | 'z-ai/glm-4.6' | 'z-ai/glm-4.6:exacto' | 'z-ai/glm-4.5-air:free' | 'qwen/qwen3-coder' | 'qwen/qwen3-32b:free' | 'qwen/qwen3-next-80b-a3b-instruct' | 'qwen/qwen-2.5-coder-32b-instruct' | 'qwen/qwen3-235b-a22b:free' | 'qwen/qwen3-coder-flash' | 'qwen/qwq-32b:free' | 'qwen/qwen3-30b-a3b-thinking-2507' | 'qwen/qwen3-30b-a3b:free' | 'qwen/qwen2.5-vl-72b-instruct' | 'qwen/qwen3-14b:free' | 'qwen/qwen3-30b-a3b-instruct-2507' | 'qwen/qwen3-235b-a22b-thinking-2507' | 'qwen/qwen2.5-vl-32b-instruct:free' | 'qwen/qwen2.5-vl-72b-instruct:free' | 'qwen/qwen3-235b-a22b-07-25:free' | 'qwen/qwen3-coder:free' | 'qwen/qwen3-235b-a22b-07-25' | 'qwen/qwen3-8b:free' | 'qwen/qwen3-max' | 'qwen/qwen3-next-80b-a3b-thinking' | 'qwen/qwen3-coder:exacto' | 'mistralai/devstral-medium-2507' | 'mistralai/devstral-2512:free' | 'mistralai/devstral-2512' | 'mistralai/codestral-2508' | 'mistralai/mistral-7b-instruct:free' | 'mistralai/devstral-small-2505' | 'mistralai/mistral-small-3.2-24b-instruct' | 'mistralai/devstral-small-2505:free' | 'mistralai/mistral-small-3.2-24b-instruct:free' | 'mistralai/mistral-medium-3' | 'mistralai/mistral-small-3.1-24b-instruct' | 'mistralai/devstral-small-2507' | 'mistralai/mistral-medium-3.1' | 'mistralai/mistral-nemo:free' | 'rekaai/reka-flash-3' | 'meta-llama/llama-3.2-11b-vision-instruct' | 'meta-llama/llama-3.3-70b-instruct:free' | 'meta-llama/llama-4-scout:free' | 'anthropic/claude-opus-4' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-sonnet-4.5' | 'sarvamai/sarvam-m:free';
|
|
2
|
+
type AnthropicModels = 'claude-opus-4-0' | 'claude-3-5-sonnet-20241022' | 'claude-opus-4-1' | 'claude-haiku-4-5' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-opus-4-5' | 'claude-3-opus-20240229' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-5' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-20250514' | 'claude-opus-4-20250514' | 'claude-3-5-haiku-20241022' | 'claude-3-haiku-20240307' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-sonnet-4-0' | 'claude-opus-4-1-20250805' | 'claude-3-sonnet-20240229' | 'claude-haiku-4-5-20251001';
|
|
3
|
+
type AzureModels = 'gpt-4.1-nano' | 'text-embedding-3-small' | 'grok-4-fast-non-reasoning' | 'deepseek-r1-0528' | 'grok-4-fast-reasoning' | 'phi-3-medium-128k-instruct' | 'gpt-4' | 'claude-opus-4-1' | 'gpt-5.2-chat' | 'llama-3.2-11b-vision-instruct' | 'cohere-embed-v-4-0' | 'cohere-command-r-08-2024' | 'grok-4' | 'cohere-embed-v3-multilingual' | 'phi-4-mini' | 'gpt-4-32k' | 'meta-llama-3.1-405b-instruct' | 'deepseek-r1' | 'grok-code-fast-1' | 'gpt-5.1-codex' | 'phi-3-mini-4k-instruct' | 'claude-haiku-4-5' | 'deepseek-v3.2-speciale' | 'mistral-medium-2505' | 'claude-opus-4-5' | 'phi-3-small-128k-instruct' | 'cohere-command-a' | 'cohere-command-r-plus-08-2024' | 'llama-4-maverick-17b-128e-instruct-fp8' | 'gpt-4.1-mini' | 'gpt-5-chat' | 'deepseek-v3.1' | 'phi-4' | 'phi-4-mini-reasoning' | 'claude-sonnet-4-5' | 'gpt-3.5-turbo-0125' | 'grok-3' | 'text-embedding-3-large' | 'meta-llama-3-70b-instruct' | 'deepseek-v3-0324' | 'phi-3-small-8k-instruct' | 'meta-llama-3.1-70b-instruct' | 'gpt-4-turbo' | 'gpt-3.5-turbo-0613' | 'phi-3.5-mini-instruct' | 'o1-preview' | 'llama-3.3-70b-instruct' | 'gpt-5.1-codex-mini' | 'kimi-k2-thinking' | 'model-router' | 'o3-mini' | 'gpt-5.1' | 'gpt-5-nano' | 'gpt-5-codex' | 'llama-3.2-90b-vision-instruct' | 'phi-3-mini-128k-instruct' | 'gpt-4o' | 'gpt-3.5-turbo-0301' | 'ministral-3b' | 'gpt-4.1' | 'o4-mini' | 'phi-4-multimodal' | 'meta-llama-3-8b-instruct' | 'o1' | 'grok-3-mini' | 'gpt-5.1-chat' | 'phi-3.5-moe-instruct' | 'gpt-5-mini' | 'o1-mini' | 'llama-4-scout-17b-16e-instruct' | 'cohere-embed-v3-english' | 'text-embedding-ada-002' | 'meta-llama-3.1-8b-instruct' | 'gpt-5.1-codex-max' | 'gpt-3.5-turbo-instruct' | 'mistral-nemo' | 'o3' | 'codex-mini' | 'phi-3-medium-4k-instruct' | 'phi-4-reasoning' | 'gpt-4-turbo-vision' | 'phi-4-reasoning-plus' | 'gpt-4o-mini' | 'gpt-5' | 'mai-ds-r1' | 'deepseek-v3.2' | 'gpt-5-pro' | 'mistral-large-2411' | 'gpt-5.2' | 'codestral-2501' | 'mistral-small-2503' | 'gpt-3.5-turbo-1106';
|
|
4
|
+
type CloudflareWorkersAiModels = 'mistral-7b-instruct-v0.1-awq' | 'aura-1' | 'mistral-7b-instruct-v0.2' | 'tinyllama-1.1b-chat-v1.0' | 'qwen1.5-0.5b-chat' | 'llama-3.2-11b-vision-instruct' | 'llama-2-13b-chat-awq' | 'llama-3.1-8b-instruct-fp8' | 'whisper' | 'stable-diffusion-xl-base-1.0' | 'llama-2-7b-chat-fp16' | 'resnet-50' | 'stable-diffusion-v1-5-inpainting' | 'sqlcoder-7b-2' | 'llama-3-8b-instruct' | 'llama-2-7b-chat-hf-lora' | 'llama-3.1-8b-instruct' | 'openchat-3.5-0106' | 'openhermes-2.5-mistral-7b-awq' | 'lucid-origin' | 'bart-large-cnn' | 'flux-1-schnell' | 'deepseek-r1-distill-qwen-32b' | 'gemma-2b-it-lora' | 'una-cybertron-7b-v2-bf16' | 'gemma-sea-lion-v4-27b-it' | 'm2m100-1.2b' | 'llama-3.2-3b-instruct' | 'qwen2.5-coder-32b-instruct' | 'stable-diffusion-v1-5-img2img' | 'gemma-7b-it-lora' | 'qwen1.5-14b-chat-awq' | 'qwen1.5-1.8b-chat' | 'mistral-small-3.1-24b-instruct' | 'gemma-7b-it' | 'qwen3-30b-a3b-fp8' | 'llamaguard-7b-awq' | 'hermes-2-pro-mistral-7b' | 'granite-4.0-h-micro' | 'falcon-7b-instruct' | 'llama-3.3-70b-instruct-fp8-fast' | 'llama-3-8b-instruct-awq' | 'phoenix-1.0' | 'phi-2' | 'dreamshaper-8-lcm' | 'discolm-german-7b-v1-awq' | 'llama-2-7b-chat-int8' | 'llama-3.2-1b-instruct' | 'whisper-large-v3-turbo' | 'llama-4-scout-17b-16e-instruct' | 'starling-lm-7b-beta' | 'deepseek-coder-6.7b-base-awq' | 'gemma-3-12b-it' | 'llama-guard-3-8b' | 'neural-chat-7b-v3-1-awq' | 'whisper-tiny-en' | 'stable-diffusion-xl-lightning' | 'mistral-7b-instruct-v0.1' | 'llava-1.5-7b-hf' | 'gpt-oss-20b' | 'deepseek-math-7b-instruct' | 'gpt-oss-120b' | 'melotts' | 'qwen1.5-7b-chat-awq' | 'llama-3.1-8b-instruct-fast' | 'nova-3' | 'llama-3.1-70b-instruct' | 'qwq-32b' | 'zephyr-7b-beta-awq' | 'deepseek-coder-6.7b-instruct-awq' | 'llama-3.1-8b-instruct-awq' | 'mistral-7b-instruct-v0.2-lora' | 'uform-gen2-qwen-500m';
|
|
5
|
+
type TogetheraiModels = 'moonshotai/Kimi-K2-Instruct' | 'moonshotai/Kimi-K2-Thinking' | 'essentialai/Rnj-1-Instruct' | 'openai/gpt-oss-120b' | 'meta-llama/Llama-3.3-70B-Instruct-Turbo' | 'Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8' | 'zai-org/GLM-4.6' | 'deepseek-ai/DeepSeek-R1' | 'deepseek-ai/DeepSeek-V3' | 'deepseek-ai/DeepSeek-V3-1';
|
|
6
|
+
|
|
7
|
+
export type { AnthropicModels as A, CloudflareWorkersAiModels as C, OpenrouterModels as O, TogetheraiModels as T, AzureModels as a };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CommonRequestOptions } from '@xsai/shared';
|
|
2
|
+
|
|
3
|
+
interface ChatProvider<T = string> {
|
|
4
|
+
chat: (model: (string & {}) | T) => CommonRequestOptions;
|
|
5
|
+
}
|
|
6
|
+
interface ChatProviderWithExtraOptions<T = string, T2 = undefined> {
|
|
7
|
+
chat: (model: (string & {}) | T, extraOptions?: T2) => CommonRequestOptions & Partial<T2>;
|
|
8
|
+
}
|
|
9
|
+
type CreateProviderOptions = Omit<CommonRequestOptions, 'model'>;
|
|
10
|
+
interface EmbedProvider<T = string> {
|
|
11
|
+
embed: (model: (string & {}) | T) => CommonRequestOptions;
|
|
12
|
+
}
|
|
13
|
+
interface EmbedProviderWithExtraOptions<T = string, T2 = undefined> {
|
|
14
|
+
embed: (model: (string & {}) | T, extraOptions?: T2) => CommonRequestOptions & Partial<T2>;
|
|
15
|
+
}
|
|
16
|
+
interface ImageProvider<T = string> {
|
|
17
|
+
image: (model: (string & {}) | T) => CommonRequestOptions;
|
|
18
|
+
}
|
|
19
|
+
interface ModelProvider {
|
|
20
|
+
model: () => CreateProviderOptions;
|
|
21
|
+
}
|
|
22
|
+
interface ModelProviderWithExtraOptions<T = undefined> {
|
|
23
|
+
model: (options?: T) => CreateProviderOptions & Partial<T>;
|
|
24
|
+
}
|
|
25
|
+
interface SpeechProvider<T = string> {
|
|
26
|
+
speech: (model: (string & {}) | T) => CommonRequestOptions;
|
|
27
|
+
}
|
|
28
|
+
interface SpeechProviderWithExtraOptions<T = string, T2 = undefined> {
|
|
29
|
+
speech: (model: (string & {}) | T, extraOptions?: T2) => CommonRequestOptions & Partial<T2>;
|
|
30
|
+
}
|
|
31
|
+
interface TranscriptionProvider<T = string> {
|
|
32
|
+
transcription: (model: (string & {}) | T) => CommonRequestOptions;
|
|
33
|
+
}
|
|
34
|
+
interface TranscriptionProviderWithExtraOptions<T = string, T2 = undefined> {
|
|
35
|
+
transcription: (model: (string & {}) | T, extraOptions?: T2) => CommonRequestOptions & Partial<T2>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type { ChatProvider as C, EmbedProvider as E, ImageProvider as I, ModelProvider as M, SpeechProvider as S, TranscriptionProvider as T, ChatProviderWithExtraOptions as a, CreateProviderOptions as b, EmbedProviderWithExtraOptions as c, ModelProviderWithExtraOptions as d, SpeechProviderWithExtraOptions as e, TranscriptionProviderWithExtraOptions as f };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { b as CreateProviderOptions, C as ChatProvider, a as ChatProviderWithExtraOptions, E as EmbedProvider, c as EmbedProviderWithExtraOptions, I as ImageProvider, M as ModelProvider, d as ModelProviderWithExtraOptions, S as SpeechProvider, e as SpeechProviderWithExtraOptions, T as TranscriptionProvider, f as TranscriptionProviderWithExtraOptions } from '../types-DW1hvH0W.js';
|
|
2
|
+
import '@xsai/shared';
|
|
3
|
+
|
|
4
|
+
declare const createChatProvider: <T extends string = string>(options: CreateProviderOptions) => ChatProvider<T>;
|
|
5
|
+
declare const createChatProviderWithExtraOptions: <T extends string = string, T2 = undefined>(options: CreateProviderOptions) => ChatProviderWithExtraOptions<T, T2>;
|
|
6
|
+
declare const createEmbedProvider: <T extends string = string>(options: CreateProviderOptions) => EmbedProvider<T>;
|
|
7
|
+
declare const createEmbedProviderWithExtraOptions: <T extends string = string, T2 = undefined>(options: CreateProviderOptions) => EmbedProviderWithExtraOptions<T, T2>;
|
|
8
|
+
declare const createImageProvider: <T extends string = string>(options: CreateProviderOptions) => ImageProvider<T>;
|
|
9
|
+
declare const createModelProvider: (options: CreateProviderOptions) => ModelProvider;
|
|
10
|
+
declare const createModelProviderWithExtraOptions: <T = undefined>(options: Omit<CreateProviderOptions, "model">) => ModelProviderWithExtraOptions<T>;
|
|
11
|
+
declare const createSpeechProvider: <T extends string = string>(options: CreateProviderOptions) => SpeechProvider<T>;
|
|
12
|
+
declare const createSpeechProviderWithExtraOptions: <T extends string = string, T2 = undefined>(options: CreateProviderOptions) => SpeechProviderWithExtraOptions<T, T2>;
|
|
13
|
+
declare const createTranscriptionProvider: <T extends string = string>(options: CreateProviderOptions) => TranscriptionProvider<T>;
|
|
14
|
+
declare const createTranscriptionProviderWithExtraOptions: <T extends string = string, T2 = undefined>(options: CreateProviderOptions) => TranscriptionProviderWithExtraOptions<T, T2>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
18
|
+
|
|
19
|
+
Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
|
|
20
|
+
|
|
21
|
+
@example
|
|
22
|
+
```
|
|
23
|
+
import type {UnionToIntersection} from 'type-fest';
|
|
24
|
+
|
|
25
|
+
type Union = {the(): void} | {great(arg: string): void} | {escape: boolean};
|
|
26
|
+
|
|
27
|
+
type Intersection = UnionToIntersection<Union>;
|
|
28
|
+
//=> {the(): void; great(arg: string): void; escape: boolean};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
@category Type
|
|
32
|
+
*/
|
|
33
|
+
type UnionToIntersection<Union> = (
|
|
34
|
+
// `extends unknown` is always going to be the case and is used to convert the
|
|
35
|
+
// `Union` into a [distributive conditional
|
|
36
|
+
// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
|
|
37
|
+
Union extends unknown
|
|
38
|
+
// The union type is used as the only argument to a function since the union
|
|
39
|
+
// of function arguments is an intersection.
|
|
40
|
+
? (distributedUnion: Union) => void
|
|
41
|
+
// This won't happen.
|
|
42
|
+
: never
|
|
43
|
+
// Infer the `Intersection` type since TypeScript represents the positional
|
|
44
|
+
// arguments of unions of functions as an intersection of the union.
|
|
45
|
+
) extends ((mergedIntersection: infer Intersection) => void)
|
|
46
|
+
// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
47
|
+
? Intersection & Union
|
|
48
|
+
: never;
|
|
49
|
+
|
|
50
|
+
declare const merge: <T extends object[]>(...arr: T) => UnionToIntersection<T[number]>;
|
|
51
|
+
|
|
52
|
+
export { ChatProvider, ChatProviderWithExtraOptions, CreateProviderOptions, EmbedProvider, EmbedProviderWithExtraOptions, ImageProvider, ModelProvider, ModelProviderWithExtraOptions, SpeechProvider, SpeechProviderWithExtraOptions, TranscriptionProvider, TranscriptionProviderWithExtraOptions, createChatProvider, createChatProviderWithExtraOptions, createEmbedProvider, createEmbedProviderWithExtraOptions, createImageProvider, createModelProvider, createModelProviderWithExtraOptions, createSpeechProvider, createSpeechProviderWithExtraOptions, createTranscriptionProvider, createTranscriptionProviderWithExtraOptions, merge };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const createChatProvider = (options) => ({
|
|
2
|
+
chat: (model) => Object.assign(options, { model })
|
|
3
|
+
});
|
|
4
|
+
const createChatProviderWithExtraOptions = (options) => ({
|
|
5
|
+
chat: (model, extraOptions) => Object.assign(options, { model }, extraOptions)
|
|
6
|
+
});
|
|
7
|
+
const createEmbedProvider = (options) => ({
|
|
8
|
+
embed: (model) => Object.assign(options, { model })
|
|
9
|
+
});
|
|
10
|
+
const createEmbedProviderWithExtraOptions = (options) => ({
|
|
11
|
+
embed: (model, extraOptions) => Object.assign(options, { model }, extraOptions)
|
|
12
|
+
});
|
|
13
|
+
const createImageProvider = (options) => ({
|
|
14
|
+
image: (model) => Object.assign(options, { model })
|
|
15
|
+
});
|
|
16
|
+
const createModelProvider = (options) => ({
|
|
17
|
+
model: () => options
|
|
18
|
+
});
|
|
19
|
+
const createModelProviderWithExtraOptions = (options) => ({
|
|
20
|
+
model: (extraOptions) => Object.assign(options, extraOptions)
|
|
21
|
+
});
|
|
22
|
+
const createSpeechProvider = (options) => ({
|
|
23
|
+
speech: (model) => Object.assign(options, { model })
|
|
24
|
+
});
|
|
25
|
+
const createSpeechProviderWithExtraOptions = (options) => ({
|
|
26
|
+
speech: (model, extraOptions) => Object.assign(options, { model }, extraOptions)
|
|
27
|
+
});
|
|
28
|
+
const createTranscriptionProvider = (options) => ({
|
|
29
|
+
transcription: (model) => Object.assign(options, { model })
|
|
30
|
+
});
|
|
31
|
+
const createTranscriptionProviderWithExtraOptions = (options) => ({
|
|
32
|
+
transcription: (model, extraOptions) => Object.assign(options, { model }, extraOptions)
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const merge = (...arr) => Object.assign(arr[0], ...arr.slice(1));
|
|
36
|
+
|
|
37
|
+
export { createChatProvider, createChatProviderWithExtraOptions, createEmbedProvider, createEmbedProviderWithExtraOptions, createImageProvider, createModelProvider, createModelProviderWithExtraOptions, createSpeechProvider, createSpeechProviderWithExtraOptions, createTranscriptionProvider, createTranscriptionProviderWithExtraOptions, merge };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsai-ext/providers",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"description": "extra-small AI SDK.",
|
|
6
6
|
"author": "Moeru AI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -27,17 +27,29 @@
|
|
|
27
27
|
"types": "./dist/create.d.ts",
|
|
28
28
|
"default": "./dist/create.js"
|
|
29
29
|
},
|
|
30
|
+
"./special": {
|
|
31
|
+
"types": "./dist/special/index.d.ts",
|
|
32
|
+
"default": "./dist/special/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./special/create": {
|
|
35
|
+
"types": "./dist/special/create.d.ts",
|
|
36
|
+
"default": "./dist/special/create.js"
|
|
37
|
+
},
|
|
38
|
+
"./utils": {
|
|
39
|
+
"types": "./dist/utils/index.d.ts",
|
|
40
|
+
"default": "./dist/utils/index.js"
|
|
41
|
+
},
|
|
30
42
|
"./package.json": "./package.json"
|
|
31
43
|
},
|
|
32
44
|
"files": [
|
|
33
45
|
"dist"
|
|
34
46
|
],
|
|
35
47
|
"dependencies": {
|
|
36
|
-
"@xsai/shared": "~0.4.
|
|
37
|
-
"@xsai-ext/shared-providers": "~0.4.0-beta.9"
|
|
48
|
+
"@xsai/shared": "~0.4.1"
|
|
38
49
|
},
|
|
39
50
|
"devDependencies": {
|
|
40
|
-
"scule": "^1.3.0"
|
|
51
|
+
"scule": "^1.3.0",
|
|
52
|
+
"type-fest": "^5.3.1"
|
|
41
53
|
},
|
|
42
54
|
"scripts": {
|
|
43
55
|
"build": "pkgroll",
|