@opencode-ai/ai 0.0.0-beta-17639 → 0.0.0-beta-17727
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 +17 -6
- package/dist/cache-policy.js +3 -5
- package/dist/protocols/anthropic-messages.d.ts +26 -28
- package/dist/protocols/anthropic-messages.js +5 -5
- package/dist/protocols/gemini.d.ts +5 -9
- package/dist/protocols/gemini.js +5 -4
- package/dist/protocols/open-responses.d.ts +176 -38
- package/dist/protocols/open-responses.js +108 -33
- package/dist/protocols/openai-chat.d.ts +17 -15
- package/dist/protocols/openai-chat.js +8 -2
- package/dist/protocols/openai-compatible-chat.d.ts +3 -3
- package/dist/protocols/openai-compatible-responses.d.ts +27 -5
- package/dist/protocols/openai-responses.d.ts +151 -33
- package/dist/protocols/openai-responses.js +4 -2
- package/dist/protocols/shared.d.ts +8 -14
- package/dist/protocols/shared.js +8 -14
- package/dist/protocols/utils/bedrock-cache.js +3 -4
- package/dist/protocols/utils/cache.js +3 -6
- package/dist/protocols/utils/open-responses-options.d.ts +46 -15
- package/dist/protocols/utils/open-responses-options.js +38 -25
- package/dist/protocols/utils/openai-options.d.ts +7 -5
- package/dist/protocols/utils/openai-options.js +3 -3
- package/dist/provider-package.d.ts +0 -5
- package/dist/providers/amazon-bedrock-mantle.d.ts +43 -19
- package/dist/providers/amazon-bedrock-mantle.js +0 -1
- package/dist/providers/amazon-bedrock.d.ts +3 -9
- package/dist/providers/amazon-bedrock.js +0 -1
- package/dist/providers/anthropic-compatible.d.ts +11 -11
- package/dist/providers/anthropic-compatible.js +0 -1
- package/dist/providers/anthropic.d.ts +12 -12
- package/dist/providers/anthropic.js +0 -1
- package/dist/providers/azure.d.ts +40 -16
- package/dist/providers/azure.js +0 -1
- package/dist/providers/cloudflare.d.ts +11 -11
- package/dist/providers/google-vertex-chat.d.ts +5 -5
- package/dist/providers/google-vertex-chat.js +0 -1
- package/dist/providers/google-vertex-messages.d.ts +11 -11
- package/dist/providers/google-vertex-messages.js +0 -1
- package/dist/providers/google-vertex-responses.d.ts +29 -7
- package/dist/providers/google-vertex-responses.js +1 -2
- package/dist/providers/google-vertex.d.ts +5 -7
- package/dist/providers/google-vertex.js +1 -2
- package/dist/providers/google.d.ts +4 -4
- package/dist/providers/google.js +0 -1
- package/dist/providers/open-responses-options.d.ts +3 -14
- package/dist/providers/openai-compatible-responses.d.ts +29 -7
- package/dist/providers/openai-compatible-responses.js +0 -1
- package/dist/providers/openai-compatible.d.ts +13 -12
- package/dist/providers/openai-compatible.js +1 -1
- package/dist/providers/openai-options.d.ts +2 -4
- package/dist/providers/openai-options.js +3 -3
- package/dist/providers/openai.d.ts +44 -20
- package/dist/providers/openai.js +0 -1
- package/dist/providers/openrouter.d.ts +16 -17
- package/dist/providers/openrouter.js +1 -2
- package/dist/providers/xai.d.ts +46 -24
- package/dist/providers/xai.js +1 -2
- package/dist/route/client.d.ts +2 -6
- package/dist/route/client.js +1 -2
- package/dist/route/framing.d.ts +2 -2
- package/dist/route/protocol.d.ts +1 -2
- package/dist/route/protocol.js +1 -2
- package/dist/schema/errors.js +2 -1
- package/dist/schema/events.d.ts +5 -3
- package/dist/schema/events.js +5 -2
- package/dist/schema/ids.d.ts +0 -13
- package/dist/schema/ids.js +0 -9
- package/dist/schema/messages.d.ts +7 -7
- package/dist/schema/messages.js +5 -2
- package/dist/schema/options.d.ts +6 -22
- package/dist/schema/options.js +6 -30
- package/package.json +5 -5
|
@@ -1,25 +1,56 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { LLMRequest } from "../../schema/index.js";
|
|
3
|
+
export declare const ReasoningEfforts: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
4
|
+
export type ReasoningEffort = (typeof ReasoningEfforts)[number] | (string & {});
|
|
5
|
+
export declare const ReasoningEffort: Schema.declare<ReasoningEffort, ReasoningEffort>;
|
|
6
|
+
export declare const TextVerbosities: readonly ["low", "medium", "high"];
|
|
7
|
+
export type TextVerbosity = (typeof TextVerbosities)[number] | (string & {});
|
|
8
|
+
export declare const TextVerbosity: Schema.declare<TextVerbosity, TextVerbosity>;
|
|
3
9
|
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];
|
|
10
|
+
export type ResponseIncludable = (typeof ResponseIncludables)[number] | (string & {});
|
|
5
11
|
export declare const ServiceTiers: readonly ["auto", "default", "flex", "priority"];
|
|
6
12
|
export type ServiceTier = (typeof ServiceTiers)[number];
|
|
7
13
|
export declare const Truncations: readonly ["auto", "disabled"];
|
|
8
14
|
export type Truncation = (typeof Truncations)[number];
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
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"]>;
|
|
15
|
+
export declare const TextVerbositySchema: Schema.declare<TextVerbosity, TextVerbosity>;
|
|
16
|
+
export declare const ResponseIncludableSchema: Schema.declare<ResponseIncludable, ResponseIncludable>;
|
|
12
17
|
export declare const ServiceTierSchema: Schema.Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
13
18
|
export declare const TruncationSchema: Schema.Literals<readonly ["auto", "disabled"]>;
|
|
14
|
-
export
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
readonly
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
export declare const AllowedTools: Schema.Struct<{
|
|
20
|
+
readonly toolNames: Schema.$Array<Schema.String>;
|
|
21
|
+
readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "none", "required"]>>;
|
|
22
|
+
}>;
|
|
23
|
+
export type AllowedTools = typeof AllowedTools.Type;
|
|
24
|
+
export declare const StreamOptions: Schema.Struct<{
|
|
25
|
+
readonly includeObfuscation: Schema.optional<Schema.Boolean>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const Options: Schema.Struct<{
|
|
28
|
+
readonly instructions: Schema.optional<Schema.String>;
|
|
29
|
+
readonly store: Schema.optional<Schema.Boolean>;
|
|
30
|
+
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
31
|
+
readonly safetyIdentifier: Schema.optional<Schema.String>;
|
|
32
|
+
readonly streamOptions: Schema.optional<Schema.Struct<{
|
|
33
|
+
readonly includeObfuscation: Schema.optional<Schema.Boolean>;
|
|
34
|
+
}>>;
|
|
35
|
+
readonly topLogprobs: Schema.optional<Schema.Int>;
|
|
36
|
+
readonly reasoningEffort: Schema.optional<Schema.declare<ReasoningEffort, ReasoningEffort>>;
|
|
37
|
+
readonly reasoningSummary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
|
|
38
|
+
readonly include: Schema.optional<Schema.$Array<Schema.declare<ResponseIncludable, ResponseIncludable>>>;
|
|
39
|
+
readonly textVerbosity: Schema.optional<Schema.declare<TextVerbosity, TextVerbosity>>;
|
|
40
|
+
readonly serviceTier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
|
|
41
|
+
readonly truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
|
|
42
|
+
readonly allowedTools: Schema.optional<Schema.Struct<{
|
|
43
|
+
readonly toolNames: Schema.$Array<Schema.String>;
|
|
44
|
+
readonly mode: Schema.optional<Schema.Literals<readonly ["auto", "none", "required"]>>;
|
|
45
|
+
}>>;
|
|
46
|
+
readonly maxToolCalls: Schema.optional<Schema.Int>;
|
|
47
|
+
readonly parallelToolCalls: Schema.optional<Schema.Boolean>;
|
|
48
|
+
}>;
|
|
49
|
+
export type Options = typeof Options.Type;
|
|
50
|
+
export type Resolved = Omit<Options, "allowedTools"> & {
|
|
51
|
+
readonly allowedTools?: AllowedTools & {
|
|
52
|
+
readonly mode: NonNullable<AllowedTools["mode"]>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
24
55
|
export declare const resolve: (request: LLMRequest) => Resolved;
|
|
25
56
|
export * as OpenResponsesOptions from "./open-responses-options.js";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
|
|
1
|
+
import { Option, Schema } from "effect";
|
|
2
|
+
export const ReasoningEfforts = ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
3
|
+
export const ReasoningEffort = Schema.declare((value) => typeof value === "string", { title: "ReasoningEffort" });
|
|
4
|
+
export const TextVerbosities = ["low", "medium", "high"];
|
|
5
|
+
export const TextVerbosity = Schema.declare((value) => typeof value === "string", { title: "TextVerbosity" });
|
|
3
6
|
export const ResponseIncludables = [
|
|
4
7
|
"file_search_call.results",
|
|
5
8
|
"web_search_call.results",
|
|
@@ -12,35 +15,45 @@ export const ResponseIncludables = [
|
|
|
12
15
|
];
|
|
13
16
|
export const ServiceTiers = ["auto", "default", "flex", "priority"];
|
|
14
17
|
export const Truncations = ["auto", "disabled"];
|
|
15
|
-
const TEXT_VERBOSITY = new Set(["low", "medium", "high"]);
|
|
16
|
-
const INCLUDABLES = new Set(ResponseIncludables);
|
|
17
|
-
const SERVICE_TIERS = new Set(ServiceTiers);
|
|
18
|
-
const TRUNCATIONS = new Set(Truncations);
|
|
19
|
-
const isTextVerbosity = (value) => typeof value === "string" && TEXT_VERBOSITY.has(value);
|
|
20
|
-
const isServiceTier = (value) => typeof value === "string" && SERVICE_TIERS.has(value);
|
|
21
|
-
const isTruncation = (value) => typeof value === "string" && TRUNCATIONS.has(value);
|
|
22
|
-
export const ReasoningEffort = Schema.String;
|
|
23
18
|
export const TextVerbositySchema = TextVerbosity;
|
|
24
|
-
export const ResponseIncludableSchema = Schema.
|
|
19
|
+
export const ResponseIncludableSchema = Schema.declare((value) => typeof value === "string", { title: "ResponseIncludable" });
|
|
25
20
|
export const ServiceTierSchema = Schema.Literals(ServiceTiers);
|
|
26
21
|
export const TruncationSchema = Schema.Literals(Truncations);
|
|
22
|
+
export const AllowedTools = Schema.Struct({
|
|
23
|
+
toolNames: Schema.Array(Schema.String),
|
|
24
|
+
mode: Schema.optional(Schema.Literals(["auto", "none", "required"])),
|
|
25
|
+
});
|
|
26
|
+
export const StreamOptions = Schema.Struct({
|
|
27
|
+
includeObfuscation: Schema.optional(Schema.Boolean),
|
|
28
|
+
});
|
|
29
|
+
export const Options = Schema.Struct({
|
|
30
|
+
instructions: Schema.optional(Schema.String),
|
|
31
|
+
store: Schema.optional(Schema.Boolean),
|
|
32
|
+
metadata: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
33
|
+
safetyIdentifier: Schema.optional(Schema.String),
|
|
34
|
+
streamOptions: Schema.optional(StreamOptions),
|
|
35
|
+
topLogprobs: Schema.optional(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 20 }))),
|
|
36
|
+
reasoningEffort: Schema.optional(ReasoningEffort),
|
|
37
|
+
reasoningSummary: Schema.optional(Schema.Literals(["auto", "concise", "detailed"])),
|
|
38
|
+
include: Schema.optional(Schema.Array(ResponseIncludableSchema)),
|
|
39
|
+
textVerbosity: Schema.optional(TextVerbositySchema),
|
|
40
|
+
serviceTier: Schema.optional(ServiceTierSchema),
|
|
41
|
+
truncation: Schema.optional(TruncationSchema),
|
|
42
|
+
allowedTools: Schema.optional(AllowedTools),
|
|
43
|
+
maxToolCalls: Schema.optional(Schema.Int),
|
|
44
|
+
parallelToolCalls: Schema.optional(Schema.Boolean),
|
|
45
|
+
});
|
|
46
|
+
const decodeOptions = Schema.decodeUnknownOption(Options);
|
|
27
47
|
export const resolve = (request) => {
|
|
28
|
-
const input = request.providerOptions
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
: [];
|
|
32
|
-
const reasoningSummary = input?.reasoningSummary;
|
|
48
|
+
const input = Option.getOrUndefined(decodeOptions(request.providerOptions));
|
|
49
|
+
if (!input)
|
|
50
|
+
return {};
|
|
33
51
|
return {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
? reasoningSummary
|
|
52
|
+
...input,
|
|
53
|
+
include: input.include?.length ? input.include : undefined,
|
|
54
|
+
allowedTools: input.allowedTools && input.allowedTools.toolNames.length > 0
|
|
55
|
+
? { ...input.allowedTools, mode: input.allowedTools.mode ?? "auto" }
|
|
39
56
|
: undefined,
|
|
40
|
-
include: include.length > 0 ? include : undefined,
|
|
41
|
-
textVerbosity: isTextVerbosity(input?.textVerbosity) ? input.textVerbosity : undefined,
|
|
42
|
-
serviceTier: isServiceTier(input?.serviceTier) ? input.serviceTier : undefined,
|
|
43
|
-
truncation: isTruncation(input?.truncation) ? input.truncation : undefined,
|
|
44
57
|
};
|
|
45
58
|
};
|
|
46
59
|
export * as OpenResponsesOptions from "./open-responses-options.js";
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { OpenResponsesOptions } from "./open-responses-options.js";
|
|
2
2
|
export declare const OpenAIReasoningEfforts: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
3
|
-
export type OpenAIReasoningEffort =
|
|
3
|
+
export type OpenAIReasoningEffort = OpenResponsesOptions.ReasoningEffort;
|
|
4
|
+
export declare const OpenAITextVerbosities: readonly ["low", "medium", "high"];
|
|
5
|
+
export type OpenAITextVerbosity = OpenResponsesOptions.TextVerbosity;
|
|
4
6
|
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"];
|
|
5
7
|
export type OpenAIResponseIncludable = OpenResponsesOptions.ResponseIncludable;
|
|
6
8
|
export declare const OpenAIServiceTiers: readonly ["auto", "default", "flex", "priority"];
|
|
7
9
|
export type OpenAIServiceTier = OpenResponsesOptions.ServiceTier;
|
|
8
|
-
export declare const OpenAIReasoningEffort: import("effect/Schema").
|
|
9
|
-
export declare const OpenAITextVerbosity: import("effect/Schema").
|
|
10
|
-
export declare const OpenAIResponseIncludable: import("effect/Schema").
|
|
10
|
+
export declare const OpenAIReasoningEffort: import("effect/Schema").declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
|
|
11
|
+
export declare const OpenAITextVerbosity: import("effect/Schema").declare<OpenResponsesOptions.TextVerbosity, OpenResponsesOptions.TextVerbosity>;
|
|
12
|
+
export declare const OpenAIResponseIncludable: import("effect/Schema").declare<OpenResponsesOptions.ResponseIncludable, OpenResponsesOptions.ResponseIncludable>;
|
|
11
13
|
export declare const OpenAIServiceTier: import("effect/Schema").Literals<readonly ["auto", "default", "flex", "priority"]>;
|
|
12
14
|
export declare const isReasoningEffort: (effort: unknown) => effort is OpenAIReasoningEffort;
|
|
13
|
-
export declare const resolve: (request: import("../../
|
|
15
|
+
export declare const resolve: (request: import("../../index.js").LLMRequest) => OpenResponsesOptions.Resolved;
|
|
14
16
|
export * as OpenAIOptions from "./openai-options.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ReasoningEfforts } from "../../schema/index.js";
|
|
2
1
|
import { OpenResponsesOptions } from "./open-responses-options.js";
|
|
3
|
-
export const OpenAIReasoningEfforts = ReasoningEfforts;
|
|
2
|
+
export const OpenAIReasoningEfforts = OpenResponsesOptions.ReasoningEfforts;
|
|
3
|
+
export const OpenAITextVerbosities = OpenResponsesOptions.TextVerbosities;
|
|
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
6
|
export const OpenAIResponseIncludables = OpenResponsesOptions.ResponseIncludables;
|
|
7
7
|
export const OpenAIServiceTiers = OpenResponsesOptions.ServiceTiers;
|
|
8
8
|
export const OpenAIReasoningEffort = OpenResponsesOptions.ReasoningEffort;
|
|
9
|
-
export const OpenAITextVerbosity = OpenResponsesOptions.
|
|
9
|
+
export const OpenAITextVerbosity = OpenResponsesOptions.TextVerbosity;
|
|
10
10
|
export const OpenAIResponseIncludable = OpenResponsesOptions.ResponseIncludableSchema;
|
|
11
11
|
export const OpenAIServiceTier = OpenResponsesOptions.ServiceTierSchema;
|
|
12
12
|
export const isReasoningEffort = (effort) => typeof effort === "string";
|
|
@@ -3,11 +3,6 @@ export interface Settings extends Readonly<Record<string, unknown>> {
|
|
|
3
3
|
readonly baseURL?: string;
|
|
4
4
|
readonly headers?: Readonly<Record<string, string>>;
|
|
5
5
|
readonly body?: Readonly<Record<string, unknown>>;
|
|
6
|
-
readonly limits?: {
|
|
7
|
-
readonly context: number;
|
|
8
|
-
readonly input?: number;
|
|
9
|
-
readonly output: number;
|
|
10
|
-
};
|
|
11
6
|
}
|
|
12
7
|
export interface Definition<ProviderSettings extends Settings = Settings, Options extends ProviderOptions = ProviderOptions> {
|
|
13
8
|
readonly model: (modelID: string, settings: ProviderSettings) => LanguageModel<Options>;
|
|
@@ -81,7 +81,6 @@ export declare const routes: (RouteDef<{
|
|
|
81
81
|
} | undefined;
|
|
82
82
|
})[];
|
|
83
83
|
readonly stream: true;
|
|
84
|
-
readonly stop?: readonly string[] | undefined;
|
|
85
84
|
readonly max_completion_tokens?: number | undefined;
|
|
86
85
|
readonly max_tokens?: number | undefined;
|
|
87
86
|
readonly tools?: readonly {
|
|
@@ -98,9 +97,10 @@ export declare const routes: (RouteDef<{
|
|
|
98
97
|
readonly ttl?: string | undefined;
|
|
99
98
|
} | undefined;
|
|
100
99
|
}[] | undefined;
|
|
100
|
+
readonly stop?: readonly string[] | undefined;
|
|
101
101
|
readonly temperature?: number | undefined;
|
|
102
102
|
readonly seed?: number | undefined;
|
|
103
|
-
readonly tool_choice?: "required" | "
|
|
103
|
+
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
104
104
|
readonly type: "function";
|
|
105
105
|
readonly function: {
|
|
106
106
|
readonly name: string;
|
|
@@ -112,7 +112,7 @@ export declare const routes: (RouteDef<{
|
|
|
112
112
|
readonly include_usage: boolean;
|
|
113
113
|
} | undefined;
|
|
114
114
|
readonly prompt_cache_key?: string | undefined;
|
|
115
|
-
readonly reasoning_effort?:
|
|
115
|
+
readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
|
|
116
116
|
readonly frequency_penalty?: number | undefined;
|
|
117
117
|
readonly presence_penalty?: number | undefined;
|
|
118
118
|
}, import("../route/transport/http.js").HttpPrepared<string>> | RouteDef<{
|
|
@@ -148,17 +148,20 @@ export declare const routes: (RouteDef<{
|
|
|
148
148
|
readonly text: string;
|
|
149
149
|
})[];
|
|
150
150
|
} | {
|
|
151
|
+
readonly type: "message";
|
|
151
152
|
readonly content: readonly {
|
|
152
153
|
readonly type: "output_text";
|
|
153
154
|
readonly text: string;
|
|
154
155
|
}[];
|
|
155
156
|
readonly role: "assistant";
|
|
157
|
+
readonly id?: string | undefined;
|
|
156
158
|
readonly phase?: "commentary" | "final_answer" | undefined;
|
|
157
159
|
} | {
|
|
158
160
|
readonly type: "function_call";
|
|
159
|
-
readonly call_id: string;
|
|
160
161
|
readonly name: string;
|
|
161
162
|
readonly arguments: string;
|
|
163
|
+
readonly call_id: string;
|
|
164
|
+
readonly id?: string | undefined;
|
|
162
165
|
} | {
|
|
163
166
|
readonly type: "function_call_output";
|
|
164
167
|
readonly call_id: string;
|
|
@@ -175,19 +178,24 @@ export declare const routes: (RouteDef<{
|
|
|
175
178
|
readonly text: string;
|
|
176
179
|
})[];
|
|
177
180
|
} | {
|
|
181
|
+
readonly type: "message";
|
|
178
182
|
readonly content: readonly {
|
|
179
183
|
readonly type: "output_text";
|
|
180
184
|
readonly text: string;
|
|
181
185
|
}[];
|
|
182
186
|
readonly role: "assistant";
|
|
187
|
+
readonly id?: string | undefined;
|
|
183
188
|
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
184
189
|
})[];
|
|
185
190
|
readonly model: string;
|
|
186
191
|
readonly stream: true;
|
|
192
|
+
readonly metadata?: {
|
|
193
|
+
readonly [x: string]: string;
|
|
194
|
+
} | undefined;
|
|
187
195
|
readonly instructions?: string | undefined;
|
|
188
196
|
readonly reasoning?: {
|
|
189
197
|
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
190
|
-
readonly effort?:
|
|
198
|
+
readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
|
|
191
199
|
} | undefined;
|
|
192
200
|
readonly tools?: readonly ({
|
|
193
201
|
readonly type: "function";
|
|
@@ -202,50 +210,66 @@ export declare const routes: (RouteDef<{
|
|
|
202
210
|
readonly size?: string | undefined;
|
|
203
211
|
readonly action?: "generate" | "auto" | "edit" | undefined;
|
|
204
212
|
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
205
|
-
readonly quality?: "
|
|
213
|
+
readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
|
|
206
214
|
readonly background?: "auto" | "opaque" | "transparent" | undefined;
|
|
207
215
|
readonly output_compression?: number | undefined;
|
|
208
216
|
readonly input_fidelity?: "low" | "high" | undefined;
|
|
209
217
|
readonly partial_images?: number | undefined;
|
|
210
218
|
})[] | undefined;
|
|
211
219
|
readonly text?: {
|
|
212
|
-
readonly verbosity?: "
|
|
220
|
+
readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
|
|
213
221
|
} | undefined;
|
|
214
222
|
readonly temperature?: number | undefined;
|
|
215
|
-
readonly tool_choice?: "required" | "
|
|
223
|
+
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
216
224
|
readonly type: "function";
|
|
217
225
|
readonly name: string;
|
|
226
|
+
} | {
|
|
227
|
+
readonly type: "allowed_tools";
|
|
228
|
+
readonly mode: "required" | "auto" | "none";
|
|
229
|
+
readonly tools: readonly {
|
|
230
|
+
readonly type: "function";
|
|
231
|
+
readonly name: string;
|
|
232
|
+
}[];
|
|
218
233
|
} | {
|
|
219
234
|
readonly type: "image_generation";
|
|
220
235
|
} | undefined;
|
|
221
236
|
readonly top_p?: number | undefined;
|
|
222
|
-
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;
|
|
223
237
|
readonly store?: boolean | undefined;
|
|
238
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
224
239
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
240
|
+
readonly stream_options?: {
|
|
241
|
+
readonly include_obfuscation?: boolean | undefined;
|
|
242
|
+
} | undefined;
|
|
225
243
|
readonly prompt_cache_key?: string | undefined;
|
|
244
|
+
readonly frequency_penalty?: number | undefined;
|
|
245
|
+
readonly presence_penalty?: number | undefined;
|
|
246
|
+
readonly safety_identifier?: string | undefined;
|
|
247
|
+
readonly top_logprobs?: number | undefined;
|
|
226
248
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
227
249
|
readonly max_output_tokens?: number | undefined;
|
|
250
|
+
readonly max_tool_calls?: number | undefined;
|
|
251
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
228
252
|
}, import("../protocols/open-responses-channel.js").Prepared>)[];
|
|
229
253
|
export declare const configure: (input?: Config) => {
|
|
230
254
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
231
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
232
|
-
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
233
|
-
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
255
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
256
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
257
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
234
258
|
configure: (input?: Config) => /*elided*/ any;
|
|
235
259
|
};
|
|
236
260
|
export declare const provider: {
|
|
237
261
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
238
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
239
|
-
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
240
|
-
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
262
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
263
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
264
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
241
265
|
configure: (input?: Config) => {
|
|
242
266
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
243
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
244
|
-
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
245
|
-
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
267
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
268
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
269
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
246
270
|
configure: /*elided*/ any;
|
|
247
271
|
};
|
|
248
272
|
};
|
|
249
273
|
export declare const chatModel: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
|
|
250
274
|
export declare const responsesModel: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
|
|
251
|
-
export declare const model: (modelID: string, settings: Settings) => import("../schema/options.js").LanguageModel<
|
|
275
|
+
export declare const model: (modelID: string, settings: Settings) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
|
|
@@ -58,7 +58,6 @@ const config = (settings) => {
|
|
|
58
58
|
credentials: settings.credentials,
|
|
59
59
|
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
60
60
|
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
61
|
-
limits: settings.limits,
|
|
62
61
|
providerOptions: settings.providerOptions,
|
|
63
62
|
region: settings.region,
|
|
64
63
|
};
|
|
@@ -146,25 +146,19 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
146
146
|
export declare const configure: (input?: Config) => {
|
|
147
147
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
148
148
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
149
|
-
readonly [x: string]:
|
|
150
|
-
readonly [x: string]: unknown;
|
|
151
|
-
};
|
|
149
|
+
readonly [x: string]: unknown;
|
|
152
150
|
}>;
|
|
153
151
|
configure: (input?: Config) => /*elided*/ any;
|
|
154
152
|
};
|
|
155
153
|
export declare const provider: {
|
|
156
154
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
157
155
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
158
|
-
readonly [x: string]:
|
|
159
|
-
readonly [x: string]: unknown;
|
|
160
|
-
};
|
|
156
|
+
readonly [x: string]: unknown;
|
|
161
157
|
}>;
|
|
162
158
|
configure: (input?: Config) => {
|
|
163
159
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
164
160
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
165
|
-
readonly [x: string]:
|
|
166
|
-
readonly [x: string]: unknown;
|
|
167
|
-
};
|
|
161
|
+
readonly [x: string]: unknown;
|
|
168
162
|
}>;
|
|
169
163
|
configure: /*elided*/ any;
|
|
170
164
|
};
|
|
@@ -35,7 +35,6 @@ export const model = (modelID, settings) => {
|
|
|
35
35
|
generation: settings.topP === undefined ? undefined : { topP: settings.topP },
|
|
36
36
|
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
37
37
|
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
38
|
-
limits: settings.limits,
|
|
39
38
|
region: settings.region,
|
|
40
39
|
}).model(modelID);
|
|
41
40
|
};
|
|
@@ -159,14 +159,6 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
159
159
|
}[];
|
|
160
160
|
})[];
|
|
161
161
|
readonly stream: true;
|
|
162
|
-
readonly system?: readonly {
|
|
163
|
-
readonly type: "text";
|
|
164
|
-
readonly text: string;
|
|
165
|
-
readonly cache_control?: {
|
|
166
|
-
readonly type: "ephemeral";
|
|
167
|
-
readonly ttl?: "1h" | "5m" | undefined;
|
|
168
|
-
} | undefined;
|
|
169
|
-
}[] | undefined;
|
|
170
162
|
readonly tools?: readonly {
|
|
171
163
|
readonly description: string;
|
|
172
164
|
readonly name: string;
|
|
@@ -178,6 +170,14 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
178
170
|
readonly ttl?: "1h" | "5m" | undefined;
|
|
179
171
|
} | undefined;
|
|
180
172
|
}[] | undefined;
|
|
173
|
+
readonly system?: readonly {
|
|
174
|
+
readonly type: "text";
|
|
175
|
+
readonly text: string;
|
|
176
|
+
readonly cache_control?: {
|
|
177
|
+
readonly type: "ephemeral";
|
|
178
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
}[] | undefined;
|
|
181
181
|
readonly temperature?: number | undefined;
|
|
182
182
|
readonly thinking?: {
|
|
183
183
|
readonly type: "enabled";
|
|
@@ -189,7 +189,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
189
189
|
readonly type: "disabled";
|
|
190
190
|
} | undefined;
|
|
191
191
|
readonly tool_choice?: {
|
|
192
|
-
readonly type: "
|
|
192
|
+
readonly type: "auto" | "none" | "any";
|
|
193
193
|
} | {
|
|
194
194
|
readonly type: "tool";
|
|
195
195
|
readonly name: string;
|
|
@@ -203,14 +203,14 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
203
203
|
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
204
204
|
export declare const configure: (input: Config) => {
|
|
205
205
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
206
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.
|
|
206
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput>;
|
|
207
207
|
configure: (input: Config) => /*elided*/ any;
|
|
208
208
|
};
|
|
209
209
|
export declare const provider: {
|
|
210
210
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
211
211
|
configure: (input: Config) => {
|
|
212
212
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
213
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.
|
|
213
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput>;
|
|
214
214
|
configure: /*elided*/ any;
|
|
215
215
|
};
|
|
216
216
|
};
|
|
@@ -37,7 +37,6 @@ export const model = (modelID, settings) => {
|
|
|
37
37
|
baseURL: settings.baseURL,
|
|
38
38
|
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
39
39
|
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
40
|
-
limits: settings.limits,
|
|
41
40
|
provider: settings.provider,
|
|
42
41
|
providerOptions: settings.providerOptions,
|
|
43
42
|
}).model(modelID);
|
|
@@ -143,14 +143,6 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
143
143
|
}[];
|
|
144
144
|
})[];
|
|
145
145
|
readonly stream: true;
|
|
146
|
-
readonly system?: readonly {
|
|
147
|
-
readonly type: "text";
|
|
148
|
-
readonly text: string;
|
|
149
|
-
readonly cache_control?: {
|
|
150
|
-
readonly type: "ephemeral";
|
|
151
|
-
readonly ttl?: "1h" | "5m" | undefined;
|
|
152
|
-
} | undefined;
|
|
153
|
-
}[] | undefined;
|
|
154
146
|
readonly tools?: readonly {
|
|
155
147
|
readonly description: string;
|
|
156
148
|
readonly name: string;
|
|
@@ -162,6 +154,14 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
162
154
|
readonly ttl?: "1h" | "5m" | undefined;
|
|
163
155
|
} | undefined;
|
|
164
156
|
}[] | undefined;
|
|
157
|
+
readonly system?: readonly {
|
|
158
|
+
readonly type: "text";
|
|
159
|
+
readonly text: string;
|
|
160
|
+
readonly cache_control?: {
|
|
161
|
+
readonly type: "ephemeral";
|
|
162
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
163
|
+
} | undefined;
|
|
164
|
+
}[] | undefined;
|
|
165
165
|
readonly temperature?: number | undefined;
|
|
166
166
|
readonly thinking?: {
|
|
167
167
|
readonly type: "enabled";
|
|
@@ -173,7 +173,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
173
173
|
readonly type: "disabled";
|
|
174
174
|
} | undefined;
|
|
175
175
|
readonly tool_choice?: {
|
|
176
|
-
readonly type: "
|
|
176
|
+
readonly type: "auto" | "none" | "any";
|
|
177
177
|
} | {
|
|
178
178
|
readonly type: "tool";
|
|
179
179
|
readonly name: string;
|
|
@@ -201,15 +201,15 @@ export type Settings = ProviderPackage.Settings & ({
|
|
|
201
201
|
};
|
|
202
202
|
export declare const configure: (input?: Config) => {
|
|
203
203
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
204
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.
|
|
204
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput>;
|
|
205
205
|
configure: (input?: Config) => /*elided*/ any;
|
|
206
206
|
};
|
|
207
207
|
export declare const provider: {
|
|
208
208
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
209
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.
|
|
209
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput>;
|
|
210
210
|
configure: (input?: Config) => {
|
|
211
211
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
212
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.
|
|
212
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput>;
|
|
213
213
|
configure: /*elided*/ any;
|
|
214
214
|
};
|
|
215
215
|
};
|
|
@@ -34,7 +34,6 @@ export const model = (modelID, settings) => {
|
|
|
34
34
|
baseURL: settings.baseURL,
|
|
35
35
|
headers: settings.headers === undefined ? undefined : { ...settings.headers },
|
|
36
36
|
http: settings.body === undefined ? undefined : { body: { ...settings.body } },
|
|
37
|
-
limits: settings.limits,
|
|
38
37
|
providerOptions: settings.providerOptions,
|
|
39
38
|
}).model(modelID);
|
|
40
39
|
};
|