@opencode/ai 2.0.21 → 2.0.23
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 +61 -1
- package/dist/cache-policy.js +10 -2
- package/dist/llm.d.ts +4 -0
- package/dist/promise.d.ts +8 -0
- package/dist/protocols/alibaba-chat.d.ts +7 -3
- package/dist/protocols/alibaba-chat.js +2 -1
- package/dist/protocols/alibaba-responses.d.ts +16 -12
- package/dist/protocols/alibaba-responses.js +3 -5
- package/dist/protocols/anthropic-messages.js +58 -51
- package/dist/protocols/bedrock-converse.js +33 -4
- package/dist/protocols/cartesia-speech.js +3 -3
- package/dist/protocols/cohere-chat.d.ts +178 -0
- package/dist/protocols/cohere-chat.js +299 -0
- package/dist/protocols/elevenlabs-speech.js +3 -3
- package/dist/protocols/gemini.d.ts +2 -2
- package/dist/protocols/gemini.js +3 -3
- package/dist/protocols/google-interactions.d.ts +236 -0
- package/dist/protocols/google-interactions.js +478 -0
- package/dist/protocols/google-speech.js +1 -1
- package/dist/protocols/google-transcription.js +1 -1
- package/dist/protocols/index.d.ts +2 -0
- package/dist/protocols/index.js +2 -0
- package/dist/protocols/meta-responses.d.ts +31 -58
- package/dist/protocols/meta-responses.js +8 -27
- package/dist/protocols/mistral-chat.d.ts +24 -9
- package/dist/protocols/mistral-chat.js +22 -10
- package/dist/protocols/open-responses.d.ts +410 -91
- package/dist/protocols/open-responses.js +25 -15
- package/dist/protocols/openai-chat.d.ts +409 -5
- package/dist/protocols/openai-chat.js +27 -26
- package/dist/protocols/openai-compatible-chat.d.ts +1 -1
- package/dist/protocols/openai-compatible-responses.d.ts +16 -4
- package/dist/protocols/openai-images.js +2 -2
- package/dist/protocols/openai-responses.d.ts +87 -223
- package/dist/protocols/openai-responses.js +10 -16
- package/dist/protocols/openai-speech.js +1 -1
- package/dist/protocols/openai-transcription.js +1 -1
- package/dist/protocols/shared.js +2 -2
- package/dist/protocols/stability-images.js +1 -1
- package/dist/protocols/utils/bedrock-media.js +2 -2
- package/dist/protocols/utils/cache.d.ts +5 -0
- package/dist/protocols/utils/cache.js +9 -1
- package/dist/protocols/utils/responses-checkpoint.js +2 -2
- package/dist/protocols/utils/responses-hosted-tools.js +1 -1
- package/dist/protocols/utils/tool-stream.d.ts +12 -0
- package/dist/protocols/utils/tool-stream.js +15 -7
- package/dist/protocols/venice-chat.d.ts +280 -0
- package/dist/protocols/venice-chat.js +283 -0
- package/dist/protocols/xai-responses.d.ts +18 -21
- package/dist/protocols/xai-responses.js +2 -8
- package/dist/protocols/zai-chat.d.ts +7 -3
- package/dist/protocols/zai-chat.js +6 -3
- package/dist/provider-error.js +27 -7
- package/dist/providers/alibaba.d.ts +17 -13
- package/dist/providers/amazon-bedrock/mantle/messages.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/messages.js +1 -0
- package/dist/providers/amazon-bedrock-mantle.d.ts +301 -9
- package/dist/providers/amazon-bedrock-mantle.js +28 -3
- package/dist/providers/azure.d.ts +13 -61
- package/dist/providers/baseten.d.ts +2 -2
- package/dist/providers/cerebras.d.ts +2 -2
- package/dist/providers/cloudflare-ai-gateway.d.ts +14 -62
- package/dist/providers/cloudflare-workers-ai.d.ts +2 -2
- package/dist/providers/cohere/chat.d.ts +4 -0
- package/dist/providers/cohere/chat.js +8 -0
- package/dist/providers/cohere.d.ts +395 -0
- package/dist/providers/cohere.js +48 -0
- package/dist/providers/deepinfra.d.ts +2 -2
- package/dist/providers/deepseek.d.ts +2 -2
- package/dist/providers/digitalocean.d.ts +469 -0
- package/dist/providers/digitalocean.js +53 -0
- package/dist/providers/fireworks.d.ts +2 -2
- package/dist/providers/google/interactions.d.ts +7 -0
- package/dist/providers/google/interactions.js +8 -0
- package/dist/providers/google-vertex-chat.d.ts +1 -1
- package/dist/providers/google-vertex-messages.js +1 -1
- package/dist/providers/google-vertex-responses.d.ts +16 -4
- package/dist/providers/google-vertex.d.ts +1 -1
- package/dist/providers/google.d.ts +95 -4
- package/dist/providers/google.js +8 -1
- package/dist/providers/groq.d.ts +8 -4
- package/dist/providers/groq.js +1 -1
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/index.js +3 -0
- package/dist/providers/meta.d.ts +15 -28
- package/dist/providers/minimax.d.ts +17 -5
- package/dist/providers/mistral.d.ts +10 -4
- package/dist/providers/moonshot.d.ts +17 -5
- package/dist/providers/openai-compatible-responses.d.ts +16 -4
- package/dist/providers/openai-compatible.d.ts +1 -1
- package/dist/providers/openai-options.d.ts +1 -1
- package/dist/providers/openai.d.ts +7 -31
- package/dist/providers/openrouter.d.ts +9 -5
- package/dist/providers/openrouter.js +1 -13
- package/dist/providers/togetherai.d.ts +2 -2
- package/dist/providers/venice.d.ts +183 -0
- package/dist/providers/venice.js +38 -0
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/zai-coding-plan.d.ts +17 -5
- package/dist/providers/zai.d.ts +1 -1
- package/dist/route/client.d.ts +4 -0
- package/dist/route/client.js +2 -5
- package/dist/route/executor.js +13 -6
- package/dist/route/framing.js +23 -23
- package/dist/route/transport/http.d.ts +2 -1
- package/dist/route/transport/http.js +28 -6
- package/dist/schema/events.d.ts +176 -0
- package/dist/schema/events.js +4 -0
- package/dist/schema/options.d.ts +11 -0
- package/dist/schema/options.js +15 -2
- package/dist/testing.d.ts +32 -0
- package/dist/tool-history.js +17 -3
- package/package.json +3 -3
|
@@ -121,8 +121,13 @@ export const ConfigurationUpdate = Schema.Struct({
|
|
|
121
121
|
type: Schema.Literal("configuration_update"),
|
|
122
122
|
reasoning: Schema.Struct({ effort: OpenResponsesOptions.ReasoningEffort }),
|
|
123
123
|
});
|
|
124
|
+
export const HostedToolReplay = Schema.StructWithRest(Schema.Struct({
|
|
125
|
+
type: Schema.String,
|
|
126
|
+
id: Schema.String,
|
|
127
|
+
}), [JsonObject]);
|
|
124
128
|
export const InputItem = Schema.Union([
|
|
125
129
|
CompactionItem,
|
|
130
|
+
ConfigurationUpdate,
|
|
126
131
|
Schema.Struct({ type: Schema.tag("message"), role: Schema.tag("system"), content: Schema.String }),
|
|
127
132
|
Schema.Struct({ type: Schema.tag("message"), role: Schema.tag("developer"), content: Schema.String }),
|
|
128
133
|
Schema.Struct({
|
|
@@ -155,6 +160,7 @@ export const InputItem = Schema.Union([
|
|
|
155
160
|
output: OpenResponsesFunctionCallOutput,
|
|
156
161
|
}),
|
|
157
162
|
HostedToolItem,
|
|
163
|
+
HostedToolReplay,
|
|
158
164
|
]);
|
|
159
165
|
export const Tool = Schema.Struct({
|
|
160
166
|
type: Schema.tag("function"),
|
|
@@ -163,6 +169,9 @@ export const Tool = Schema.Struct({
|
|
|
163
169
|
parameters: JsonObject,
|
|
164
170
|
strict: Schema.optional(Schema.Boolean),
|
|
165
171
|
});
|
|
172
|
+
export const HostedTool = Schema.StructWithRest(Schema.Struct({
|
|
173
|
+
type: Schema.String,
|
|
174
|
+
}), [JsonObject]);
|
|
166
175
|
export const ToolChoice = Schema.Union([
|
|
167
176
|
Schema.Literals(["auto", "none", "required"]),
|
|
168
177
|
Schema.Struct({ type: Schema.tag("function"), name: Schema.String }),
|
|
@@ -180,7 +189,7 @@ export const coreFields = {
|
|
|
180
189
|
model: Schema.String,
|
|
181
190
|
input: Schema.Array(InputItem),
|
|
182
191
|
instructions: Schema.optional(Schema.String),
|
|
183
|
-
tools: optionalArray(Tool),
|
|
192
|
+
tools: optionalArray(Schema.Union([Tool, HostedTool])),
|
|
184
193
|
tool_choice: Schema.optional(ToolChoice),
|
|
185
194
|
store: Schema.optional(Schema.Boolean),
|
|
186
195
|
metadata: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
@@ -208,7 +217,7 @@ export const coreFields = {
|
|
|
208
217
|
presence_penalty: Schema.optional(Schema.Number),
|
|
209
218
|
frequency_penalty: Schema.optional(Schema.Number),
|
|
210
219
|
};
|
|
211
|
-
const OpenResponsesBody = Schema.Struct({
|
|
220
|
+
export const OpenResponsesBody = Schema.Struct({
|
|
212
221
|
...coreFields,
|
|
213
222
|
stream: Schema.Literal(true),
|
|
214
223
|
});
|
|
@@ -280,7 +289,7 @@ const BASE_ADAPTER = { id: ADAPTER, name: NAME };
|
|
|
280
289
|
// =============================================================================
|
|
281
290
|
// Request Lowering
|
|
282
291
|
// =============================================================================
|
|
283
|
-
export const lowerTool = Effect.
|
|
292
|
+
export const lowerTool = Effect.fnUntraced(function* (protocolName, tool) {
|
|
284
293
|
if (tool.native !== undefined)
|
|
285
294
|
return yield* ProviderShared.invalidRequest(`${protocolName} does not support provider-native tool ${tool.name}`);
|
|
286
295
|
return {
|
|
@@ -334,12 +343,15 @@ const lowerReasoning = (part, providerMetadataKey) => {
|
|
|
334
343
|
encrypted_content: encryptedContent,
|
|
335
344
|
};
|
|
336
345
|
};
|
|
337
|
-
const
|
|
346
|
+
const decodeImageDetail = ProviderShared.validateWith(Schema.decodeUnknownEffect(OpenResponsesInputImage.fields.detail));
|
|
347
|
+
const decodeMessageMetadata = ProviderShared.validateWith(Schema.decodeUnknownEffect(MessageMetadata));
|
|
348
|
+
const lowerMedia = Effect.fnUntraced(function* (part, request, adapter, target) {
|
|
338
349
|
const media = part.media.inline();
|
|
339
350
|
const providerMedia = adapter.lowerMedia?.({ part, media, request });
|
|
340
351
|
if (providerMedia)
|
|
341
352
|
return providerMedia;
|
|
342
|
-
const
|
|
353
|
+
const rawDetail = part.providerMetadata?.[metadataKey(request.model)]?.detail;
|
|
354
|
+
const detail = rawDetail === undefined ? undefined : yield* decodeImageDetail(rawDetail);
|
|
343
355
|
const mime = part.media.mediaType.toLowerCase();
|
|
344
356
|
const url = ProviderShared.mediaUrl(part.media);
|
|
345
357
|
const location = url ?? (yield* ProviderShared.requireInlineMedia(adapter.name, part.media)).dataUrl;
|
|
@@ -394,11 +406,12 @@ const lowerToolResultOutput = Effect.fnUntraced(function* (part, request, adapte
|
|
|
394
406
|
return yield* Effect.forEach(content, (item) => lowerToolResultContentItem(item, request, adapter));
|
|
395
407
|
});
|
|
396
408
|
const DEFAULT_EFFORT = "medium";
|
|
397
|
-
const lowerMessages = Effect.
|
|
409
|
+
const lowerMessages = Effect.fnUntraced(function* (request, adapter) {
|
|
398
410
|
const input = [];
|
|
399
411
|
const providerMetadataKey = metadataKey(request.model);
|
|
400
412
|
for (const message of request.messages) {
|
|
401
|
-
const
|
|
413
|
+
const rawMetadata = message.providerMetadata?.[providerMetadataKey];
|
|
414
|
+
const metadata = rawMetadata === undefined ? undefined : yield* decodeMessageMetadata(rawMetadata);
|
|
402
415
|
if (message.role === "system") {
|
|
403
416
|
const update = effortUpdate(message);
|
|
404
417
|
if (update) {
|
|
@@ -546,7 +559,7 @@ const lowerMessages = Effect.fn("OpenResponses.lowerMessages")(function* (reques
|
|
|
546
559
|
}
|
|
547
560
|
return input;
|
|
548
561
|
});
|
|
549
|
-
export const lowerConversation = Effect.
|
|
562
|
+
export const lowerConversation = Effect.fnUntraced(function* (request, adapter) {
|
|
550
563
|
const instructions = ProviderShared.joinText(request.system);
|
|
551
564
|
return {
|
|
552
565
|
model: request.model.id,
|
|
@@ -611,10 +624,7 @@ export const fromRequestWithAdapter = Effect.fn("OpenResponses.fromRequestWithAd
|
|
|
611
624
|
(request.toolChoice ? yield* lowerToolChoice(adapter.name, request.toolChoice) : undefined),
|
|
612
625
|
};
|
|
613
626
|
});
|
|
614
|
-
const
|
|
615
|
-
export const fromRequest = Effect.fn("OpenResponses.fromRequest")(function* (request) {
|
|
616
|
-
return yield* decodeBody(yield* fromRequestWithAdapter(request, BASE_ADAPTER));
|
|
617
|
-
});
|
|
627
|
+
export const fromRequest = (request) => fromRequestWithAdapter(request, BASE_ADAPTER);
|
|
618
628
|
// =============================================================================
|
|
619
629
|
// Stream Parsing
|
|
620
630
|
// =============================================================================
|
|
@@ -892,7 +902,7 @@ const onReasoningSummaryPartDone = (state, event) => {
|
|
|
892
902
|
NO_EVENTS,
|
|
893
903
|
];
|
|
894
904
|
};
|
|
895
|
-
const onFunctionCallArgumentsDelta = Effect.
|
|
905
|
+
const onFunctionCallArgumentsDelta = Effect.fnUntraced(function* (state, event) {
|
|
896
906
|
if (event.item_id === undefined)
|
|
897
907
|
return [state, NO_EVENTS];
|
|
898
908
|
const tool = state.tools[event.item_id];
|
|
@@ -917,7 +927,7 @@ const onFunctionCallArgumentsDelta = Effect.fn("OpenResponses.onFunctionCallArgu
|
|
|
917
927
|
events.push(...result.events);
|
|
918
928
|
return [{ ...state, lifecycle, tools: result.tools }, events];
|
|
919
929
|
});
|
|
920
|
-
const onOutputItemDone = Effect.
|
|
930
|
+
const onOutputItemDone = Effect.fnUntraced(function* (state, item) {
|
|
921
931
|
if (!item)
|
|
922
932
|
return [state, NO_EVENTS];
|
|
923
933
|
if (item.type === "compaction") {
|
|
@@ -1045,7 +1055,7 @@ const onOutputItemDone = Effect.fn("OpenResponses.onOutputItemDone")(function* (
|
|
|
1045
1055
|
}
|
|
1046
1056
|
return [state, NO_EVENTS];
|
|
1047
1057
|
});
|
|
1048
|
-
const onResponseFinish = Effect.
|
|
1058
|
+
const onResponseFinish = Effect.fnUntraced(function* (state, event) {
|
|
1049
1059
|
let current = state;
|
|
1050
1060
|
const events = [];
|
|
1051
1061
|
if (event.type === "response.completed") {
|
|
@@ -18,6 +18,19 @@ declare const ExtraContent: Schema.Struct<{
|
|
|
18
18
|
readonly thought_signature: Schema.String;
|
|
19
19
|
}>;
|
|
20
20
|
}>;
|
|
21
|
+
export declare const OpenAIChatAssistantToolCall: Schema.Struct<{
|
|
22
|
+
readonly id: Schema.String;
|
|
23
|
+
readonly type: Schema.tag<"function">;
|
|
24
|
+
readonly function: Schema.Struct<{
|
|
25
|
+
readonly name: Schema.String;
|
|
26
|
+
readonly arguments: Schema.String;
|
|
27
|
+
}>;
|
|
28
|
+
readonly extra_content: Schema.optional<Schema.Struct<{
|
|
29
|
+
readonly google: Schema.Struct<{
|
|
30
|
+
readonly thought_signature: Schema.String;
|
|
31
|
+
}>;
|
|
32
|
+
}>>;
|
|
33
|
+
}>;
|
|
21
34
|
declare const ReasoningDetail: Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
22
35
|
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
23
36
|
readonly format: Schema.optional<Schema.String>;
|
|
@@ -49,6 +62,88 @@ declare const ReasoningDetail: Schema.Union<readonly [Schema.StructWithRest<Sche
|
|
|
49
62
|
readonly index: Schema.optional<Schema.Number>;
|
|
50
63
|
}>]>;
|
|
51
64
|
type ReasoningDetail = Schema.Schema.Type<typeof ReasoningDetail>;
|
|
65
|
+
export declare const OpenAIChatMessage: Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
66
|
+
readonly role: Schema.Literal<"system">;
|
|
67
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
68
|
+
readonly type: Schema.Literal<"text">;
|
|
69
|
+
readonly text: Schema.String;
|
|
70
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
71
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
72
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
73
|
+
}>>;
|
|
74
|
+
}>, Schema.Struct<{
|
|
75
|
+
readonly type: Schema.Literal<"image_url">;
|
|
76
|
+
readonly image_url: Schema.Struct<{
|
|
77
|
+
readonly url: Schema.String;
|
|
78
|
+
}>;
|
|
79
|
+
}>, Schema.Struct<{
|
|
80
|
+
readonly type: Schema.Literal<"file">;
|
|
81
|
+
readonly file: Schema.Struct<{
|
|
82
|
+
readonly filename: Schema.String;
|
|
83
|
+
readonly file_data: Schema.String;
|
|
84
|
+
}>;
|
|
85
|
+
}>]>>]>;
|
|
86
|
+
}>, Schema.Struct<{
|
|
87
|
+
readonly role: Schema.Literal<"user">;
|
|
88
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
89
|
+
readonly type: Schema.Literal<"text">;
|
|
90
|
+
readonly text: Schema.String;
|
|
91
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
92
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
93
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
94
|
+
}>>;
|
|
95
|
+
}>, Schema.Struct<{
|
|
96
|
+
readonly type: Schema.Literal<"image_url">;
|
|
97
|
+
readonly image_url: Schema.Struct<{
|
|
98
|
+
readonly url: Schema.String;
|
|
99
|
+
}>;
|
|
100
|
+
}>, Schema.Struct<{
|
|
101
|
+
readonly type: Schema.Literal<"file">;
|
|
102
|
+
readonly file: Schema.Struct<{
|
|
103
|
+
readonly filename: Schema.String;
|
|
104
|
+
readonly file_data: Schema.String;
|
|
105
|
+
}>;
|
|
106
|
+
}>]>>]>;
|
|
107
|
+
}>, Schema.StructWithRest<Schema.Struct<{
|
|
108
|
+
readonly role: Schema.Literal<"assistant">;
|
|
109
|
+
readonly content: Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
110
|
+
readonly type: Schema.Literal<"text">;
|
|
111
|
+
readonly text: Schema.String;
|
|
112
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
113
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
114
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
115
|
+
}>>;
|
|
116
|
+
}>>]>>;
|
|
117
|
+
readonly tool_calls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
118
|
+
readonly id: Schema.String;
|
|
119
|
+
readonly type: Schema.tag<"function">;
|
|
120
|
+
readonly function: Schema.Struct<{
|
|
121
|
+
readonly name: Schema.String;
|
|
122
|
+
readonly arguments: Schema.String;
|
|
123
|
+
}>;
|
|
124
|
+
readonly extra_content: Schema.optional<Schema.Struct<{
|
|
125
|
+
readonly google: Schema.Struct<{
|
|
126
|
+
readonly thought_signature: Schema.String;
|
|
127
|
+
}>;
|
|
128
|
+
}>>;
|
|
129
|
+
}>>>;
|
|
130
|
+
readonly reasoning_content: Schema.optional<Schema.String>;
|
|
131
|
+
readonly reasoning: Schema.optional<Schema.String>;
|
|
132
|
+
readonly reasoning_text: Schema.optional<Schema.String>;
|
|
133
|
+
readonly reasoning_details: Schema.optional<Schema.Unknown>;
|
|
134
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.Struct<{
|
|
135
|
+
readonly role: Schema.Literal<"tool">;
|
|
136
|
+
readonly tool_call_id: Schema.String;
|
|
137
|
+
readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
|
|
138
|
+
readonly type: Schema.Literal<"text">;
|
|
139
|
+
readonly text: Schema.String;
|
|
140
|
+
readonly cache_control: Schema.optional<Schema.Struct<{
|
|
141
|
+
readonly type: Schema.Literal<"ephemeral">;
|
|
142
|
+
readonly ttl: Schema.optional<Schema.String>;
|
|
143
|
+
}>>;
|
|
144
|
+
}>>]>;
|
|
145
|
+
}>]>;
|
|
146
|
+
type OpenAIChatMessage = Schema.Schema.Type<typeof OpenAIChatMessage>;
|
|
52
147
|
export declare const bodyFields: {
|
|
53
148
|
model: Schema.String;
|
|
54
149
|
messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
|
|
@@ -288,6 +383,89 @@ declare const OpenAIChatBody: Schema.Struct<{
|
|
|
288
383
|
stop: Schema.optional<Schema.$Array<Schema.String>>;
|
|
289
384
|
}>;
|
|
290
385
|
export type OpenAIChatBody = Schema.Schema.Type<typeof OpenAIChatBody>;
|
|
386
|
+
export declare const OpenAIChatUsage: Schema.StructWithRest<Schema.Struct<{
|
|
387
|
+
readonly prompt_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
388
|
+
readonly completion_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
389
|
+
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
390
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
391
|
+
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
392
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
393
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
394
|
+
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
395
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
396
|
+
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
397
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
398
|
+
readonly completion_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
399
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
400
|
+
readonly accepted_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
401
|
+
readonly rejected_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
402
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
403
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
404
|
+
export declare const OpenAIChatToolCallDelta: Schema.Struct<{
|
|
405
|
+
readonly index: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
406
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
407
|
+
readonly function: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
408
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
409
|
+
readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
410
|
+
}>>>;
|
|
411
|
+
readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
412
|
+
}>;
|
|
413
|
+
export declare const OpenAIChatDelta: Schema.StructWithRest<Schema.Struct<{
|
|
414
|
+
readonly content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
415
|
+
readonly refusal: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
416
|
+
readonly reasoning_content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
417
|
+
readonly reasoning: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
418
|
+
readonly reasoning_text: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
419
|
+
readonly reasoning_details: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
420
|
+
readonly tool_calls: Schema.optional<Schema.NullOr<Schema.$Array<Schema.Struct<{
|
|
421
|
+
readonly index: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
422
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
423
|
+
readonly function: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
424
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
425
|
+
readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
426
|
+
}>>>;
|
|
427
|
+
readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
428
|
+
}>>>>;
|
|
429
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
430
|
+
export declare const OpenAIChatChoice: Schema.StructWithRest<Schema.Struct<{
|
|
431
|
+
readonly delta: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
432
|
+
readonly content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
433
|
+
readonly refusal: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
434
|
+
readonly reasoning_content: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
435
|
+
readonly reasoning: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
436
|
+
readonly reasoning_text: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
437
|
+
readonly reasoning_details: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
438
|
+
readonly tool_calls: Schema.optional<Schema.NullOr<Schema.$Array<Schema.Struct<{
|
|
439
|
+
readonly index: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
440
|
+
readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
441
|
+
readonly function: Schema.optional<Schema.NullOr<Schema.Struct<{
|
|
442
|
+
readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
443
|
+
readonly arguments: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
444
|
+
}>>>;
|
|
445
|
+
readonly extra_content: Schema.optional<Schema.NullOr<Schema.Unknown>>;
|
|
446
|
+
}>>>>;
|
|
447
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
448
|
+
readonly finish_reason: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
449
|
+
readonly native_finish_reason: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
450
|
+
readonly usage: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
451
|
+
readonly prompt_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
452
|
+
readonly completion_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
453
|
+
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
454
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
455
|
+
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
456
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
457
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
458
|
+
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
459
|
+
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
460
|
+
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
461
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
462
|
+
readonly completion_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
463
|
+
readonly reasoning_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
464
|
+
readonly accepted_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
465
|
+
readonly rejected_prediction_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
466
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
467
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>>;
|
|
468
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
291
469
|
export declare const OpenAIChatEvent: Schema.StructWithRest<Schema.Struct<{
|
|
292
470
|
readonly choices: Schema.optional<Schema.NullOr<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
293
471
|
readonly delta: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
@@ -315,6 +493,8 @@ export declare const OpenAIChatEvent: Schema.StructWithRest<Schema.Struct<{
|
|
|
315
493
|
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
316
494
|
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
317
495
|
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
496
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
497
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
318
498
|
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
319
499
|
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
320
500
|
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
@@ -332,6 +512,8 @@ export declare const OpenAIChatEvent: Schema.StructWithRest<Schema.Struct<{
|
|
|
332
512
|
readonly total_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
333
513
|
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
334
514
|
readonly prompt_cache_hit_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
515
|
+
readonly cache_read_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
516
|
+
readonly cache_created_input_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
335
517
|
readonly prompt_tokens_details: Schema.optional<Schema.NullOr<Schema.StructWithRest<Schema.Struct<{
|
|
336
518
|
readonly cached_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
337
519
|
readonly cache_write_tokens: Schema.optional<Schema.NullOr<Schema.Number>>;
|
|
@@ -375,6 +557,8 @@ export interface ParserState {
|
|
|
375
557
|
interface LoweringOptions {
|
|
376
558
|
readonly cacheControl?: (cache: CacheHint | undefined) => OpenAIChatCacheControl | undefined;
|
|
377
559
|
readonly toolCallID?: (id: string) => string;
|
|
560
|
+
/** Project provider-specific fields from the exact source, even when other messages are dropped during lowering. */
|
|
561
|
+
readonly assistant?: (source: LLMRequest["messages"][number], message: OpenAIChatMessage) => OpenAIChatMessage;
|
|
378
562
|
}
|
|
379
563
|
export declare const fromRequest: (request: LLMRequest<import("../schema/options.js").LanguageModel<{
|
|
380
564
|
readonly [x: string]: unknown;
|
|
@@ -619,6 +803,222 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
|
|
|
619
803
|
} | undefined;
|
|
620
804
|
stream: true;
|
|
621
805
|
}, AIError, never>;
|
|
806
|
+
export declare const finishEvents: (state: ParserState) => Effect.Effect<(({
|
|
807
|
+
readonly type: "compaction";
|
|
808
|
+
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
809
|
+
readonly id?: string | undefined;
|
|
810
|
+
readonly text?: string | null | undefined;
|
|
811
|
+
readonly encrypted?: string | undefined;
|
|
812
|
+
} & ({
|
|
813
|
+
readonly encrypted: string;
|
|
814
|
+
readonly text?: never;
|
|
815
|
+
} | {
|
|
816
|
+
readonly text: string | null;
|
|
817
|
+
readonly encrypted?: never;
|
|
818
|
+
})) | {
|
|
819
|
+
readonly type: "step-start";
|
|
820
|
+
readonly index: number;
|
|
821
|
+
} | {
|
|
822
|
+
readonly id: string;
|
|
823
|
+
readonly type: "text-start";
|
|
824
|
+
readonly providerMetadata?: {
|
|
825
|
+
readonly [x: string]: {
|
|
826
|
+
readonly [x: string]: unknown;
|
|
827
|
+
};
|
|
828
|
+
} | undefined;
|
|
829
|
+
} | {
|
|
830
|
+
readonly id: string;
|
|
831
|
+
readonly type: "text-delta";
|
|
832
|
+
readonly text: string;
|
|
833
|
+
readonly providerMetadata?: {
|
|
834
|
+
readonly [x: string]: {
|
|
835
|
+
readonly [x: string]: unknown;
|
|
836
|
+
};
|
|
837
|
+
} | undefined;
|
|
838
|
+
} | {
|
|
839
|
+
readonly id: string;
|
|
840
|
+
readonly type: "text-end";
|
|
841
|
+
readonly text?: string | undefined;
|
|
842
|
+
readonly providerMetadata?: {
|
|
843
|
+
readonly [x: string]: {
|
|
844
|
+
readonly [x: string]: unknown;
|
|
845
|
+
};
|
|
846
|
+
} | undefined;
|
|
847
|
+
} | {
|
|
848
|
+
readonly id: string;
|
|
849
|
+
readonly type: "reasoning-start";
|
|
850
|
+
readonly providerMetadata?: {
|
|
851
|
+
readonly [x: string]: {
|
|
852
|
+
readonly [x: string]: unknown;
|
|
853
|
+
};
|
|
854
|
+
} | undefined;
|
|
855
|
+
} | {
|
|
856
|
+
readonly id: string;
|
|
857
|
+
readonly type: "reasoning-delta";
|
|
858
|
+
readonly text: string;
|
|
859
|
+
readonly providerMetadata?: {
|
|
860
|
+
readonly [x: string]: {
|
|
861
|
+
readonly [x: string]: unknown;
|
|
862
|
+
};
|
|
863
|
+
} | undefined;
|
|
864
|
+
} | {
|
|
865
|
+
readonly id: string;
|
|
866
|
+
readonly type: "reasoning-end";
|
|
867
|
+
readonly text?: string | undefined;
|
|
868
|
+
readonly providerMetadata?: {
|
|
869
|
+
readonly [x: string]: {
|
|
870
|
+
readonly [x: string]: unknown;
|
|
871
|
+
};
|
|
872
|
+
} | undefined;
|
|
873
|
+
} | {
|
|
874
|
+
readonly id: string;
|
|
875
|
+
readonly type: "tool-input-start";
|
|
876
|
+
readonly name: string;
|
|
877
|
+
readonly providerMetadata?: {
|
|
878
|
+
readonly [x: string]: {
|
|
879
|
+
readonly [x: string]: unknown;
|
|
880
|
+
};
|
|
881
|
+
} | undefined;
|
|
882
|
+
readonly namespace?: string | undefined;
|
|
883
|
+
readonly providerExecuted?: boolean | undefined;
|
|
884
|
+
} | {
|
|
885
|
+
readonly id: string;
|
|
886
|
+
readonly type: "tool-input-delta";
|
|
887
|
+
readonly name: string;
|
|
888
|
+
readonly text: string;
|
|
889
|
+
readonly input?: unknown;
|
|
890
|
+
readonly namespace?: string | undefined;
|
|
891
|
+
} | {
|
|
892
|
+
readonly id: string;
|
|
893
|
+
readonly type: "tool-input-end";
|
|
894
|
+
readonly name: string;
|
|
895
|
+
readonly providerMetadata?: {
|
|
896
|
+
readonly [x: string]: {
|
|
897
|
+
readonly [x: string]: unknown;
|
|
898
|
+
};
|
|
899
|
+
} | undefined;
|
|
900
|
+
readonly namespace?: string | undefined;
|
|
901
|
+
} | {
|
|
902
|
+
readonly id: string;
|
|
903
|
+
readonly type: "tool-input-error";
|
|
904
|
+
readonly name: string;
|
|
905
|
+
readonly raw: string;
|
|
906
|
+
readonly namespace?: string | undefined;
|
|
907
|
+
} | {
|
|
908
|
+
readonly id: string;
|
|
909
|
+
readonly type: "tool-call";
|
|
910
|
+
readonly name: string;
|
|
911
|
+
readonly input: unknown;
|
|
912
|
+
readonly providerMetadata?: {
|
|
913
|
+
readonly [x: string]: {
|
|
914
|
+
readonly [x: string]: unknown;
|
|
915
|
+
};
|
|
916
|
+
} | undefined;
|
|
917
|
+
readonly namespace?: string | undefined;
|
|
918
|
+
readonly providerExecuted?: boolean | undefined;
|
|
919
|
+
} | {
|
|
920
|
+
readonly id: string;
|
|
921
|
+
readonly type: "tool-result";
|
|
922
|
+
readonly name: string;
|
|
923
|
+
readonly result: {
|
|
924
|
+
readonly type: "json";
|
|
925
|
+
readonly value: unknown;
|
|
926
|
+
} | {
|
|
927
|
+
readonly type: "text";
|
|
928
|
+
readonly value: unknown;
|
|
929
|
+
} | {
|
|
930
|
+
readonly type: "error";
|
|
931
|
+
readonly value: unknown;
|
|
932
|
+
} | {
|
|
933
|
+
readonly type: "content";
|
|
934
|
+
readonly value: readonly ({
|
|
935
|
+
readonly type: "text";
|
|
936
|
+
readonly text: string;
|
|
937
|
+
} | {
|
|
938
|
+
readonly type: "file";
|
|
939
|
+
readonly uri: string;
|
|
940
|
+
readonly mime: string;
|
|
941
|
+
readonly name?: string | undefined;
|
|
942
|
+
})[];
|
|
943
|
+
};
|
|
944
|
+
readonly output?: {
|
|
945
|
+
readonly structured: unknown;
|
|
946
|
+
readonly content: readonly ({
|
|
947
|
+
readonly type: "text";
|
|
948
|
+
readonly text: string;
|
|
949
|
+
} | {
|
|
950
|
+
readonly type: "file";
|
|
951
|
+
readonly uri: string;
|
|
952
|
+
readonly mime: string;
|
|
953
|
+
readonly name?: string | undefined;
|
|
954
|
+
})[];
|
|
955
|
+
} | undefined;
|
|
956
|
+
readonly providerMetadata?: {
|
|
957
|
+
readonly [x: string]: {
|
|
958
|
+
readonly [x: string]: unknown;
|
|
959
|
+
};
|
|
960
|
+
} | undefined;
|
|
961
|
+
readonly namespace?: string | undefined;
|
|
962
|
+
readonly providerExecuted?: boolean | undefined;
|
|
963
|
+
} | {
|
|
964
|
+
readonly id: string;
|
|
965
|
+
readonly type: "tool-error";
|
|
966
|
+
readonly message: string;
|
|
967
|
+
readonly name: string;
|
|
968
|
+
readonly error?: unknown;
|
|
969
|
+
readonly providerMetadata?: {
|
|
970
|
+
readonly [x: string]: {
|
|
971
|
+
readonly [x: string]: unknown;
|
|
972
|
+
};
|
|
973
|
+
} | undefined;
|
|
974
|
+
readonly namespace?: string | undefined;
|
|
975
|
+
} | {
|
|
976
|
+
readonly type: "media";
|
|
977
|
+
readonly media: import("../media.js").Asset;
|
|
978
|
+
readonly providerMetadata?: {
|
|
979
|
+
readonly [x: string]: {
|
|
980
|
+
readonly [x: string]: unknown;
|
|
981
|
+
};
|
|
982
|
+
} | undefined;
|
|
983
|
+
} | {
|
|
984
|
+
readonly type: "step-finish";
|
|
985
|
+
readonly reason: {
|
|
986
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
987
|
+
readonly raw?: string | undefined;
|
|
988
|
+
readonly category?: string | undefined;
|
|
989
|
+
readonly explanation?: string | undefined;
|
|
990
|
+
};
|
|
991
|
+
readonly index: number;
|
|
992
|
+
readonly providerMetadata?: {
|
|
993
|
+
readonly [x: string]: {
|
|
994
|
+
readonly [x: string]: unknown;
|
|
995
|
+
};
|
|
996
|
+
} | undefined;
|
|
997
|
+
readonly usage?: Usage | undefined;
|
|
998
|
+
} | {
|
|
999
|
+
readonly type: "finish";
|
|
1000
|
+
readonly reason: {
|
|
1001
|
+
readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1002
|
+
readonly raw?: string | undefined;
|
|
1003
|
+
readonly category?: string | undefined;
|
|
1004
|
+
readonly explanation?: string | undefined;
|
|
1005
|
+
};
|
|
1006
|
+
readonly providerMetadata?: {
|
|
1007
|
+
readonly [x: string]: {
|
|
1008
|
+
readonly [x: string]: unknown;
|
|
1009
|
+
};
|
|
1010
|
+
} | undefined;
|
|
1011
|
+
readonly usage?: Usage | undefined;
|
|
1012
|
+
} | {
|
|
1013
|
+
readonly type: "provider-error";
|
|
1014
|
+
readonly message: string;
|
|
1015
|
+
readonly classification?: "context-overflow" | "payload-too-large" | undefined;
|
|
1016
|
+
readonly providerMetadata?: {
|
|
1017
|
+
readonly [x: string]: {
|
|
1018
|
+
readonly [x: string]: unknown;
|
|
1019
|
+
};
|
|
1020
|
+
} | undefined;
|
|
1021
|
+
})[], AIError, never>;
|
|
622
1022
|
/**
|
|
623
1023
|
* The OpenAI Chat protocol — request body construction, body schema, and the
|
|
624
1024
|
* streaming-event state machine. Reused by every route that speaks OpenAI Chat
|
|
@@ -739,9 +1139,9 @@ export declare const protocol: Protocol<{
|
|
|
739
1139
|
readonly top_p?: number | undefined;
|
|
740
1140
|
readonly frequency_penalty?: number | undefined;
|
|
741
1141
|
readonly presence_penalty?: number | undefined;
|
|
1142
|
+
readonly store?: boolean | undefined;
|
|
742
1143
|
readonly prompt_cache_key?: string | undefined;
|
|
743
1144
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
744
|
-
readonly store?: boolean | undefined;
|
|
745
1145
|
readonly stream_options?: {
|
|
746
1146
|
readonly include_usage: boolean;
|
|
747
1147
|
} | undefined;
|
|
@@ -755,16 +1155,18 @@ export declare const protocol: Protocol<{
|
|
|
755
1155
|
} | null | undefined;
|
|
756
1156
|
readonly usage?: {
|
|
757
1157
|
readonly [x: string]: unknown;
|
|
1158
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
758
1159
|
readonly cached_tokens?: number | null | undefined;
|
|
1160
|
+
readonly total_tokens?: number | null | undefined;
|
|
759
1161
|
readonly prompt_tokens?: number | null | undefined;
|
|
760
1162
|
readonly completion_tokens?: number | null | undefined;
|
|
761
|
-
readonly total_tokens?: number | null | undefined;
|
|
762
1163
|
readonly prompt_tokens_details?: {
|
|
763
1164
|
readonly [x: string]: unknown;
|
|
764
1165
|
readonly cached_tokens?: number | null | undefined;
|
|
765
1166
|
readonly cache_write_tokens?: number | null | undefined;
|
|
766
1167
|
} | null | undefined;
|
|
767
1168
|
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
1169
|
+
readonly cache_created_input_tokens?: number | null | undefined;
|
|
768
1170
|
readonly completion_tokens_details?: {
|
|
769
1171
|
readonly [x: string]: unknown;
|
|
770
1172
|
readonly reasoning_tokens?: number | null | undefined;
|
|
@@ -794,16 +1196,18 @@ export declare const protocol: Protocol<{
|
|
|
794
1196
|
} | null | undefined;
|
|
795
1197
|
readonly usage?: {
|
|
796
1198
|
readonly [x: string]: unknown;
|
|
1199
|
+
readonly cache_read_input_tokens?: number | null | undefined;
|
|
797
1200
|
readonly cached_tokens?: number | null | undefined;
|
|
1201
|
+
readonly total_tokens?: number | null | undefined;
|
|
798
1202
|
readonly prompt_tokens?: number | null | undefined;
|
|
799
1203
|
readonly completion_tokens?: number | null | undefined;
|
|
800
|
-
readonly total_tokens?: number | null | undefined;
|
|
801
1204
|
readonly prompt_tokens_details?: {
|
|
802
1205
|
readonly [x: string]: unknown;
|
|
803
1206
|
readonly cached_tokens?: number | null | undefined;
|
|
804
1207
|
readonly cache_write_tokens?: number | null | undefined;
|
|
805
1208
|
} | null | undefined;
|
|
806
1209
|
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
1210
|
+
readonly cache_created_input_tokens?: number | null | undefined;
|
|
807
1211
|
readonly completion_tokens_details?: {
|
|
808
1212
|
readonly [x: string]: unknown;
|
|
809
1213
|
readonly reasoning_tokens?: number | null | undefined;
|
|
@@ -930,9 +1334,9 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
|
|
|
930
1334
|
readonly top_p?: number | undefined;
|
|
931
1335
|
readonly frequency_penalty?: number | undefined;
|
|
932
1336
|
readonly presence_penalty?: number | undefined;
|
|
1337
|
+
readonly store?: boolean | undefined;
|
|
933
1338
|
readonly prompt_cache_key?: string | undefined;
|
|
934
1339
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
935
|
-
readonly store?: boolean | undefined;
|
|
936
1340
|
readonly stream_options?: {
|
|
937
1341
|
readonly include_usage: boolean;
|
|
938
1342
|
} | undefined;
|
|
@@ -1052,9 +1456,9 @@ export declare const route: Route<{
|
|
|
1052
1456
|
readonly top_p?: number | undefined;
|
|
1053
1457
|
readonly frequency_penalty?: number | undefined;
|
|
1054
1458
|
readonly presence_penalty?: number | undefined;
|
|
1459
|
+
readonly store?: boolean | undefined;
|
|
1055
1460
|
readonly prompt_cache_key?: string | undefined;
|
|
1056
1461
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
1057
|
-
readonly store?: boolean | undefined;
|
|
1058
1462
|
readonly stream_options?: {
|
|
1059
1463
|
readonly include_usage: boolean;
|
|
1060
1464
|
} | undefined;
|