@opencode/ai 2.2.2 → 2.2.4
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/README.md +159 -144
- package/dist/decision.d.ts +0 -1
- package/dist/effect.d.ts +47 -17
- package/dist/effect.js +25 -13
- package/dist/experimental/testing.d.ts +3 -0
- package/dist/experimental/testing.js +3 -0
- package/dist/experimental.d.ts +12 -0
- package/dist/experimental.js +9 -0
- package/dist/index.d.ts +637 -1323
- package/dist/index.js +60 -56
- package/dist/llm.d.ts +4 -3
- package/dist/llm.js +21 -29
- package/dist/protocols/alibaba-responses.d.ts +2 -2
- package/dist/protocols/assemblyai-transcription.js +3 -3
- package/dist/protocols/meta-responses.d.ts +4 -4
- package/dist/protocols/open-responses.d.ts +18 -18
- package/dist/protocols/open-responses.js +4 -2
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-responses.d.ts +12 -12
- package/dist/protocols/runway-video.js +2 -2
- package/dist/protocols/xai-responses.d.ts +2 -2
- package/dist/protocols/xai-responses.js +1 -1
- package/dist/protocols/xai-video.js +2 -2
- package/dist/providers/alibaba.d.ts +2 -2
- package/dist/providers/amazon-bedrock-mantle.d.ts +2 -2
- package/dist/providers/azure.d.ts +4 -4
- package/dist/providers/cloudflare-ai-gateway.d.ts +4 -4
- package/dist/providers/digitalocean.d.ts +2 -2
- package/dist/providers/google-vertex-responses.d.ts +2 -2
- package/dist/providers/meta.d.ts +2 -2
- package/dist/providers/minimax.d.ts +2 -2
- package/dist/providers/moonshot.d.ts +2 -2
- package/dist/providers/openai-compatible-responses.d.ts +2 -2
- package/dist/providers/openai.d.ts +2 -2
- package/dist/providers/openrouter/responses.d.ts +1 -2
- package/dist/providers/openrouter.d.ts +36 -23
- package/dist/providers/openrouter.js +29 -10
- package/dist/providers/venice.d.ts +2 -2
- package/dist/providers/zai-coding-plan.d.ts +2 -2
- package/dist/route/client.d.ts +3 -2
- package/dist/route/client.js +6 -9
- package/dist/route/media-protocol.d.ts +2 -3
- package/dist/route/media-protocol.js +2 -6
- package/dist/schema/errors.d.ts +6 -0
- package/dist/schema/errors.js +8 -0
- package/dist/schema/events.d.ts +2 -0
- package/dist/schema/events.js +4 -0
- package/dist/testing.d.ts +1 -4
- package/dist/testing.js +4 -12
- package/dist/tool.d.ts +40 -73
- package/dist/tool.js +27 -18
- package/package.json +7 -3
|
@@ -46,7 +46,7 @@ declare const OpenAIResponsesBody: Schema.Struct<{
|
|
|
46
46
|
readonly detail: Schema.optional<Schema.String>;
|
|
47
47
|
}>, Schema.Struct<{
|
|
48
48
|
readonly type: Schema.tag<"input_file">;
|
|
49
|
-
readonly filename: Schema.String
|
|
49
|
+
readonly filename: Schema.optional<Schema.String>;
|
|
50
50
|
readonly detail: Schema.optional<Schema.String>;
|
|
51
51
|
readonly file_data: Schema.optional<Schema.String>;
|
|
52
52
|
readonly file_url: Schema.optional<Schema.String>;
|
|
@@ -93,7 +93,7 @@ declare const OpenAIResponsesBody: Schema.Struct<{
|
|
|
93
93
|
readonly detail: Schema.optional<Schema.String>;
|
|
94
94
|
}>, Schema.Struct<{
|
|
95
95
|
readonly type: Schema.tag<"input_file">;
|
|
96
|
-
readonly filename: Schema.String
|
|
96
|
+
readonly filename: Schema.optional<Schema.String>;
|
|
97
97
|
readonly detail: Schema.optional<Schema.String>;
|
|
98
98
|
readonly file_data: Schema.optional<Schema.String>;
|
|
99
99
|
readonly file_url: Schema.optional<Schema.String>;
|
|
@@ -263,7 +263,7 @@ export declare const protocol: Protocol<{
|
|
|
263
263
|
readonly detail?: string | undefined;
|
|
264
264
|
} | {
|
|
265
265
|
readonly type: "input_file";
|
|
266
|
-
readonly filename
|
|
266
|
+
readonly filename?: string | undefined;
|
|
267
267
|
readonly detail?: string | undefined;
|
|
268
268
|
readonly file_data?: string | undefined;
|
|
269
269
|
readonly file_url?: string | undefined;
|
|
@@ -295,7 +295,7 @@ export declare const protocol: Protocol<{
|
|
|
295
295
|
readonly detail?: string | undefined;
|
|
296
296
|
} | {
|
|
297
297
|
readonly type: "input_file";
|
|
298
|
-
readonly filename
|
|
298
|
+
readonly filename?: string | undefined;
|
|
299
299
|
readonly detail?: string | undefined;
|
|
300
300
|
readonly file_data?: string | undefined;
|
|
301
301
|
readonly file_url?: string | undefined;
|
|
@@ -551,7 +551,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
551
551
|
readonly detail?: string | undefined;
|
|
552
552
|
} | {
|
|
553
553
|
readonly type: "input_file";
|
|
554
|
-
readonly filename
|
|
554
|
+
readonly filename?: string | undefined;
|
|
555
555
|
readonly detail?: string | undefined;
|
|
556
556
|
readonly file_data?: string | undefined;
|
|
557
557
|
readonly file_url?: string | undefined;
|
|
@@ -583,7 +583,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
583
583
|
readonly detail?: string | undefined;
|
|
584
584
|
} | {
|
|
585
585
|
readonly type: "input_file";
|
|
586
|
-
readonly filename
|
|
586
|
+
readonly filename?: string | undefined;
|
|
587
587
|
readonly detail?: string | undefined;
|
|
588
588
|
readonly file_data?: string | undefined;
|
|
589
589
|
readonly file_url?: string | undefined;
|
|
@@ -781,7 +781,7 @@ export declare const channelTransport: (options: import("./open-responses-channe
|
|
|
781
781
|
readonly detail?: string | undefined;
|
|
782
782
|
} | {
|
|
783
783
|
readonly type: "input_file";
|
|
784
|
-
readonly filename
|
|
784
|
+
readonly filename?: string | undefined;
|
|
785
785
|
readonly detail?: string | undefined;
|
|
786
786
|
readonly file_data?: string | undefined;
|
|
787
787
|
readonly file_url?: string | undefined;
|
|
@@ -813,7 +813,7 @@ export declare const channelTransport: (options: import("./open-responses-channe
|
|
|
813
813
|
readonly detail?: string | undefined;
|
|
814
814
|
} | {
|
|
815
815
|
readonly type: "input_file";
|
|
816
|
-
readonly filename
|
|
816
|
+
readonly filename?: string | undefined;
|
|
817
817
|
readonly detail?: string | undefined;
|
|
818
818
|
readonly file_data?: string | undefined;
|
|
819
819
|
readonly file_url?: string | undefined;
|
|
@@ -1011,7 +1011,7 @@ export declare const transport: import("../route/transport/index.js").Transport<
|
|
|
1011
1011
|
readonly detail?: string | undefined;
|
|
1012
1012
|
} | {
|
|
1013
1013
|
readonly type: "input_file";
|
|
1014
|
-
readonly filename
|
|
1014
|
+
readonly filename?: string | undefined;
|
|
1015
1015
|
readonly detail?: string | undefined;
|
|
1016
1016
|
readonly file_data?: string | undefined;
|
|
1017
1017
|
readonly file_url?: string | undefined;
|
|
@@ -1043,7 +1043,7 @@ export declare const transport: import("../route/transport/index.js").Transport<
|
|
|
1043
1043
|
readonly detail?: string | undefined;
|
|
1044
1044
|
} | {
|
|
1045
1045
|
readonly type: "input_file";
|
|
1046
|
-
readonly filename
|
|
1046
|
+
readonly filename?: string | undefined;
|
|
1047
1047
|
readonly detail?: string | undefined;
|
|
1048
1048
|
readonly file_data?: string | undefined;
|
|
1049
1049
|
readonly file_url?: string | undefined;
|
|
@@ -1241,7 +1241,7 @@ export declare const route: Route<{
|
|
|
1241
1241
|
readonly detail?: string | undefined;
|
|
1242
1242
|
} | {
|
|
1243
1243
|
readonly type: "input_file";
|
|
1244
|
-
readonly filename
|
|
1244
|
+
readonly filename?: string | undefined;
|
|
1245
1245
|
readonly detail?: string | undefined;
|
|
1246
1246
|
readonly file_data?: string | undefined;
|
|
1247
1247
|
readonly file_url?: string | undefined;
|
|
@@ -1273,7 +1273,7 @@ export declare const route: Route<{
|
|
|
1273
1273
|
readonly detail?: string | undefined;
|
|
1274
1274
|
} | {
|
|
1275
1275
|
readonly type: "input_file";
|
|
1276
|
-
readonly filename
|
|
1276
|
+
readonly filename?: string | undefined;
|
|
1277
1277
|
readonly detail?: string | undefined;
|
|
1278
1278
|
readonly file_data?: string | undefined;
|
|
1279
1279
|
readonly file_url?: string | undefined;
|
|
@@ -76,13 +76,13 @@ const decodeStart = route.decodeStarted(StartResponse, (value) => ({
|
|
|
76
76
|
const decodeTask = route.decodeJson(Task);
|
|
77
77
|
const decodeStatus = Effect.fn("RunwayVideo.decodeStatus")(function* (response, context) {
|
|
78
78
|
const output = yield* decodeTask(response);
|
|
79
|
-
const status =
|
|
79
|
+
const status = MediaProtocol.status(STATUS, output.value.status);
|
|
80
80
|
return { id: context.token.taskID, status, progress: output.value.progress ?? undefined };
|
|
81
81
|
});
|
|
82
82
|
const decodeResult = Effect.fn("RunwayVideo.decodeResult")(function* (response, context) {
|
|
83
83
|
const output = yield* decodeTask(response);
|
|
84
84
|
const task = output.value;
|
|
85
|
-
const status =
|
|
85
|
+
const status = MediaProtocol.status(STATUS, task.status);
|
|
86
86
|
if (status === "failed") {
|
|
87
87
|
const code = task.failureCode ?? undefined;
|
|
88
88
|
const message = `${route.name} task failed${code === undefined ? "" : ` (${code})`}${task.failure ? `: ${task.failure}` : ""}`;
|
|
@@ -35,7 +35,7 @@ export declare const protocol: Protocol<{
|
|
|
35
35
|
readonly detail?: string | undefined;
|
|
36
36
|
} | {
|
|
37
37
|
readonly type: "input_file";
|
|
38
|
-
readonly filename
|
|
38
|
+
readonly filename?: string | undefined;
|
|
39
39
|
readonly detail?: string | undefined;
|
|
40
40
|
readonly file_data?: string | undefined;
|
|
41
41
|
readonly file_url?: string | undefined;
|
|
@@ -67,7 +67,7 @@ export declare const protocol: Protocol<{
|
|
|
67
67
|
readonly detail?: string | undefined;
|
|
68
68
|
} | {
|
|
69
69
|
readonly type: "input_file";
|
|
70
|
-
readonly filename
|
|
70
|
+
readonly filename?: string | undefined;
|
|
71
71
|
readonly detail?: string | undefined;
|
|
72
72
|
readonly file_data?: string | undefined;
|
|
73
73
|
readonly file_url?: string | undefined;
|
|
@@ -50,7 +50,7 @@ const fromRequest = Effect.fn("XAIResponses.fromRequest")(function* (request) {
|
|
|
50
50
|
operation: "in-band-compaction",
|
|
51
51
|
provider: request.model.provider,
|
|
52
52
|
route: request.model.route.id,
|
|
53
|
-
message: "xAI requires explicit compaction through
|
|
53
|
+
message: "xAI requires explicit compaction through ai.compact; automatic context management is not supported",
|
|
54
54
|
});
|
|
55
55
|
const options = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(Options))(request.providerOptions ?? {});
|
|
56
56
|
const body = yield* OpenResponses.fromRequestWithAdapter(request, adapter);
|
|
@@ -82,13 +82,13 @@ const fraction = (progress) => progress !== undefined && progress !== null && pr
|
|
|
82
82
|
const decodeVideoStatus = route.decodeJson(VideoStatus);
|
|
83
83
|
const decodeStatus = Effect.fn("XAIVideo.decodeStatus")(function* (response, context) {
|
|
84
84
|
const output = yield* decodeVideoStatus(response);
|
|
85
|
-
const status =
|
|
85
|
+
const status = MediaProtocol.status(STATUS, output.value.status);
|
|
86
86
|
return { id: context.token.requestID, status, progress: fraction(output.value.progress) };
|
|
87
87
|
});
|
|
88
88
|
const decodeResult = Effect.fn("XAIVideo.decodeResult")(function* (response, context) {
|
|
89
89
|
const output = yield* decodeVideoStatus(response);
|
|
90
90
|
const decoded = output.value;
|
|
91
|
-
const status =
|
|
91
|
+
const status = MediaProtocol.status(STATUS, decoded.status);
|
|
92
92
|
if (status === "running")
|
|
93
93
|
return yield* output.pending(context.token.requestID);
|
|
94
94
|
if (status === "failed") {
|
|
@@ -543,7 +543,7 @@ export declare const routes: (Route<{
|
|
|
543
543
|
readonly detail?: string | undefined;
|
|
544
544
|
} | {
|
|
545
545
|
readonly type: "input_file";
|
|
546
|
-
readonly filename
|
|
546
|
+
readonly filename?: string | undefined;
|
|
547
547
|
readonly detail?: string | undefined;
|
|
548
548
|
readonly file_data?: string | undefined;
|
|
549
549
|
readonly file_url?: string | undefined;
|
|
@@ -575,7 +575,7 @@ export declare const routes: (Route<{
|
|
|
575
575
|
readonly detail?: string | undefined;
|
|
576
576
|
} | {
|
|
577
577
|
readonly type: "input_file";
|
|
578
|
-
readonly filename
|
|
578
|
+
readonly filename?: string | undefined;
|
|
579
579
|
readonly detail?: string | undefined;
|
|
580
580
|
readonly file_data?: string | undefined;
|
|
581
581
|
readonly file_url?: string | undefined;
|
|
@@ -374,7 +374,7 @@ export declare const routes: (Route<{
|
|
|
374
374
|
readonly detail?: string | undefined;
|
|
375
375
|
} | {
|
|
376
376
|
readonly type: "input_file";
|
|
377
|
-
readonly filename
|
|
377
|
+
readonly filename?: string | undefined;
|
|
378
378
|
readonly detail?: string | undefined;
|
|
379
379
|
readonly file_data?: string | undefined;
|
|
380
380
|
readonly file_url?: string | undefined;
|
|
@@ -406,7 +406,7 @@ export declare const routes: (Route<{
|
|
|
406
406
|
readonly detail?: string | undefined;
|
|
407
407
|
} | {
|
|
408
408
|
readonly type: "input_file";
|
|
409
|
-
readonly filename
|
|
409
|
+
readonly filename?: string | undefined;
|
|
410
410
|
readonly detail?: string | undefined;
|
|
411
411
|
readonly file_data?: string | undefined;
|
|
412
412
|
readonly file_url?: string | undefined;
|
|
@@ -50,7 +50,7 @@ declare const responsesRoute: Route<{
|
|
|
50
50
|
readonly detail?: string | undefined;
|
|
51
51
|
} | {
|
|
52
52
|
readonly type: "input_file";
|
|
53
|
-
readonly filename
|
|
53
|
+
readonly filename?: string | undefined;
|
|
54
54
|
readonly detail?: string | undefined;
|
|
55
55
|
readonly file_data?: string | undefined;
|
|
56
56
|
readonly file_url?: string | undefined;
|
|
@@ -82,7 +82,7 @@ declare const responsesRoute: Route<{
|
|
|
82
82
|
readonly detail?: string | undefined;
|
|
83
83
|
} | {
|
|
84
84
|
readonly type: "input_file";
|
|
85
|
-
readonly filename
|
|
85
|
+
readonly filename?: string | undefined;
|
|
86
86
|
readonly detail?: string | undefined;
|
|
87
87
|
readonly file_data?: string | undefined;
|
|
88
88
|
readonly file_url?: string | undefined;
|
|
@@ -455,7 +455,7 @@ export declare const routes: (Route<{
|
|
|
455
455
|
readonly detail?: string | undefined;
|
|
456
456
|
} | {
|
|
457
457
|
readonly type: "input_file";
|
|
458
|
-
readonly filename
|
|
458
|
+
readonly filename?: string | undefined;
|
|
459
459
|
readonly detail?: string | undefined;
|
|
460
460
|
readonly file_data?: string | undefined;
|
|
461
461
|
readonly file_url?: string | undefined;
|
|
@@ -487,7 +487,7 @@ export declare const routes: (Route<{
|
|
|
487
487
|
readonly detail?: string | undefined;
|
|
488
488
|
} | {
|
|
489
489
|
readonly type: "input_file";
|
|
490
|
-
readonly filename
|
|
490
|
+
readonly filename?: string | undefined;
|
|
491
491
|
readonly detail?: string | undefined;
|
|
492
492
|
readonly file_data?: string | undefined;
|
|
493
493
|
readonly file_url?: string | undefined;
|
|
@@ -59,7 +59,7 @@ export declare const responsesRoute: import("../route/client.js").Route<{
|
|
|
59
59
|
readonly detail?: string | undefined;
|
|
60
60
|
} | {
|
|
61
61
|
readonly type: "input_file";
|
|
62
|
-
readonly filename
|
|
62
|
+
readonly filename?: string | undefined;
|
|
63
63
|
readonly detail?: string | undefined;
|
|
64
64
|
readonly file_data?: string | undefined;
|
|
65
65
|
readonly file_url?: string | undefined;
|
|
@@ -91,7 +91,7 @@ export declare const responsesRoute: import("../route/client.js").Route<{
|
|
|
91
91
|
readonly detail?: string | undefined;
|
|
92
92
|
} | {
|
|
93
93
|
readonly type: "input_file";
|
|
94
|
-
readonly filename
|
|
94
|
+
readonly filename?: string | undefined;
|
|
95
95
|
readonly detail?: string | undefined;
|
|
96
96
|
readonly file_data?: string | undefined;
|
|
97
97
|
readonly file_url?: string | undefined;
|
|
@@ -1254,7 +1254,7 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1254
1254
|
readonly detail?: string | undefined;
|
|
1255
1255
|
} | {
|
|
1256
1256
|
readonly type: "input_file";
|
|
1257
|
-
readonly filename
|
|
1257
|
+
readonly filename?: string | undefined;
|
|
1258
1258
|
readonly detail?: string | undefined;
|
|
1259
1259
|
readonly file_data?: string | undefined;
|
|
1260
1260
|
readonly file_url?: string | undefined;
|
|
@@ -1286,7 +1286,7 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1286
1286
|
readonly detail?: string | undefined;
|
|
1287
1287
|
} | {
|
|
1288
1288
|
readonly type: "input_file";
|
|
1289
|
-
readonly filename
|
|
1289
|
+
readonly filename?: string | undefined;
|
|
1290
1290
|
readonly detail?: string | undefined;
|
|
1291
1291
|
readonly file_data?: string | undefined;
|
|
1292
1292
|
readonly file_url?: string | undefined;
|
|
@@ -468,7 +468,7 @@ export declare const routes: (Route<{
|
|
|
468
468
|
readonly detail?: string | undefined;
|
|
469
469
|
} | {
|
|
470
470
|
readonly type: "input_file";
|
|
471
|
-
readonly filename
|
|
471
|
+
readonly filename?: string | undefined;
|
|
472
472
|
readonly detail?: string | undefined;
|
|
473
473
|
readonly file_data?: string | undefined;
|
|
474
474
|
readonly file_url?: string | undefined;
|
|
@@ -500,7 +500,7 @@ export declare const routes: (Route<{
|
|
|
500
500
|
readonly detail?: string | undefined;
|
|
501
501
|
} | {
|
|
502
502
|
readonly type: "input_file";
|
|
503
|
-
readonly filename
|
|
503
|
+
readonly filename?: string | undefined;
|
|
504
504
|
readonly detail?: string | undefined;
|
|
505
505
|
readonly file_data?: string | undefined;
|
|
506
506
|
readonly file_url?: string | undefined;
|
|
@@ -47,7 +47,7 @@ export declare const routes: Route<{
|
|
|
47
47
|
readonly detail?: string | undefined;
|
|
48
48
|
} | {
|
|
49
49
|
readonly type: "input_file";
|
|
50
|
-
readonly filename
|
|
50
|
+
readonly filename?: string | undefined;
|
|
51
51
|
readonly detail?: string | undefined;
|
|
52
52
|
readonly file_data?: string | undefined;
|
|
53
53
|
readonly file_url?: string | undefined;
|
|
@@ -79,7 +79,7 @@ export declare const routes: Route<{
|
|
|
79
79
|
readonly detail?: string | undefined;
|
|
80
80
|
} | {
|
|
81
81
|
readonly type: "input_file";
|
|
82
|
-
readonly filename
|
|
82
|
+
readonly filename?: string | undefined;
|
|
83
83
|
readonly detail?: string | undefined;
|
|
84
84
|
readonly file_data?: string | undefined;
|
|
85
85
|
readonly file_url?: string | undefined;
|
package/dist/providers/meta.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export declare const routes: (Route<{
|
|
|
68
68
|
readonly detail?: string | undefined;
|
|
69
69
|
} | {
|
|
70
70
|
readonly type: "input_file";
|
|
71
|
-
readonly filename
|
|
71
|
+
readonly filename?: string | undefined;
|
|
72
72
|
readonly detail?: string | undefined;
|
|
73
73
|
readonly file_data?: string | undefined;
|
|
74
74
|
readonly file_url?: string | undefined;
|
|
@@ -100,7 +100,7 @@ export declare const routes: (Route<{
|
|
|
100
100
|
readonly detail?: string | undefined;
|
|
101
101
|
} | {
|
|
102
102
|
readonly type: "input_file";
|
|
103
|
-
readonly filename
|
|
103
|
+
readonly filename?: string | undefined;
|
|
104
104
|
readonly detail?: string | undefined;
|
|
105
105
|
readonly file_data?: string | undefined;
|
|
106
106
|
readonly file_url?: string | undefined;
|
|
@@ -372,7 +372,7 @@ export declare const routes: (Route<{
|
|
|
372
372
|
readonly detail?: string | undefined;
|
|
373
373
|
} | {
|
|
374
374
|
readonly type: "input_file";
|
|
375
|
-
readonly filename
|
|
375
|
+
readonly filename?: string | undefined;
|
|
376
376
|
readonly detail?: string | undefined;
|
|
377
377
|
readonly file_data?: string | undefined;
|
|
378
378
|
readonly file_url?: string | undefined;
|
|
@@ -404,7 +404,7 @@ export declare const routes: (Route<{
|
|
|
404
404
|
readonly detail?: string | undefined;
|
|
405
405
|
} | {
|
|
406
406
|
readonly type: "input_file";
|
|
407
|
-
readonly filename
|
|
407
|
+
readonly filename?: string | undefined;
|
|
408
408
|
readonly detail?: string | undefined;
|
|
409
409
|
readonly file_data?: string | undefined;
|
|
410
410
|
readonly file_url?: string | undefined;
|
|
@@ -368,7 +368,7 @@ export declare const routes: (Route<{
|
|
|
368
368
|
readonly detail?: string | undefined;
|
|
369
369
|
} | {
|
|
370
370
|
readonly type: "input_file";
|
|
371
|
-
readonly filename
|
|
371
|
+
readonly filename?: string | undefined;
|
|
372
372
|
readonly detail?: string | undefined;
|
|
373
373
|
readonly file_data?: string | undefined;
|
|
374
374
|
readonly file_url?: string | undefined;
|
|
@@ -400,7 +400,7 @@ export declare const routes: (Route<{
|
|
|
400
400
|
readonly detail?: string | undefined;
|
|
401
401
|
} | {
|
|
402
402
|
readonly type: "input_file";
|
|
403
|
-
readonly filename
|
|
403
|
+
readonly filename?: string | undefined;
|
|
404
404
|
readonly detail?: string | undefined;
|
|
405
405
|
readonly file_data?: string | undefined;
|
|
406
406
|
readonly file_url?: string | undefined;
|
|
@@ -45,7 +45,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
45
45
|
readonly detail?: string | undefined;
|
|
46
46
|
} | {
|
|
47
47
|
readonly type: "input_file";
|
|
48
|
-
readonly filename
|
|
48
|
+
readonly filename?: string | undefined;
|
|
49
49
|
readonly detail?: string | undefined;
|
|
50
50
|
readonly file_data?: string | undefined;
|
|
51
51
|
readonly file_url?: string | undefined;
|
|
@@ -77,7 +77,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
77
77
|
readonly detail?: string | undefined;
|
|
78
78
|
} | {
|
|
79
79
|
readonly type: "input_file";
|
|
80
|
-
readonly filename
|
|
80
|
+
readonly filename?: string | undefined;
|
|
81
81
|
readonly detail?: string | undefined;
|
|
82
82
|
readonly file_data?: string | undefined;
|
|
83
83
|
readonly file_url?: string | undefined;
|
|
@@ -214,7 +214,7 @@ export declare const routes: (Route<{
|
|
|
214
214
|
readonly detail?: string | undefined;
|
|
215
215
|
} | {
|
|
216
216
|
readonly type: "input_file";
|
|
217
|
-
readonly filename
|
|
217
|
+
readonly filename?: string | undefined;
|
|
218
218
|
readonly detail?: string | undefined;
|
|
219
219
|
readonly file_data?: string | undefined;
|
|
220
220
|
readonly file_url?: string | undefined;
|
|
@@ -246,7 +246,7 @@ export declare const routes: (Route<{
|
|
|
246
246
|
readonly detail?: string | undefined;
|
|
247
247
|
} | {
|
|
248
248
|
readonly type: "input_file";
|
|
249
|
-
readonly filename
|
|
249
|
+
readonly filename?: string | undefined;
|
|
250
250
|
readonly detail?: string | undefined;
|
|
251
251
|
readonly file_data?: string | undefined;
|
|
252
252
|
readonly file_url?: string | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { OpenResponsesProviderOptionsInput } from "../open-responses-options.js";
|
|
2
1
|
import type { OpenRouter } from "../openrouter.js";
|
|
3
2
|
export { responsesModel as model } from "../openrouter.js";
|
|
4
|
-
export type Settings = OpenRouter.Settings<
|
|
3
|
+
export type Settings = OpenRouter.Settings<OpenRouter.OpenRouterResponsesProviderOptionsInput>;
|
|
@@ -4,6 +4,7 @@ import { Protocol } from "../route/protocol.js";
|
|
|
4
4
|
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
5
5
|
import { type ModelID, type OpenString, type ProviderOptions } from "../schema/index.js";
|
|
6
6
|
import type { ProviderPackage } from "../provider-package.js";
|
|
7
|
+
import { HttpTransport } from "../route/transport/index.js";
|
|
7
8
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
8
9
|
import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js";
|
|
9
10
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
@@ -73,6 +74,7 @@ export interface OpenRouterOptions {
|
|
|
73
74
|
}>;
|
|
74
75
|
}
|
|
75
76
|
export type OpenRouterProviderOptionsInput = OpenRouterOptions;
|
|
77
|
+
export type OpenRouterResponsesProviderOptionsInput = OpenResponsesProviderOptionsInput & Pick<OpenRouterOptions, "debug" | "models" | "plugins" | "provider" | "user">;
|
|
76
78
|
export interface OpenRouterDecisionOptions {
|
|
77
79
|
readonly [key: string]: unknown;
|
|
78
80
|
readonly provider?: OpenRouterProviderRouting;
|
|
@@ -82,7 +84,7 @@ export interface OpenRouterDecisionOptions {
|
|
|
82
84
|
}
|
|
83
85
|
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
84
86
|
readonly baseURL?: string;
|
|
85
|
-
readonly providerOptions?: OpenRouterProviderOptionsInput |
|
|
87
|
+
readonly providerOptions?: OpenRouterProviderOptionsInput | OpenRouterResponsesProviderOptionsInput;
|
|
86
88
|
};
|
|
87
89
|
export type Settings<Options = OpenRouterProviderOptionsInput> = ProviderPackage.Settings & Options & {
|
|
88
90
|
readonly apiKey?: string;
|
|
@@ -259,9 +261,9 @@ declare const OpenRouterBody: Schema.StructWithRest<Schema.Struct<{
|
|
|
259
261
|
readonly models: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Array<Schema.String>>, never>>;
|
|
260
262
|
readonly provider: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Record<Schema.String, Schema.Unknown>>, never>>;
|
|
261
263
|
readonly plugins: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>>, never>>;
|
|
262
|
-
readonly web_search_options: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Record<Schema.String, Schema.Unknown>>, never>>;
|
|
263
264
|
readonly debug: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Record<Schema.String, Schema.Unknown>>, never>>;
|
|
264
265
|
readonly user: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.String>, never>>;
|
|
266
|
+
readonly web_search_options: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Record<Schema.String, Schema.Unknown>>, never>>;
|
|
265
267
|
readonly reasoning: Schema.optionalKey<Schema.middlewareDecoding<Schema.UndefinedOr<Schema.$Record<Schema.String, Schema.Unknown>>, never>>;
|
|
266
268
|
readonly usage: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
267
269
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
@@ -442,6 +444,10 @@ export declare const protocol: Protocol<{
|
|
|
442
444
|
usage?: {
|
|
443
445
|
readonly [x: string]: unknown;
|
|
444
446
|
} | undefined;
|
|
447
|
+
web_search_options?: {
|
|
448
|
+
readonly [x: string]: unknown;
|
|
449
|
+
} | undefined;
|
|
450
|
+
reasoning?: Record<string, unknown> | undefined;
|
|
445
451
|
models?: readonly string[] | undefined;
|
|
446
452
|
provider?: {
|
|
447
453
|
readonly [x: string]: unknown;
|
|
@@ -449,14 +455,10 @@ export declare const protocol: Protocol<{
|
|
|
449
455
|
plugins?: readonly {
|
|
450
456
|
readonly [x: string]: unknown;
|
|
451
457
|
}[] | undefined;
|
|
452
|
-
web_search_options?: {
|
|
453
|
-
readonly [x: string]: unknown;
|
|
454
|
-
} | undefined;
|
|
455
458
|
debug?: {
|
|
456
459
|
readonly [x: string]: unknown;
|
|
457
460
|
} | undefined;
|
|
458
461
|
user?: string | undefined;
|
|
459
|
-
reasoning?: Record<string, unknown> | undefined;
|
|
460
462
|
}, string, "[DONE]" | {
|
|
461
463
|
readonly [x: string]: unknown;
|
|
462
464
|
readonly choices?: readonly {
|
|
@@ -710,6 +712,10 @@ export declare const route: Route<{
|
|
|
710
712
|
usage?: {
|
|
711
713
|
readonly [x: string]: unknown;
|
|
712
714
|
} | undefined;
|
|
715
|
+
web_search_options?: {
|
|
716
|
+
readonly [x: string]: unknown;
|
|
717
|
+
} | undefined;
|
|
718
|
+
reasoning?: Record<string, unknown> | undefined;
|
|
713
719
|
models?: readonly string[] | undefined;
|
|
714
720
|
provider?: {
|
|
715
721
|
readonly [x: string]: unknown;
|
|
@@ -717,15 +723,11 @@ export declare const route: Route<{
|
|
|
717
723
|
plugins?: readonly {
|
|
718
724
|
readonly [x: string]: unknown;
|
|
719
725
|
}[] | undefined;
|
|
720
|
-
web_search_options?: {
|
|
721
|
-
readonly [x: string]: unknown;
|
|
722
|
-
} | undefined;
|
|
723
726
|
debug?: {
|
|
724
727
|
readonly [x: string]: unknown;
|
|
725
728
|
} | undefined;
|
|
726
729
|
user?: string | undefined;
|
|
727
|
-
|
|
728
|
-
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
730
|
+
}, HttpTransport.HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
729
731
|
export declare const routes: (Route<{
|
|
730
732
|
readonly model: string;
|
|
731
733
|
readonly input: readonly ({
|
|
@@ -756,7 +758,7 @@ export declare const routes: (Route<{
|
|
|
756
758
|
readonly detail?: string | undefined;
|
|
757
759
|
} | {
|
|
758
760
|
readonly type: "input_file";
|
|
759
|
-
readonly filename
|
|
761
|
+
readonly filename?: string | undefined;
|
|
760
762
|
readonly detail?: string | undefined;
|
|
761
763
|
readonly file_data?: string | undefined;
|
|
762
764
|
readonly file_url?: string | undefined;
|
|
@@ -788,7 +790,7 @@ export declare const routes: (Route<{
|
|
|
788
790
|
readonly detail?: string | undefined;
|
|
789
791
|
} | {
|
|
790
792
|
readonly type: "input_file";
|
|
791
|
-
readonly filename
|
|
793
|
+
readonly filename?: string | undefined;
|
|
792
794
|
readonly detail?: string | undefined;
|
|
793
795
|
readonly file_data?: string | undefined;
|
|
794
796
|
readonly file_url?: string | undefined;
|
|
@@ -923,7 +925,18 @@ export declare const routes: (Route<{
|
|
|
923
925
|
readonly presence_penalty?: number | undefined;
|
|
924
926
|
readonly frequency_penalty?: number | undefined;
|
|
925
927
|
readonly stream: true;
|
|
926
|
-
|
|
928
|
+
readonly models?: readonly string[] | undefined;
|
|
929
|
+
readonly provider?: {
|
|
930
|
+
readonly [x: string]: unknown;
|
|
931
|
+
} | undefined;
|
|
932
|
+
readonly plugins?: readonly {
|
|
933
|
+
readonly [x: string]: unknown;
|
|
934
|
+
}[] | undefined;
|
|
935
|
+
readonly debug?: {
|
|
936
|
+
readonly [x: string]: unknown;
|
|
937
|
+
} | undefined;
|
|
938
|
+
readonly user?: string | undefined;
|
|
939
|
+
}, HttpTransport.HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | Route<{
|
|
927
940
|
model: string;
|
|
928
941
|
messages: readonly ({
|
|
929
942
|
readonly role: "system";
|
|
@@ -1099,6 +1112,10 @@ export declare const routes: (Route<{
|
|
|
1099
1112
|
usage?: {
|
|
1100
1113
|
readonly [x: string]: unknown;
|
|
1101
1114
|
} | undefined;
|
|
1115
|
+
web_search_options?: {
|
|
1116
|
+
readonly [x: string]: unknown;
|
|
1117
|
+
} | undefined;
|
|
1118
|
+
reasoning?: Record<string, unknown> | undefined;
|
|
1102
1119
|
models?: readonly string[] | undefined;
|
|
1103
1120
|
provider?: {
|
|
1104
1121
|
readonly [x: string]: unknown;
|
|
@@ -1106,19 +1123,15 @@ export declare const routes: (Route<{
|
|
|
1106
1123
|
plugins?: readonly {
|
|
1107
1124
|
readonly [x: string]: unknown;
|
|
1108
1125
|
}[] | undefined;
|
|
1109
|
-
web_search_options?: {
|
|
1110
|
-
readonly [x: string]: unknown;
|
|
1111
|
-
} | undefined;
|
|
1112
1126
|
debug?: {
|
|
1113
1127
|
readonly [x: string]: unknown;
|
|
1114
1128
|
} | undefined;
|
|
1115
1129
|
user?: string | undefined;
|
|
1116
|
-
|
|
1117
|
-
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
|
|
1130
|
+
}, HttpTransport.HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
|
|
1118
1131
|
export declare const configure: (input?: Config) => {
|
|
1119
1132
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1120
1133
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterOptions, import("../route/client.js").CompactionOperations | undefined>;
|
|
1121
|
-
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
1134
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterResponsesProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
1122
1135
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1123
1136
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1124
1137
|
configure: typeof configure;
|
|
@@ -1126,16 +1139,16 @@ export declare const configure: (input?: Config) => {
|
|
|
1126
1139
|
export declare const provider: {
|
|
1127
1140
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1128
1141
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterOptions, import("../route/client.js").CompactionOperations | undefined>;
|
|
1129
|
-
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
1142
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterResponsesProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
1130
1143
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1131
1144
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1132
1145
|
configure: typeof configure;
|
|
1133
1146
|
};
|
|
1134
1147
|
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1135
1148
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1136
|
-
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
1149
|
+
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterResponsesProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
1137
1150
|
export declare const model: ProviderPackage.Model<Settings, OpenRouterProviderOptionsInput>;
|
|
1138
|
-
export declare const responsesModel: ProviderPackage.Model<Settings<
|
|
1151
|
+
export declare const responsesModel: ProviderPackage.Model<Settings<OpenRouterResponsesProviderOptionsInput>, OpenRouterResponsesProviderOptionsInput>;
|
|
1139
1152
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1140
1153
|
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1141
1154
|
export * as OpenRouter from "./openrouter.js";
|