@opencode/ai 0.0.0-dev-20546 → 0.0.0-dev-20549

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.
@@ -0,0 +1,183 @@
1
+ import type { ProviderPackage } from "../provider-package.js";
2
+ import { VeniceChat } from "../protocols/venice-chat.js";
3
+ import { type ProviderAuthOption } from "../route/auth-options.js";
4
+ import { Route, type RouteDefaultsInput } from "../route/client.js";
5
+ import { type ModelID } from "../schema/index.js";
6
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
7
+ export type ChatOptionsInput = VeniceChat.OptionsInput;
8
+ export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
9
+ readonly baseURL?: string;
10
+ readonly queryParams?: Readonly<Record<string, string>>;
11
+ readonly providerOptions?: ChatOptionsInput;
12
+ };
13
+ export type Settings = ProviderPackage.Settings & ChatOptionsInput & {
14
+ readonly apiKey?: string;
15
+ readonly baseURL?: string;
16
+ readonly queryParams?: Readonly<Record<string, string>>;
17
+ };
18
+ export declare const routes: Route<{
19
+ readonly model: string;
20
+ readonly messages: readonly ({
21
+ readonly role: "system";
22
+ readonly content: string | readonly ({
23
+ readonly type: "text";
24
+ readonly text: string;
25
+ readonly cache_control?: {
26
+ readonly type: "ephemeral";
27
+ readonly ttl?: string | undefined;
28
+ } | undefined;
29
+ } | {
30
+ readonly type: "image_url";
31
+ readonly image_url: {
32
+ readonly url: string;
33
+ };
34
+ } | {
35
+ readonly type: "file";
36
+ readonly file: {
37
+ readonly filename: string;
38
+ readonly file_data: string;
39
+ };
40
+ })[];
41
+ } | {
42
+ readonly role: "user";
43
+ readonly content: string | readonly ({
44
+ readonly type: "text";
45
+ readonly text: string;
46
+ readonly cache_control?: {
47
+ readonly type: "ephemeral";
48
+ readonly ttl?: string | undefined;
49
+ } | undefined;
50
+ } | {
51
+ readonly type: "image_url";
52
+ readonly image_url: {
53
+ readonly url: string;
54
+ };
55
+ } | {
56
+ readonly type: "file";
57
+ readonly file: {
58
+ readonly filename: string;
59
+ readonly file_data: string;
60
+ };
61
+ })[];
62
+ } | {
63
+ readonly role: "tool";
64
+ readonly tool_call_id: string;
65
+ readonly content: string | readonly {
66
+ readonly type: "text";
67
+ readonly text: string;
68
+ readonly cache_control?: {
69
+ readonly type: "ephemeral";
70
+ readonly ttl?: string | undefined;
71
+ } | undefined;
72
+ }[];
73
+ } | {
74
+ readonly [x: string]: unknown;
75
+ readonly content: string | readonly {
76
+ readonly type: "text";
77
+ readonly text: string;
78
+ readonly cache_control?: {
79
+ readonly type: "ephemeral";
80
+ readonly ttl?: string | undefined;
81
+ } | undefined;
82
+ }[] | null;
83
+ readonly role: "assistant";
84
+ readonly reasoning?: string | undefined;
85
+ readonly reasoning_content?: string | undefined;
86
+ readonly reasoning_text?: string | undefined;
87
+ readonly tool_calls?: readonly {
88
+ readonly function: {
89
+ readonly name: string;
90
+ readonly arguments: string;
91
+ };
92
+ readonly id: string;
93
+ readonly type: "function";
94
+ readonly thought_signature?: string | undefined;
95
+ readonly extra_content?: {
96
+ readonly google: {
97
+ readonly thought_signature: string;
98
+ };
99
+ } | undefined;
100
+ }[] | undefined;
101
+ readonly thought_signature?: string | undefined;
102
+ readonly reasoning_details?: unknown;
103
+ })[];
104
+ readonly stream: true;
105
+ readonly venice_parameters: {
106
+ readonly [x: string]: string | boolean;
107
+ };
108
+ readonly reasoning?: {
109
+ readonly enabled?: boolean | undefined;
110
+ readonly summary?: string | undefined;
111
+ readonly effort?: string | undefined;
112
+ } | undefined;
113
+ readonly max_completion_tokens?: number | undefined;
114
+ readonly max_tokens?: number | undefined;
115
+ readonly tools?: readonly {
116
+ readonly function: {
117
+ readonly description: string;
118
+ readonly name: string;
119
+ readonly parameters: {
120
+ readonly [x: string]: unknown;
121
+ };
122
+ readonly strict?: boolean | undefined;
123
+ };
124
+ readonly type: "function";
125
+ readonly cache_control?: {
126
+ readonly type: "ephemeral";
127
+ readonly ttl?: string | undefined;
128
+ } | undefined;
129
+ }[] | undefined;
130
+ readonly stop?: readonly string[] | undefined;
131
+ readonly user?: string | undefined;
132
+ readonly temperature?: number | undefined;
133
+ readonly seed?: number | undefined;
134
+ readonly tool_choice?: "required" | "auto" | "none" | {
135
+ readonly type: "function";
136
+ readonly function: {
137
+ readonly name: string;
138
+ };
139
+ } | undefined;
140
+ readonly top_p?: number | undefined;
141
+ readonly top_k?: number | undefined;
142
+ readonly frequency_penalty?: number | undefined;
143
+ readonly presence_penalty?: number | undefined;
144
+ readonly store?: boolean | undefined;
145
+ readonly prompt_cache_key?: string | undefined;
146
+ readonly parallel_tool_calls?: boolean | undefined;
147
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
148
+ readonly stream_options?: {
149
+ readonly include_usage: boolean;
150
+ } | undefined;
151
+ readonly tool_stream?: boolean | undefined;
152
+ readonly top_logprobs?: number | undefined;
153
+ readonly prompt_cache_retention?: string | undefined;
154
+ readonly repetition_penalty?: number | undefined;
155
+ readonly response_format?: {
156
+ readonly [x: string]: unknown;
157
+ } | undefined;
158
+ readonly logprobs?: boolean | undefined;
159
+ readonly min_p?: number | undefined;
160
+ readonly stop_token_ids?: readonly number[] | undefined;
161
+ readonly max_temp?: number | undefined;
162
+ readonly min_temp?: number | undefined;
163
+ }, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
164
+ export declare const configure: (input?: Config) => {
165
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
166
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
167
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
168
+ configure: (input?: Config) => /*elided*/ any;
169
+ };
170
+ export declare const provider: {
171
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
172
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
173
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
174
+ configure: (input?: Config) => {
175
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
176
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
177
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
178
+ configure: /*elided*/ any;
179
+ };
180
+ };
181
+ export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
182
+ export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
183
+ export * as Venice from "./venice.js";
@@ -0,0 +1,38 @@
1
+ import { VeniceChat } from "../protocols/venice-chat.js";
2
+ import { OpenAIChat } from "../protocols/openai-chat.js";
3
+ import { AuthOptions } from "../route/auth-options.js";
4
+ import { Route } from "../route/client.js";
5
+ import { Endpoint } from "../route/endpoint.js";
6
+ import { ProviderID } from "../schema/index.js";
7
+ export const id = ProviderID.make("venice");
8
+ const route = Route.make({
9
+ id: "venice-chat",
10
+ provider: id,
11
+ providerMetadataKey: "venice",
12
+ protocol: VeniceChat.protocol,
13
+ endpoint: Endpoint.path("/chat/completions", { baseURL: "https://api.venice.ai/api/v1" }),
14
+ framing: OpenAIChat.framing,
15
+ });
16
+ export const routes = [route];
17
+ export const configure = (input = {}) => {
18
+ const { apiKey: _apiKey, auth: _auth, baseURL, queryParams, ...rest } = input;
19
+ const chat = (modelID) => route
20
+ .with({
21
+ ...rest,
22
+ endpoint: { baseURL: baseURL ?? route.endpoint.baseURL, query: queryParams },
23
+ auth: AuthOptions.bearer(input, "VENICE_API_KEY"),
24
+ })
25
+ .model({ id: modelID, compatibility: VeniceChat.compatibility });
26
+ return { id, model: chat, chat, configure };
27
+ };
28
+ export const provider = configure();
29
+ export const chat = provider.chat;
30
+ export const model = (modelID, { apiKey, baseURL, queryParams, body, headers, ...providerOptions }) => configure({
31
+ apiKey,
32
+ baseURL,
33
+ queryParams,
34
+ headers,
35
+ http: body === undefined ? undefined : { body: { ...body } },
36
+ providerOptions,
37
+ }).model(modelID);
38
+ export * as Venice from "./venice.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-20546",
3
+ "version": "0.0.0-dev-20549",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "@clack/prompts": "1.0.0-alpha.1",
36
36
  "@effect/platform-node": "4.0.0-rc.112",
37
- "@opencode/http-recorder": "0.0.0-dev-20546",
37
+ "@opencode/http-recorder": "0.0.0-dev-20549",
38
38
  "@tsconfig/bun": "1.0.9",
39
39
  "@types/bun": "1.4.0",
40
40
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -44,7 +44,7 @@
44
44
  "@aws-sdk/credential-providers": "3.1057.0",
45
45
  "@smithy/eventstream-codec": "4.2.14",
46
46
  "@smithy/util-utf8": "4.2.2",
47
- "@opencode/schema": "0.0.0-dev-20546",
47
+ "@opencode/schema": "0.0.0-dev-20549",
48
48
  "aws4fetch": "1.0.20",
49
49
  "effect": "4.0.0-rc.112",
50
50
  "google-auth-library": "10.5.0"