@opencode-ai/ai 0.0.0-next-16134 → 0.0.0-next-16144
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 +1 -1
- package/dist/protocols/index.d.ts +1 -0
- package/dist/protocols/index.js +1 -0
- package/dist/protocols/open-responses.d.ts +613 -0
- package/dist/protocols/open-responses.js +756 -0
- package/dist/protocols/openai-chat.js +6 -7
- package/dist/protocols/openai-compatible-responses.d.ts +9 -21
- package/dist/protocols/openai-compatible-responses.js +8 -9
- package/dist/protocols/openai-responses.d.ts +55 -77
- package/dist/protocols/openai-responses.js +59 -771
- package/dist/protocols/utils/open-responses-options.d.ts +22 -0
- package/dist/protocols/utils/open-responses-options.js +42 -0
- package/dist/protocols/utils/openai-options.d.ts +8 -16
- package/dist/protocols/utils/openai-options.js +9 -59
- package/dist/protocols/utils/tool-schema.d.ts +1 -0
- package/dist/protocols/utils/tool-schema.js +2 -0
- package/dist/providers/azure.d.ts +4 -4
- package/dist/providers/github-copilot.d.ts +4 -4
- package/dist/providers/google-vertex-responses.d.ts +6 -18
- package/dist/providers/google-vertex-responses.js +1 -0
- package/dist/providers/open-responses-options.d.ts +17 -0
- package/dist/providers/open-responses-options.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +10 -20
- package/dist/providers/openai-options.d.ts +3 -12
- package/dist/providers/openai.d.ts +8 -8
- package/dist/providers/xai.d.ts +4 -4
- package/dist/route/protocol.d.ts +2 -1
- package/package.json +3 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { TextVerbosity, type LLMRequest } from "../../schema";
|
|
3
|
+
export declare const ResponseIncludables: readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"];
|
|
4
|
+
export type ResponseIncludable = (typeof ResponseIncludables)[number];
|
|
5
|
+
export declare const ServiceTiers: readonly ["auto", "default", "flex", "priority"];
|
|
6
|
+
export type ServiceTier = (typeof ServiceTiers)[number];
|
|
7
|
+
export declare const ReasoningEffort: Schema.String;
|
|
8
|
+
export declare const TextVerbositySchema: Schema.Literals<readonly ["low", "medium", "high"]>;
|
|
9
|
+
export declare const ResponseIncludableSchema: Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>;
|
|
10
|
+
export declare const ServiceTierSchema: Schema.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
11
|
+
export interface Resolved {
|
|
12
|
+
readonly instructions?: string;
|
|
13
|
+
readonly store?: boolean;
|
|
14
|
+
readonly promptCacheKey?: string;
|
|
15
|
+
readonly reasoningEffort?: string;
|
|
16
|
+
readonly reasoningSummary?: "auto" | "concise" | "detailed";
|
|
17
|
+
readonly include?: ReadonlyArray<ResponseIncludable>;
|
|
18
|
+
readonly textVerbosity?: Schema.Schema.Type<typeof TextVerbosity>;
|
|
19
|
+
readonly serviceTier?: ServiceTier;
|
|
20
|
+
}
|
|
21
|
+
export declare const resolve: (request: LLMRequest) => Resolved;
|
|
22
|
+
export * as OpenResponsesOptions from "./open-responses-options";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { TextVerbosity } from "../../schema";
|
|
3
|
+
export const ResponseIncludables = [
|
|
4
|
+
"file_search_call.results",
|
|
5
|
+
"web_search_call.results",
|
|
6
|
+
"web_search_call.action.sources",
|
|
7
|
+
"message.input_image.image_url",
|
|
8
|
+
"computer_call_output.output.image_url",
|
|
9
|
+
"code_interpreter_call.outputs",
|
|
10
|
+
"reasoning.encrypted_content",
|
|
11
|
+
"message.output_text.logprobs",
|
|
12
|
+
];
|
|
13
|
+
export const ServiceTiers = ["auto", "default", "flex", "priority"];
|
|
14
|
+
const TEXT_VERBOSITY = new Set(["low", "medium", "high"]);
|
|
15
|
+
const INCLUDABLES = new Set(ResponseIncludables);
|
|
16
|
+
const SERVICE_TIERS = new Set(ServiceTiers);
|
|
17
|
+
const isTextVerbosity = (value) => typeof value === "string" && TEXT_VERBOSITY.has(value);
|
|
18
|
+
const isServiceTier = (value) => typeof value === "string" && SERVICE_TIERS.has(value);
|
|
19
|
+
export const ReasoningEffort = Schema.String;
|
|
20
|
+
export const TextVerbositySchema = TextVerbosity;
|
|
21
|
+
export const ResponseIncludableSchema = Schema.Literals(ResponseIncludables);
|
|
22
|
+
export const ServiceTierSchema = Schema.Literals(ServiceTiers);
|
|
23
|
+
export const resolve = (request) => {
|
|
24
|
+
const input = request.providerOptions?.[request.model.route.providerMetadataKey ?? "openresponses"];
|
|
25
|
+
const include = Array.isArray(input?.include)
|
|
26
|
+
? input.include.filter((entry) => INCLUDABLES.has(entry))
|
|
27
|
+
: [];
|
|
28
|
+
const reasoningSummary = input?.reasoningSummary;
|
|
29
|
+
return {
|
|
30
|
+
instructions: typeof input?.instructions === "string" ? input.instructions : undefined,
|
|
31
|
+
store: typeof input?.store === "boolean" ? input.store : undefined,
|
|
32
|
+
promptCacheKey: typeof input?.promptCacheKey === "string" ? input.promptCacheKey : undefined,
|
|
33
|
+
reasoningEffort: typeof input?.reasoningEffort === "string" ? input.reasoningEffort : undefined,
|
|
34
|
+
reasoningSummary: reasoningSummary === "auto" || reasoningSummary === "concise" || reasoningSummary === "detailed"
|
|
35
|
+
? reasoningSummary
|
|
36
|
+
: undefined,
|
|
37
|
+
include: include.length > 0 ? include : undefined,
|
|
38
|
+
textVerbosity: isTextVerbosity(input?.textVerbosity) ? input.textVerbosity : undefined,
|
|
39
|
+
serviceTier: isServiceTier(input?.serviceTier) ? input.serviceTier : undefined,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export * as OpenResponsesOptions from "./open-responses-options";
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { LLMRequest } from "../../schema";
|
|
1
|
+
import { OpenResponsesOptions } from "./open-responses-options";
|
|
3
2
|
export declare const OpenAIReasoningEfforts: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
4
3
|
export type OpenAIReasoningEffort = string;
|
|
5
4
|
export declare const OpenAIResponseIncludables: readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"];
|
|
6
|
-
export type OpenAIResponseIncludable =
|
|
5
|
+
export type OpenAIResponseIncludable = OpenResponsesOptions.ResponseIncludable;
|
|
7
6
|
export declare const OpenAIServiceTiers: readonly ["auto", "default", "flex", "priority"];
|
|
8
|
-
export type OpenAIServiceTier =
|
|
9
|
-
export declare const OpenAIReasoningEffort: Schema.String;
|
|
10
|
-
export declare const OpenAITextVerbosity: Schema.Literals<readonly ["low", "medium", "high"]>;
|
|
11
|
-
export declare const OpenAIResponseIncludable: Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>;
|
|
12
|
-
export declare const OpenAIServiceTier: Schema.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
7
|
+
export type OpenAIServiceTier = OpenResponsesOptions.ServiceTier;
|
|
8
|
+
export declare const OpenAIReasoningEffort: import("effect/Schema").String;
|
|
9
|
+
export declare const OpenAITextVerbosity: import("effect/Schema").Literals<readonly ["low", "medium", "high"]>;
|
|
10
|
+
export declare const OpenAIResponseIncludable: import("effect/Schema").Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>;
|
|
11
|
+
export declare const OpenAIServiceTier: import("effect/Schema").Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
13
12
|
export declare const isReasoningEffort: (effort: unknown) => effort is OpenAIReasoningEffort;
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const reasoningEffort: (request: LLMRequest) => string | undefined;
|
|
16
|
-
export declare const reasoningSummary: (request: LLMRequest) => "auto" | undefined;
|
|
17
|
-
export declare const include: (request: LLMRequest) => ReadonlyArray<OpenAIResponseIncludable> | undefined;
|
|
18
|
-
export declare const promptCacheKey: (request: LLMRequest) => string | undefined;
|
|
19
|
-
export declare const textVerbosity: (request: LLMRequest) => "low" | "medium" | "high" | undefined;
|
|
20
|
-
export declare const serviceTier: (request: LLMRequest) => "auto" | "default" | "flex" | "priority" | undefined;
|
|
21
|
-
export declare const instructions: (request: LLMRequest) => string | undefined;
|
|
13
|
+
export declare const resolve: (request: import("../..").LLMRequest) => OpenResponsesOptions.Resolved;
|
|
22
14
|
export * as OpenAIOptions from "./openai-options";
|
|
@@ -1,64 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ReasoningEfforts } from "../../schema";
|
|
2
|
+
import { OpenResponsesOptions } from "./open-responses-options";
|
|
3
3
|
export const OpenAIReasoningEfforts = ReasoningEfforts;
|
|
4
4
|
// Mirrors OpenAI's `ResponseIncludable` union from the official SDK. Keep this
|
|
5
5
|
// in lockstep with `openai-node/src/resources/responses/responses.ts`.
|
|
6
|
-
export const OpenAIResponseIncludables =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"code_interpreter_call.outputs",
|
|
13
|
-
"reasoning.encrypted_content",
|
|
14
|
-
"message.output_text.logprobs",
|
|
15
|
-
];
|
|
16
|
-
export const OpenAIServiceTiers = ["auto", "default", "flex", "priority"];
|
|
17
|
-
const TEXT_VERBOSITY = new Set(["low", "medium", "high"]);
|
|
18
|
-
const INCLUDABLES = new Set(OpenAIResponseIncludables);
|
|
19
|
-
const SERVICE_TIERS = new Set(OpenAIServiceTiers);
|
|
20
|
-
export const OpenAIReasoningEffort = Schema.String;
|
|
21
|
-
export const OpenAITextVerbosity = TextVerbosity;
|
|
22
|
-
export const OpenAIResponseIncludable = Schema.Literals(OpenAIResponseIncludables);
|
|
23
|
-
export const OpenAIServiceTier = Schema.Literals(OpenAIServiceTiers);
|
|
6
|
+
export const OpenAIResponseIncludables = OpenResponsesOptions.ResponseIncludables;
|
|
7
|
+
export const OpenAIServiceTiers = OpenResponsesOptions.ServiceTiers;
|
|
8
|
+
export const OpenAIReasoningEffort = OpenResponsesOptions.ReasoningEffort;
|
|
9
|
+
export const OpenAITextVerbosity = OpenResponsesOptions.TextVerbositySchema;
|
|
10
|
+
export const OpenAIResponseIncludable = OpenResponsesOptions.ResponseIncludableSchema;
|
|
11
|
+
export const OpenAIServiceTier = OpenResponsesOptions.ServiceTierSchema;
|
|
24
12
|
export const isReasoningEffort = (effort) => typeof effort === "string";
|
|
25
|
-
const
|
|
26
|
-
const options = (request) => request.providerOptions?.openai;
|
|
27
|
-
export const store = (request) => {
|
|
28
|
-
const value = options(request)?.store;
|
|
29
|
-
return typeof value === "boolean" ? value : undefined;
|
|
30
|
-
};
|
|
31
|
-
export const reasoningEffort = (request) => {
|
|
32
|
-
const value = options(request)?.reasoningEffort;
|
|
33
|
-
return typeof value === "string" ? value : undefined;
|
|
34
|
-
};
|
|
35
|
-
export const reasoningSummary = (request) => options(request)?.reasoningSummary === "auto" ? "auto" : undefined;
|
|
36
|
-
// Resolve the OpenAI Responses `include` field. Filters out unknown
|
|
37
|
-
// includable values defensively so a typo in upstream config drops the
|
|
38
|
-
// invalid entry instead of poisoning the wire body. An empty array (either
|
|
39
|
-
// passed directly or produced by filtering) is treated as "no include" and
|
|
40
|
-
// returns undefined so the request body omits the field entirely.
|
|
41
|
-
export const include = (request) => {
|
|
42
|
-
const value = options(request)?.include;
|
|
43
|
-
if (!Array.isArray(value))
|
|
44
|
-
return undefined;
|
|
45
|
-
const filtered = value.filter((entry) => INCLUDABLES.has(entry));
|
|
46
|
-
return filtered.length > 0 ? filtered : undefined;
|
|
47
|
-
};
|
|
48
|
-
export const promptCacheKey = (request) => {
|
|
49
|
-
const value = options(request)?.promptCacheKey;
|
|
50
|
-
return typeof value === "string" ? value : undefined;
|
|
51
|
-
};
|
|
52
|
-
export const textVerbosity = (request) => {
|
|
53
|
-
const value = options(request)?.textVerbosity;
|
|
54
|
-
return isTextVerbosity(value) ? value : undefined;
|
|
55
|
-
};
|
|
56
|
-
export const serviceTier = (request) => {
|
|
57
|
-
const value = options(request)?.serviceTier;
|
|
58
|
-
return typeof value === "string" && SERVICE_TIERS.has(value) ? value : undefined;
|
|
59
|
-
};
|
|
60
|
-
export const instructions = (request) => {
|
|
61
|
-
const value = options(request)?.instructions;
|
|
62
|
-
return typeof value === "string" ? value : undefined;
|
|
63
|
-
};
|
|
13
|
+
export const resolve = OpenResponsesOptions.resolve;
|
|
64
14
|
export * as OpenAIOptions from "./openai-options";
|
|
@@ -4,4 +4,5 @@ export declare const ToolSchemaProjection: {
|
|
|
4
4
|
readonly modelCompatibility: (schema: JsonSchema, compatibility: ModelToolSchemaCompatibility | undefined) => JsonSchema;
|
|
5
5
|
readonly moonshot: (schema: JsonSchema) => JsonSchema;
|
|
6
6
|
readonly openAI: (schema: JsonSchema) => JsonSchema;
|
|
7
|
+
readonly responses: (schema: JsonSchema) => JsonSchema;
|
|
7
8
|
};
|
|
@@ -60,6 +60,7 @@ const openAI = (schema) => {
|
|
|
60
60
|
const normalized = removeNullSchemas(flattened);
|
|
61
61
|
return isRecord(normalized) ? normalized : { type: "object" };
|
|
62
62
|
};
|
|
63
|
+
const responses = openAI;
|
|
63
64
|
const gemini = (schema) => GeminiToolSchema.convert(schema) ?? {};
|
|
64
65
|
const modelCompatibility = (schema, compatibility) => {
|
|
65
66
|
if (compatibility === undefined)
|
|
@@ -76,4 +77,5 @@ export const ToolSchemaProjection = {
|
|
|
76
77
|
modelCompatibility,
|
|
77
78
|
moonshot,
|
|
78
79
|
openAI,
|
|
80
|
+
responses,
|
|
79
81
|
};
|
|
@@ -105,7 +105,7 @@ export declare const routes: (RouteDef<{
|
|
|
105
105
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
106
106
|
readonly type: import("effect/Schema").tag<"input_text">;
|
|
107
107
|
readonly text: import("effect/Schema").String;
|
|
108
|
-
}>, import("effect/Schema").Struct<{
|
|
108
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
109
109
|
readonly type: import("effect/Schema").tag<"input_image">;
|
|
110
110
|
readonly image_url: import("effect/Schema").String;
|
|
111
111
|
}>, import("effect/Schema").Struct<{
|
|
@@ -113,7 +113,7 @@ export declare const routes: (RouteDef<{
|
|
|
113
113
|
readonly filename: import("effect/Schema").String;
|
|
114
114
|
readonly file_data: import("effect/Schema").String;
|
|
115
115
|
readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
116
|
-
}>]>>;
|
|
116
|
+
}>]>]>>;
|
|
117
117
|
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
118
118
|
readonly role: import("effect/Schema").tag<"assistant">;
|
|
119
119
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
@@ -148,7 +148,7 @@ export declare const routes: (RouteDef<{
|
|
|
148
148
|
} | undefined;
|
|
149
149
|
readonly reasoning?: {
|
|
150
150
|
readonly effort?: string | undefined;
|
|
151
|
-
readonly summary?: "auto" | undefined;
|
|
151
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
152
152
|
} | undefined;
|
|
153
153
|
readonly tools?: readonly ({
|
|
154
154
|
readonly type: "function";
|
|
@@ -177,9 +177,9 @@ export declare const routes: (RouteDef<{
|
|
|
177
177
|
readonly type: import("effect/Schema").tag<"image_generation">;
|
|
178
178
|
}, "Type"> | undefined;
|
|
179
179
|
readonly top_p?: number | undefined;
|
|
180
|
-
readonly store?: boolean | undefined;
|
|
181
180
|
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
182
181
|
readonly instructions?: string | undefined;
|
|
182
|
+
readonly store?: boolean | undefined;
|
|
183
183
|
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
184
184
|
readonly prompt_cache_key?: string | undefined;
|
|
185
185
|
readonly max_output_tokens?: number | undefined;
|
|
@@ -93,7 +93,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
93
93
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
94
94
|
readonly type: import("effect/Schema").tag<"input_text">;
|
|
95
95
|
readonly text: import("effect/Schema").String;
|
|
96
|
-
}>, import("effect/Schema").Struct<{
|
|
96
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
97
97
|
readonly type: import("effect/Schema").tag<"input_image">;
|
|
98
98
|
readonly image_url: import("effect/Schema").String;
|
|
99
99
|
}>, import("effect/Schema").Struct<{
|
|
@@ -101,7 +101,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
101
101
|
readonly filename: import("effect/Schema").String;
|
|
102
102
|
readonly file_data: import("effect/Schema").String;
|
|
103
103
|
readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
104
|
-
}>]>>;
|
|
104
|
+
}>]>]>>;
|
|
105
105
|
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
106
106
|
readonly role: import("effect/Schema").tag<"assistant">;
|
|
107
107
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
@@ -136,7 +136,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
136
136
|
} | undefined;
|
|
137
137
|
readonly reasoning?: {
|
|
138
138
|
readonly effort?: string | undefined;
|
|
139
|
-
readonly summary?: "auto" | undefined;
|
|
139
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
140
140
|
} | undefined;
|
|
141
141
|
readonly tools?: readonly ({
|
|
142
142
|
readonly type: "function";
|
|
@@ -165,9 +165,9 @@ export declare const routes: (import("../route").Route<{
|
|
|
165
165
|
readonly type: import("effect/Schema").tag<"image_generation">;
|
|
166
166
|
}, "Type"> | undefined;
|
|
167
167
|
readonly top_p?: number | undefined;
|
|
168
|
-
readonly store?: boolean | undefined;
|
|
169
168
|
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
170
169
|
readonly instructions?: string | undefined;
|
|
170
|
+
readonly store?: boolean | undefined;
|
|
171
171
|
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
172
172
|
readonly prompt_cache_key?: string | undefined;
|
|
173
173
|
readonly max_output_tokens?: number | undefined;
|
|
@@ -36,7 +36,7 @@ export declare const routes: import("../route").Route<{
|
|
|
36
36
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
37
37
|
readonly type: import("effect/Schema").tag<"input_text">;
|
|
38
38
|
readonly text: import("effect/Schema").String;
|
|
39
|
-
}>, import("effect/Schema").Struct<{
|
|
39
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
40
40
|
readonly type: import("effect/Schema").tag<"input_image">;
|
|
41
41
|
readonly image_url: import("effect/Schema").String;
|
|
42
42
|
}>, import("effect/Schema").Struct<{
|
|
@@ -44,7 +44,7 @@ export declare const routes: import("../route").Route<{
|
|
|
44
44
|
readonly filename: import("effect/Schema").String;
|
|
45
45
|
readonly file_data: import("effect/Schema").String;
|
|
46
46
|
readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
47
|
-
}>]>>;
|
|
47
|
+
}>]>]>>;
|
|
48
48
|
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
49
49
|
readonly role: import("effect/Schema").tag<"assistant">;
|
|
50
50
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
@@ -79,9 +79,9 @@ export declare const routes: import("../route").Route<{
|
|
|
79
79
|
} | undefined;
|
|
80
80
|
readonly reasoning?: {
|
|
81
81
|
readonly effort?: string | undefined;
|
|
82
|
-
readonly summary?: "auto" | undefined;
|
|
82
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
83
83
|
} | undefined;
|
|
84
|
-
readonly tools?: readonly
|
|
84
|
+
readonly tools?: readonly {
|
|
85
85
|
readonly type: "function";
|
|
86
86
|
readonly name: string;
|
|
87
87
|
readonly description: string;
|
|
@@ -89,28 +89,16 @@ export declare const routes: import("../route").Route<{
|
|
|
89
89
|
readonly [x: string]: unknown;
|
|
90
90
|
};
|
|
91
91
|
readonly strict?: boolean | undefined;
|
|
92
|
-
} |
|
|
93
|
-
readonly type: "image_generation";
|
|
94
|
-
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
95
|
-
readonly size?: string | undefined;
|
|
96
|
-
readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
|
|
97
|
-
readonly background?: "auto" | "opaque" | "transparent" | undefined;
|
|
98
|
-
readonly output_compression?: number | undefined;
|
|
99
|
-
readonly action?: "generate" | "auto" | "edit" | undefined;
|
|
100
|
-
readonly input_fidelity?: "low" | "high" | undefined;
|
|
101
|
-
readonly partial_images?: number | undefined;
|
|
102
|
-
})[] | undefined;
|
|
92
|
+
}[] | undefined;
|
|
103
93
|
readonly temperature?: number | undefined;
|
|
104
94
|
readonly tool_choice?: "required" | "none" | "auto" | import("effect/Schema").Struct.ReadonlySide<{
|
|
105
95
|
readonly type: import("effect/Schema").tag<"function">;
|
|
106
96
|
readonly name: import("effect/Schema").String;
|
|
107
|
-
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
108
|
-
readonly type: import("effect/Schema").tag<"image_generation">;
|
|
109
97
|
}, "Type"> | undefined;
|
|
110
98
|
readonly top_p?: number | undefined;
|
|
111
|
-
readonly store?: boolean | undefined;
|
|
112
99
|
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
113
100
|
readonly instructions?: string | undefined;
|
|
101
|
+
readonly store?: boolean | undefined;
|
|
114
102
|
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
115
103
|
readonly prompt_cache_key?: string | undefined;
|
|
116
104
|
readonly max_output_tokens?: number | undefined;
|
|
@@ -5,6 +5,7 @@ export const id = ProviderID.make("google-vertex");
|
|
|
5
5
|
const route = OpenAICompatibleResponses.route.with({
|
|
6
6
|
id: "google-vertex-responses",
|
|
7
7
|
provider: id,
|
|
8
|
+
providerOptions: { openresponses: { store: false } },
|
|
8
9
|
});
|
|
9
10
|
export const routes = [route];
|
|
10
11
|
const configuredRoute = (input) => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ResponseIncludable, ServiceTier } from "../protocols/utils/open-responses-options";
|
|
2
|
+
import type { ProviderOptions, ReasoningEffort, TextVerbosity } from "../schema";
|
|
3
|
+
export interface OpenResponsesOptionsInput {
|
|
4
|
+
readonly [key: string]: unknown;
|
|
5
|
+
readonly instructions?: string;
|
|
6
|
+
readonly store?: boolean;
|
|
7
|
+
readonly promptCacheKey?: string;
|
|
8
|
+
readonly reasoningEffort?: ReasoningEffort;
|
|
9
|
+
readonly reasoningSummary?: "auto" | "concise" | "detailed";
|
|
10
|
+
readonly include?: ReadonlyArray<ResponseIncludable>;
|
|
11
|
+
readonly textVerbosity?: TextVerbosity;
|
|
12
|
+
readonly serviceTier?: ServiceTier;
|
|
13
|
+
}
|
|
14
|
+
export type OpenResponsesProviderOptionsInput = ProviderOptions & {
|
|
15
|
+
readonly openresponses?: OpenResponsesOptionsInput;
|
|
16
|
+
};
|
|
17
|
+
export * as OpenResponsesProviderOptions from "./open-responses-options";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as OpenResponsesProviderOptions from "./open-responses-options";
|
|
@@ -2,17 +2,19 @@ import type { ProviderPackage } from "../provider-package";
|
|
|
2
2
|
import { type ProviderAuthOption } from "../route/auth-options";
|
|
3
3
|
import type { RouteDefaultsInput } from "../route/client";
|
|
4
4
|
import { type ModelID } from "../schema";
|
|
5
|
-
import type {
|
|
5
|
+
import type { OpenResponsesProviderOptionsInput } from "./open-responses-options";
|
|
6
|
+
export type { OpenResponsesOptionsInput, OpenResponsesProviderOptionsInput } from "./open-responses-options";
|
|
6
7
|
export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
|
|
7
8
|
export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
8
9
|
readonly provider?: string;
|
|
9
10
|
readonly baseURL: string;
|
|
11
|
+
readonly providerOptions?: OpenResponsesProviderOptionsInput;
|
|
10
12
|
};
|
|
11
13
|
export interface Settings extends ProviderPackage.Settings {
|
|
12
14
|
readonly apiKey?: string;
|
|
13
15
|
readonly baseURL: string;
|
|
14
16
|
readonly provider?: string;
|
|
15
|
-
readonly providerOptions?:
|
|
17
|
+
readonly providerOptions?: OpenResponsesProviderOptionsInput;
|
|
16
18
|
}
|
|
17
19
|
export declare const routes: import("../route").Route<{
|
|
18
20
|
readonly input: readonly ({
|
|
@@ -34,7 +36,7 @@ export declare const routes: import("../route").Route<{
|
|
|
34
36
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
35
37
|
readonly type: import("effect/Schema").tag<"input_text">;
|
|
36
38
|
readonly text: import("effect/Schema").String;
|
|
37
|
-
}>, import("effect/Schema").Struct<{
|
|
39
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
38
40
|
readonly type: import("effect/Schema").tag<"input_image">;
|
|
39
41
|
readonly image_url: import("effect/Schema").String;
|
|
40
42
|
}>, import("effect/Schema").Struct<{
|
|
@@ -42,7 +44,7 @@ export declare const routes: import("../route").Route<{
|
|
|
42
44
|
readonly filename: import("effect/Schema").String;
|
|
43
45
|
readonly file_data: import("effect/Schema").String;
|
|
44
46
|
readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
45
|
-
}>]>>;
|
|
47
|
+
}>]>]>>;
|
|
46
48
|
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
47
49
|
readonly role: import("effect/Schema").tag<"assistant">;
|
|
48
50
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
@@ -77,9 +79,9 @@ export declare const routes: import("../route").Route<{
|
|
|
77
79
|
} | undefined;
|
|
78
80
|
readonly reasoning?: {
|
|
79
81
|
readonly effort?: string | undefined;
|
|
80
|
-
readonly summary?: "auto" | undefined;
|
|
82
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
81
83
|
} | undefined;
|
|
82
|
-
readonly tools?: readonly
|
|
84
|
+
readonly tools?: readonly {
|
|
83
85
|
readonly type: "function";
|
|
84
86
|
readonly name: string;
|
|
85
87
|
readonly description: string;
|
|
@@ -87,28 +89,16 @@ export declare const routes: import("../route").Route<{
|
|
|
87
89
|
readonly [x: string]: unknown;
|
|
88
90
|
};
|
|
89
91
|
readonly strict?: boolean | undefined;
|
|
90
|
-
} |
|
|
91
|
-
readonly type: "image_generation";
|
|
92
|
-
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
93
|
-
readonly size?: string | undefined;
|
|
94
|
-
readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
|
|
95
|
-
readonly background?: "auto" | "opaque" | "transparent" | undefined;
|
|
96
|
-
readonly output_compression?: number | undefined;
|
|
97
|
-
readonly action?: "generate" | "auto" | "edit" | undefined;
|
|
98
|
-
readonly input_fidelity?: "low" | "high" | undefined;
|
|
99
|
-
readonly partial_images?: number | undefined;
|
|
100
|
-
})[] | undefined;
|
|
92
|
+
}[] | undefined;
|
|
101
93
|
readonly temperature?: number | undefined;
|
|
102
94
|
readonly tool_choice?: "required" | "none" | "auto" | import("effect/Schema").Struct.ReadonlySide<{
|
|
103
95
|
readonly type: import("effect/Schema").tag<"function">;
|
|
104
96
|
readonly name: import("effect/Schema").String;
|
|
105
|
-
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
106
|
-
readonly type: import("effect/Schema").tag<"image_generation">;
|
|
107
97
|
}, "Type"> | undefined;
|
|
108
98
|
readonly top_p?: number | undefined;
|
|
109
|
-
readonly store?: boolean | undefined;
|
|
110
99
|
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
111
100
|
readonly instructions?: string | undefined;
|
|
101
|
+
readonly store?: boolean | undefined;
|
|
112
102
|
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
113
103
|
readonly prompt_cache_key?: string | undefined;
|
|
114
104
|
readonly max_output_tokens?: number | undefined;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import type { ProviderOptions
|
|
2
|
-
import type {
|
|
1
|
+
import type { ProviderOptions } from "../schema";
|
|
2
|
+
import type { OpenResponsesOptionsInput } from "./open-responses-options";
|
|
3
3
|
export type { OpenAIResponseIncludable, OpenAIServiceTier } from "../protocols/utils/openai-options";
|
|
4
|
-
export
|
|
5
|
-
readonly [key: string]: unknown;
|
|
6
|
-
readonly store?: boolean;
|
|
7
|
-
readonly promptCacheKey?: string;
|
|
8
|
-
readonly reasoningEffort?: ReasoningEffort;
|
|
9
|
-
readonly reasoningSummary?: "auto";
|
|
10
|
-
readonly include?: ReadonlyArray<OpenAIResponseIncludable>;
|
|
11
|
-
readonly textVerbosity?: TextVerbosity;
|
|
12
|
-
readonly serviceTier?: OpenAIServiceTier;
|
|
13
|
-
}
|
|
4
|
+
export type OpenAIOptionsInput = OpenResponsesOptionsInput;
|
|
14
5
|
export type OpenAIProviderOptionsInput = ProviderOptions & {
|
|
15
6
|
readonly openai?: OpenAIOptionsInput;
|
|
16
7
|
};
|
|
@@ -91,7 +91,7 @@ export declare const routes: (Route<{
|
|
|
91
91
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
92
92
|
readonly type: import("effect/Schema").tag<"input_text">;
|
|
93
93
|
readonly text: import("effect/Schema").String;
|
|
94
|
-
}>, import("effect/Schema").Struct<{
|
|
94
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
95
95
|
readonly type: import("effect/Schema").tag<"input_image">;
|
|
96
96
|
readonly image_url: import("effect/Schema").String;
|
|
97
97
|
}>, import("effect/Schema").Struct<{
|
|
@@ -99,7 +99,7 @@ export declare const routes: (Route<{
|
|
|
99
99
|
readonly filename: import("effect/Schema").String;
|
|
100
100
|
readonly file_data: import("effect/Schema").String;
|
|
101
101
|
readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
102
|
-
}>]>>;
|
|
102
|
+
}>]>]>>;
|
|
103
103
|
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
104
104
|
readonly role: import("effect/Schema").tag<"assistant">;
|
|
105
105
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
@@ -134,7 +134,7 @@ export declare const routes: (Route<{
|
|
|
134
134
|
} | undefined;
|
|
135
135
|
readonly reasoning?: {
|
|
136
136
|
readonly effort?: string | undefined;
|
|
137
|
-
readonly summary?: "auto" | undefined;
|
|
137
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
138
138
|
} | undefined;
|
|
139
139
|
readonly tools?: readonly ({
|
|
140
140
|
readonly type: "function";
|
|
@@ -163,9 +163,9 @@ export declare const routes: (Route<{
|
|
|
163
163
|
readonly type: import("effect/Schema").tag<"image_generation">;
|
|
164
164
|
}, "Type"> | undefined;
|
|
165
165
|
readonly top_p?: number | undefined;
|
|
166
|
-
readonly store?: boolean | undefined;
|
|
167
166
|
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
168
167
|
readonly instructions?: string | undefined;
|
|
168
|
+
readonly store?: boolean | undefined;
|
|
169
169
|
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
170
170
|
readonly prompt_cache_key?: string | undefined;
|
|
171
171
|
readonly max_output_tokens?: number | undefined;
|
|
@@ -189,7 +189,7 @@ export declare const routes: (Route<{
|
|
|
189
189
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
190
190
|
readonly type: import("effect/Schema").tag<"input_text">;
|
|
191
191
|
readonly text: import("effect/Schema").String;
|
|
192
|
-
}>, import("effect/Schema").Struct<{
|
|
192
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
193
193
|
readonly type: import("effect/Schema").tag<"input_image">;
|
|
194
194
|
readonly image_url: import("effect/Schema").String;
|
|
195
195
|
}>, import("effect/Schema").Struct<{
|
|
@@ -197,7 +197,7 @@ export declare const routes: (Route<{
|
|
|
197
197
|
readonly filename: import("effect/Schema").String;
|
|
198
198
|
readonly file_data: import("effect/Schema").String;
|
|
199
199
|
readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
200
|
-
}>]>>;
|
|
200
|
+
}>]>]>>;
|
|
201
201
|
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
202
202
|
readonly role: import("effect/Schema").tag<"assistant">;
|
|
203
203
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
@@ -232,7 +232,7 @@ export declare const routes: (Route<{
|
|
|
232
232
|
} | undefined;
|
|
233
233
|
readonly reasoning?: {
|
|
234
234
|
readonly effort?: string | undefined;
|
|
235
|
-
readonly summary?: "auto" | undefined;
|
|
235
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
236
236
|
} | undefined;
|
|
237
237
|
readonly tools?: readonly ({
|
|
238
238
|
readonly type: "function";
|
|
@@ -261,9 +261,9 @@ export declare const routes: (Route<{
|
|
|
261
261
|
readonly type: import("effect/Schema").tag<"image_generation">;
|
|
262
262
|
}, "Type"> | undefined;
|
|
263
263
|
readonly top_p?: number | undefined;
|
|
264
|
-
readonly store?: boolean | undefined;
|
|
265
264
|
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
266
265
|
readonly instructions?: string | undefined;
|
|
266
|
+
readonly store?: boolean | undefined;
|
|
267
267
|
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
268
268
|
readonly prompt_cache_key?: string | undefined;
|
|
269
269
|
readonly max_output_tokens?: number | undefined;
|
package/dist/providers/xai.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
90
90
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
91
91
|
readonly type: import("effect/Schema").tag<"input_text">;
|
|
92
92
|
readonly text: import("effect/Schema").String;
|
|
93
|
-
}>, import("effect/Schema").Struct<{
|
|
93
|
+
}>, import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
94
94
|
readonly type: import("effect/Schema").tag<"input_image">;
|
|
95
95
|
readonly image_url: import("effect/Schema").String;
|
|
96
96
|
}>, import("effect/Schema").Struct<{
|
|
@@ -98,7 +98,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
98
98
|
readonly filename: import("effect/Schema").String;
|
|
99
99
|
readonly file_data: import("effect/Schema").String;
|
|
100
100
|
readonly mime_type: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
101
|
-
}>]>>;
|
|
101
|
+
}>]>]>>;
|
|
102
102
|
}, "Type"> | import("effect/Schema").Struct.ReadonlySide<{
|
|
103
103
|
readonly role: import("effect/Schema").tag<"assistant">;
|
|
104
104
|
readonly content: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
@@ -133,7 +133,7 @@ export declare const routes: (import("../route").Route<{
|
|
|
133
133
|
} | undefined;
|
|
134
134
|
readonly reasoning?: {
|
|
135
135
|
readonly effort?: string | undefined;
|
|
136
|
-
readonly summary?: "auto" | undefined;
|
|
136
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
137
137
|
} | undefined;
|
|
138
138
|
readonly tools?: readonly ({
|
|
139
139
|
readonly type: "function";
|
|
@@ -162,9 +162,9 @@ export declare const routes: (import("../route").Route<{
|
|
|
162
162
|
readonly type: import("effect/Schema").tag<"image_generation">;
|
|
163
163
|
}, "Type"> | undefined;
|
|
164
164
|
readonly top_p?: number | undefined;
|
|
165
|
-
readonly store?: boolean | undefined;
|
|
166
165
|
readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
|
|
167
166
|
readonly instructions?: string | undefined;
|
|
167
|
+
readonly store?: boolean | undefined;
|
|
168
168
|
readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
|
|
169
169
|
readonly prompt_cache_key?: string | undefined;
|
|
170
170
|
readonly max_output_tokens?: number | undefined;
|
package/dist/route/protocol.d.ts
CHANGED
|
@@ -11,7 +11,8 @@ import type { LLMError, LLMEvent, LLMRequest, ProtocolID } from "../schema";
|
|
|
11
11
|
* Examples:
|
|
12
12
|
*
|
|
13
13
|
* - `OpenAIChat.protocol` — chat completions style
|
|
14
|
-
* - `
|
|
14
|
+
* - `OpenResponses.protocol` — provider-neutral Responses API baseline
|
|
15
|
+
* - `OpenAIResponses.protocol` — OpenAI extensions to that baseline
|
|
15
16
|
* - `AnthropicMessages.protocol` — messages API with content blocks
|
|
16
17
|
* - `Gemini.protocol` — generateContent
|
|
17
18
|
* - `BedrockConverse.protocol` — Converse with binary event-stream framing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-16144",
|
|
4
4
|
"name": "@opencode-ai/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
28
28
|
"@effect/platform-node": "4.0.0-beta.98",
|
|
29
|
-
"@opencode-ai/http-recorder": "0.0.0-next-
|
|
29
|
+
"@opencode-ai/http-recorder": "0.0.0-next-16144",
|
|
30
30
|
"@tsconfig/bun": "1.0.9",
|
|
31
31
|
"@types/bun": "1.3.13",
|
|
32
32
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@smithy/eventstream-codec": "4.2.14",
|
|
37
37
|
"@smithy/util-utf8": "4.2.2",
|
|
38
|
-
"@opencode-ai/schema": "0.0.0-next-
|
|
38
|
+
"@opencode-ai/schema": "0.0.0-next-16144",
|
|
39
39
|
"aws4fetch": "1.0.20",
|
|
40
40
|
"effect": "4.0.0-beta.98",
|
|
41
41
|
"google-auth-library": "10.5.0"
|