@opencode/ai 2.1.3 → 2.2.0
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 +283 -114
- package/dist/ai-client.d.ts +2 -2
- package/dist/ai-client.js +2 -1
- package/dist/cache-policy.d.ts +4 -0
- package/dist/cache-policy.js +20 -6
- package/dist/decision-client.d.ts +21 -0
- package/dist/decision-client.js +55 -0
- package/dist/decision.d.ts +472 -0
- package/dist/decision.js +158 -0
- package/dist/effect.d.ts +38 -0
- package/dist/effect.js +27 -0
- package/dist/effort-updates.d.ts +2 -2
- package/dist/experimental/cloudflare-run-extraction.d.ts +13 -0
- package/dist/experimental/cloudflare-run-extraction.js +83 -0
- package/dist/experimental/extraction.d.ts +183 -0
- package/dist/experimental/extraction.js +102 -0
- package/dist/experimental/realtime.d.ts +7 -2
- package/dist/experimental/realtime.js +5 -5
- package/dist/experimental.d.ts +2 -3
- package/dist/experimental.js +1 -2
- package/dist/image-client.d.ts +13 -22
- package/dist/image-client.js +0 -1
- package/dist/image.d.ts +154 -324
- package/dist/image.js +4 -11
- package/dist/index.d.ts +1426 -34
- package/dist/index.js +127 -24
- package/dist/llm.d.ts +16 -1
- package/dist/llm.js +34 -0
- package/dist/media-client.d.ts +2 -1
- package/dist/media-model.d.ts +3 -0
- package/dist/media-model.js +4 -1
- package/dist/media.d.ts +0 -7
- package/dist/media.js +0 -6
- package/dist/protocols/alibaba-chat.d.ts +32 -12
- package/dist/protocols/alibaba-images.d.ts +22 -0
- package/dist/protocols/alibaba-images.js +77 -0
- package/dist/protocols/alibaba-messages.d.ts +62 -27
- package/dist/protocols/alibaba-responses.d.ts +41 -38
- package/dist/protocols/anthropic-messages.d.ts +196 -94
- package/dist/protocols/anthropic-messages.js +47 -16
- package/dist/protocols/bedrock-converse.d.ts +140 -47
- package/dist/protocols/bedrock-converse.js +114 -18
- package/dist/protocols/bedrock-event-stream.js +1 -0
- package/dist/protocols/bfl-images.d.ts +9 -0
- package/dist/protocols/bfl-images.js +17 -15
- package/dist/protocols/cartesia-speech.d.ts +32 -50
- package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
- package/dist/protocols/cloudflare-run-decisions.js +36 -0
- package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
- package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
- package/dist/protocols/cohere-chat.d.ts +7 -8
- package/dist/protocols/deepgram-speech.d.ts +32 -50
- package/dist/protocols/elevenlabs-speech.d.ts +32 -50
- package/dist/protocols/fal-images.d.ts +10 -1
- package/dist/protocols/fal-images.js +16 -25
- package/dist/protocols/fal-video.js +1 -1
- package/dist/protocols/gemini.d.ts +37 -34
- package/dist/protocols/gemini.js +13 -8
- package/dist/protocols/google-images.d.ts +2 -2
- package/dist/protocols/google-images.js +8 -37
- package/dist/protocols/google-interactions.d.ts +18 -14
- package/dist/protocols/google-interactions.js +14 -7
- package/dist/protocols/google-speech.d.ts +32 -50
- package/dist/protocols/google-speech.js +0 -1
- package/dist/protocols/google-transcription.d.ts +32 -50
- package/dist/protocols/google-transcription.js +0 -1
- package/dist/protocols/google-video.d.ts +1 -1
- package/dist/protocols/google-video.js +2 -7
- package/dist/protocols/index.d.ts +3 -0
- package/dist/protocols/index.js +3 -0
- package/dist/protocols/meta-images.d.ts +7 -1
- package/dist/protocols/meta-images.js +10 -8
- package/dist/protocols/meta-messages.d.ts +73 -38
- package/dist/protocols/meta-messages.js +14 -1
- package/dist/protocols/meta-responses.d.ts +84 -78
- package/dist/protocols/meta-responses.js +29 -1
- package/dist/protocols/mistral-chat.d.ts +81 -78
- 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/open-responses.d.ts +426 -396
- package/dist/protocols/open-responses.js +16 -25
- package/dist/protocols/openai-chat.d.ts +764 -52
- package/dist/protocols/openai-chat.js +38 -25
- package/dist/protocols/openai-compatible-chat.d.ts +35 -15
- package/dist/protocols/openai-compatible-responses.d.ts +44 -42
- package/dist/protocols/openai-decisions.d.ts +22 -0
- package/dist/protocols/openai-decisions.js +128 -0
- package/dist/protocols/openai-images.d.ts +53 -56
- package/dist/protocols/openai-images.js +100 -34
- package/dist/protocols/openai-responses.d.ts +322 -264
- package/dist/protocols/openai-responses.js +33 -3
- package/dist/protocols/openai-speech.d.ts +32 -50
- package/dist/protocols/openai-speech.js +15 -5
- package/dist/protocols/openai-transcription.d.ts +32 -50
- package/dist/protocols/openai-transcription.js +15 -11
- package/dist/protocols/replicate-images.js +1 -1
- package/dist/protocols/runway-video.d.ts +1 -1
- package/dist/protocols/runway-video.js +1 -1
- package/dist/protocols/shared.d.ts +9 -1
- package/dist/protocols/shared.js +13 -2
- package/dist/protocols/stability-images.d.ts +5 -0
- package/dist/protocols/stability-images.js +4 -9
- package/dist/protocols/system-one.d.ts +101 -0
- package/dist/protocols/system-one.js +230 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
- package/dist/protocols/utils/bedrock-cache.js +7 -6
- package/dist/protocols/utils/cache.d.ts +14 -3
- package/dist/protocols/utils/cache.js +11 -4
- package/dist/protocols/utils/gemini-generate-content.d.ts +3 -3
- package/dist/protocols/utils/gemini-generate-content.js +10 -16
- package/dist/protocols/utils/gemini-json-schema.d.ts +5 -0
- package/dist/protocols/utils/gemini-json-schema.js +3 -3
- package/dist/protocols/utils/image-sizing.d.ts +31 -0
- package/dist/protocols/utils/image-sizing.js +73 -0
- package/dist/protocols/utils/media-input.d.ts +4 -5
- package/dist/protocols/utils/media-input.js +8 -5
- package/dist/protocols/utils/partial-json-options.d.ts +0 -1
- package/dist/protocols/utils/partial-json-options.js +0 -1
- package/dist/protocols/utils/speech-stream.d.ts +0 -1
- package/dist/protocols/utils/speech-stream.js +0 -1
- package/dist/protocols/utils/tool-schema.js +15 -5
- package/dist/protocols/utils/tool-stream.d.ts +10 -1
- package/dist/protocols/venice-chat.d.ts +71 -53
- package/dist/protocols/venice-chat.js +7 -6
- package/dist/protocols/xai-images.d.ts +1 -2
- package/dist/protocols/xai-images.js +9 -2
- package/dist/protocols/xai-responses.d.ts +88 -78
- package/dist/protocols/xai-responses.js +28 -2
- package/dist/protocols/xai-video.d.ts +1 -1
- package/dist/protocols/xai-video.js +11 -8
- package/dist/protocols/zai-chat.d.ts +54 -30
- package/dist/protocols/zai-chat.js +8 -3
- package/dist/protocols/zai-images.d.ts +3 -1
- package/dist/protocols/zai-images.js +12 -11
- package/dist/protocols/zai-messages.d.ts +72 -35
- package/dist/protocols/zai-messages.js +3 -2
- package/dist/provider-error.js +24 -7
- package/dist/providers/alibaba/images.d.ts +2 -0
- package/dist/providers/alibaba/images.js +1 -0
- package/dist/providers/alibaba.d.ts +146 -85
- package/dist/providers/alibaba.js +16 -8
- package/dist/providers/amazon-bedrock-mantle.d.ts +277 -218
- package/dist/providers/amazon-bedrock.d.ts +48 -28
- package/dist/providers/amazon-bedrock.js +11 -11
- package/dist/providers/anthropic-compatible.d.ts +64 -29
- package/dist/providers/anthropic.d.ts +64 -29
- package/dist/providers/azure/images.d.ts +2 -0
- package/dist/providers/azure/images.js +1 -0
- package/dist/providers/azure.d.ts +156 -115
- package/dist/providers/azure.js +19 -1
- package/dist/providers/baseten/decisions.d.ts +2 -0
- package/dist/providers/baseten/decisions.js +1 -0
- package/dist/providers/baseten.d.ts +75 -25
- package/dist/providers/baseten.js +41 -8
- package/dist/providers/cerebras.d.ts +66 -24
- package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +409 -272
- package/dist/providers/cloudflare-ai-gateway.js +33 -6
- package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
- package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/images.js +1 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +79 -25
- package/dist/providers/cloudflare-workers-ai.js +45 -9
- package/dist/providers/cohere.d.ts +117 -75
- package/dist/providers/deepinfra.d.ts +66 -24
- package/dist/providers/deepseek.d.ts +66 -24
- package/dist/providers/digitalocean/decisions.d.ts +2 -0
- package/dist/providers/digitalocean/decisions.js +1 -0
- package/dist/providers/digitalocean/images.d.ts +2 -0
- package/dist/providers/digitalocean/images.js +1 -0
- package/dist/providers/digitalocean.d.ts +108 -37
- package/dist/providers/digitalocean.js +39 -8
- package/dist/providers/fireworks.d.ts +66 -24
- package/dist/providers/google/images.d.ts +2 -0
- package/dist/providers/google/images.js +1 -0
- package/dist/providers/google-vertex/images.d.ts +2 -0
- package/dist/providers/google-vertex/images.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +33 -12
- package/dist/providers/google-vertex-messages.d.ts +64 -29
- package/dist/providers/google-vertex-mistral.d.ts +17 -17
- package/dist/providers/google-vertex-responses.d.ts +38 -35
- package/dist/providers/google-vertex.d.ts +20 -18
- package/dist/providers/google-vertex.js +32 -15
- package/dist/providers/google.d.ts +22 -21
- package/dist/providers/google.js +15 -8
- package/dist/providers/groq.d.ts +66 -28
- package/dist/providers/groq.js +0 -6
- package/dist/providers/meta.d.ts +144 -85
- package/dist/providers/minimax.d.ts +145 -86
- package/dist/providers/mistral.d.ts +28 -28
- package/dist/providers/moonshot.d.ts +277 -218
- package/dist/providers/open-responses-options.d.ts +0 -1
- package/dist/providers/open-responses-options.js +1 -1
- package/dist/providers/openai/images.d.ts +2 -0
- package/dist/providers/openai/images.js +1 -0
- package/dist/providers/openai-compatible/images.d.ts +2 -0
- package/dist/providers/openai-compatible/images.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +38 -35
- package/dist/providers/openai-compatible.d.ts +36 -13
- package/dist/providers/openai-compatible.js +22 -10
- package/dist/providers/openai-options.d.ts +3 -2
- package/dist/providers/openai-options.js +0 -1
- package/dist/providers/openai.d.ts +146 -109
- package/dist/providers/openai.js +20 -4
- package/dist/providers/opencode/decisions.d.ts +2 -0
- package/dist/providers/opencode/decisions.js +1 -0
- package/dist/providers/opencode.d.ts +9 -10
- package/dist/providers/opencode.js +10 -8
- package/dist/providers/openrouter/decisions.d.ts +2 -0
- package/dist/providers/openrouter/decisions.js +1 -0
- package/dist/providers/openrouter/images.d.ts +2 -0
- package/dist/providers/openrouter/images.js +1 -0
- package/dist/providers/openrouter.d.ts +128 -47
- package/dist/providers/openrouter.js +38 -16
- package/dist/providers/togetherai.d.ts +66 -24
- package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
- package/dist/providers/typesafe-ai/decisions.js +1 -0
- package/dist/providers/typesafe-ai.d.ts +9 -10
- package/dist/providers/typesafe-ai.js +10 -8
- package/dist/providers/venice.d.ts +214 -20
- package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
- package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/images.js +1 -0
- package/dist/providers/vercel-ai-gateway.d.ts +10 -16
- package/dist/providers/vercel-ai-gateway.js +31 -85
- package/dist/providers/xai/images.d.ts +2 -0
- package/dist/providers/xai/images.js +1 -0
- package/dist/providers/xai.d.ts +40 -17
- package/dist/providers/xai.js +15 -8
- package/dist/providers/zai/images.d.ts +2 -0
- package/dist/providers/zai/images.js +1 -0
- package/dist/providers/zai-coding-plan.d.ts +224 -85
- package/dist/providers/zai.d.ts +110 -23
- package/dist/providers/zai.js +15 -8
- package/dist/route/auth-options.d.ts +0 -3
- package/dist/route/auth.d.ts +0 -2
- package/dist/route/auth.js +0 -2
- package/dist/route/client.d.ts +2 -4
- package/dist/route/client.js +29 -8
- package/dist/route/decision.d.ts +58 -0
- package/dist/route/decision.js +75 -0
- package/dist/route/executor-service.js +1 -1
- package/dist/route/executor.d.ts +1 -1
- package/dist/route/framing.d.ts +2 -0
- package/dist/route/index.d.ts +3 -0
- package/dist/route/index.js +3 -0
- package/dist/route/media-protocol.d.ts +1 -0
- package/dist/route/media-protocol.js +12 -8
- package/dist/route/media.d.ts +5 -1
- package/dist/route/media.js +6 -2
- package/dist/route/transport/http.js +1 -0
- package/dist/route/transport/index.d.ts +1 -0
- package/dist/schema/events.d.ts +148 -6
- package/dist/schema/events.js +20 -0
- package/dist/schema/messages.d.ts +6 -2
- package/dist/schema/messages.js +3 -0
- package/dist/schema/options.d.ts +5 -3
- package/dist/schema/options.js +8 -3
- package/dist/speech-client.d.ts +13 -22
- package/dist/speech-client.js +0 -1
- package/dist/speech.d.ts +148 -283
- package/dist/speech.js +2 -4
- package/dist/testing.d.ts +25 -24
- package/dist/testing.js +3 -21
- package/dist/transcription-client.d.ts +13 -22
- package/dist/transcription.d.ts +148 -283
- package/dist/transcription.js +1 -1
- package/dist/utils/media-type.js +22 -1
- package/dist/video-client.d.ts +13 -22
- package/dist/video-client.js +0 -1
- package/dist/video.d.ts +115 -250
- package/dist/video.js +3 -5
- package/package.json +516 -13
- package/dist/experimental/evaluation-client.d.ts +0 -21
- package/dist/experimental/evaluation-client.js +0 -64
- package/dist/experimental/evaluation.d.ts +0 -242
- package/dist/experimental/evaluation.js +0 -115
- package/dist/experimental/system-one.d.ts +0 -16
- package/dist/experimental/system-one.js +0 -135
- package/dist/promise.d.ts +0 -1021
- package/dist/promise.js +0 -101
- package/dist/provider.d.ts +0 -23
- package/dist/provider.js +0 -2
package/dist/image.d.ts
CHANGED
|
@@ -19,11 +19,10 @@ export declare const ImageModelSchema: Schema.declare<ImageModel<{
|
|
|
19
19
|
}>, ImageModel<{
|
|
20
20
|
readonly [x: string]: unknown;
|
|
21
21
|
}>>;
|
|
22
|
-
export type ImageSize = `${number}x${number}`;
|
|
23
|
-
export declare const ImageSize: Schema.declare<`${number}x${number}`, `${number}x${number}`>;
|
|
24
22
|
export type ImageAspectRatio = Media.AspectRatio;
|
|
25
23
|
export declare const ImageAspectRatio: Schema.declare<`${number}:${number}`, `${number}:${number}`>;
|
|
26
|
-
|
|
24
|
+
/** Size tier: `1K` is about as many pixels as 1024×1024 at the requested aspect, `2K` as 2048×2048. */
|
|
25
|
+
export type ImageResolution = OpenString<"1K" | "2K" | "4K">;
|
|
27
26
|
declare const ImageRequest_base: Schema.Class<ImageRequest, Schema.Struct<{
|
|
28
27
|
readonly model: Schema.declare<ImageModel<{
|
|
29
28
|
readonly [x: string]: unknown;
|
|
@@ -63,43 +62,9 @@ declare const ImageRequest_base: Schema.Class<ImageRequest, Schema.Struct<{
|
|
|
63
62
|
}>>;
|
|
64
63
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
65
64
|
}>, never, never>>>;
|
|
66
|
-
/** Inpainting mask; routes that cannot honor it fail with `UnsupportedOperation`. */
|
|
67
|
-
readonly mask: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
68
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
69
|
-
readonly type: Schema.Literal<"bytes">;
|
|
70
|
-
readonly data: Schema.Uint8Array;
|
|
71
|
-
readonly mediaType: Schema.String;
|
|
72
|
-
}>, Schema.Struct<{
|
|
73
|
-
readonly type: Schema.Literal<"base64">;
|
|
74
|
-
readonly data: Schema.String;
|
|
75
|
-
readonly mediaType: Schema.String;
|
|
76
|
-
}>, Schema.Struct<{
|
|
77
|
-
readonly type: Schema.Literal<"url">;
|
|
78
|
-
readonly url: Schema.String;
|
|
79
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
80
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
81
|
-
}>, Schema.Struct<{
|
|
82
|
-
readonly type: Schema.Literal<"ref">;
|
|
83
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
84
|
-
readonly id: Schema.String;
|
|
85
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
86
|
-
}>]>;
|
|
87
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
88
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
89
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
90
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
91
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
92
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
93
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
94
|
-
readonly format: Schema.optional<Schema.String>;
|
|
95
|
-
}>>;
|
|
96
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
97
|
-
}>, never, never>>;
|
|
98
65
|
readonly n: Schema.optional<Schema.Int>;
|
|
99
|
-
readonly
|
|
100
|
-
readonly
|
|
101
|
-
readonly seed: Schema.optional<Schema.Number>;
|
|
102
|
-
readonly format: Schema.optional<Schema.String>;
|
|
66
|
+
readonly aspect: Schema.optional<Schema.declare<`${number}:${number}`, `${number}:${number}`>>;
|
|
67
|
+
readonly resolution: Schema.optional<Schema.String>;
|
|
103
68
|
readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
104
69
|
readonly http: Schema.optional<typeof HttpOptions>;
|
|
105
70
|
}>, {}>;
|
|
@@ -111,9 +76,9 @@ export type ImageRequestFor<Options extends ImageOptions = ImageOptions> = Omit<
|
|
|
111
76
|
readonly providerOptions?: Options;
|
|
112
77
|
};
|
|
113
78
|
export type ImageModelOptions<Model> = Model extends ImageModel<infer Options> ? Options : never;
|
|
114
|
-
export type ImageRequestInput<Model extends ImageModel = ImageModel> = Omit<ConstructorParameters<typeof ImageRequest>[0], "model" | "providerOptions" | "http"> & {
|
|
79
|
+
export type ImageRequestInput<Model extends ImageModel = ImageModel> = Omit<ConstructorParameters<typeof ImageRequest>[0], "model" | "providerOptions" | "http" | "resolution"> & {
|
|
115
80
|
readonly model: Model;
|
|
116
|
-
readonly
|
|
81
|
+
readonly resolution?: ImageResolution;
|
|
117
82
|
readonly providerOptions?: NoInfer<ImageModelOptions<Model>>;
|
|
118
83
|
readonly http?: HttpOptions.Input;
|
|
119
84
|
};
|
|
@@ -168,11 +133,6 @@ declare const ImageResponse_base: Schema.Class<ImageResponse, Schema.Struct<{
|
|
|
168
133
|
readonly type: Schema.Literal<"compute">;
|
|
169
134
|
readonly seconds: Schema.Number;
|
|
170
135
|
}>]>>;
|
|
171
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
172
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
173
|
-
readonly message: Schema.String;
|
|
174
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
175
|
-
}>>>;
|
|
176
136
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
177
137
|
}>, {}>;
|
|
178
138
|
export declare class ImageResponse extends ImageResponse_base {
|
|
@@ -270,11 +230,6 @@ export declare const ImageFinishEvent: Schema.Struct<{
|
|
|
270
230
|
readonly type: Schema.Literal<"compute">;
|
|
271
231
|
readonly seconds: Schema.Number;
|
|
272
232
|
}>]>>;
|
|
273
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
274
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
275
|
-
readonly message: Schema.String;
|
|
276
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
277
|
-
}>>>;
|
|
278
233
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
279
234
|
}>;
|
|
280
235
|
declare const imageEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
@@ -374,11 +329,6 @@ declare const imageEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.St
|
|
|
374
329
|
readonly type: Schema.Literal<"compute">;
|
|
375
330
|
readonly seconds: Schema.Number;
|
|
376
331
|
}>]>>;
|
|
377
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
378
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
379
|
-
readonly message: Schema.String;
|
|
380
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
381
|
-
}>>>;
|
|
382
332
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
383
333
|
}>]>;
|
|
384
334
|
export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
@@ -478,11 +428,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
478
428
|
readonly type: Schema.Literal<"compute">;
|
|
479
429
|
readonly seconds: Schema.Number;
|
|
480
430
|
}>]>>;
|
|
481
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
482
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
483
|
-
readonly message: Schema.String;
|
|
484
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
485
|
-
}>>>;
|
|
486
431
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
487
432
|
}>]> & {
|
|
488
433
|
readonly discriminants: readonly ["generation-queued", "generation-progress", "image-partial", "image", "finish"];
|
|
@@ -508,11 +453,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
508
453
|
readonly type: Schema.Literal<"compute">;
|
|
509
454
|
readonly seconds: Schema.Number;
|
|
510
455
|
}>]>>;
|
|
511
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
512
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
513
|
-
readonly message: Schema.String;
|
|
514
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
515
|
-
}>>>;
|
|
516
456
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
517
457
|
}>;
|
|
518
458
|
"generation-progress": Schema.Struct<{
|
|
@@ -597,14 +537,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
597
537
|
}>;
|
|
598
538
|
};
|
|
599
539
|
readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
|
|
600
|
-
readonly type: "generation-queued";
|
|
601
|
-
readonly id: string;
|
|
602
|
-
readonly position?: number | undefined;
|
|
603
|
-
} | {
|
|
604
|
-
readonly type: "generation-progress";
|
|
605
|
-
readonly id: string;
|
|
606
|
-
readonly progress?: number | undefined;
|
|
607
|
-
} | {
|
|
608
540
|
readonly type: "image-partial";
|
|
609
541
|
readonly index: number;
|
|
610
542
|
readonly image: Media.Asset;
|
|
@@ -612,17 +544,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
612
544
|
readonly type: "image";
|
|
613
545
|
readonly index: number;
|
|
614
546
|
readonly image: Media.Asset;
|
|
547
|
+
} | {
|
|
548
|
+
readonly type: "generation-queued";
|
|
549
|
+
readonly id: string;
|
|
550
|
+
readonly position?: number | undefined;
|
|
551
|
+
} | {
|
|
552
|
+
readonly type: "generation-progress";
|
|
553
|
+
readonly id: string;
|
|
554
|
+
readonly progress?: number | undefined;
|
|
615
555
|
} | {
|
|
616
556
|
readonly type: "finish";
|
|
617
557
|
readonly usage?: {
|
|
618
|
-
readonly type: "tokens";
|
|
619
|
-
readonly input?: number | undefined;
|
|
620
|
-
readonly output?: number | undefined;
|
|
621
|
-
readonly total?: number | undefined;
|
|
622
|
-
readonly details?: {
|
|
623
|
-
readonly [x: string]: unknown;
|
|
624
|
-
} | undefined;
|
|
625
|
-
} | {
|
|
626
558
|
readonly type: "seconds";
|
|
627
559
|
readonly seconds: number;
|
|
628
560
|
} | {
|
|
@@ -634,34 +566,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
634
566
|
} | {
|
|
635
567
|
readonly type: "compute";
|
|
636
568
|
readonly seconds: number;
|
|
637
|
-
} |
|
|
638
|
-
|
|
639
|
-
readonly
|
|
640
|
-
readonly
|
|
641
|
-
readonly
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
};
|
|
569
|
+
} | {
|
|
570
|
+
readonly type: "tokens";
|
|
571
|
+
readonly input?: number | undefined;
|
|
572
|
+
readonly output?: number | undefined;
|
|
573
|
+
readonly total?: number | undefined;
|
|
574
|
+
readonly details?: {
|
|
575
|
+
readonly [x: string]: unknown;
|
|
645
576
|
} | undefined;
|
|
646
|
-
}
|
|
577
|
+
} | undefined;
|
|
647
578
|
readonly providerMetadata?: {
|
|
648
579
|
readonly [x: string]: {
|
|
649
580
|
readonly [x: string]: unknown;
|
|
650
581
|
};
|
|
651
582
|
} | undefined;
|
|
652
583
|
}) => value is Extract<{
|
|
653
|
-
readonly type: "generation-queued";
|
|
654
|
-
readonly id: string;
|
|
655
|
-
readonly position?: number | undefined;
|
|
656
|
-
}, {
|
|
657
|
-
readonly type: Keys;
|
|
658
|
-
}> | Extract<{
|
|
659
|
-
readonly type: "generation-progress";
|
|
660
|
-
readonly id: string;
|
|
661
|
-
readonly progress?: number | undefined;
|
|
662
|
-
}, {
|
|
663
|
-
readonly type: Keys;
|
|
664
|
-
}> | Extract<{
|
|
665
584
|
readonly type: "image-partial";
|
|
666
585
|
readonly index: number;
|
|
667
586
|
readonly image: Media.Asset;
|
|
@@ -673,17 +592,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
673
592
|
readonly image: Media.Asset;
|
|
674
593
|
}, {
|
|
675
594
|
readonly type: Keys;
|
|
595
|
+
}> | Extract<{
|
|
596
|
+
readonly type: "generation-queued";
|
|
597
|
+
readonly id: string;
|
|
598
|
+
readonly position?: number | undefined;
|
|
599
|
+
}, {
|
|
600
|
+
readonly type: Keys;
|
|
601
|
+
}> | Extract<{
|
|
602
|
+
readonly type: "generation-progress";
|
|
603
|
+
readonly id: string;
|
|
604
|
+
readonly progress?: number | undefined;
|
|
605
|
+
}, {
|
|
606
|
+
readonly type: Keys;
|
|
676
607
|
}> | Extract<{
|
|
677
608
|
readonly type: "finish";
|
|
678
609
|
readonly usage?: {
|
|
679
|
-
readonly type: "tokens";
|
|
680
|
-
readonly input?: number | undefined;
|
|
681
|
-
readonly output?: number | undefined;
|
|
682
|
-
readonly total?: number | undefined;
|
|
683
|
-
readonly details?: {
|
|
684
|
-
readonly [x: string]: unknown;
|
|
685
|
-
} | undefined;
|
|
686
|
-
} | {
|
|
687
610
|
readonly type: "seconds";
|
|
688
611
|
readonly seconds: number;
|
|
689
612
|
} | {
|
|
@@ -695,16 +618,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
695
618
|
} | {
|
|
696
619
|
readonly type: "compute";
|
|
697
620
|
readonly seconds: number;
|
|
698
|
-
} |
|
|
699
|
-
|
|
700
|
-
readonly
|
|
701
|
-
readonly
|
|
702
|
-
readonly
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
};
|
|
621
|
+
} | {
|
|
622
|
+
readonly type: "tokens";
|
|
623
|
+
readonly input?: number | undefined;
|
|
624
|
+
readonly output?: number | undefined;
|
|
625
|
+
readonly total?: number | undefined;
|
|
626
|
+
readonly details?: {
|
|
627
|
+
readonly [x: string]: unknown;
|
|
706
628
|
} | undefined;
|
|
707
|
-
}
|
|
629
|
+
} | undefined;
|
|
708
630
|
readonly providerMetadata?: {
|
|
709
631
|
readonly [x: string]: {
|
|
710
632
|
readonly [x: string]: unknown;
|
|
@@ -717,14 +639,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
717
639
|
finish: (u: unknown) => u is {
|
|
718
640
|
readonly type: "finish";
|
|
719
641
|
readonly usage?: {
|
|
720
|
-
readonly type: "tokens";
|
|
721
|
-
readonly input?: number | undefined;
|
|
722
|
-
readonly output?: number | undefined;
|
|
723
|
-
readonly total?: number | undefined;
|
|
724
|
-
readonly details?: {
|
|
725
|
-
readonly [x: string]: unknown;
|
|
726
|
-
} | undefined;
|
|
727
|
-
} | {
|
|
728
642
|
readonly type: "seconds";
|
|
729
643
|
readonly seconds: number;
|
|
730
644
|
} | {
|
|
@@ -736,16 +650,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
736
650
|
} | {
|
|
737
651
|
readonly type: "compute";
|
|
738
652
|
readonly seconds: number;
|
|
739
|
-
} |
|
|
740
|
-
|
|
741
|
-
readonly
|
|
742
|
-
readonly
|
|
743
|
-
readonly
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
};
|
|
653
|
+
} | {
|
|
654
|
+
readonly type: "tokens";
|
|
655
|
+
readonly input?: number | undefined;
|
|
656
|
+
readonly output?: number | undefined;
|
|
657
|
+
readonly total?: number | undefined;
|
|
658
|
+
readonly details?: {
|
|
659
|
+
readonly [x: string]: unknown;
|
|
747
660
|
} | undefined;
|
|
748
|
-
}
|
|
661
|
+
} | undefined;
|
|
749
662
|
readonly providerMetadata?: {
|
|
750
663
|
readonly [x: string]: {
|
|
751
664
|
readonly [x: string]: unknown;
|
|
@@ -871,21 +784,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
871
784
|
readonly type: Schema.Literal<"compute">;
|
|
872
785
|
readonly seconds: Schema.Number;
|
|
873
786
|
}>]>>;
|
|
874
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
875
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
876
|
-
readonly message: Schema.String;
|
|
877
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
878
|
-
}>>>;
|
|
879
787
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
880
788
|
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(value: {
|
|
881
|
-
readonly type: "generation-queued";
|
|
882
|
-
readonly id: string;
|
|
883
|
-
readonly position?: number | undefined;
|
|
884
|
-
} | {
|
|
885
|
-
readonly type: "generation-progress";
|
|
886
|
-
readonly id: string;
|
|
887
|
-
readonly progress?: number | undefined;
|
|
888
|
-
} | {
|
|
889
789
|
readonly type: "image-partial";
|
|
890
790
|
readonly index: number;
|
|
891
791
|
readonly image: Media.Asset;
|
|
@@ -893,17 +793,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
893
793
|
readonly type: "image";
|
|
894
794
|
readonly index: number;
|
|
895
795
|
readonly image: Media.Asset;
|
|
796
|
+
} | {
|
|
797
|
+
readonly type: "generation-queued";
|
|
798
|
+
readonly id: string;
|
|
799
|
+
readonly position?: number | undefined;
|
|
800
|
+
} | {
|
|
801
|
+
readonly type: "generation-progress";
|
|
802
|
+
readonly id: string;
|
|
803
|
+
readonly progress?: number | undefined;
|
|
896
804
|
} | {
|
|
897
805
|
readonly type: "finish";
|
|
898
806
|
readonly usage?: {
|
|
899
|
-
readonly type: "tokens";
|
|
900
|
-
readonly input?: number | undefined;
|
|
901
|
-
readonly output?: number | undefined;
|
|
902
|
-
readonly total?: number | undefined;
|
|
903
|
-
readonly details?: {
|
|
904
|
-
readonly [x: string]: unknown;
|
|
905
|
-
} | undefined;
|
|
906
|
-
} | {
|
|
907
807
|
readonly type: "seconds";
|
|
908
808
|
readonly seconds: number;
|
|
909
809
|
} | {
|
|
@@ -915,16 +815,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
915
815
|
} | {
|
|
916
816
|
readonly type: "compute";
|
|
917
817
|
readonly seconds: number;
|
|
918
|
-
} |
|
|
919
|
-
|
|
920
|
-
readonly
|
|
921
|
-
readonly
|
|
922
|
-
readonly
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
};
|
|
818
|
+
} | {
|
|
819
|
+
readonly type: "tokens";
|
|
820
|
+
readonly input?: number | undefined;
|
|
821
|
+
readonly output?: number | undefined;
|
|
822
|
+
readonly total?: number | undefined;
|
|
823
|
+
readonly details?: {
|
|
824
|
+
readonly [x: string]: unknown;
|
|
926
825
|
} | undefined;
|
|
927
|
-
}
|
|
826
|
+
} | undefined;
|
|
928
827
|
readonly providerMetadata?: {
|
|
929
828
|
readonly [x: string]: {
|
|
930
829
|
readonly [x: string]: unknown;
|
|
@@ -1028,21 +927,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1028
927
|
readonly type: Schema.Literal<"compute">;
|
|
1029
928
|
readonly seconds: Schema.Number;
|
|
1030
929
|
}>]>>;
|
|
1031
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1032
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
1033
|
-
readonly message: Schema.String;
|
|
1034
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1035
|
-
}>>>;
|
|
1036
930
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1037
931
|
}> as M["Type"]["type"]]: (value: M["Type"]) => any; }>(cases: Cases): (value: {
|
|
1038
|
-
readonly type: "generation-queued";
|
|
1039
|
-
readonly id: string;
|
|
1040
|
-
readonly position?: number | undefined;
|
|
1041
|
-
} | {
|
|
1042
|
-
readonly type: "generation-progress";
|
|
1043
|
-
readonly id: string;
|
|
1044
|
-
readonly progress?: number | undefined;
|
|
1045
|
-
} | {
|
|
1046
932
|
readonly type: "image-partial";
|
|
1047
933
|
readonly index: number;
|
|
1048
934
|
readonly image: Media.Asset;
|
|
@@ -1050,17 +936,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1050
936
|
readonly type: "image";
|
|
1051
937
|
readonly index: number;
|
|
1052
938
|
readonly image: Media.Asset;
|
|
939
|
+
} | {
|
|
940
|
+
readonly type: "generation-queued";
|
|
941
|
+
readonly id: string;
|
|
942
|
+
readonly position?: number | undefined;
|
|
943
|
+
} | {
|
|
944
|
+
readonly type: "generation-progress";
|
|
945
|
+
readonly id: string;
|
|
946
|
+
readonly progress?: number | undefined;
|
|
1053
947
|
} | {
|
|
1054
948
|
readonly type: "finish";
|
|
1055
949
|
readonly usage?: {
|
|
1056
|
-
readonly type: "tokens";
|
|
1057
|
-
readonly input?: number | undefined;
|
|
1058
|
-
readonly output?: number | undefined;
|
|
1059
|
-
readonly total?: number | undefined;
|
|
1060
|
-
readonly details?: {
|
|
1061
|
-
readonly [x: string]: unknown;
|
|
1062
|
-
} | undefined;
|
|
1063
|
-
} | {
|
|
1064
950
|
readonly type: "seconds";
|
|
1065
951
|
readonly seconds: number;
|
|
1066
952
|
} | {
|
|
@@ -1072,16 +958,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1072
958
|
} | {
|
|
1073
959
|
readonly type: "compute";
|
|
1074
960
|
readonly seconds: number;
|
|
1075
|
-
} |
|
|
1076
|
-
|
|
1077
|
-
readonly
|
|
1078
|
-
readonly
|
|
1079
|
-
readonly
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
};
|
|
961
|
+
} | {
|
|
962
|
+
readonly type: "tokens";
|
|
963
|
+
readonly input?: number | undefined;
|
|
964
|
+
readonly output?: number | undefined;
|
|
965
|
+
readonly total?: number | undefined;
|
|
966
|
+
readonly details?: {
|
|
967
|
+
readonly [x: string]: unknown;
|
|
1083
968
|
} | undefined;
|
|
1084
|
-
}
|
|
969
|
+
} | undefined;
|
|
1085
970
|
readonly providerMetadata?: {
|
|
1086
971
|
readonly [x: string]: {
|
|
1087
972
|
readonly [x: string]: unknown;
|
|
@@ -1187,21 +1072,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1187
1072
|
readonly type: Schema.Literal<"compute">;
|
|
1188
1073
|
readonly seconds: Schema.Number;
|
|
1189
1074
|
}>]>>;
|
|
1190
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1191
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
1192
|
-
readonly message: Schema.String;
|
|
1193
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1194
|
-
}>>>;
|
|
1195
1075
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1196
1076
|
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial">]: never; }, OrElse extends (value: Exclude<{
|
|
1197
|
-
readonly type: "generation-queued";
|
|
1198
|
-
readonly id: string;
|
|
1199
|
-
readonly position?: number | undefined;
|
|
1200
|
-
} | {
|
|
1201
|
-
readonly type: "generation-progress";
|
|
1202
|
-
readonly id: string;
|
|
1203
|
-
readonly progress?: number | undefined;
|
|
1204
|
-
} | {
|
|
1205
1077
|
readonly type: "image-partial";
|
|
1206
1078
|
readonly index: number;
|
|
1207
1079
|
readonly image: Media.Asset;
|
|
@@ -1209,17 +1081,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1209
1081
|
readonly type: "image";
|
|
1210
1082
|
readonly index: number;
|
|
1211
1083
|
readonly image: Media.Asset;
|
|
1084
|
+
} | {
|
|
1085
|
+
readonly type: "generation-queued";
|
|
1086
|
+
readonly id: string;
|
|
1087
|
+
readonly position?: number | undefined;
|
|
1088
|
+
} | {
|
|
1089
|
+
readonly type: "generation-progress";
|
|
1090
|
+
readonly id: string;
|
|
1091
|
+
readonly progress?: number | undefined;
|
|
1212
1092
|
} | {
|
|
1213
1093
|
readonly type: "finish";
|
|
1214
1094
|
readonly usage?: {
|
|
1215
|
-
readonly type: "tokens";
|
|
1216
|
-
readonly input?: number | undefined;
|
|
1217
|
-
readonly output?: number | undefined;
|
|
1218
|
-
readonly total?: number | undefined;
|
|
1219
|
-
readonly details?: {
|
|
1220
|
-
readonly [x: string]: unknown;
|
|
1221
|
-
} | undefined;
|
|
1222
|
-
} | {
|
|
1223
1095
|
readonly type: "seconds";
|
|
1224
1096
|
readonly seconds: number;
|
|
1225
1097
|
} | {
|
|
@@ -1231,30 +1103,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1231
1103
|
} | {
|
|
1232
1104
|
readonly type: "compute";
|
|
1233
1105
|
readonly seconds: number;
|
|
1234
|
-
} |
|
|
1235
|
-
|
|
1236
|
-
readonly
|
|
1237
|
-
readonly
|
|
1238
|
-
readonly
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
};
|
|
1106
|
+
} | {
|
|
1107
|
+
readonly type: "tokens";
|
|
1108
|
+
readonly input?: number | undefined;
|
|
1109
|
+
readonly output?: number | undefined;
|
|
1110
|
+
readonly total?: number | undefined;
|
|
1111
|
+
readonly details?: {
|
|
1112
|
+
readonly [x: string]: unknown;
|
|
1242
1113
|
} | undefined;
|
|
1243
|
-
}
|
|
1114
|
+
} | undefined;
|
|
1244
1115
|
readonly providerMetadata?: {
|
|
1245
1116
|
readonly [x: string]: {
|
|
1246
1117
|
readonly [x: string]: unknown;
|
|
1247
1118
|
};
|
|
1248
1119
|
} | undefined;
|
|
1249
1120
|
}, { readonly [K in "type"]: keyof Cases; }>) => any>(value: {
|
|
1250
|
-
readonly type: "generation-queued";
|
|
1251
|
-
readonly id: string;
|
|
1252
|
-
readonly position?: number | undefined;
|
|
1253
|
-
} | {
|
|
1254
|
-
readonly type: "generation-progress";
|
|
1255
|
-
readonly id: string;
|
|
1256
|
-
readonly progress?: number | undefined;
|
|
1257
|
-
} | {
|
|
1258
1121
|
readonly type: "image-partial";
|
|
1259
1122
|
readonly index: number;
|
|
1260
1123
|
readonly image: Media.Asset;
|
|
@@ -1262,17 +1125,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1262
1125
|
readonly type: "image";
|
|
1263
1126
|
readonly index: number;
|
|
1264
1127
|
readonly image: Media.Asset;
|
|
1128
|
+
} | {
|
|
1129
|
+
readonly type: "generation-queued";
|
|
1130
|
+
readonly id: string;
|
|
1131
|
+
readonly position?: number | undefined;
|
|
1132
|
+
} | {
|
|
1133
|
+
readonly type: "generation-progress";
|
|
1134
|
+
readonly id: string;
|
|
1135
|
+
readonly progress?: number | undefined;
|
|
1265
1136
|
} | {
|
|
1266
1137
|
readonly type: "finish";
|
|
1267
1138
|
readonly usage?: {
|
|
1268
|
-
readonly type: "tokens";
|
|
1269
|
-
readonly input?: number | undefined;
|
|
1270
|
-
readonly output?: number | undefined;
|
|
1271
|
-
readonly total?: number | undefined;
|
|
1272
|
-
readonly details?: {
|
|
1273
|
-
readonly [x: string]: unknown;
|
|
1274
|
-
} | undefined;
|
|
1275
|
-
} | {
|
|
1276
1139
|
readonly type: "seconds";
|
|
1277
1140
|
readonly seconds: number;
|
|
1278
1141
|
} | {
|
|
@@ -1284,16 +1147,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1284
1147
|
} | {
|
|
1285
1148
|
readonly type: "compute";
|
|
1286
1149
|
readonly seconds: number;
|
|
1287
|
-
} |
|
|
1288
|
-
|
|
1289
|
-
readonly
|
|
1290
|
-
readonly
|
|
1291
|
-
readonly
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
};
|
|
1150
|
+
} | {
|
|
1151
|
+
readonly type: "tokens";
|
|
1152
|
+
readonly input?: number | undefined;
|
|
1153
|
+
readonly output?: number | undefined;
|
|
1154
|
+
readonly total?: number | undefined;
|
|
1155
|
+
readonly details?: {
|
|
1156
|
+
readonly [x: string]: unknown;
|
|
1295
1157
|
} | undefined;
|
|
1296
|
-
}
|
|
1158
|
+
} | undefined;
|
|
1297
1159
|
readonly providerMetadata?: {
|
|
1298
1160
|
readonly [x: string]: {
|
|
1299
1161
|
readonly [x: string]: unknown;
|
|
@@ -1397,21 +1259,8 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1397
1259
|
readonly type: Schema.Literal<"compute">;
|
|
1398
1260
|
readonly seconds: Schema.Number;
|
|
1399
1261
|
}>]>>;
|
|
1400
|
-
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1401
|
-
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
1402
|
-
readonly message: Schema.String;
|
|
1403
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1404
|
-
}>>>;
|
|
1405
1262
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1406
1263
|
}> as M["Type"]["type"]]+?: (value: M["Type"]) => any; } & { [K in Exclude<keyof Cases, "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial">]: never; }, OrElse extends (value: Exclude<{
|
|
1407
|
-
readonly type: "generation-queued";
|
|
1408
|
-
readonly id: string;
|
|
1409
|
-
readonly position?: number | undefined;
|
|
1410
|
-
} | {
|
|
1411
|
-
readonly type: "generation-progress";
|
|
1412
|
-
readonly id: string;
|
|
1413
|
-
readonly progress?: number | undefined;
|
|
1414
|
-
} | {
|
|
1415
1264
|
readonly type: "image-partial";
|
|
1416
1265
|
readonly index: number;
|
|
1417
1266
|
readonly image: Media.Asset;
|
|
@@ -1419,17 +1268,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1419
1268
|
readonly type: "image";
|
|
1420
1269
|
readonly index: number;
|
|
1421
1270
|
readonly image: Media.Asset;
|
|
1271
|
+
} | {
|
|
1272
|
+
readonly type: "generation-queued";
|
|
1273
|
+
readonly id: string;
|
|
1274
|
+
readonly position?: number | undefined;
|
|
1275
|
+
} | {
|
|
1276
|
+
readonly type: "generation-progress";
|
|
1277
|
+
readonly id: string;
|
|
1278
|
+
readonly progress?: number | undefined;
|
|
1422
1279
|
} | {
|
|
1423
1280
|
readonly type: "finish";
|
|
1424
1281
|
readonly usage?: {
|
|
1425
|
-
readonly type: "tokens";
|
|
1426
|
-
readonly input?: number | undefined;
|
|
1427
|
-
readonly output?: number | undefined;
|
|
1428
|
-
readonly total?: number | undefined;
|
|
1429
|
-
readonly details?: {
|
|
1430
|
-
readonly [x: string]: unknown;
|
|
1431
|
-
} | undefined;
|
|
1432
|
-
} | {
|
|
1433
1282
|
readonly type: "seconds";
|
|
1434
1283
|
readonly seconds: number;
|
|
1435
1284
|
} | {
|
|
@@ -1441,30 +1290,21 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1441
1290
|
} | {
|
|
1442
1291
|
readonly type: "compute";
|
|
1443
1292
|
readonly seconds: number;
|
|
1444
|
-
} |
|
|
1445
|
-
|
|
1446
|
-
readonly
|
|
1447
|
-
readonly
|
|
1448
|
-
readonly
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
};
|
|
1293
|
+
} | {
|
|
1294
|
+
readonly type: "tokens";
|
|
1295
|
+
readonly input?: number | undefined;
|
|
1296
|
+
readonly output?: number | undefined;
|
|
1297
|
+
readonly total?: number | undefined;
|
|
1298
|
+
readonly details?: {
|
|
1299
|
+
readonly [x: string]: unknown;
|
|
1452
1300
|
} | undefined;
|
|
1453
|
-
}
|
|
1301
|
+
} | undefined;
|
|
1454
1302
|
readonly providerMetadata?: {
|
|
1455
1303
|
readonly [x: string]: {
|
|
1456
1304
|
readonly [x: string]: unknown;
|
|
1457
1305
|
};
|
|
1458
1306
|
} | undefined;
|
|
1459
1307
|
}, { readonly [K in "type"]: keyof Cases; }>) => any>(cases: Cases, orElse: OrElse): (value: {
|
|
1460
|
-
readonly type: "generation-queued";
|
|
1461
|
-
readonly id: string;
|
|
1462
|
-
readonly position?: number | undefined;
|
|
1463
|
-
} | {
|
|
1464
|
-
readonly type: "generation-progress";
|
|
1465
|
-
readonly id: string;
|
|
1466
|
-
readonly progress?: number | undefined;
|
|
1467
|
-
} | {
|
|
1468
1308
|
readonly type: "image-partial";
|
|
1469
1309
|
readonly index: number;
|
|
1470
1310
|
readonly image: Media.Asset;
|
|
@@ -1472,17 +1312,17 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1472
1312
|
readonly type: "image";
|
|
1473
1313
|
readonly index: number;
|
|
1474
1314
|
readonly image: Media.Asset;
|
|
1315
|
+
} | {
|
|
1316
|
+
readonly type: "generation-queued";
|
|
1317
|
+
readonly id: string;
|
|
1318
|
+
readonly position?: number | undefined;
|
|
1319
|
+
} | {
|
|
1320
|
+
readonly type: "generation-progress";
|
|
1321
|
+
readonly id: string;
|
|
1322
|
+
readonly progress?: number | undefined;
|
|
1475
1323
|
} | {
|
|
1476
1324
|
readonly type: "finish";
|
|
1477
1325
|
readonly usage?: {
|
|
1478
|
-
readonly type: "tokens";
|
|
1479
|
-
readonly input?: number | undefined;
|
|
1480
|
-
readonly output?: number | undefined;
|
|
1481
|
-
readonly total?: number | undefined;
|
|
1482
|
-
readonly details?: {
|
|
1483
|
-
readonly [x: string]: unknown;
|
|
1484
|
-
} | undefined;
|
|
1485
|
-
} | {
|
|
1486
1326
|
readonly type: "seconds";
|
|
1487
1327
|
readonly seconds: number;
|
|
1488
1328
|
} | {
|
|
@@ -1494,16 +1334,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1494
1334
|
} | {
|
|
1495
1335
|
readonly type: "compute";
|
|
1496
1336
|
readonly seconds: number;
|
|
1497
|
-
} |
|
|
1498
|
-
|
|
1499
|
-
readonly
|
|
1500
|
-
readonly
|
|
1501
|
-
readonly
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
};
|
|
1337
|
+
} | {
|
|
1338
|
+
readonly type: "tokens";
|
|
1339
|
+
readonly input?: number | undefined;
|
|
1340
|
+
readonly output?: number | undefined;
|
|
1341
|
+
readonly total?: number | undefined;
|
|
1342
|
+
readonly details?: {
|
|
1343
|
+
readonly [x: string]: unknown;
|
|
1505
1344
|
} | undefined;
|
|
1506
|
-
}
|
|
1345
|
+
} | undefined;
|
|
1507
1346
|
readonly providerMetadata?: {
|
|
1508
1347
|
readonly [x: string]: {
|
|
1509
1348
|
readonly [x: string]: unknown;
|
|
@@ -1536,14 +1375,6 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1536
1375
|
finish: (u: unknown) => u is {
|
|
1537
1376
|
readonly type: "finish";
|
|
1538
1377
|
readonly usage?: {
|
|
1539
|
-
readonly type: "tokens";
|
|
1540
|
-
readonly input?: number | undefined;
|
|
1541
|
-
readonly output?: number | undefined;
|
|
1542
|
-
readonly total?: number | undefined;
|
|
1543
|
-
readonly details?: {
|
|
1544
|
-
readonly [x: string]: unknown;
|
|
1545
|
-
} | undefined;
|
|
1546
|
-
} | {
|
|
1547
1378
|
readonly type: "seconds";
|
|
1548
1379
|
readonly seconds: number;
|
|
1549
1380
|
} | {
|
|
@@ -1555,16 +1386,15 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1555
1386
|
} | {
|
|
1556
1387
|
readonly type: "compute";
|
|
1557
1388
|
readonly seconds: number;
|
|
1558
|
-
} |
|
|
1559
|
-
|
|
1560
|
-
readonly
|
|
1561
|
-
readonly
|
|
1562
|
-
readonly
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
};
|
|
1389
|
+
} | {
|
|
1390
|
+
readonly type: "tokens";
|
|
1391
|
+
readonly input?: number | undefined;
|
|
1392
|
+
readonly output?: number | undefined;
|
|
1393
|
+
readonly total?: number | undefined;
|
|
1394
|
+
readonly details?: {
|
|
1395
|
+
readonly [x: string]: unknown;
|
|
1566
1396
|
} | undefined;
|
|
1567
|
-
}
|
|
1397
|
+
} | undefined;
|
|
1568
1398
|
readonly providerMetadata?: {
|
|
1569
1399
|
readonly [x: string]: {
|
|
1570
1400
|
readonly [x: string]: unknown;
|