@ai-sdk/openai-compatible 1.0.0-canary.6 → 1.0.0-canary.7

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 CHANGED
@@ -1,5 +1,28 @@
1
1
  # @ai-sdk/openai-compatible
2
2
 
3
+ ## 1.0.0-canary.7
4
+
5
+ ### Patch Changes
6
+
7
+ - fa49207: feat(providers/openai-compatible): convert to providerOptions
8
+ - 26735b5: chore(embedding-model): add v2 interface
9
+ - 443d8ec: feat(embedding-model-v2): add response body field
10
+ - fd65bc6: chore(embedding-model-v2): rename rawResponse to response
11
+ - Updated dependencies [26735b5]
12
+ - Updated dependencies [443d8ec]
13
+ - Updated dependencies [14c9410]
14
+ - Updated dependencies [d9c98f4]
15
+ - Updated dependencies [c4a2fec]
16
+ - Updated dependencies [0054544]
17
+ - Updated dependencies [9e9c809]
18
+ - Updated dependencies [32831c6]
19
+ - Updated dependencies [d0f9495]
20
+ - Updated dependencies [fd65bc6]
21
+ - Updated dependencies [393138b]
22
+ - Updated dependencies [7182d14]
23
+ - @ai-sdk/provider@2.0.0-canary.6
24
+ - @ai-sdk/provider-utils@3.0.0-canary.7
25
+
3
26
  ## 1.0.0-canary.6
4
27
 
5
28
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,15 +1,20 @@
1
- import { LanguageModelV2ProviderMetadata, LanguageModelV2, LanguageModelV2ObjectGenerationMode, EmbeddingModelV1, ImageModelV1, ProviderV2 } from '@ai-sdk/provider';
1
+ import { SharedV2ProviderMetadata, LanguageModelV2, LanguageModelV2ObjectGenerationMode, EmbeddingModelV2, ImageModelV1, ProviderV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  import { z, ZodSchema } from 'zod';
4
4
 
5
5
  type OpenAICompatibleChatModelId = string;
6
- interface OpenAICompatibleChatSettings {
6
+ declare const openaiCompatibleProviderOptions: z.ZodObject<{
7
7
  /**
8
- A unique identifier representing your end-user, which can help the provider to
9
- monitor and detect abuse.
10
- */
11
- user?: string;
12
- }
8
+ * A unique identifier representing your end-user, which can help the provider to
9
+ * monitor and detect abuse.
10
+ */
11
+ user: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ user?: string | undefined;
14
+ }, {
15
+ user?: string | undefined;
16
+ }>;
17
+ type OpenAICompatibleProviderOptions = z.infer<typeof openaiCompatibleProviderOptions>;
13
18
 
14
19
  declare const openaiCompatibleErrorDataSchema: z.ZodObject<{
15
20
  error: z.ZodObject<{
@@ -66,7 +71,7 @@ type MetadataExtractor = {
66
71
  */
67
72
  extractMetadata: ({ parsedBody, }: {
68
73
  parsedBody: unknown;
69
- }) => LanguageModelV2ProviderMetadata | undefined;
74
+ }) => SharedV2ProviderMetadata | undefined;
70
75
  /**
71
76
  * Creates an extractor for handling streaming responses. The returned object provides
72
77
  * methods to process individual chunks and build the final metadata from the accumulated
@@ -89,7 +94,7 @@ type MetadataExtractor = {
89
94
  * @returns Provider-specific metadata or undefined if no metadata is available.
90
95
  * The metadata should be under a key indicating the provider id.
91
96
  */
92
- buildMetadata(): LanguageModelV2ProviderMetadata | undefined;
97
+ buildMetadata(): SharedV2ProviderMetadata | undefined;
93
98
  };
94
99
  };
95
100
 
@@ -118,11 +123,10 @@ declare class OpenAICompatibleChatLanguageModel implements LanguageModelV2 {
118
123
  readonly specificationVersion = "v2";
119
124
  readonly supportsStructuredOutputs: boolean;
120
125
  readonly modelId: OpenAICompatibleChatModelId;
121
- readonly settings: OpenAICompatibleChatSettings;
122
126
  private readonly config;
123
127
  private readonly failedResponseHandler;
124
128
  private readonly chunkSchema;
125
- constructor(modelId: OpenAICompatibleChatModelId, settings: OpenAICompatibleChatSettings, config: OpenAICompatibleChatConfig);
129
+ constructor(modelId: OpenAICompatibleChatModelId, config: OpenAICompatibleChatConfig);
126
130
  get defaultObjectGenerationMode(): 'json' | 'tool' | undefined;
127
131
  get provider(): string;
128
132
  private get providerOptionsName();
@@ -132,36 +136,39 @@ declare class OpenAICompatibleChatLanguageModel implements LanguageModelV2 {
132
136
  }
133
137
 
134
138
  type OpenAICompatibleCompletionModelId = string;
135
- interface OpenAICompatibleCompletionSettings {
139
+ declare const openaiCompatibleCompletionProviderOptions: z.ZodObject<{
136
140
  /**
137
- Echo back the prompt in addition to the completion.
141
+ * Echo back the prompt in addition to the completion.
138
142
  */
139
- echo?: boolean;
143
+ echo: z.ZodOptional<z.ZodBoolean>;
140
144
  /**
141
- Modify the likelihood of specified tokens appearing in the completion.
142
-
143
- Accepts a JSON object that maps tokens (specified by their token ID in
144
- the GPT tokenizer) to an associated bias value from -100 to 100. You
145
- can use this tokenizer tool to convert text to token IDs. Mathematically,
146
- the bias is added to the logits generated by the model prior to sampling.
147
- The exact effect will vary per model, but values between -1 and 1 should
148
- decrease or increase likelihood of selection; values like -100 or 100
149
- should result in a ban or exclusive selection of the relevant token.
150
-
151
- As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
152
- token from being generated.
145
+ * Modify the likelihood of specified tokens appearing in the completion.
146
+ *
147
+ * Accepts a JSON object that maps tokens (specified by their token ID in
148
+ * the GPT tokenizer) to an associated bias value from -100 to 100.
153
149
  */
154
- logitBias?: Record<number, number>;
150
+ logitBias: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodNumber>>;
155
151
  /**
156
- The suffix that comes after a completion of inserted text.
152
+ * The suffix that comes after a completion of inserted text.
157
153
  */
158
- suffix?: string;
154
+ suffix: z.ZodOptional<z.ZodString>;
159
155
  /**
160
- A unique identifier representing your end-user, which can help OpenAI to
161
- monitor and detect abuse. Learn more.
156
+ * A unique identifier representing your end-user, which can help providers to
157
+ * monitor and detect abuse.
162
158
  */
163
- user?: string;
164
- }
159
+ user: z.ZodOptional<z.ZodString>;
160
+ }, "strip", z.ZodTypeAny, {
161
+ user?: string | undefined;
162
+ echo?: boolean | undefined;
163
+ logitBias?: Record<number, number> | undefined;
164
+ suffix?: string | undefined;
165
+ }, {
166
+ user?: string | undefined;
167
+ echo?: boolean | undefined;
168
+ logitBias?: Record<number, number> | undefined;
169
+ suffix?: string | undefined;
170
+ }>;
171
+ type OpenAICompatibleCompletionProviderOptions = z.infer<typeof openaiCompatibleCompletionProviderOptions>;
165
172
 
166
173
  type OpenAICompatibleCompletionConfig = {
167
174
  provider: string;
@@ -177,11 +184,10 @@ declare class OpenAICompatibleCompletionLanguageModel implements LanguageModelV2
177
184
  readonly specificationVersion = "v2";
178
185
  readonly defaultObjectGenerationMode: undefined;
179
186
  readonly modelId: OpenAICompatibleCompletionModelId;
180
- readonly settings: OpenAICompatibleCompletionSettings;
181
187
  private readonly config;
182
188
  private readonly failedResponseHandler;
183
189
  private readonly chunkSchema;
184
- constructor(modelId: OpenAICompatibleCompletionModelId, settings: OpenAICompatibleCompletionSettings, config: OpenAICompatibleCompletionConfig);
190
+ constructor(modelId: OpenAICompatibleCompletionModelId, config: OpenAICompatibleCompletionConfig);
185
191
  get provider(): string;
186
192
  private get providerOptionsName();
187
193
  private getArgs;
@@ -190,18 +196,25 @@ declare class OpenAICompatibleCompletionLanguageModel implements LanguageModelV2
190
196
  }
191
197
 
192
198
  type OpenAICompatibleEmbeddingModelId = string;
193
- interface OpenAICompatibleEmbeddingSettings {
199
+ declare const openaiCompatibleEmbeddingProviderOptions: z.ZodObject<{
194
200
  /**
195
- The number of dimensions the resulting output embeddings should have.
196
- Only supported in text-embedding-3 and later models.
201
+ * The number of dimensions the resulting output embeddings should have.
202
+ * Only supported in text-embedding-3 and later models.
197
203
  */
198
- dimensions?: number;
204
+ dimensions: z.ZodOptional<z.ZodNumber>;
199
205
  /**
200
- A unique identifier representing your end-user, which can help OpenAI to
201
- monitor and detect abuse. Learn more.
202
- */
203
- user?: string;
204
- }
206
+ * A unique identifier representing your end-user, which can help providers to
207
+ * monitor and detect abuse.
208
+ */
209
+ user: z.ZodOptional<z.ZodString>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ user?: string | undefined;
212
+ dimensions?: number | undefined;
213
+ }, {
214
+ user?: string | undefined;
215
+ dimensions?: number | undefined;
216
+ }>;
217
+ type OpenAICompatibleEmbeddingProviderOptions = z.infer<typeof openaiCompatibleEmbeddingProviderOptions>;
205
218
 
206
219
  type OpenAICompatibleEmbeddingConfig = {
207
220
  /**
@@ -221,16 +234,16 @@ type OpenAICompatibleEmbeddingConfig = {
221
234
  fetch?: FetchFunction;
222
235
  errorStructure?: ProviderErrorStructure<any>;
223
236
  };
224
- declare class OpenAICompatibleEmbeddingModel implements EmbeddingModelV1<string> {
225
- readonly specificationVersion = "v1";
237
+ declare class OpenAICompatibleEmbeddingModel implements EmbeddingModelV2<string> {
238
+ readonly specificationVersion = "v2";
226
239
  readonly modelId: OpenAICompatibleEmbeddingModelId;
227
240
  private readonly config;
228
- private readonly settings;
229
241
  get provider(): string;
230
242
  get maxEmbeddingsPerCall(): number;
231
243
  get supportsParallelCalls(): boolean;
232
- constructor(modelId: OpenAICompatibleEmbeddingModelId, settings: OpenAICompatibleEmbeddingSettings, config: OpenAICompatibleEmbeddingConfig);
233
- doEmbed({ values, headers, abortSignal, }: Parameters<EmbeddingModelV1<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV1<string>['doEmbed']>>>;
244
+ constructor(modelId: OpenAICompatibleEmbeddingModelId, config: OpenAICompatibleEmbeddingConfig);
245
+ private get providerOptionsName();
246
+ doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV2<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV2<string>['doEmbed']>>>;
234
247
  }
235
248
 
236
249
  type OpenAICompatibleImageModelId = string;
@@ -271,12 +284,12 @@ declare class OpenAICompatibleImageModel implements ImageModelV1 {
271
284
  }
272
285
 
273
286
  interface OpenAICompatibleProvider<CHAT_MODEL_IDS extends string = string, COMPLETION_MODEL_IDS extends string = string, EMBEDDING_MODEL_IDS extends string = string, IMAGE_MODEL_IDS extends string = string> extends Omit<ProviderV2, 'imageModel'> {
274
- (modelId: CHAT_MODEL_IDS, settings?: OpenAICompatibleChatSettings): LanguageModelV2;
275
- languageModel(modelId: CHAT_MODEL_IDS, settings?: OpenAICompatibleChatSettings): LanguageModelV2;
276
- chatModel(modelId: CHAT_MODEL_IDS, settings?: OpenAICompatibleChatSettings): LanguageModelV2;
277
- completionModel(modelId: COMPLETION_MODEL_IDS, settings?: OpenAICompatibleCompletionSettings): LanguageModelV2;
278
- textEmbeddingModel(modelId: EMBEDDING_MODEL_IDS, settings?: OpenAICompatibleEmbeddingSettings): EmbeddingModelV1<string>;
279
- imageModel(modelId: IMAGE_MODEL_IDS, settings?: OpenAICompatibleImageSettings): ImageModelV1;
287
+ (modelId: CHAT_MODEL_IDS): LanguageModelV2;
288
+ languageModel(modelId: CHAT_MODEL_IDS): LanguageModelV2;
289
+ chatModel(modelId: CHAT_MODEL_IDS): LanguageModelV2;
290
+ completionModel(modelId: COMPLETION_MODEL_IDS): LanguageModelV2;
291
+ textEmbeddingModel(modelId: EMBEDDING_MODEL_IDS): EmbeddingModelV2<string>;
292
+ imageModel(modelId: IMAGE_MODEL_IDS): ImageModelV1;
280
293
  }
281
294
  interface OpenAICompatibleProviderSettings {
282
295
  /**
@@ -313,4 +326,4 @@ Create an OpenAICompatible provider instance.
313
326
  */
314
327
  declare function createOpenAICompatible<CHAT_MODEL_IDS extends string, COMPLETION_MODEL_IDS extends string, EMBEDDING_MODEL_IDS extends string, IMAGE_MODEL_IDS extends string>(options: OpenAICompatibleProviderSettings): OpenAICompatibleProvider<CHAT_MODEL_IDS, COMPLETION_MODEL_IDS, EMBEDDING_MODEL_IDS, IMAGE_MODEL_IDS>;
315
328
 
316
- export { type MetadataExtractor, OpenAICompatibleChatLanguageModel, type OpenAICompatibleChatSettings, OpenAICompatibleCompletionLanguageModel, type OpenAICompatibleCompletionSettings, OpenAICompatibleEmbeddingModel, type OpenAICompatibleEmbeddingSettings, type OpenAICompatibleErrorData, OpenAICompatibleImageModel, type OpenAICompatibleImageSettings, type OpenAICompatibleProvider, type OpenAICompatibleProviderSettings, type ProviderErrorStructure, createOpenAICompatible };
329
+ export { type MetadataExtractor, OpenAICompatibleChatLanguageModel, type OpenAICompatibleChatModelId, OpenAICompatibleCompletionLanguageModel, type OpenAICompatibleCompletionModelId, type OpenAICompatibleCompletionProviderOptions, OpenAICompatibleEmbeddingModel, type OpenAICompatibleEmbeddingModelId, type OpenAICompatibleEmbeddingProviderOptions, type OpenAICompatibleErrorData, OpenAICompatibleImageModel, type OpenAICompatibleImageSettings, type OpenAICompatibleProvider, type OpenAICompatibleProviderOptions, type OpenAICompatibleProviderSettings, type ProviderErrorStructure, createOpenAICompatible };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,20 @@
1
- import { LanguageModelV2ProviderMetadata, LanguageModelV2, LanguageModelV2ObjectGenerationMode, EmbeddingModelV1, ImageModelV1, ProviderV2 } from '@ai-sdk/provider';
1
+ import { SharedV2ProviderMetadata, LanguageModelV2, LanguageModelV2ObjectGenerationMode, EmbeddingModelV2, ImageModelV1, ProviderV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
  import { z, ZodSchema } from 'zod';
4
4
 
5
5
  type OpenAICompatibleChatModelId = string;
6
- interface OpenAICompatibleChatSettings {
6
+ declare const openaiCompatibleProviderOptions: z.ZodObject<{
7
7
  /**
8
- A unique identifier representing your end-user, which can help the provider to
9
- monitor and detect abuse.
10
- */
11
- user?: string;
12
- }
8
+ * A unique identifier representing your end-user, which can help the provider to
9
+ * monitor and detect abuse.
10
+ */
11
+ user: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ user?: string | undefined;
14
+ }, {
15
+ user?: string | undefined;
16
+ }>;
17
+ type OpenAICompatibleProviderOptions = z.infer<typeof openaiCompatibleProviderOptions>;
13
18
 
14
19
  declare const openaiCompatibleErrorDataSchema: z.ZodObject<{
15
20
  error: z.ZodObject<{
@@ -66,7 +71,7 @@ type MetadataExtractor = {
66
71
  */
67
72
  extractMetadata: ({ parsedBody, }: {
68
73
  parsedBody: unknown;
69
- }) => LanguageModelV2ProviderMetadata | undefined;
74
+ }) => SharedV2ProviderMetadata | undefined;
70
75
  /**
71
76
  * Creates an extractor for handling streaming responses. The returned object provides
72
77
  * methods to process individual chunks and build the final metadata from the accumulated
@@ -89,7 +94,7 @@ type MetadataExtractor = {
89
94
  * @returns Provider-specific metadata or undefined if no metadata is available.
90
95
  * The metadata should be under a key indicating the provider id.
91
96
  */
92
- buildMetadata(): LanguageModelV2ProviderMetadata | undefined;
97
+ buildMetadata(): SharedV2ProviderMetadata | undefined;
93
98
  };
94
99
  };
95
100
 
@@ -118,11 +123,10 @@ declare class OpenAICompatibleChatLanguageModel implements LanguageModelV2 {
118
123
  readonly specificationVersion = "v2";
119
124
  readonly supportsStructuredOutputs: boolean;
120
125
  readonly modelId: OpenAICompatibleChatModelId;
121
- readonly settings: OpenAICompatibleChatSettings;
122
126
  private readonly config;
123
127
  private readonly failedResponseHandler;
124
128
  private readonly chunkSchema;
125
- constructor(modelId: OpenAICompatibleChatModelId, settings: OpenAICompatibleChatSettings, config: OpenAICompatibleChatConfig);
129
+ constructor(modelId: OpenAICompatibleChatModelId, config: OpenAICompatibleChatConfig);
126
130
  get defaultObjectGenerationMode(): 'json' | 'tool' | undefined;
127
131
  get provider(): string;
128
132
  private get providerOptionsName();
@@ -132,36 +136,39 @@ declare class OpenAICompatibleChatLanguageModel implements LanguageModelV2 {
132
136
  }
133
137
 
134
138
  type OpenAICompatibleCompletionModelId = string;
135
- interface OpenAICompatibleCompletionSettings {
139
+ declare const openaiCompatibleCompletionProviderOptions: z.ZodObject<{
136
140
  /**
137
- Echo back the prompt in addition to the completion.
141
+ * Echo back the prompt in addition to the completion.
138
142
  */
139
- echo?: boolean;
143
+ echo: z.ZodOptional<z.ZodBoolean>;
140
144
  /**
141
- Modify the likelihood of specified tokens appearing in the completion.
142
-
143
- Accepts a JSON object that maps tokens (specified by their token ID in
144
- the GPT tokenizer) to an associated bias value from -100 to 100. You
145
- can use this tokenizer tool to convert text to token IDs. Mathematically,
146
- the bias is added to the logits generated by the model prior to sampling.
147
- The exact effect will vary per model, but values between -1 and 1 should
148
- decrease or increase likelihood of selection; values like -100 or 100
149
- should result in a ban or exclusive selection of the relevant token.
150
-
151
- As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
152
- token from being generated.
145
+ * Modify the likelihood of specified tokens appearing in the completion.
146
+ *
147
+ * Accepts a JSON object that maps tokens (specified by their token ID in
148
+ * the GPT tokenizer) to an associated bias value from -100 to 100.
153
149
  */
154
- logitBias?: Record<number, number>;
150
+ logitBias: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodNumber>>;
155
151
  /**
156
- The suffix that comes after a completion of inserted text.
152
+ * The suffix that comes after a completion of inserted text.
157
153
  */
158
- suffix?: string;
154
+ suffix: z.ZodOptional<z.ZodString>;
159
155
  /**
160
- A unique identifier representing your end-user, which can help OpenAI to
161
- monitor and detect abuse. Learn more.
156
+ * A unique identifier representing your end-user, which can help providers to
157
+ * monitor and detect abuse.
162
158
  */
163
- user?: string;
164
- }
159
+ user: z.ZodOptional<z.ZodString>;
160
+ }, "strip", z.ZodTypeAny, {
161
+ user?: string | undefined;
162
+ echo?: boolean | undefined;
163
+ logitBias?: Record<number, number> | undefined;
164
+ suffix?: string | undefined;
165
+ }, {
166
+ user?: string | undefined;
167
+ echo?: boolean | undefined;
168
+ logitBias?: Record<number, number> | undefined;
169
+ suffix?: string | undefined;
170
+ }>;
171
+ type OpenAICompatibleCompletionProviderOptions = z.infer<typeof openaiCompatibleCompletionProviderOptions>;
165
172
 
166
173
  type OpenAICompatibleCompletionConfig = {
167
174
  provider: string;
@@ -177,11 +184,10 @@ declare class OpenAICompatibleCompletionLanguageModel implements LanguageModelV2
177
184
  readonly specificationVersion = "v2";
178
185
  readonly defaultObjectGenerationMode: undefined;
179
186
  readonly modelId: OpenAICompatibleCompletionModelId;
180
- readonly settings: OpenAICompatibleCompletionSettings;
181
187
  private readonly config;
182
188
  private readonly failedResponseHandler;
183
189
  private readonly chunkSchema;
184
- constructor(modelId: OpenAICompatibleCompletionModelId, settings: OpenAICompatibleCompletionSettings, config: OpenAICompatibleCompletionConfig);
190
+ constructor(modelId: OpenAICompatibleCompletionModelId, config: OpenAICompatibleCompletionConfig);
185
191
  get provider(): string;
186
192
  private get providerOptionsName();
187
193
  private getArgs;
@@ -190,18 +196,25 @@ declare class OpenAICompatibleCompletionLanguageModel implements LanguageModelV2
190
196
  }
191
197
 
192
198
  type OpenAICompatibleEmbeddingModelId = string;
193
- interface OpenAICompatibleEmbeddingSettings {
199
+ declare const openaiCompatibleEmbeddingProviderOptions: z.ZodObject<{
194
200
  /**
195
- The number of dimensions the resulting output embeddings should have.
196
- Only supported in text-embedding-3 and later models.
201
+ * The number of dimensions the resulting output embeddings should have.
202
+ * Only supported in text-embedding-3 and later models.
197
203
  */
198
- dimensions?: number;
204
+ dimensions: z.ZodOptional<z.ZodNumber>;
199
205
  /**
200
- A unique identifier representing your end-user, which can help OpenAI to
201
- monitor and detect abuse. Learn more.
202
- */
203
- user?: string;
204
- }
206
+ * A unique identifier representing your end-user, which can help providers to
207
+ * monitor and detect abuse.
208
+ */
209
+ user: z.ZodOptional<z.ZodString>;
210
+ }, "strip", z.ZodTypeAny, {
211
+ user?: string | undefined;
212
+ dimensions?: number | undefined;
213
+ }, {
214
+ user?: string | undefined;
215
+ dimensions?: number | undefined;
216
+ }>;
217
+ type OpenAICompatibleEmbeddingProviderOptions = z.infer<typeof openaiCompatibleEmbeddingProviderOptions>;
205
218
 
206
219
  type OpenAICompatibleEmbeddingConfig = {
207
220
  /**
@@ -221,16 +234,16 @@ type OpenAICompatibleEmbeddingConfig = {
221
234
  fetch?: FetchFunction;
222
235
  errorStructure?: ProviderErrorStructure<any>;
223
236
  };
224
- declare class OpenAICompatibleEmbeddingModel implements EmbeddingModelV1<string> {
225
- readonly specificationVersion = "v1";
237
+ declare class OpenAICompatibleEmbeddingModel implements EmbeddingModelV2<string> {
238
+ readonly specificationVersion = "v2";
226
239
  readonly modelId: OpenAICompatibleEmbeddingModelId;
227
240
  private readonly config;
228
- private readonly settings;
229
241
  get provider(): string;
230
242
  get maxEmbeddingsPerCall(): number;
231
243
  get supportsParallelCalls(): boolean;
232
- constructor(modelId: OpenAICompatibleEmbeddingModelId, settings: OpenAICompatibleEmbeddingSettings, config: OpenAICompatibleEmbeddingConfig);
233
- doEmbed({ values, headers, abortSignal, }: Parameters<EmbeddingModelV1<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV1<string>['doEmbed']>>>;
244
+ constructor(modelId: OpenAICompatibleEmbeddingModelId, config: OpenAICompatibleEmbeddingConfig);
245
+ private get providerOptionsName();
246
+ doEmbed({ values, headers, abortSignal, providerOptions, }: Parameters<EmbeddingModelV2<string>['doEmbed']>[0]): Promise<Awaited<ReturnType<EmbeddingModelV2<string>['doEmbed']>>>;
234
247
  }
235
248
 
236
249
  type OpenAICompatibleImageModelId = string;
@@ -271,12 +284,12 @@ declare class OpenAICompatibleImageModel implements ImageModelV1 {
271
284
  }
272
285
 
273
286
  interface OpenAICompatibleProvider<CHAT_MODEL_IDS extends string = string, COMPLETION_MODEL_IDS extends string = string, EMBEDDING_MODEL_IDS extends string = string, IMAGE_MODEL_IDS extends string = string> extends Omit<ProviderV2, 'imageModel'> {
274
- (modelId: CHAT_MODEL_IDS, settings?: OpenAICompatibleChatSettings): LanguageModelV2;
275
- languageModel(modelId: CHAT_MODEL_IDS, settings?: OpenAICompatibleChatSettings): LanguageModelV2;
276
- chatModel(modelId: CHAT_MODEL_IDS, settings?: OpenAICompatibleChatSettings): LanguageModelV2;
277
- completionModel(modelId: COMPLETION_MODEL_IDS, settings?: OpenAICompatibleCompletionSettings): LanguageModelV2;
278
- textEmbeddingModel(modelId: EMBEDDING_MODEL_IDS, settings?: OpenAICompatibleEmbeddingSettings): EmbeddingModelV1<string>;
279
- imageModel(modelId: IMAGE_MODEL_IDS, settings?: OpenAICompatibleImageSettings): ImageModelV1;
287
+ (modelId: CHAT_MODEL_IDS): LanguageModelV2;
288
+ languageModel(modelId: CHAT_MODEL_IDS): LanguageModelV2;
289
+ chatModel(modelId: CHAT_MODEL_IDS): LanguageModelV2;
290
+ completionModel(modelId: COMPLETION_MODEL_IDS): LanguageModelV2;
291
+ textEmbeddingModel(modelId: EMBEDDING_MODEL_IDS): EmbeddingModelV2<string>;
292
+ imageModel(modelId: IMAGE_MODEL_IDS): ImageModelV1;
280
293
  }
281
294
  interface OpenAICompatibleProviderSettings {
282
295
  /**
@@ -313,4 +326,4 @@ Create an OpenAICompatible provider instance.
313
326
  */
314
327
  declare function createOpenAICompatible<CHAT_MODEL_IDS extends string, COMPLETION_MODEL_IDS extends string, EMBEDDING_MODEL_IDS extends string, IMAGE_MODEL_IDS extends string>(options: OpenAICompatibleProviderSettings): OpenAICompatibleProvider<CHAT_MODEL_IDS, COMPLETION_MODEL_IDS, EMBEDDING_MODEL_IDS, IMAGE_MODEL_IDS>;
315
328
 
316
- export { type MetadataExtractor, OpenAICompatibleChatLanguageModel, type OpenAICompatibleChatSettings, OpenAICompatibleCompletionLanguageModel, type OpenAICompatibleCompletionSettings, OpenAICompatibleEmbeddingModel, type OpenAICompatibleEmbeddingSettings, type OpenAICompatibleErrorData, OpenAICompatibleImageModel, type OpenAICompatibleImageSettings, type OpenAICompatibleProvider, type OpenAICompatibleProviderSettings, type ProviderErrorStructure, createOpenAICompatible };
329
+ export { type MetadataExtractor, OpenAICompatibleChatLanguageModel, type OpenAICompatibleChatModelId, OpenAICompatibleCompletionLanguageModel, type OpenAICompatibleCompletionModelId, type OpenAICompatibleCompletionProviderOptions, OpenAICompatibleEmbeddingModel, type OpenAICompatibleEmbeddingModelId, type OpenAICompatibleEmbeddingProviderOptions, type OpenAICompatibleErrorData, OpenAICompatibleImageModel, type OpenAICompatibleImageSettings, type OpenAICompatibleProvider, type OpenAICompatibleProviderOptions, type OpenAICompatibleProviderSettings, type ProviderErrorStructure, createOpenAICompatible };