@openrouter/ai-sdk-provider 1.2.0 → 1.2.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 +36 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +250 -155
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +250 -155
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +36 -0
- package/dist/internal/index.d.ts +36 -0
- package/dist/internal/index.js +218 -148
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +218 -148
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LanguageModelV2, LanguageModelV2CallOptions, LanguageModelV2Content, LanguageModelV2FinishReason, LanguageModelV2Usage, LanguageModelV2CallWarning, LanguageModelV2ResponseMetadata, SharedV2Headers, LanguageModelV2StreamPart } from '@ai-sdk/provider';
|
|
2
2
|
export { LanguageModelV2, LanguageModelV2Prompt } from '@ai-sdk/provider';
|
|
3
|
+
import { z } from 'zod/v4';
|
|
3
4
|
|
|
4
5
|
type OpenRouterChatModelId = string;
|
|
5
6
|
type OpenRouterChatSettings = {
|
|
@@ -208,6 +209,40 @@ type OpenRouterCompletionSettings = {
|
|
|
208
209
|
suffix?: string;
|
|
209
210
|
} & OpenRouterSharedSettings;
|
|
210
211
|
|
|
212
|
+
declare enum ReasoningFormat {
|
|
213
|
+
Unknown = "unknown",
|
|
214
|
+
OpenAIResponsesV1 = "openai-responses-v1",
|
|
215
|
+
XAIResponsesV1 = "xai-responses-v1",
|
|
216
|
+
AnthropicClaudeV1 = "anthropic-claude-v1"
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare enum ReasoningDetailType {
|
|
220
|
+
Summary = "reasoning.summary",
|
|
221
|
+
Encrypted = "reasoning.encrypted",
|
|
222
|
+
Text = "reasoning.text"
|
|
223
|
+
}
|
|
224
|
+
declare const ReasoningDetailUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
225
|
+
type: z.ZodLiteral<ReasoningDetailType.Summary>;
|
|
226
|
+
summary: z.ZodString;
|
|
227
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
format: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof ReasoningFormat>>>;
|
|
229
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<ReasoningDetailType.Encrypted>;
|
|
232
|
+
data: z.ZodString;
|
|
233
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
234
|
+
format: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof ReasoningFormat>>>;
|
|
235
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
type: z.ZodLiteral<ReasoningDetailType.Text>;
|
|
238
|
+
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
signature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
241
|
+
format: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof ReasoningFormat>>>;
|
|
242
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
}, z.core.$strip>]>;
|
|
244
|
+
type ReasoningDetailUnion = z.infer<typeof ReasoningDetailUnionSchema>;
|
|
245
|
+
|
|
211
246
|
type OpenRouterChatConfig = {
|
|
212
247
|
provider: string;
|
|
213
248
|
compatibility: 'strict' | 'compatible';
|
|
@@ -237,6 +272,7 @@ declare class OpenRouterChatLanguageModel implements LanguageModelV2 {
|
|
|
237
272
|
providerMetadata?: {
|
|
238
273
|
openrouter: {
|
|
239
274
|
provider: string;
|
|
275
|
+
reasoning_details?: ReasoningDetailUnion[];
|
|
240
276
|
usage: OpenRouterUsageAccounting;
|
|
241
277
|
};
|
|
242
278
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LanguageModelV2, LanguageModelV2CallOptions, LanguageModelV2Content, LanguageModelV2FinishReason, LanguageModelV2Usage, LanguageModelV2CallWarning, LanguageModelV2ResponseMetadata, SharedV2Headers, LanguageModelV2StreamPart } from '@ai-sdk/provider';
|
|
2
2
|
export { LanguageModelV2, LanguageModelV2Prompt } from '@ai-sdk/provider';
|
|
3
|
+
import { z } from 'zod/v4';
|
|
3
4
|
|
|
4
5
|
type OpenRouterChatModelId = string;
|
|
5
6
|
type OpenRouterChatSettings = {
|
|
@@ -208,6 +209,40 @@ type OpenRouterCompletionSettings = {
|
|
|
208
209
|
suffix?: string;
|
|
209
210
|
} & OpenRouterSharedSettings;
|
|
210
211
|
|
|
212
|
+
declare enum ReasoningFormat {
|
|
213
|
+
Unknown = "unknown",
|
|
214
|
+
OpenAIResponsesV1 = "openai-responses-v1",
|
|
215
|
+
XAIResponsesV1 = "xai-responses-v1",
|
|
216
|
+
AnthropicClaudeV1 = "anthropic-claude-v1"
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare enum ReasoningDetailType {
|
|
220
|
+
Summary = "reasoning.summary",
|
|
221
|
+
Encrypted = "reasoning.encrypted",
|
|
222
|
+
Text = "reasoning.text"
|
|
223
|
+
}
|
|
224
|
+
declare const ReasoningDetailUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
225
|
+
type: z.ZodLiteral<ReasoningDetailType.Summary>;
|
|
226
|
+
summary: z.ZodString;
|
|
227
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
format: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof ReasoningFormat>>>;
|
|
229
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
type: z.ZodLiteral<ReasoningDetailType.Encrypted>;
|
|
232
|
+
data: z.ZodString;
|
|
233
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
234
|
+
format: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof ReasoningFormat>>>;
|
|
235
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
236
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
237
|
+
type: z.ZodLiteral<ReasoningDetailType.Text>;
|
|
238
|
+
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
signature: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
241
|
+
format: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof ReasoningFormat>>>;
|
|
242
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
}, z.core.$strip>]>;
|
|
244
|
+
type ReasoningDetailUnion = z.infer<typeof ReasoningDetailUnionSchema>;
|
|
245
|
+
|
|
211
246
|
type OpenRouterChatConfig = {
|
|
212
247
|
provider: string;
|
|
213
248
|
compatibility: 'strict' | 'compatible';
|
|
@@ -237,6 +272,7 @@ declare class OpenRouterChatLanguageModel implements LanguageModelV2 {
|
|
|
237
272
|
providerMetadata?: {
|
|
238
273
|
openrouter: {
|
|
239
274
|
provider: string;
|
|
275
|
+
reasoning_details?: ReasoningDetailUnion[];
|
|
240
276
|
usage: OpenRouterUsageAccounting;
|
|
241
277
|
};
|
|
242
278
|
};
|