@aeye/openrouter 0.4.0 → 0.5.0

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.
Files changed (33) hide show
  1. package/README.md +152 -65
  2. package/aeye-openrouter.md +175 -161
  3. package/dist/__integration__/openrouter.integration.test.js +122 -6
  4. package/dist/__integration__/openrouter.integration.test.js.map +1 -1
  5. package/dist/__tests__/batch.test.d.ts +5 -0
  6. package/dist/__tests__/batch.test.d.ts.map +1 -0
  7. package/dist/__tests__/batch.test.js +41 -0
  8. package/dist/__tests__/batch.test.js.map +1 -0
  9. package/dist/__tests__/features.test.d.ts +5 -0
  10. package/dist/__tests__/features.test.d.ts.map +1 -0
  11. package/dist/__tests__/features.test.js +206 -0
  12. package/dist/__tests__/features.test.js.map +1 -0
  13. package/dist/__tests__/openrouter.test.js +185 -0
  14. package/dist/__tests__/openrouter.test.js.map +1 -1
  15. package/dist/__tests__/rerank-decide.test.d.ts +5 -0
  16. package/dist/__tests__/rerank-decide.test.d.ts.map +1 -0
  17. package/dist/__tests__/rerank-decide.test.js +75 -0
  18. package/dist/__tests__/rerank-decide.test.js.map +1 -0
  19. package/dist/__tests__/schema-rejection.test.d.ts +6 -0
  20. package/dist/__tests__/schema-rejection.test.d.ts.map +1 -0
  21. package/dist/__tests__/schema-rejection.test.js +39 -0
  22. package/dist/__tests__/schema-rejection.test.js.map +1 -0
  23. package/dist/openrouter.d.ts +118 -41
  24. package/dist/openrouter.d.ts.map +1 -1
  25. package/dist/openrouter.js +407 -210
  26. package/dist/openrouter.js.map +1 -1
  27. package/dist/source.d.ts +9 -4
  28. package/dist/source.d.ts.map +1 -1
  29. package/dist/source.js +45 -28
  30. package/dist/source.js.map +1 -1
  31. package/dist/types.d.ts +244 -81
  32. package/dist/types.d.ts.map +1 -1
  33. package/package.json +71 -71
@@ -0,0 +1,39 @@
1
+ /**
2
+ * OpenRouter reports an upstream schema rejection as "Provider returned
3
+ * error", with the upstream's message in `metadata.raw`.
4
+ */
5
+ import { z } from 'zod';
6
+ import { AI } from '@aeye/ai';
7
+ import { SchemaRejectedError } from '@aeye/core';
8
+ import { OpenRouterProvider } from '../openrouter';
9
+ const mockCreate = jest.fn();
10
+ jest.mock('openai', () => jest.fn().mockImplementation(() => ({ chat: { completions: { create: mockCreate } } })));
11
+ const ctx = { ai: AI.with().providers({}).create({}), metadata: {} };
12
+ /** An error shaped like the SDK's APIError for an upstream failure. */
13
+ function upstreamError(raw) {
14
+ return Object.assign(new Error('400 Provider returned error'), {
15
+ status: 400,
16
+ error: { message: 'Provider returned error', code: 400, metadata: { raw, provider_name: 'Google' } },
17
+ });
18
+ }
19
+ async function rejection(error) {
20
+ mockCreate.mockRejectedValue(error);
21
+ const request = {
22
+ messages: [{ role: 'user', content: 'Answer' }],
23
+ responseFormat: { type: z.object({ value: z.number() }), strict: 1 },
24
+ };
25
+ return new OpenRouterProvider({ apiKey: 'test' }).createExecutor()(request, ctx, { model: 'google/gemini-2.5-flash' })
26
+ .then(() => undefined, (e) => e);
27
+ }
28
+ describe('OpenRouter schema rejections', () => {
29
+ it('reads the upstream message', async () => {
30
+ const error = await rejection(upstreamError('{"error":{"message":"Invalid JSON payload received. Unknown name \\"additionalProperties\\" at \'generation_config.response_schema\'"}}'));
31
+ expect(error).toBeInstanceOf(SchemaRejectedError);
32
+ expect(error).toMatchObject({ target: { kind: 'output' } });
33
+ });
34
+ it('leaves other upstream errors alone', async () => {
35
+ const original = upstreamError('{"error":{"message":"Model is overloaded"}}');
36
+ expect(await rejection(original)).toBe(original);
37
+ });
38
+ });
39
+ //# sourceMappingURL=schema-rejection.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-rejection.test.js","sourceRoot":"","sources":["../../src/__tests__/schema-rejection.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,EAAqB,MAAM,UAAU,CAAC;AACjD,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,kBAAkB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC;SACnH,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,4BAA4B,EAAE,KAAK,IAAI,EAAE;QAC1C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,aAAa,CAAC,yIAAyI,CAAC,CAAC,CAAC;QACxL,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QAClD,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,QAAQ,GAAG,aAAa,CAAC,6CAA6C,CAAC,CAAC;QAC9E,MAAM,CAAC,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -14,15 +14,16 @@
14
14
  * `defaultParams.providers.requireParameters` explicitly (`false` disables, `true`
15
15
  * forces regardless of strictness). See {@link OpenRouterConfig.defaultParams}.
16
16
  */
17
- import type { Message, ModelInfo, Provider } from '@aeye/ai';
18
- import { type Chunk, type Request, type Response } from '@aeye/core';
19
- import { OpenAIConfig, OpenAIProvider } from '@aeye/openai';
17
+ import type { BatchJob, Message, ModelInfo, Provider } from '@aeye/ai';
18
+ import { type Chunk, type DescriptorFamily, type Request, type Response, type SchemaRejectedError } from '@aeye/core';
19
+ import { type BatchSubmission, OpenAIConfig, OpenAIProvider, type OperationRun } from '@aeye/openai';
20
20
  import OpenAI from 'openai';
21
- import { OpenRouterChatChunk, OpenRouterChatRequest, OpenRouterChatResponse, OpenRouterModel, OpenRouterRequestMessage } from './types';
21
+ import type { OpenRouterChatChunk, OpenRouterChatRequest, OpenRouterChatResponse, OpenRouterContentPart, OpenRouterMetrics, OpenRouterModel, OpenRouterPlugin, OpenRouterProviderPreferences, OpenRouterRequestMessage } from './types';
22
22
  /**
23
- * OpenRouter provider configuration
23
+ * OpenRouter provider configuration. Requests always go through chat
24
+ * completions, where OpenRouter serves routing, plugins, and server tools.
24
25
  */
25
- export interface OpenRouterConfig extends OpenAIConfig {
26
+ export interface OpenRouterConfig extends Omit<OpenAIConfig, 'api'> {
26
27
  defaultParams?: {
27
28
  siteUrl?: string;
28
29
  appName?: string;
@@ -42,84 +43,160 @@ export interface OpenRouterConfig extends OpenAIConfig {
42
43
  * Non-strict requests are unaffected unless this is explicitly set.
43
44
  */
44
45
  requireParameters?: boolean;
45
- dataCollection?: 'deny' | 'allow';
46
+ dataCollection?: OpenRouterProviderPreferences['data_collection'];
46
47
  zdr?: boolean;
48
+ enforceDistillableText?: boolean;
47
49
  only?: string[];
48
50
  ignore?: string[];
49
- quantizations?: ('int4' | 'int8' | 'fp4' | 'fp6' | 'fp8' | 'fp16' | 'bf16' | 'fp32' | 'unknown')[];
50
- sort?: 'price' | 'throughput' | 'latency';
51
- maxPrice?: {
52
- prompt?: number;
53
- completion?: number;
54
- image?: number;
55
- };
51
+ quantizations?: OpenRouterProviderPreferences['quantizations'];
52
+ sort?: OpenRouterProviderPreferences['sort'];
53
+ preferredMinThroughput?: number;
54
+ preferredMaxLatency?: number;
55
+ maxPrice?: OpenRouterProviderPreferences['max_price'];
56
56
  };
57
+ fallbackModels?: string[];
58
+ plugins?: OpenRouterPlugin[];
59
+ /**
60
+ * @deprecated OpenRouter replaced transforms with plugins; `middle-out`
61
+ * is sent as the `context-compression` plugin.
62
+ */
57
63
  transforms?: string[];
58
64
  };
59
65
  }
60
66
  /**
61
67
  * Convert OpenRouter model to ModelInfo with full details
62
68
  */
63
- export declare function convertOpenRouterModel(model: OpenRouterModel, zdrModelIds: Set<string>, metrics?: {
64
- latency?: number;
65
- throughput?: number;
66
- uptime?: number;
67
- } | null): ModelInfo;
69
+ export declare function convertOpenRouterModel(model: OpenRouterModel, zdrModelIds: Set<string>, metrics?: OpenRouterMetrics | null): ModelInfo;
68
70
  /**
69
71
  * OpenRouter provider implementation extending base OpenAI-compatible provider
70
72
  */
71
73
  export declare class OpenRouterProvider extends OpenAIProvider<OpenRouterConfig> implements Provider<OpenRouterConfig> {
72
74
  readonly name = "openrouter";
75
+ protected readonly defaults: {
76
+ chat?: import("@aeye/core").ModelInput;
77
+ imageGenerate?: import("@aeye/core").ModelInput;
78
+ imageEdit?: import("@aeye/core").ModelInput;
79
+ imageAnalyze?: import("@aeye/core").ModelInput;
80
+ transcription?: import("@aeye/core").ModelInput;
81
+ speech?: import("@aeye/core").ModelInput;
82
+ embedding?: import("@aeye/core").ModelInput;
83
+ decision?: import("@aeye/core").ModelInput;
84
+ rerank?: import("@aeye/core").ModelInput;
85
+ };
86
+ /**
87
+ * OpenRouter is a router, not a model host: it speaks an OpenAI-shaped API
88
+ * but forwards each request to the upstream provider that actually serves
89
+ * the model, translating the tool/response schemas on the way. So the wire
90
+ * dialect that matters is the UPSTREAM model's, which
91
+ * `resolveStrictFormat` already derives from the `[family]/...` id prefix
92
+ * (`google/gemini-3-flash-preview` → `'google'`).
93
+ *
94
+ * The inherited default is `['openai']` — correct for api.openai.com, wrong
95
+ * here, and it silently forced EVERY tool schema through LENIENT no matter
96
+ * which family the model belonged to. LENIENT encodes `z.any()` as a
97
+ * self-referencing `$defs/Any`, which Gemini's function-calling grammar
98
+ * compiler rejects with `400 INVALID_ARGUMENT` as soon as a tool call is
99
+ * forced. `applySchemaDeliveryFallback` never hid this because it resolves
100
+ * the family itself and only covers `response_format`, not tools — which is
101
+ * why structured output looked family-aware while tools were not.
102
+ */
103
+ protected supportedStrictFamilies: ReadonlySet<DescriptorFamily>;
104
+ private readonly reasoningOf;
73
105
  protected createClient(config: OpenRouterConfig): OpenAI;
74
106
  protected convertModel(model: OpenAI.Model): ModelInfo;
75
107
  /**
76
- * Augment chat request with OpenRouter-specific parameters
108
+ * OpenRouter serves hosted tools and reasoning options through chat
109
+ * completions, so the Responses API is never needed.
77
110
  */
78
- protected augmentChatRequest(params: OpenRouterChatRequest, request: Request, config: OpenRouterConfig): void;
111
+ protected usesResponses(): boolean;
79
112
  /**
80
- *
81
- * @param expected
82
- * @param response
113
+ * OpenRouter doesn't honor `allowed_tools` (models still call the others,
114
+ * and some upstreams reject it), so only the allowed tools are sent.
83
115
  */
116
+ protected buildChatParams(request: Request, run: OperationRun<OpenRouterConfig>, streaming: boolean): Promise<OpenAI.Chat.Completions.ChatCompletionCreateParamsNonStreaming>;
117
+ /**
118
+ * OpenRouter reports an upstream's rejection as "Provider returned error",
119
+ * with the upstream's own message in `metadata.raw`.
120
+ */
121
+ protected rejectedSchema(request: Request, error: Error): SchemaRejectedError | undefined;
122
+ /**
123
+ * OpenRouter strips `strict` from tools bound for Anthropic unless the
124
+ * request carries Anthropic's structured-outputs beta flag, so a strict tool
125
+ * would silently go unenforced (openrouter.ai/docs/guides/routing/provider-selection,
126
+ * read 2026-11-04). Other upstreams ignore the header.
127
+ */
128
+ protected chatHeaders(params: OpenAI.Chat.ChatCompletionCreateParams): Record<string, string> | undefined;
129
+ /**
130
+ * Augment chat request with OpenRouter-specific parameters
131
+ */
132
+ protected augmentChatRequest(params: OpenRouterChatRequest, request: Request, config: OpenRouterConfig): void;
84
133
  protected augmentChatResponse(expected: OpenRouterChatResponse, response: Response, config: OpenRouterConfig): void;
85
134
  protected augmentChatChunk(expected: OpenRouterChatChunk, chunk: Chunk, config: OpenRouterConfig): void;
86
- protected augmentChatMessage(chatMessage: OpenRouterRequestMessage, message: Message, config: OpenRouterConfig): void;
135
+ /**
136
+ * OpenRouter marks cache breakpoints Anthropic-style and translates them
137
+ * for each upstream provider.
138
+ */
139
+ protected augmentChatContent(chatContent: OpenRouterContentPart): void;
140
+ protected augmentChatMessage(chatMessage: OpenAI.Chat.ChatCompletionMessageParam, message: Message): void;
141
+ /**
142
+ * Assistant messages carry their reasoning back on the same message, which
143
+ * OpenRouter relays with the turn's text and tool calls, once even when a
144
+ * message was split into parts.
145
+ */
87
146
  protected convertMessages(request: Request, config: OpenRouterConfig): Promise<OpenRouterRequestMessage[]>;
88
147
  /**
89
- * OpenRouter does not support image generation
148
+ * Produce images through chat: image models on OpenRouter answer with
149
+ * images when asked for the image modality. Runs through the chat hooks.
90
150
  */
91
- generateImage: undefined;
151
+ private chatImages;
152
+ generateImage: Provider['generateImage'];
153
+ editImage: Provider['editImage'];
92
154
  /**
93
- * OpenRouter does not support image generation streaming
155
+ * Image streaming is not offered; image requests fall back to the
156
+ * non-streaming methods.
94
157
  */
95
158
  generateImageStream: undefined;
159
+ editImageStream: undefined;
96
160
  /**
97
- * OpenRouter does not support image editing
161
+ * Transcription streaming is not offered; transcription falls back to
162
+ * the non-streaming method.
98
163
  */
99
- editImage: undefined;
164
+ transcribeStream: undefined;
100
165
  /**
101
- * OpenRouter does not support image editing
166
+ * Order documents by relevance to a query.
167
+ *
168
+ * @param request Rerank request parameters
169
+ * @param ctx Context object
170
+ * @param config Optional configuration override
171
+ * @returns Documents by relevance, most relevant first
102
172
  */
103
- editImageStream: undefined;
173
+ rerank: Provider['rerank'];
104
174
  /**
105
- * OpenRouter does not support audio transcription
175
+ * Typed answers about an input, from System One models such as Jev and
176
+ * Kev or other decision models. A conversation goes in as chat messages.
177
+ * Decisions are an alpha endpoint, outside the versioned API.
178
+ *
179
+ * @param request Decision request parameters
180
+ * @param ctx Context object
181
+ * @param config Optional configuration override
182
+ * @returns Answers by question name
106
183
  */
107
- transcribe: undefined;
184
+ decide: Provider['decide'];
108
185
  /**
109
- * OpenRouter does not support audio transcription streaming
186
+ * Start a batch: OpenRouter takes the requests inline.
110
187
  */
111
- transcribeStream: undefined;
188
+ protected createBatch(batch: BatchSubmission, run: OperationRun<OpenRouterConfig>): Promise<BatchJob>;
112
189
  /**
113
- * OpenRouter does not support speech synthesis
190
+ * Read a batch: OpenRouter returns the results inline once it completes.
114
191
  */
115
- speech: undefined;
192
+ protected retrieveBatch(job: BatchJob, run: OperationRun<OpenRouterConfig>): Promise<BatchJob>;
116
193
  /**
117
- * OpenRouter does not support embeddings
194
+ * A batch as @aeye reports it.
118
195
  */
119
- embed: undefined;
196
+ private toBatchJob;
120
197
  /**
121
198
  * Override listModels to use OpenRouter's model API with ZDR support
122
199
  */
123
- listModels(config: OpenRouterConfig): Promise<ModelInfo[]>;
200
+ listModels(config?: OpenRouterConfig): Promise<ModelInfo[]>;
124
201
  }
125
202
  //# sourceMappingURL=openrouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openrouter.d.ts","sourceRoot":"","sources":["../src/openrouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAmB,SAAS,EAAkC,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE9G,OAAO,EAAuB,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,sBAAsB,EAAqB,eAAe,EAA8B,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEvL;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACpD,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE;YACV,KAAK,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