@opencode/ai 0.0.0-dev-21631 → 0.0.0-dev-21641
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/experimental/evaluation.js +3 -10
- package/dist/protocols/mistral-chat.d.ts +13 -10
- package/dist/protocols/mistral-chat.js +2 -1
- package/dist/protocols/open-responses-channel.js +47 -46
- package/dist/protocols/open-responses-continuation.d.ts +8 -2
- package/dist/protocols/open-responses-continuation.js +3 -1
- package/dist/protocols/venice-chat.d.ts +40 -41
- package/dist/protocols/venice-chat.js +6 -5
- package/dist/protocols/zai-chat.d.ts +21 -18
- package/dist/protocols/zai-chat.js +8 -3
- package/dist/protocols/zai-messages.d.ts +10 -8
- package/dist/protocols/zai-messages.js +3 -2
- package/dist/providers/venice.d.ts +183 -8
- package/dist/providers/zai-coding-plan.d.ts +91 -11
- package/dist/providers/zai.d.ts +72 -7
- package/package.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import { tryRequest } from "../media-model.js";
|
|
3
|
+
import { AIError, HttpOptions, ModelID, ProviderID, ProviderMetadata, Usage, } from "../schema/index.js";
|
|
3
4
|
import { EvaluationClient, Service } from "./evaluation-client.js";
|
|
4
5
|
export const EvaluationInput = Schema.Union([Schema.String, Schema.JsonObject, Schema.Array(Schema.Json)]);
|
|
5
6
|
const EvaluationCriterion = Schema.NullOr(EvaluationInput);
|
|
@@ -99,15 +100,7 @@ export function request(input) {
|
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
102
|
export function run(input) {
|
|
102
|
-
return Effect.
|
|
103
|
-
try: () => request(input),
|
|
104
|
-
catch: (cause) => new AIError({
|
|
105
|
-
reason: new InvalidRequestError({
|
|
106
|
-
message: cause instanceof Error ? cause.message : String(cause),
|
|
107
|
-
cause,
|
|
108
|
-
}),
|
|
109
|
-
}),
|
|
110
|
-
}).pipe(Effect.flatMap(EvaluationClient.evaluate));
|
|
103
|
+
return tryRequest(() => request(input)).pipe(Effect.flatMap(EvaluationClient.evaluate));
|
|
111
104
|
}
|
|
112
105
|
export const Evaluation = {
|
|
113
106
|
request,
|
|
@@ -21,15 +21,18 @@ declare const MistralThinkingContent: Schema.StructWithRest<Schema.Struct<{
|
|
|
21
21
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
22
22
|
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
23
23
|
type MistralThinkingContent = Schema.Schema.Type<typeof MistralThinkingContent>;
|
|
24
|
-
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
24
|
+
declare const ReasoningEffort: Schema.declare<import("../schema/options.js").OpenString<"high" | "low" | "medium" | "minimal" | "none" | "xhigh">, import("../schema/options.js").OpenString<"high" | "low" | "medium" | "minimal" | "none" | "xhigh">>;
|
|
25
|
+
export type ReasoningEffort = typeof ReasoningEffort.Type;
|
|
26
|
+
declare const MistralOptions: Schema.Struct<{
|
|
27
|
+
readonly safePrompt: Schema.optional<Schema.Boolean>;
|
|
28
|
+
readonly documentImageLimit: Schema.optional<Schema.Number>;
|
|
29
|
+
readonly documentPageLimit: Schema.optional<Schema.Number>;
|
|
30
|
+
readonly parallelToolCalls: Schema.optional<Schema.Boolean>;
|
|
31
|
+
readonly reasoningEffort: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"high" | "low" | "medium" | "minimal" | "none" | "xhigh">, import("../schema/options.js").OpenString<"high" | "low" | "medium" | "minimal" | "none" | "xhigh">>>;
|
|
32
|
+
readonly promptMode: Schema.optional<Schema.Literal<"reasoning">>;
|
|
33
|
+
readonly promptCacheKey: Schema.optional<Schema.String>;
|
|
34
|
+
}>;
|
|
35
|
+
export type ProviderOptionsInput = typeof MistralOptions.Type & {
|
|
33
36
|
readonly [key: string]: unknown;
|
|
34
37
|
};
|
|
35
38
|
export declare const MistralBody: Schema.Struct<{
|
|
@@ -210,7 +213,7 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
|
|
|
210
213
|
document_image_limit: number | undefined;
|
|
211
214
|
document_page_limit: number | undefined;
|
|
212
215
|
parallel_tool_calls: boolean | undefined;
|
|
213
|
-
reasoning_effort:
|
|
216
|
+
reasoning_effort: import("../schema/options.js").OpenString<"high" | "low" | "medium" | "minimal" | "none" | "xhigh"> | undefined;
|
|
214
217
|
prompt_mode: "reasoning" | undefined;
|
|
215
218
|
}, AIError, never>;
|
|
216
219
|
type ToolKey = string | number;
|
|
@@ -69,12 +69,13 @@ const MistralTool = Schema.Struct({
|
|
|
69
69
|
strict: Schema.Literal(false),
|
|
70
70
|
}),
|
|
71
71
|
});
|
|
72
|
+
const ReasoningEffort = ProviderShared.knownString();
|
|
72
73
|
const MistralOptions = Schema.Struct({
|
|
73
74
|
safePrompt: Schema.optional(Schema.Boolean),
|
|
74
75
|
documentImageLimit: Schema.optional(Schema.Number),
|
|
75
76
|
documentPageLimit: Schema.optional(Schema.Number),
|
|
76
77
|
parallelToolCalls: Schema.optional(Schema.Boolean),
|
|
77
|
-
reasoningEffort: Schema.optional(
|
|
78
|
+
reasoningEffort: Schema.optional(ReasoningEffort),
|
|
78
79
|
promptMode: Schema.optional(Schema.Literal("reasoning")),
|
|
79
80
|
promptCacheKey: Schema.optional(Schema.String),
|
|
80
81
|
});
|
|
@@ -20,58 +20,59 @@ const message = (body) => Effect.gen(function* () {
|
|
|
20
20
|
const driver = (options, body) => {
|
|
21
21
|
let responseID;
|
|
22
22
|
let terminal = false;
|
|
23
|
+
const observeEvent = Effect.fnUntraced(function* (_create, frame, event) {
|
|
24
|
+
if (terminal)
|
|
25
|
+
return yield* ProviderShared.eventError(options.id, `${options.name} emitted ${event.type} after a terminal event`, frame);
|
|
26
|
+
if (event.type === "error") {
|
|
27
|
+
terminal = true;
|
|
28
|
+
return {
|
|
29
|
+
type: "provider-failure",
|
|
30
|
+
error: OpenResponses.providerFailure(event, `${options.name} stream error`, frame),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (event.type === "response.failed") {
|
|
34
|
+
terminal = true;
|
|
35
|
+
if (responseID && event.response?.id && event.response.id !== responseID)
|
|
36
|
+
return yield* ProviderShared.eventError(options.id, `${options.name} response ID changed during execution`, frame);
|
|
37
|
+
return {
|
|
38
|
+
type: "provider-failure",
|
|
39
|
+
error: OpenResponses.providerFailure(event, `${options.name} response failed`, frame),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (event.type === "response.created") {
|
|
43
|
+
const created = event.response?.id;
|
|
44
|
+
if (responseID)
|
|
45
|
+
return yield* ProviderShared.eventError(options.id, `${options.name} emitted duplicate response.created`, frame);
|
|
46
|
+
if (!created)
|
|
47
|
+
return yield* ProviderShared.eventError(options.id, `${options.name} response.created is missing response.id`, frame);
|
|
48
|
+
responseID = created;
|
|
49
|
+
return { type: "frame", frame };
|
|
50
|
+
}
|
|
51
|
+
// Keepalives and provider notifications carry no response state and may precede response.created.
|
|
52
|
+
if (!event.type.startsWith("response."))
|
|
53
|
+
return { type: "frame", frame };
|
|
54
|
+
if (!responseID)
|
|
55
|
+
return yield* ProviderShared.eventError(options.id, `${options.name} emitted ${event.type} before response.created`, frame);
|
|
56
|
+
if (event.response?.id && event.response.id !== responseID)
|
|
57
|
+
return yield* ProviderShared.eventError(options.id, `${options.name} response ID changed during execution`, frame);
|
|
58
|
+
if (event.type === "response.completed") {
|
|
59
|
+
terminal = true;
|
|
60
|
+
return { type: "completed", frame };
|
|
61
|
+
}
|
|
62
|
+
if (event.type === "response.incomplete") {
|
|
63
|
+
terminal = true;
|
|
64
|
+
return { type: "incomplete", frame };
|
|
65
|
+
}
|
|
66
|
+
return { type: "frame", frame };
|
|
67
|
+
});
|
|
23
68
|
return {
|
|
24
69
|
create: () => Effect.sync(() => {
|
|
25
70
|
responseID = undefined;
|
|
26
71
|
terminal = false;
|
|
27
72
|
return { message: body, mode: "full" };
|
|
28
73
|
}),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (terminal)
|
|
32
|
-
return yield* ProviderShared.eventError(options.id, `${options.name} emitted ${event.type} after a terminal event`, frame);
|
|
33
|
-
if (event.type === "error") {
|
|
34
|
-
terminal = true;
|
|
35
|
-
return {
|
|
36
|
-
type: "provider-failure",
|
|
37
|
-
error: OpenResponses.providerFailure(event, `${options.name} stream error`, frame),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
if (event.type === "response.failed") {
|
|
41
|
-
terminal = true;
|
|
42
|
-
if (responseID && event.response?.id && event.response.id !== responseID)
|
|
43
|
-
return yield* ProviderShared.eventError(options.id, `${options.name} response ID changed during execution`, frame);
|
|
44
|
-
return {
|
|
45
|
-
type: "provider-failure",
|
|
46
|
-
error: OpenResponses.providerFailure(event, `${options.name} response failed`, frame),
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
if (event.type === "response.created") {
|
|
50
|
-
const created = event.response?.id;
|
|
51
|
-
if (responseID)
|
|
52
|
-
return yield* ProviderShared.eventError(options.id, `${options.name} emitted duplicate response.created`, frame);
|
|
53
|
-
if (!created)
|
|
54
|
-
return yield* ProviderShared.eventError(options.id, `${options.name} response.created is missing response.id`, frame);
|
|
55
|
-
responseID = created;
|
|
56
|
-
return { type: "frame", frame };
|
|
57
|
-
}
|
|
58
|
-
// Keepalives and provider notifications carry no response state and may precede response.created.
|
|
59
|
-
if (!event.type.startsWith("response."))
|
|
60
|
-
return { type: "frame", frame };
|
|
61
|
-
if (!responseID)
|
|
62
|
-
return yield* ProviderShared.eventError(options.id, `${options.name} emitted ${event.type} before response.created`, frame);
|
|
63
|
-
if (event.response?.id && event.response.id !== responseID)
|
|
64
|
-
return yield* ProviderShared.eventError(options.id, `${options.name} response ID changed during execution`, frame);
|
|
65
|
-
if (event.type === "response.completed") {
|
|
66
|
-
terminal = true;
|
|
67
|
-
return { type: "completed", frame };
|
|
68
|
-
}
|
|
69
|
-
if (event.type === "response.incomplete") {
|
|
70
|
-
terminal = true;
|
|
71
|
-
return { type: "incomplete", frame };
|
|
72
|
-
}
|
|
73
|
-
return { type: "frame", frame };
|
|
74
|
-
}),
|
|
74
|
+
observeEvent,
|
|
75
|
+
observe: (create, frame) => OpenResponses.decodeChannelEvent(frame).pipe(Effect.mapError((cause) => ProviderShared.eventError(options.id, `Invalid ${options.name} WebSocket event`, frame, cause)), Effect.flatMap((event) => observeEvent(create, frame, event))),
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
78
|
export const transport = (options) => {
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AIError } from "../schema/index.js";
|
|
2
|
+
import type { ChannelCreate, ChannelObservation, WebSocketChannelDriver } from "../route/transport/index.js";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { OpenResponses } from "./open-responses.js";
|
|
2
5
|
/**
|
|
3
6
|
* Fields to send next to `previous_response_id` on an incremental step, or undefined to send the step in full.
|
|
4
7
|
* Whether omitted fields carry over from the continued response is provider behavior the route must know.
|
|
5
8
|
*/
|
|
6
9
|
export type Shape = (request: Readonly<Record<string, unknown>>) => Readonly<Record<string, unknown>> | undefined;
|
|
10
|
+
export interface BaseDriver extends WebSocketChannelDriver {
|
|
11
|
+
readonly observeEvent?: (create: ChannelCreate, frame: string, event: OpenResponses.Event) => Effect.Effect<ChannelObservation, AIError>;
|
|
12
|
+
}
|
|
7
13
|
export interface DriverInput {
|
|
8
14
|
readonly id: string;
|
|
9
15
|
readonly name: string;
|
|
10
16
|
readonly request: Readonly<Record<string, unknown>>;
|
|
11
17
|
readonly message: string;
|
|
12
|
-
readonly base:
|
|
18
|
+
readonly base: BaseDriver;
|
|
13
19
|
readonly continuation?: Shape;
|
|
14
20
|
}
|
|
15
21
|
export declare const driver: (input: DriverInput) => WebSocketChannelDriver;
|
|
@@ -121,7 +121,9 @@ export const driver = (input) => {
|
|
|
121
121
|
}),
|
|
122
122
|
observe: (create, frame) => Effect.gen(function* () {
|
|
123
123
|
const event = yield* OpenResponses.decodeChannelEvent(frame).pipe(Effect.mapError((cause) => ProviderShared.eventError(input.id, `Invalid ${input.name} WebSocket event`, frame, cause)));
|
|
124
|
-
const observation = yield* input.base.
|
|
124
|
+
const observation = yield* input.base.observeEvent
|
|
125
|
+
? input.base.observeEvent(create, frame, event)
|
|
126
|
+
: input.base.observe(create, frame);
|
|
125
127
|
if (event.type === "response.output_item.done" && event.item)
|
|
126
128
|
output.push(event.item);
|
|
127
129
|
if (observation.type === "provider-failure") {
|
|
@@ -1,44 +1,43 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Protocol } from "../route/protocol.js";
|
|
3
3
|
import { OpenAIChat } from "./openai-chat.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
readonly
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
5
|
+
export type ReasoningEffort = OpenResponsesOptions.ReasoningEffort;
|
|
6
|
+
declare const Options: Schema.Struct<{
|
|
7
|
+
readonly reasoningEffort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
8
|
+
readonly reasoning: Schema.optional<Schema.Struct<{
|
|
9
|
+
readonly effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
10
|
+
readonly enabled: Schema.optional<Schema.Boolean>;
|
|
11
|
+
readonly summary: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "concise" | "detailed">, import("../schema/options.js").OpenString<"auto" | "concise" | "detailed">>>;
|
|
12
|
+
}>>;
|
|
13
|
+
readonly veniceParameters: Schema.optional<Schema.Struct<{
|
|
14
|
+
readonly enableWebSearch: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"auto" | "off" | "on">, import("../schema/options.js").OpenString<"auto" | "off" | "on">>>;
|
|
15
|
+
readonly enableWebScraping: Schema.optional<Schema.Boolean>;
|
|
16
|
+
readonly enableWebCitations: Schema.optional<Schema.Boolean>;
|
|
17
|
+
readonly enableXSearch: Schema.optional<Schema.Boolean>;
|
|
18
|
+
readonly stripThinkingResponse: Schema.optional<Schema.Boolean>;
|
|
19
|
+
readonly disableThinking: Schema.optional<Schema.Boolean>;
|
|
20
|
+
readonly includeVeniceSystemPrompt: Schema.optional<Schema.Boolean>;
|
|
21
|
+
readonly characterSlug: Schema.optional<Schema.String>;
|
|
22
|
+
readonly includeSearchResultsInStream: Schema.optional<Schema.Boolean>;
|
|
23
|
+
readonly returnSearchResultsAsDocuments: Schema.optional<Schema.Boolean>;
|
|
24
|
+
}>>;
|
|
25
|
+
readonly promptCacheKey: Schema.optional<Schema.String>;
|
|
26
|
+
readonly promptCacheRetention: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"24h" | "default" | "extended">, import("../schema/options.js").OpenString<"24h" | "default" | "extended">>>;
|
|
27
|
+
readonly parallelToolCalls: Schema.optional<Schema.Boolean>;
|
|
28
|
+
readonly maxCompletionTokens: Schema.optional<Schema.Number>;
|
|
29
|
+
readonly maxTokens: Schema.optional<Schema.Number>;
|
|
30
|
+
readonly minP: Schema.optional<Schema.Number>;
|
|
31
|
+
readonly repetitionPenalty: Schema.optional<Schema.Number>;
|
|
32
|
+
readonly stopTokenIds: Schema.optional<Schema.$Array<Schema.Number>>;
|
|
33
|
+
readonly logprobs: Schema.optional<Schema.Boolean>;
|
|
34
|
+
readonly topLogprobs: Schema.optional<Schema.Number>;
|
|
35
|
+
readonly maxTemp: Schema.optional<Schema.Number>;
|
|
36
|
+
readonly minTemp: Schema.optional<Schema.Number>;
|
|
37
|
+
readonly responseFormat: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
38
|
+
readonly user: Schema.optional<Schema.String>;
|
|
16
39
|
}>;
|
|
17
|
-
export type OptionsInput =
|
|
18
|
-
readonly reasoningEffort?: ReasoningEffort;
|
|
19
|
-
readonly reasoning?: {
|
|
20
|
-
readonly effort?: ReasoningEffort;
|
|
21
|
-
readonly enabled?: boolean;
|
|
22
|
-
readonly summary?: "auto" | "concise" | "detailed" | (string & {});
|
|
23
|
-
};
|
|
24
|
-
readonly veniceParameters?: Omit<typeof Parameters.Type, "enableWebSearch"> & {
|
|
25
|
-
readonly enableWebSearch?: "off" | "on" | "auto" | (string & {});
|
|
26
|
-
};
|
|
27
|
-
readonly promptCacheKey?: string;
|
|
28
|
-
readonly promptCacheRetention?: "default" | "extended" | "24h" | (string & {});
|
|
29
|
-
readonly parallelToolCalls?: boolean;
|
|
30
|
-
readonly maxCompletionTokens?: number;
|
|
31
|
-
readonly maxTokens?: number;
|
|
32
|
-
readonly minP?: number;
|
|
33
|
-
readonly repetitionPenalty?: number;
|
|
34
|
-
readonly stopTokenIds?: readonly number[];
|
|
35
|
-
readonly logprobs?: boolean;
|
|
36
|
-
readonly topLogprobs?: number;
|
|
37
|
-
readonly maxTemp?: number;
|
|
38
|
-
readonly minTemp?: number;
|
|
39
|
-
readonly responseFormat?: Readonly<Record<string, unknown>>;
|
|
40
|
-
readonly user?: string;
|
|
41
|
-
};
|
|
40
|
+
export type OptionsInput = typeof Options.Type;
|
|
42
41
|
interface State {
|
|
43
42
|
readonly shared: OpenAIChat.ParserState;
|
|
44
43
|
readonly pending: string;
|
|
@@ -80,7 +79,7 @@ export declare const protocol: Protocol<{
|
|
|
80
79
|
} | undefined;
|
|
81
80
|
readonly store?: boolean | undefined;
|
|
82
81
|
readonly prompt_cache_key?: string | undefined;
|
|
83
|
-
readonly reasoning_effort?:
|
|
82
|
+
readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
84
83
|
readonly tool_stream?: boolean | undefined;
|
|
85
84
|
readonly max_completion_tokens?: number | undefined;
|
|
86
85
|
readonly max_tokens?: number | undefined;
|
|
@@ -175,14 +174,14 @@ export declare const protocol: Protocol<{
|
|
|
175
174
|
readonly thought_signature?: string | undefined;
|
|
176
175
|
})[];
|
|
177
176
|
readonly reasoning?: {
|
|
178
|
-
readonly effort?:
|
|
177
|
+
readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
179
178
|
readonly enabled?: boolean | undefined;
|
|
180
|
-
readonly summary?:
|
|
179
|
+
readonly summary?: import("../schema/options.js").OpenString<"auto" | "concise" | "detailed"> | undefined;
|
|
181
180
|
} | undefined;
|
|
182
181
|
readonly venice_parameters: {
|
|
183
182
|
readonly [x: string]: string | boolean;
|
|
184
183
|
};
|
|
185
|
-
readonly prompt_cache_retention?:
|
|
184
|
+
readonly prompt_cache_retention?: import("../schema/options.js").OpenString<"24h" | "default" | "extended"> | undefined;
|
|
186
185
|
readonly parallel_tool_calls?: boolean | undefined;
|
|
187
186
|
readonly min_p?: number | undefined;
|
|
188
187
|
readonly top_k?: number | undefined;
|
|
@@ -5,8 +5,9 @@ import { classifyProviderFailure } from "../provider-error.js";
|
|
|
5
5
|
import { OpenAIChat } from "./openai-chat.js";
|
|
6
6
|
import { JsonObject, optionalArray, optionalNull, ProviderShared } from "./shared.js";
|
|
7
7
|
import { cacheControl } from "./utils/cache.js";
|
|
8
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
8
9
|
const Parameters = Schema.Struct({
|
|
9
|
-
enableWebSearch: Schema.optional(
|
|
10
|
+
enableWebSearch: Schema.optional(ProviderShared.knownString()),
|
|
10
11
|
enableWebScraping: Schema.optional(Schema.Boolean),
|
|
11
12
|
enableWebCitations: Schema.optional(Schema.Boolean),
|
|
12
13
|
enableXSearch: Schema.optional(Schema.Boolean),
|
|
@@ -18,16 +19,16 @@ const Parameters = Schema.Struct({
|
|
|
18
19
|
returnSearchResultsAsDocuments: Schema.optional(Schema.Boolean),
|
|
19
20
|
});
|
|
20
21
|
const Reasoning = Schema.Struct({
|
|
21
|
-
effort: Schema.optional(
|
|
22
|
+
effort: Schema.optional(OpenResponsesOptions.ReasoningEffort),
|
|
22
23
|
enabled: Schema.optional(Schema.Boolean),
|
|
23
|
-
summary: Schema.optional(
|
|
24
|
+
summary: Schema.optional(ProviderShared.knownString()),
|
|
24
25
|
});
|
|
25
26
|
const Options = Schema.Struct({
|
|
26
|
-
reasoningEffort: Schema.optional(
|
|
27
|
+
reasoningEffort: Schema.optional(OpenResponsesOptions.ReasoningEffort),
|
|
27
28
|
reasoning: Schema.optional(Reasoning),
|
|
28
29
|
veniceParameters: Schema.optional(Parameters),
|
|
29
30
|
promptCacheKey: Schema.optional(Schema.String),
|
|
30
|
-
promptCacheRetention: Schema.optional(
|
|
31
|
+
promptCacheRetention: Schema.optional(ProviderShared.knownString()),
|
|
31
32
|
parallelToolCalls: Schema.optional(Schema.Boolean),
|
|
32
33
|
maxCompletionTokens: Schema.optional(Schema.Number),
|
|
33
34
|
maxTokens: Schema.optional(Schema.Number),
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
1
2
|
import { Protocol } from "../route/protocol.js";
|
|
2
3
|
import { OpenAIChat } from "./openai-chat.js";
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
readonly
|
|
7
|
-
|
|
4
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
5
|
+
export type ReasoningEffort = OpenResponsesOptions.ReasoningEffort;
|
|
6
|
+
declare const Options: Schema.Struct<{
|
|
7
|
+
readonly reasoningEffort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
8
|
+
readonly thinking: Schema.optional<Schema.Struct<{
|
|
9
|
+
readonly type: Schema.optional<Schema.declare<import("../schema/options.js").OpenString<"disabled" | "enabled">, import("../schema/options.js").OpenString<"disabled" | "enabled">>>;
|
|
8
10
|
/** False retains historical reasoning; omission preserves the endpoint's default. */
|
|
9
|
-
readonly clear_thinking
|
|
10
|
-
}
|
|
11
|
-
readonly toolStream
|
|
12
|
-
readonly doSample
|
|
13
|
-
readonly responseFormat
|
|
14
|
-
readonly type: "
|
|
15
|
-
}
|
|
16
|
-
readonly requestID
|
|
17
|
-
readonly userID
|
|
18
|
-
}
|
|
11
|
+
readonly clear_thinking: Schema.optional<Schema.Boolean>;
|
|
12
|
+
}>>;
|
|
13
|
+
readonly toolStream: Schema.optional<Schema.Boolean>;
|
|
14
|
+
readonly doSample: Schema.optional<Schema.Boolean>;
|
|
15
|
+
readonly responseFormat: Schema.optional<Schema.Struct<{
|
|
16
|
+
readonly type: Schema.declare<import("../schema/options.js").OpenString<"json_object" | "text">, import("../schema/options.js").OpenString<"json_object" | "text">>;
|
|
17
|
+
}>>;
|
|
18
|
+
readonly requestID: Schema.optional<Schema.String>;
|
|
19
|
+
readonly userID: Schema.optional<Schema.String>;
|
|
20
|
+
}>;
|
|
21
|
+
export type OptionsInput = typeof Options.Type;
|
|
19
22
|
export declare const compatibility: {
|
|
20
23
|
maxTokensField: "max_tokens";
|
|
21
24
|
supportsStrictMode: false;
|
|
@@ -133,7 +136,7 @@ export declare const protocol: Protocol<{
|
|
|
133
136
|
} | undefined;
|
|
134
137
|
readonly store?: boolean | undefined;
|
|
135
138
|
readonly prompt_cache_key?: string | undefined;
|
|
136
|
-
readonly reasoning_effort?:
|
|
139
|
+
readonly reasoning_effort?: OpenResponsesOptions.ReasoningEffort | undefined;
|
|
137
140
|
readonly tool_stream?: boolean | undefined;
|
|
138
141
|
readonly max_completion_tokens?: number | undefined;
|
|
139
142
|
readonly max_tokens?: number | undefined;
|
|
@@ -144,12 +147,12 @@ export declare const protocol: Protocol<{
|
|
|
144
147
|
readonly seed?: number | undefined;
|
|
145
148
|
readonly stop?: readonly string[] | undefined;
|
|
146
149
|
readonly thinking?: {
|
|
147
|
-
readonly type?:
|
|
150
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
148
151
|
readonly clear_thinking?: boolean | undefined;
|
|
149
152
|
} | undefined;
|
|
150
153
|
readonly do_sample?: boolean | undefined;
|
|
151
154
|
readonly response_format?: {
|
|
152
|
-
readonly type:
|
|
155
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
153
156
|
} | undefined;
|
|
154
157
|
readonly request_id?: string | undefined;
|
|
155
158
|
readonly user_id?: string | undefined;
|
|
@@ -2,12 +2,17 @@ import { Effect, Schema } from "effect";
|
|
|
2
2
|
import { Protocol } from "../route/protocol.js";
|
|
3
3
|
import { OpenAIChat } from "./openai-chat.js";
|
|
4
4
|
import { ProviderShared } from "./shared.js";
|
|
5
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
5
6
|
const Options = Schema.Struct({
|
|
6
|
-
reasoningEffort: Schema.optional(
|
|
7
|
-
thinking: Schema.optional(Schema.Struct({
|
|
7
|
+
reasoningEffort: Schema.optional(OpenResponsesOptions.ReasoningEffort),
|
|
8
|
+
thinking: Schema.optional(Schema.Struct({
|
|
9
|
+
type: Schema.optional(ProviderShared.knownString()),
|
|
10
|
+
/** False retains historical reasoning; omission preserves the endpoint's default. */
|
|
11
|
+
clear_thinking: Schema.optional(Schema.Boolean),
|
|
12
|
+
})),
|
|
8
13
|
toolStream: Schema.optional(Schema.Boolean),
|
|
9
14
|
doSample: Schema.optional(Schema.Boolean),
|
|
10
|
-
responseFormat: Schema.optional(Schema.Struct({ type:
|
|
15
|
+
responseFormat: Schema.optional(Schema.Struct({ type: ProviderShared.knownString() })),
|
|
11
16
|
requestID: Schema.optional(Schema.String),
|
|
12
17
|
userID: Schema.optional(Schema.String),
|
|
13
18
|
});
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
1
2
|
import { Protocol } from "../route/protocol.js";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
readonly effort
|
|
5
|
-
readonly thinking
|
|
6
|
-
readonly type: "
|
|
7
|
-
}
|
|
8
|
-
}
|
|
3
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
4
|
+
declare const Options: Schema.Struct<{
|
|
5
|
+
readonly effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
|
|
6
|
+
readonly thinking: Schema.optional<Schema.Struct<{
|
|
7
|
+
readonly type: Schema.declare<import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">, import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">>;
|
|
8
|
+
}>>;
|
|
9
|
+
}>;
|
|
10
|
+
export type OptionsInput = typeof Options.Type;
|
|
9
11
|
export declare const protocol: Protocol<{
|
|
10
12
|
readonly context_management?: {
|
|
11
13
|
readonly edits: readonly {
|
|
@@ -263,7 +265,7 @@ export declare const protocol: Protocol<{
|
|
|
263
265
|
} | undefined;
|
|
264
266
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
265
267
|
readonly thinking?: {
|
|
266
|
-
readonly type:
|
|
268
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
267
269
|
} | undefined;
|
|
268
270
|
}, string, {
|
|
269
271
|
readonly [x: string]: unknown;
|
|
@@ -3,9 +3,10 @@ import { Protocol } from "../route/protocol.js";
|
|
|
3
3
|
import { LLMRequest } from "../schema/index.js";
|
|
4
4
|
import { AnthropicMessages } from "./anthropic-messages.js";
|
|
5
5
|
import { ProviderShared } from "./shared.js";
|
|
6
|
+
import { OpenResponsesOptions } from "./utils/open-responses-options.js";
|
|
6
7
|
const Options = Schema.Struct({
|
|
7
|
-
effort: Schema.optional(
|
|
8
|
-
thinking: Schema.optional(Schema.Struct({ type:
|
|
8
|
+
effort: Schema.optional(OpenResponsesOptions.ReasoningEffort),
|
|
9
|
+
thinking: Schema.optional(Schema.Struct({ type: ProviderShared.knownString() })),
|
|
9
10
|
});
|
|
10
11
|
const Body = Schema.Struct({
|
|
11
12
|
...AnthropicMessages.AnthropicMessagesBody.fields,
|
|
@@ -139,14 +139,14 @@ export declare const routes: Route<{
|
|
|
139
139
|
readonly thought_signature?: string | undefined;
|
|
140
140
|
})[];
|
|
141
141
|
readonly reasoning?: {
|
|
142
|
-
readonly effort?:
|
|
142
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
143
143
|
readonly enabled?: boolean | undefined;
|
|
144
|
-
readonly summary?:
|
|
144
|
+
readonly summary?: import("../schema/options.js").OpenString<"auto" | "concise" | "detailed"> | undefined;
|
|
145
145
|
} | undefined;
|
|
146
146
|
readonly venice_parameters: {
|
|
147
147
|
readonly [x: string]: string | boolean;
|
|
148
148
|
};
|
|
149
|
-
readonly prompt_cache_retention?:
|
|
149
|
+
readonly prompt_cache_retention?: import("../schema/options.js").OpenString<"24h" | "default" | "extended"> | undefined;
|
|
150
150
|
readonly parallel_tool_calls?: boolean | undefined;
|
|
151
151
|
readonly min_p?: number | undefined;
|
|
152
152
|
readonly top_k?: number | undefined;
|
|
@@ -163,16 +163,191 @@ export declare const routes: Route<{
|
|
|
163
163
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
164
164
|
export declare const configure: (input?: Config) => {
|
|
165
165
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
166
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
167
|
-
|
|
166
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
167
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
168
|
+
readonly reasoning?: {
|
|
169
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
170
|
+
readonly enabled?: boolean | undefined;
|
|
171
|
+
readonly summary?: import("../schema/options.js").OpenString<"auto" | "concise" | "detailed"> | undefined;
|
|
172
|
+
} | undefined;
|
|
173
|
+
readonly veniceParameters?: {
|
|
174
|
+
readonly enableWebSearch?: import("../schema/options.js").OpenString<"auto" | "off" | "on"> | undefined;
|
|
175
|
+
readonly enableWebScraping?: boolean | undefined;
|
|
176
|
+
readonly enableWebCitations?: boolean | undefined;
|
|
177
|
+
readonly enableXSearch?: boolean | undefined;
|
|
178
|
+
readonly stripThinkingResponse?: boolean | undefined;
|
|
179
|
+
readonly disableThinking?: boolean | undefined;
|
|
180
|
+
readonly includeVeniceSystemPrompt?: boolean | undefined;
|
|
181
|
+
readonly characterSlug?: string | undefined;
|
|
182
|
+
readonly includeSearchResultsInStream?: boolean | undefined;
|
|
183
|
+
readonly returnSearchResultsAsDocuments?: boolean | undefined;
|
|
184
|
+
} | undefined;
|
|
185
|
+
readonly promptCacheKey?: string | undefined;
|
|
186
|
+
readonly promptCacheRetention?: import("../schema/options.js").OpenString<"24h" | "default" | "extended"> | undefined;
|
|
187
|
+
readonly parallelToolCalls?: boolean | undefined;
|
|
188
|
+
readonly maxCompletionTokens?: number | undefined;
|
|
189
|
+
readonly maxTokens?: number | undefined;
|
|
190
|
+
readonly minP?: number | undefined;
|
|
191
|
+
readonly repetitionPenalty?: number | undefined;
|
|
192
|
+
readonly stopTokenIds?: readonly number[] | undefined;
|
|
193
|
+
readonly logprobs?: boolean | undefined;
|
|
194
|
+
readonly topLogprobs?: number | undefined;
|
|
195
|
+
readonly maxTemp?: number | undefined;
|
|
196
|
+
readonly minTemp?: number | undefined;
|
|
197
|
+
readonly responseFormat?: {
|
|
198
|
+
readonly [x: string]: unknown;
|
|
199
|
+
} | undefined;
|
|
200
|
+
readonly user?: string | undefined;
|
|
201
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
202
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
203
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
204
|
+
readonly reasoning?: {
|
|
205
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
206
|
+
readonly enabled?: boolean | undefined;
|
|
207
|
+
readonly summary?: import("../schema/options.js").OpenString<"auto" | "concise" | "detailed"> | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
readonly veniceParameters?: {
|
|
210
|
+
readonly enableWebSearch?: import("../schema/options.js").OpenString<"auto" | "off" | "on"> | undefined;
|
|
211
|
+
readonly enableWebScraping?: boolean | undefined;
|
|
212
|
+
readonly enableWebCitations?: boolean | undefined;
|
|
213
|
+
readonly enableXSearch?: boolean | undefined;
|
|
214
|
+
readonly stripThinkingResponse?: boolean | undefined;
|
|
215
|
+
readonly disableThinking?: boolean | undefined;
|
|
216
|
+
readonly includeVeniceSystemPrompt?: boolean | undefined;
|
|
217
|
+
readonly characterSlug?: string | undefined;
|
|
218
|
+
readonly includeSearchResultsInStream?: boolean | undefined;
|
|
219
|
+
readonly returnSearchResultsAsDocuments?: boolean | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
readonly promptCacheKey?: string | undefined;
|
|
222
|
+
readonly promptCacheRetention?: import("../schema/options.js").OpenString<"24h" | "default" | "extended"> | undefined;
|
|
223
|
+
readonly parallelToolCalls?: boolean | undefined;
|
|
224
|
+
readonly maxCompletionTokens?: number | undefined;
|
|
225
|
+
readonly maxTokens?: number | undefined;
|
|
226
|
+
readonly minP?: number | undefined;
|
|
227
|
+
readonly repetitionPenalty?: number | undefined;
|
|
228
|
+
readonly stopTokenIds?: readonly number[] | undefined;
|
|
229
|
+
readonly logprobs?: boolean | undefined;
|
|
230
|
+
readonly topLogprobs?: number | undefined;
|
|
231
|
+
readonly maxTemp?: number | undefined;
|
|
232
|
+
readonly minTemp?: number | undefined;
|
|
233
|
+
readonly responseFormat?: {
|
|
234
|
+
readonly [x: string]: unknown;
|
|
235
|
+
} | undefined;
|
|
236
|
+
readonly user?: string | undefined;
|
|
237
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
168
238
|
configure: typeof configure;
|
|
169
239
|
};
|
|
170
240
|
export declare const provider: {
|
|
171
241
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
172
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
173
|
-
|
|
242
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
243
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
244
|
+
readonly reasoning?: {
|
|
245
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
246
|
+
readonly enabled?: boolean | undefined;
|
|
247
|
+
readonly summary?: import("../schema/options.js").OpenString<"auto" | "concise" | "detailed"> | undefined;
|
|
248
|
+
} | undefined;
|
|
249
|
+
readonly veniceParameters?: {
|
|
250
|
+
readonly enableWebSearch?: import("../schema/options.js").OpenString<"auto" | "off" | "on"> | undefined;
|
|
251
|
+
readonly enableWebScraping?: boolean | undefined;
|
|
252
|
+
readonly enableWebCitations?: boolean | undefined;
|
|
253
|
+
readonly enableXSearch?: boolean | undefined;
|
|
254
|
+
readonly stripThinkingResponse?: boolean | undefined;
|
|
255
|
+
readonly disableThinking?: boolean | undefined;
|
|
256
|
+
readonly includeVeniceSystemPrompt?: boolean | undefined;
|
|
257
|
+
readonly characterSlug?: string | undefined;
|
|
258
|
+
readonly includeSearchResultsInStream?: boolean | undefined;
|
|
259
|
+
readonly returnSearchResultsAsDocuments?: boolean | undefined;
|
|
260
|
+
} | undefined;
|
|
261
|
+
readonly promptCacheKey?: string | undefined;
|
|
262
|
+
readonly promptCacheRetention?: import("../schema/options.js").OpenString<"24h" | "default" | "extended"> | undefined;
|
|
263
|
+
readonly parallelToolCalls?: boolean | undefined;
|
|
264
|
+
readonly maxCompletionTokens?: number | undefined;
|
|
265
|
+
readonly maxTokens?: number | undefined;
|
|
266
|
+
readonly minP?: number | undefined;
|
|
267
|
+
readonly repetitionPenalty?: number | undefined;
|
|
268
|
+
readonly stopTokenIds?: readonly number[] | undefined;
|
|
269
|
+
readonly logprobs?: boolean | undefined;
|
|
270
|
+
readonly topLogprobs?: number | undefined;
|
|
271
|
+
readonly maxTemp?: number | undefined;
|
|
272
|
+
readonly minTemp?: number | undefined;
|
|
273
|
+
readonly responseFormat?: {
|
|
274
|
+
readonly [x: string]: unknown;
|
|
275
|
+
} | undefined;
|
|
276
|
+
readonly user?: string | undefined;
|
|
277
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
278
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
279
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
280
|
+
readonly reasoning?: {
|
|
281
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
282
|
+
readonly enabled?: boolean | undefined;
|
|
283
|
+
readonly summary?: import("../schema/options.js").OpenString<"auto" | "concise" | "detailed"> | undefined;
|
|
284
|
+
} | undefined;
|
|
285
|
+
readonly veniceParameters?: {
|
|
286
|
+
readonly enableWebSearch?: import("../schema/options.js").OpenString<"auto" | "off" | "on"> | undefined;
|
|
287
|
+
readonly enableWebScraping?: boolean | undefined;
|
|
288
|
+
readonly enableWebCitations?: boolean | undefined;
|
|
289
|
+
readonly enableXSearch?: boolean | undefined;
|
|
290
|
+
readonly stripThinkingResponse?: boolean | undefined;
|
|
291
|
+
readonly disableThinking?: boolean | undefined;
|
|
292
|
+
readonly includeVeniceSystemPrompt?: boolean | undefined;
|
|
293
|
+
readonly characterSlug?: string | undefined;
|
|
294
|
+
readonly includeSearchResultsInStream?: boolean | undefined;
|
|
295
|
+
readonly returnSearchResultsAsDocuments?: boolean | undefined;
|
|
296
|
+
} | undefined;
|
|
297
|
+
readonly promptCacheKey?: string | undefined;
|
|
298
|
+
readonly promptCacheRetention?: import("../schema/options.js").OpenString<"24h" | "default" | "extended"> | undefined;
|
|
299
|
+
readonly parallelToolCalls?: boolean | undefined;
|
|
300
|
+
readonly maxCompletionTokens?: number | undefined;
|
|
301
|
+
readonly maxTokens?: number | undefined;
|
|
302
|
+
readonly minP?: number | undefined;
|
|
303
|
+
readonly repetitionPenalty?: number | undefined;
|
|
304
|
+
readonly stopTokenIds?: readonly number[] | undefined;
|
|
305
|
+
readonly logprobs?: boolean | undefined;
|
|
306
|
+
readonly topLogprobs?: number | undefined;
|
|
307
|
+
readonly maxTemp?: number | undefined;
|
|
308
|
+
readonly minTemp?: number | undefined;
|
|
309
|
+
readonly responseFormat?: {
|
|
310
|
+
readonly [x: string]: unknown;
|
|
311
|
+
} | undefined;
|
|
312
|
+
readonly user?: string | undefined;
|
|
313
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
174
314
|
configure: typeof configure;
|
|
175
315
|
};
|
|
176
|
-
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
316
|
+
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
317
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
318
|
+
readonly reasoning?: {
|
|
319
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
320
|
+
readonly enabled?: boolean | undefined;
|
|
321
|
+
readonly summary?: import("../schema/options.js").OpenString<"auto" | "concise" | "detailed"> | undefined;
|
|
322
|
+
} | undefined;
|
|
323
|
+
readonly veniceParameters?: {
|
|
324
|
+
readonly enableWebSearch?: import("../schema/options.js").OpenString<"auto" | "off" | "on"> | undefined;
|
|
325
|
+
readonly enableWebScraping?: boolean | undefined;
|
|
326
|
+
readonly enableWebCitations?: boolean | undefined;
|
|
327
|
+
readonly enableXSearch?: boolean | undefined;
|
|
328
|
+
readonly stripThinkingResponse?: boolean | undefined;
|
|
329
|
+
readonly disableThinking?: boolean | undefined;
|
|
330
|
+
readonly includeVeniceSystemPrompt?: boolean | undefined;
|
|
331
|
+
readonly characterSlug?: string | undefined;
|
|
332
|
+
readonly includeSearchResultsInStream?: boolean | undefined;
|
|
333
|
+
readonly returnSearchResultsAsDocuments?: boolean | undefined;
|
|
334
|
+
} | undefined;
|
|
335
|
+
readonly promptCacheKey?: string | undefined;
|
|
336
|
+
readonly promptCacheRetention?: import("../schema/options.js").OpenString<"24h" | "default" | "extended"> | undefined;
|
|
337
|
+
readonly parallelToolCalls?: boolean | undefined;
|
|
338
|
+
readonly maxCompletionTokens?: number | undefined;
|
|
339
|
+
readonly maxTokens?: number | undefined;
|
|
340
|
+
readonly minP?: number | undefined;
|
|
341
|
+
readonly repetitionPenalty?: number | undefined;
|
|
342
|
+
readonly stopTokenIds?: readonly number[] | undefined;
|
|
343
|
+
readonly logprobs?: boolean | undefined;
|
|
344
|
+
readonly topLogprobs?: number | undefined;
|
|
345
|
+
readonly maxTemp?: number | undefined;
|
|
346
|
+
readonly minTemp?: number | undefined;
|
|
347
|
+
readonly responseFormat?: {
|
|
348
|
+
readonly [x: string]: unknown;
|
|
349
|
+
} | undefined;
|
|
350
|
+
readonly user?: string | undefined;
|
|
351
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
177
352
|
export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
|
|
178
353
|
export * as Venice from "./venice.js";
|
|
@@ -318,12 +318,12 @@ export declare const routes: (Route<{
|
|
|
318
318
|
readonly seed?: number | undefined;
|
|
319
319
|
readonly stop?: readonly string[] | undefined;
|
|
320
320
|
readonly thinking?: {
|
|
321
|
-
readonly type?:
|
|
321
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
322
322
|
readonly clear_thinking?: boolean | undefined;
|
|
323
323
|
} | undefined;
|
|
324
324
|
readonly do_sample?: boolean | undefined;
|
|
325
325
|
readonly response_format?: {
|
|
326
|
-
readonly type:
|
|
326
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
327
327
|
} | undefined;
|
|
328
328
|
readonly request_id?: string | undefined;
|
|
329
329
|
readonly user_id?: string | undefined;
|
|
@@ -584,27 +584,107 @@ export declare const routes: (Route<{
|
|
|
584
584
|
} | undefined;
|
|
585
585
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
586
586
|
readonly thinking?: {
|
|
587
|
-
readonly type:
|
|
587
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
588
588
|
} | undefined;
|
|
589
589
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
|
|
590
590
|
export declare const configure: (input?: Config) => {
|
|
591
591
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
592
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
593
|
-
|
|
594
|
-
|
|
592
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
593
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
594
|
+
readonly thinking?: {
|
|
595
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
596
|
+
readonly clear_thinking?: boolean | undefined;
|
|
597
|
+
} | undefined;
|
|
598
|
+
readonly toolStream?: boolean | undefined;
|
|
599
|
+
readonly doSample?: boolean | undefined;
|
|
600
|
+
readonly responseFormat?: {
|
|
601
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
602
|
+
} | undefined;
|
|
603
|
+
readonly requestID?: string | undefined;
|
|
604
|
+
readonly userID?: string | undefined;
|
|
605
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
606
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
607
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
608
|
+
readonly thinking?: {
|
|
609
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
610
|
+
readonly clear_thinking?: boolean | undefined;
|
|
611
|
+
} | undefined;
|
|
612
|
+
readonly toolStream?: boolean | undefined;
|
|
613
|
+
readonly doSample?: boolean | undefined;
|
|
614
|
+
readonly responseFormat?: {
|
|
615
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
616
|
+
} | undefined;
|
|
617
|
+
readonly requestID?: string | undefined;
|
|
618
|
+
readonly userID?: string | undefined;
|
|
619
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
620
|
+
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
621
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
622
|
+
readonly thinking?: {
|
|
623
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
624
|
+
} | undefined;
|
|
625
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
595
626
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
596
627
|
configure: typeof configure;
|
|
597
628
|
};
|
|
598
629
|
export declare const provider: {
|
|
599
630
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
600
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
601
|
-
|
|
602
|
-
|
|
631
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
632
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
633
|
+
readonly thinking?: {
|
|
634
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
635
|
+
readonly clear_thinking?: boolean | undefined;
|
|
636
|
+
} | undefined;
|
|
637
|
+
readonly toolStream?: boolean | undefined;
|
|
638
|
+
readonly doSample?: boolean | undefined;
|
|
639
|
+
readonly responseFormat?: {
|
|
640
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
641
|
+
} | undefined;
|
|
642
|
+
readonly requestID?: string | undefined;
|
|
643
|
+
readonly userID?: string | undefined;
|
|
644
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
645
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
646
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
647
|
+
readonly thinking?: {
|
|
648
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
649
|
+
readonly clear_thinking?: boolean | undefined;
|
|
650
|
+
} | undefined;
|
|
651
|
+
readonly toolStream?: boolean | undefined;
|
|
652
|
+
readonly doSample?: boolean | undefined;
|
|
653
|
+
readonly responseFormat?: {
|
|
654
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
655
|
+
} | undefined;
|
|
656
|
+
readonly requestID?: string | undefined;
|
|
657
|
+
readonly userID?: string | undefined;
|
|
658
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
659
|
+
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
660
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
661
|
+
readonly thinking?: {
|
|
662
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
663
|
+
} | undefined;
|
|
664
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
603
665
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
604
666
|
configure: typeof configure;
|
|
605
667
|
};
|
|
606
|
-
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
607
|
-
|
|
668
|
+
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
669
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
670
|
+
readonly thinking?: {
|
|
671
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
672
|
+
readonly clear_thinking?: boolean | undefined;
|
|
673
|
+
} | undefined;
|
|
674
|
+
readonly toolStream?: boolean | undefined;
|
|
675
|
+
readonly doSample?: boolean | undefined;
|
|
676
|
+
readonly responseFormat?: {
|
|
677
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
678
|
+
} | undefined;
|
|
679
|
+
readonly requestID?: string | undefined;
|
|
680
|
+
readonly userID?: string | undefined;
|
|
681
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
682
|
+
export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
683
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
684
|
+
readonly thinking?: {
|
|
685
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
686
|
+
} | undefined;
|
|
687
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
608
688
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
609
689
|
export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
|
|
610
690
|
export * as ZAICodingPlan from "./zai-coding-plan.js";
|
package/dist/providers/zai.d.ts
CHANGED
|
@@ -136,31 +136,96 @@ export declare const routes: Route<{
|
|
|
136
136
|
readonly seed?: number | undefined;
|
|
137
137
|
readonly stop?: readonly string[] | undefined;
|
|
138
138
|
readonly thinking?: {
|
|
139
|
-
readonly type?:
|
|
139
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
140
140
|
readonly clear_thinking?: boolean | undefined;
|
|
141
141
|
} | undefined;
|
|
142
142
|
readonly do_sample?: boolean | undefined;
|
|
143
143
|
readonly response_format?: {
|
|
144
|
-
readonly type:
|
|
144
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
145
145
|
} | undefined;
|
|
146
146
|
readonly request_id?: string | undefined;
|
|
147
147
|
readonly user_id?: string | undefined;
|
|
148
148
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
149
149
|
export declare const configure: (input?: Config) => {
|
|
150
150
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
151
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
152
|
-
|
|
151
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
152
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
153
|
+
readonly thinking?: {
|
|
154
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
155
|
+
readonly clear_thinking?: boolean | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
readonly toolStream?: boolean | undefined;
|
|
158
|
+
readonly doSample?: boolean | undefined;
|
|
159
|
+
readonly responseFormat?: {
|
|
160
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
161
|
+
} | undefined;
|
|
162
|
+
readonly requestID?: string | undefined;
|
|
163
|
+
readonly userID?: string | undefined;
|
|
164
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
165
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
166
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
167
|
+
readonly thinking?: {
|
|
168
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
169
|
+
readonly clear_thinking?: boolean | undefined;
|
|
170
|
+
} | undefined;
|
|
171
|
+
readonly toolStream?: boolean | undefined;
|
|
172
|
+
readonly doSample?: boolean | undefined;
|
|
173
|
+
readonly responseFormat?: {
|
|
174
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
175
|
+
} | undefined;
|
|
176
|
+
readonly requestID?: string | undefined;
|
|
177
|
+
readonly userID?: string | undefined;
|
|
178
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
153
179
|
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("./zai.js").ZAIImageOptions>;
|
|
154
180
|
configure: typeof configure;
|
|
155
181
|
};
|
|
156
182
|
export declare const provider: {
|
|
157
183
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
158
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
159
|
-
|
|
184
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
185
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
186
|
+
readonly thinking?: {
|
|
187
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
188
|
+
readonly clear_thinking?: boolean | undefined;
|
|
189
|
+
} | undefined;
|
|
190
|
+
readonly toolStream?: boolean | undefined;
|
|
191
|
+
readonly doSample?: boolean | undefined;
|
|
192
|
+
readonly responseFormat?: {
|
|
193
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
194
|
+
} | undefined;
|
|
195
|
+
readonly requestID?: string | undefined;
|
|
196
|
+
readonly userID?: string | undefined;
|
|
197
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
198
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
199
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
200
|
+
readonly thinking?: {
|
|
201
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
202
|
+
readonly clear_thinking?: boolean | undefined;
|
|
203
|
+
} | undefined;
|
|
204
|
+
readonly toolStream?: boolean | undefined;
|
|
205
|
+
readonly doSample?: boolean | undefined;
|
|
206
|
+
readonly responseFormat?: {
|
|
207
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
208
|
+
} | undefined;
|
|
209
|
+
readonly requestID?: string | undefined;
|
|
210
|
+
readonly userID?: string | undefined;
|
|
211
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
160
212
|
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("./zai.js").ZAIImageOptions>;
|
|
161
213
|
configure: typeof configure;
|
|
162
214
|
};
|
|
163
215
|
export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("./zai.js").ZAIImageOptions>;
|
|
164
|
-
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
216
|
+
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
217
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
218
|
+
readonly thinking?: {
|
|
219
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
220
|
+
readonly clear_thinking?: boolean | undefined;
|
|
221
|
+
} | undefined;
|
|
222
|
+
readonly toolStream?: boolean | undefined;
|
|
223
|
+
readonly doSample?: boolean | undefined;
|
|
224
|
+
readonly responseFormat?: {
|
|
225
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
226
|
+
} | undefined;
|
|
227
|
+
readonly requestID?: string | undefined;
|
|
228
|
+
readonly userID?: string | undefined;
|
|
229
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
165
230
|
export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
|
|
166
231
|
export * as ZAI from "./zai.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-21641",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
37
37
|
"@effect/platform-node": "4.0.1",
|
|
38
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
38
|
+
"@opencode/http-recorder": "0.0.0-dev-21641",
|
|
39
39
|
"@tsconfig/bun": "1.0.9",
|
|
40
40
|
"@types/bun": "1.4.3",
|
|
41
41
|
"@typescript/native": "npm:typescript@7.1.0-beta",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
46
46
|
"@smithy/eventstream-codec": "4.2.14",
|
|
47
47
|
"@smithy/util-utf8": "4.2.2",
|
|
48
|
-
"@opencode/schema": "0.0.0-dev-
|
|
48
|
+
"@opencode/schema": "0.0.0-dev-21641",
|
|
49
49
|
"aws4fetch": "1.0.20",
|
|
50
50
|
"effect": "4.0.1",
|
|
51
51
|
"google-auth-library": "10.5.0"
|