@llmgateway/ai-sdk-provider 3.8.0 → 3.8.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/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/internal/index.d.mts +64 -65
- package/dist/internal/index.d.ts +64 -65
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult, ImageModelV3, ImageModelV3CallOptions, SharedV3Warning } from '@ai-sdk/provider';
|
|
2
2
|
export { LanguageModelV3, LanguageModelV3Prompt } from '@ai-sdk/provider';
|
|
3
|
-
import { models, Provider } from '@llmgateway/models';
|
|
4
3
|
|
|
5
|
-
type LLMGatewayChatModelId =
|
|
4
|
+
type LLMGatewayChatModelId = string;
|
|
6
5
|
type LLMGatewayChatSettings = {
|
|
7
6
|
/**
|
|
8
7
|
Modify the likelihood of specified tokens appearing in the completion.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult, ImageModelV3, ImageModelV3CallOptions, SharedV3Warning } from '@ai-sdk/provider';
|
|
2
2
|
export { LanguageModelV3, LanguageModelV3Prompt } from '@ai-sdk/provider';
|
|
3
|
-
import { models, Provider } from '@llmgateway/models';
|
|
4
3
|
|
|
5
|
-
type LLMGatewayChatModelId =
|
|
4
|
+
type LLMGatewayChatModelId = string;
|
|
6
5
|
type LLMGatewayChatSettings = {
|
|
7
6
|
/**
|
|
8
7
|
Modify the likelihood of specified tokens appearing in the completion.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LanguageModelV3, LanguageModelV3CallOptions, ImageModelV3, ImageModelV3CallOptions, SharedV3Warning, LanguageModelV3GenerateResult, LanguageModelV3StreamResult } from '@ai-sdk/provider';
|
|
2
2
|
export { LanguageModelV3, LanguageModelV3Prompt } from '@ai-sdk/provider';
|
|
3
|
-
import { models, Provider } from '@llmgateway/models';
|
|
4
3
|
export { Model, ModelDefinition, Provider, ProviderModelMapping, StabilityLevel, models } from '@llmgateway/models';
|
|
5
4
|
|
|
6
5
|
type LLMGatewayProviderOptions = {
|
|
@@ -154,6 +153,70 @@ declare class LLMGatewayImageModel implements ImageModelV3 {
|
|
|
154
153
|
}>;
|
|
155
154
|
}
|
|
156
155
|
|
|
156
|
+
type LLMGatewayChatModelId = string;
|
|
157
|
+
type LLMGatewayChatSettings = {
|
|
158
|
+
/**
|
|
159
|
+
Modify the likelihood of specified tokens appearing in the completion.
|
|
160
|
+
|
|
161
|
+
Accepts a JSON object that maps tokens (specified by their token ID in
|
|
162
|
+
the GPT tokenizer) to an associated bias value from -100 to 100. You
|
|
163
|
+
can use this tokenizer tool to convert text to token IDs. Mathematically,
|
|
164
|
+
the bias is added to the logits generated by the model prior to sampling.
|
|
165
|
+
The exact effect will vary per model, but values between -1 and 1 should
|
|
166
|
+
decrease or increase likelihood of selection; values like -100 or 100
|
|
167
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
168
|
+
|
|
169
|
+
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
170
|
+
token from being generated.
|
|
171
|
+
*/
|
|
172
|
+
logitBias?: Record<number, number>;
|
|
173
|
+
/**
|
|
174
|
+
Return the log probabilities of the tokens. Including logprobs will increase
|
|
175
|
+
the response size and can slow down response times. However, it can
|
|
176
|
+
be useful to understand better how the model is behaving.
|
|
177
|
+
|
|
178
|
+
Setting to true will return the log probabilities of the tokens that
|
|
179
|
+
were generated.
|
|
180
|
+
|
|
181
|
+
Setting to a number will return the log probabilities of the top n
|
|
182
|
+
tokens that were generated.
|
|
183
|
+
*/
|
|
184
|
+
logprobs?: boolean | number;
|
|
185
|
+
/**
|
|
186
|
+
Whether to enable parallel function calling during tool use. Default to true.
|
|
187
|
+
*/
|
|
188
|
+
parallelToolCalls?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
A unique identifier representing your end-user, which can help LLMGateway to
|
|
191
|
+
monitor and detect abuse. Learn more.
|
|
192
|
+
*/
|
|
193
|
+
user?: string;
|
|
194
|
+
} & LLMGatewaySharedSettings;
|
|
195
|
+
|
|
196
|
+
type LLMGatewayChatConfig = {
|
|
197
|
+
provider: string;
|
|
198
|
+
compatibility: 'strict' | 'compatible';
|
|
199
|
+
headers: () => Record<string, string | undefined>;
|
|
200
|
+
url: (options: {
|
|
201
|
+
modelId: string;
|
|
202
|
+
path: string;
|
|
203
|
+
}) => string;
|
|
204
|
+
fetch?: typeof fetch;
|
|
205
|
+
extraBody?: Record<string, unknown>;
|
|
206
|
+
};
|
|
207
|
+
declare class LLMGatewayChatLanguageModel implements LanguageModelV3 {
|
|
208
|
+
readonly specificationVersion: "v3";
|
|
209
|
+
readonly provider = "llmgateway";
|
|
210
|
+
readonly modelId: LLMGatewayChatModelId;
|
|
211
|
+
readonly supportedUrls: Record<string, RegExp[]>;
|
|
212
|
+
readonly settings: LLMGatewayChatSettings;
|
|
213
|
+
private readonly config;
|
|
214
|
+
constructor(modelId: LLMGatewayChatModelId, settings: LLMGatewayChatSettings, config: LLMGatewayChatConfig);
|
|
215
|
+
private getArgs;
|
|
216
|
+
doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
|
|
217
|
+
doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
|
|
218
|
+
}
|
|
219
|
+
|
|
157
220
|
declare const providers: [{
|
|
158
221
|
readonly id: "llmgateway";
|
|
159
222
|
readonly name: "LLM Gateway";
|
|
@@ -343,68 +406,4 @@ declare const providers: [{
|
|
|
343
406
|
}];
|
|
344
407
|
type ProviderId = (typeof providers)[number]['id'];
|
|
345
408
|
|
|
346
|
-
type LLMGatewayChatModelId = (typeof models)[number]['id'] | `${Provider}/${(typeof models)[number]['id']}` | 'test-model';
|
|
347
|
-
type LLMGatewayChatSettings = {
|
|
348
|
-
/**
|
|
349
|
-
Modify the likelihood of specified tokens appearing in the completion.
|
|
350
|
-
|
|
351
|
-
Accepts a JSON object that maps tokens (specified by their token ID in
|
|
352
|
-
the GPT tokenizer) to an associated bias value from -100 to 100. You
|
|
353
|
-
can use this tokenizer tool to convert text to token IDs. Mathematically,
|
|
354
|
-
the bias is added to the logits generated by the model prior to sampling.
|
|
355
|
-
The exact effect will vary per model, but values between -1 and 1 should
|
|
356
|
-
decrease or increase likelihood of selection; values like -100 or 100
|
|
357
|
-
should result in a ban or exclusive selection of the relevant token.
|
|
358
|
-
|
|
359
|
-
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
360
|
-
token from being generated.
|
|
361
|
-
*/
|
|
362
|
-
logitBias?: Record<number, number>;
|
|
363
|
-
/**
|
|
364
|
-
Return the log probabilities of the tokens. Including logprobs will increase
|
|
365
|
-
the response size and can slow down response times. However, it can
|
|
366
|
-
be useful to understand better how the model is behaving.
|
|
367
|
-
|
|
368
|
-
Setting to true will return the log probabilities of the tokens that
|
|
369
|
-
were generated.
|
|
370
|
-
|
|
371
|
-
Setting to a number will return the log probabilities of the top n
|
|
372
|
-
tokens that were generated.
|
|
373
|
-
*/
|
|
374
|
-
logprobs?: boolean | number;
|
|
375
|
-
/**
|
|
376
|
-
Whether to enable parallel function calling during tool use. Default to true.
|
|
377
|
-
*/
|
|
378
|
-
parallelToolCalls?: boolean;
|
|
379
|
-
/**
|
|
380
|
-
A unique identifier representing your end-user, which can help LLMGateway to
|
|
381
|
-
monitor and detect abuse. Learn more.
|
|
382
|
-
*/
|
|
383
|
-
user?: string;
|
|
384
|
-
} & LLMGatewaySharedSettings;
|
|
385
|
-
|
|
386
|
-
type LLMGatewayChatConfig = {
|
|
387
|
-
provider: string;
|
|
388
|
-
compatibility: 'strict' | 'compatible';
|
|
389
|
-
headers: () => Record<string, string | undefined>;
|
|
390
|
-
url: (options: {
|
|
391
|
-
modelId: string;
|
|
392
|
-
path: string;
|
|
393
|
-
}) => string;
|
|
394
|
-
fetch?: typeof fetch;
|
|
395
|
-
extraBody?: Record<string, unknown>;
|
|
396
|
-
};
|
|
397
|
-
declare class LLMGatewayChatLanguageModel implements LanguageModelV3 {
|
|
398
|
-
readonly specificationVersion: "v3";
|
|
399
|
-
readonly provider = "llmgateway";
|
|
400
|
-
readonly modelId: LLMGatewayChatModelId;
|
|
401
|
-
readonly supportedUrls: Record<string, RegExp[]>;
|
|
402
|
-
readonly settings: LLMGatewayChatSettings;
|
|
403
|
-
private readonly config;
|
|
404
|
-
constructor(modelId: LLMGatewayChatModelId, settings: LLMGatewayChatSettings, config: LLMGatewayChatConfig);
|
|
405
|
-
private getArgs;
|
|
406
|
-
doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
|
|
407
|
-
doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
409
|
export { LLMGatewayChatLanguageModel, type LLMGatewayChatModelId, type LLMGatewayChatSettings, LLMGatewayCompletionLanguageModel, type LLMGatewayCompletionSettings, LLMGatewayImageModel, type LLMGatewayImageModelId, type LLMGatewayImageSettings, type LLMGatewayProviderOptions, type LLMGatewaySharedSettings, type LLMGatewayUsageAccounting, type ProviderId, providers };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LanguageModelV3, LanguageModelV3CallOptions, ImageModelV3, ImageModelV3CallOptions, SharedV3Warning, LanguageModelV3GenerateResult, LanguageModelV3StreamResult } from '@ai-sdk/provider';
|
|
2
2
|
export { LanguageModelV3, LanguageModelV3Prompt } from '@ai-sdk/provider';
|
|
3
|
-
import { models, Provider } from '@llmgateway/models';
|
|
4
3
|
export { Model, ModelDefinition, Provider, ProviderModelMapping, StabilityLevel, models } from '@llmgateway/models';
|
|
5
4
|
|
|
6
5
|
type LLMGatewayProviderOptions = {
|
|
@@ -154,6 +153,70 @@ declare class LLMGatewayImageModel implements ImageModelV3 {
|
|
|
154
153
|
}>;
|
|
155
154
|
}
|
|
156
155
|
|
|
156
|
+
type LLMGatewayChatModelId = string;
|
|
157
|
+
type LLMGatewayChatSettings = {
|
|
158
|
+
/**
|
|
159
|
+
Modify the likelihood of specified tokens appearing in the completion.
|
|
160
|
+
|
|
161
|
+
Accepts a JSON object that maps tokens (specified by their token ID in
|
|
162
|
+
the GPT tokenizer) to an associated bias value from -100 to 100. You
|
|
163
|
+
can use this tokenizer tool to convert text to token IDs. Mathematically,
|
|
164
|
+
the bias is added to the logits generated by the model prior to sampling.
|
|
165
|
+
The exact effect will vary per model, but values between -1 and 1 should
|
|
166
|
+
decrease or increase likelihood of selection; values like -100 or 100
|
|
167
|
+
should result in a ban or exclusive selection of the relevant token.
|
|
168
|
+
|
|
169
|
+
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
170
|
+
token from being generated.
|
|
171
|
+
*/
|
|
172
|
+
logitBias?: Record<number, number>;
|
|
173
|
+
/**
|
|
174
|
+
Return the log probabilities of the tokens. Including logprobs will increase
|
|
175
|
+
the response size and can slow down response times. However, it can
|
|
176
|
+
be useful to understand better how the model is behaving.
|
|
177
|
+
|
|
178
|
+
Setting to true will return the log probabilities of the tokens that
|
|
179
|
+
were generated.
|
|
180
|
+
|
|
181
|
+
Setting to a number will return the log probabilities of the top n
|
|
182
|
+
tokens that were generated.
|
|
183
|
+
*/
|
|
184
|
+
logprobs?: boolean | number;
|
|
185
|
+
/**
|
|
186
|
+
Whether to enable parallel function calling during tool use. Default to true.
|
|
187
|
+
*/
|
|
188
|
+
parallelToolCalls?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
A unique identifier representing your end-user, which can help LLMGateway to
|
|
191
|
+
monitor and detect abuse. Learn more.
|
|
192
|
+
*/
|
|
193
|
+
user?: string;
|
|
194
|
+
} & LLMGatewaySharedSettings;
|
|
195
|
+
|
|
196
|
+
type LLMGatewayChatConfig = {
|
|
197
|
+
provider: string;
|
|
198
|
+
compatibility: 'strict' | 'compatible';
|
|
199
|
+
headers: () => Record<string, string | undefined>;
|
|
200
|
+
url: (options: {
|
|
201
|
+
modelId: string;
|
|
202
|
+
path: string;
|
|
203
|
+
}) => string;
|
|
204
|
+
fetch?: typeof fetch;
|
|
205
|
+
extraBody?: Record<string, unknown>;
|
|
206
|
+
};
|
|
207
|
+
declare class LLMGatewayChatLanguageModel implements LanguageModelV3 {
|
|
208
|
+
readonly specificationVersion: "v3";
|
|
209
|
+
readonly provider = "llmgateway";
|
|
210
|
+
readonly modelId: LLMGatewayChatModelId;
|
|
211
|
+
readonly supportedUrls: Record<string, RegExp[]>;
|
|
212
|
+
readonly settings: LLMGatewayChatSettings;
|
|
213
|
+
private readonly config;
|
|
214
|
+
constructor(modelId: LLMGatewayChatModelId, settings: LLMGatewayChatSettings, config: LLMGatewayChatConfig);
|
|
215
|
+
private getArgs;
|
|
216
|
+
doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
|
|
217
|
+
doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
|
|
218
|
+
}
|
|
219
|
+
|
|
157
220
|
declare const providers: [{
|
|
158
221
|
readonly id: "llmgateway";
|
|
159
222
|
readonly name: "LLM Gateway";
|
|
@@ -343,68 +406,4 @@ declare const providers: [{
|
|
|
343
406
|
}];
|
|
344
407
|
type ProviderId = (typeof providers)[number]['id'];
|
|
345
408
|
|
|
346
|
-
type LLMGatewayChatModelId = (typeof models)[number]['id'] | `${Provider}/${(typeof models)[number]['id']}` | 'test-model';
|
|
347
|
-
type LLMGatewayChatSettings = {
|
|
348
|
-
/**
|
|
349
|
-
Modify the likelihood of specified tokens appearing in the completion.
|
|
350
|
-
|
|
351
|
-
Accepts a JSON object that maps tokens (specified by their token ID in
|
|
352
|
-
the GPT tokenizer) to an associated bias value from -100 to 100. You
|
|
353
|
-
can use this tokenizer tool to convert text to token IDs. Mathematically,
|
|
354
|
-
the bias is added to the logits generated by the model prior to sampling.
|
|
355
|
-
The exact effect will vary per model, but values between -1 and 1 should
|
|
356
|
-
decrease or increase likelihood of selection; values like -100 or 100
|
|
357
|
-
should result in a ban or exclusive selection of the relevant token.
|
|
358
|
-
|
|
359
|
-
As an example, you can pass {"50256": -100} to prevent the <|endoftext|>
|
|
360
|
-
token from being generated.
|
|
361
|
-
*/
|
|
362
|
-
logitBias?: Record<number, number>;
|
|
363
|
-
/**
|
|
364
|
-
Return the log probabilities of the tokens. Including logprobs will increase
|
|
365
|
-
the response size and can slow down response times. However, it can
|
|
366
|
-
be useful to understand better how the model is behaving.
|
|
367
|
-
|
|
368
|
-
Setting to true will return the log probabilities of the tokens that
|
|
369
|
-
were generated.
|
|
370
|
-
|
|
371
|
-
Setting to a number will return the log probabilities of the top n
|
|
372
|
-
tokens that were generated.
|
|
373
|
-
*/
|
|
374
|
-
logprobs?: boolean | number;
|
|
375
|
-
/**
|
|
376
|
-
Whether to enable parallel function calling during tool use. Default to true.
|
|
377
|
-
*/
|
|
378
|
-
parallelToolCalls?: boolean;
|
|
379
|
-
/**
|
|
380
|
-
A unique identifier representing your end-user, which can help LLMGateway to
|
|
381
|
-
monitor and detect abuse. Learn more.
|
|
382
|
-
*/
|
|
383
|
-
user?: string;
|
|
384
|
-
} & LLMGatewaySharedSettings;
|
|
385
|
-
|
|
386
|
-
type LLMGatewayChatConfig = {
|
|
387
|
-
provider: string;
|
|
388
|
-
compatibility: 'strict' | 'compatible';
|
|
389
|
-
headers: () => Record<string, string | undefined>;
|
|
390
|
-
url: (options: {
|
|
391
|
-
modelId: string;
|
|
392
|
-
path: string;
|
|
393
|
-
}) => string;
|
|
394
|
-
fetch?: typeof fetch;
|
|
395
|
-
extraBody?: Record<string, unknown>;
|
|
396
|
-
};
|
|
397
|
-
declare class LLMGatewayChatLanguageModel implements LanguageModelV3 {
|
|
398
|
-
readonly specificationVersion: "v3";
|
|
399
|
-
readonly provider = "llmgateway";
|
|
400
|
-
readonly modelId: LLMGatewayChatModelId;
|
|
401
|
-
readonly supportedUrls: Record<string, RegExp[]>;
|
|
402
|
-
readonly settings: LLMGatewayChatSettings;
|
|
403
|
-
private readonly config;
|
|
404
|
-
constructor(modelId: LLMGatewayChatModelId, settings: LLMGatewayChatSettings, config: LLMGatewayChatConfig);
|
|
405
|
-
private getArgs;
|
|
406
|
-
doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
|
|
407
|
-
doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
409
|
export { LLMGatewayChatLanguageModel, type LLMGatewayChatModelId, type LLMGatewayChatSettings, LLMGatewayCompletionLanguageModel, type LLMGatewayCompletionSettings, LLMGatewayImageModel, type LLMGatewayImageModelId, type LLMGatewayImageSettings, type LLMGatewayProviderOptions, type LLMGatewaySharedSettings, type LLMGatewayUsageAccounting, type ProviderId, providers };
|