@opencode/ai 2.0.15 → 2.0.17
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 +441 -99
- package/dist/ai-client.d.ts +8 -0
- package/dist/ai-client.js +12 -0
- package/dist/experimental/evaluation-client.d.ts +3 -3
- package/dist/experimental/evaluation-client.js +1 -1
- package/dist/experimental/evaluation.js +1 -1
- package/dist/generation.d.ts +39 -29
- package/dist/generation.js +62 -36
- package/dist/image-client.d.ts +59 -17
- package/dist/image-client.js +16 -24
- package/dist/image.d.ts +394 -55
- package/dist/image.js +48 -57
- package/dist/index.d.ts +15 -2
- package/dist/index.js +10 -0
- package/dist/llm.d.ts +7 -5
- package/dist/llm.js +10 -4
- package/dist/media-client.d.ts +30 -0
- package/dist/media-client.js +51 -0
- package/dist/media-model.d.ts +43 -0
- package/dist/media-model.js +47 -0
- package/dist/media.d.ts +10 -9
- package/dist/media.js +11 -12
- package/dist/promise.d.ts +473 -15
- package/dist/promise.js +71 -13
- package/dist/protocols/alibaba-chat.d.ts +12 -0
- package/dist/protocols/alibaba-chat.js +4 -1
- package/dist/protocols/alibaba-messages.d.ts +1 -1
- package/dist/protocols/alibaba-messages.js +6 -4
- package/dist/protocols/alibaba-responses.d.ts +2 -2
- package/dist/protocols/anthropic-messages.d.ts +34 -34
- package/dist/protocols/anthropic-messages.js +14 -9
- package/dist/protocols/assemblyai-transcription.d.ts +41 -0
- package/dist/protocols/assemblyai-transcription.js +136 -0
- package/dist/protocols/bedrock-converse.d.ts +7 -0
- package/dist/protocols/bedrock-converse.js +39 -19
- package/dist/protocols/bfl-images.d.ts +38 -0
- package/dist/protocols/bfl-images.js +153 -0
- package/dist/protocols/cartesia-speech.d.ts +143 -0
- package/dist/protocols/cartesia-speech.js +120 -0
- package/dist/protocols/deepgram-speech.d.ts +135 -0
- package/dist/protocols/deepgram-speech.js +91 -0
- package/dist/protocols/deepgram-transcription.d.ts +26 -0
- package/dist/protocols/deepgram-transcription.js +125 -0
- package/dist/protocols/elevenlabs-speech.d.ts +138 -0
- package/dist/protocols/elevenlabs-speech.js +111 -0
- package/dist/protocols/fal-images.d.ts +25 -0
- package/dist/protocols/fal-images.js +104 -0
- package/dist/protocols/fal-video.d.ts +29 -0
- package/dist/protocols/fal-video.js +73 -0
- package/dist/protocols/gemini.d.ts +22 -22
- package/dist/protocols/gemini.js +19 -36
- package/dist/protocols/google-images.d.ts +3 -3
- package/dist/protocols/google-images.js +12 -34
- package/dist/protocols/google-speech.d.ts +146 -0
- package/dist/protocols/google-speech.js +88 -0
- package/dist/protocols/google-transcription.d.ts +174 -0
- package/dist/protocols/google-transcription.js +126 -0
- package/dist/protocols/google-video.d.ts +26 -0
- package/dist/protocols/google-video.js +142 -0
- package/dist/protocols/meta-images.d.ts +3 -4
- package/dist/protocols/meta-images.js +13 -29
- package/dist/protocols/meta-messages.d.ts +5 -5
- package/dist/protocols/meta-responses.d.ts +4 -4
- package/dist/protocols/meta-responses.js +6 -4
- package/dist/protocols/open-responses.d.ts +10 -9
- package/dist/protocols/open-responses.js +4 -9
- package/dist/protocols/openai-chat.d.ts +84 -0
- package/dist/protocols/openai-chat.js +28 -17
- package/dist/protocols/openai-compatible-chat.d.ts +12 -0
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-images.d.ts +130 -7
- package/dist/protocols/openai-images.js +143 -91
- package/dist/protocols/openai-responses.d.ts +20 -20
- package/dist/protocols/openai-responses.js +31 -31
- package/dist/protocols/openai-speech.d.ts +136 -0
- package/dist/protocols/openai-speech.js +97 -0
- package/dist/protocols/openai-transcription.d.ts +211 -0
- package/dist/protocols/openai-transcription.js +202 -0
- package/dist/protocols/replicate-images.d.ts +28 -0
- package/dist/protocols/replicate-images.js +127 -0
- package/dist/protocols/runway-video.d.ts +38 -0
- package/dist/protocols/runway-video.js +140 -0
- package/dist/protocols/shared.d.ts +21 -17
- package/dist/protocols/shared.js +27 -36
- package/dist/protocols/stability-images.d.ts +39 -0
- package/dist/protocols/stability-images.js +136 -0
- package/dist/protocols/utils/fal-queue.d.ts +26 -0
- package/dist/protocols/utils/fal-queue.js +67 -0
- package/dist/protocols/utils/gemini-generate-content.d.ts +65 -0
- package/dist/protocols/utils/gemini-generate-content.js +65 -0
- package/dist/protocols/utils/gemini-json-schema.d.ts +3 -0
- package/dist/protocols/utils/gemini-json-schema.js +76 -0
- package/dist/protocols/utils/media-input.d.ts +23 -1
- package/dist/protocols/utils/media-input.js +40 -0
- package/dist/protocols/utils/responses-checkpoint.js +3 -7
- package/dist/protocols/utils/responses-compaction.d.ts +3 -1
- package/dist/protocols/utils/responses-compaction.js +16 -3
- package/dist/protocols/utils/speech-stream.d.ts +49 -0
- package/dist/protocols/utils/speech-stream.js +64 -0
- package/dist/protocols/utils/tool-schema.d.ts +2 -2
- package/dist/protocols/utils/tool-schema.js +62 -19
- package/dist/protocols/xai-images.d.ts +4 -4
- package/dist/protocols/xai-images.js +14 -40
- package/dist/protocols/xai-responses.d.ts +2 -2
- package/dist/protocols/xai-responses.js +1 -1
- package/dist/protocols/xai-video.d.ts +34 -0
- package/dist/protocols/xai-video.js +141 -0
- package/dist/protocols/zai-chat.d.ts +13 -1
- package/dist/protocols/zai-images.d.ts +2 -2
- package/dist/protocols/zai-images.js +11 -14
- package/dist/protocols/zai-messages.d.ts +1 -1
- package/dist/provider-error.js +10 -1
- package/dist/providers/alibaba.d.ts +15 -3
- package/dist/providers/amazon-bedrock-mantle.d.ts +14 -2
- package/dist/providers/amazon-bedrock.d.ts +2 -0
- package/dist/providers/amazon-bedrock.js +1 -0
- package/dist/providers/anthropic-compatible.d.ts +5 -5
- package/dist/providers/anthropic.d.ts +5 -5
- package/dist/providers/assemblyai.d.ts +25 -0
- package/dist/providers/assemblyai.js +24 -0
- package/dist/providers/azure.d.ts +20 -8
- package/dist/providers/azure.js +2 -2
- package/dist/providers/baseten.d.ts +24 -0
- package/dist/providers/black-forest-labs.d.ts +25 -0
- package/dist/providers/black-forest-labs.js +23 -0
- package/dist/providers/cartesia.d.ts +24 -0
- package/dist/providers/cartesia.js +17 -0
- package/dist/providers/cerebras.d.ts +24 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +42 -18
- package/dist/providers/cloudflare-workers-ai.d.ts +24 -0
- package/dist/providers/deepgram.d.ts +29 -0
- package/dist/providers/deepgram.js +25 -0
- package/dist/providers/deepinfra.d.ts +24 -0
- package/dist/providers/deepseek.d.ts +24 -0
- package/dist/providers/elevenlabs.d.ts +24 -0
- package/dist/providers/elevenlabs.js +23 -0
- package/dist/providers/fal.d.ts +29 -0
- package/dist/providers/fal.js +26 -0
- package/dist/providers/fireworks.d.ts +24 -0
- package/dist/providers/google-vertex-chat.d.ts +12 -0
- package/dist/providers/google-vertex-messages.d.ts +5 -5
- package/dist/providers/google-vertex-responses.d.ts +2 -2
- package/dist/providers/google-vertex.d.ts +6 -6
- package/dist/providers/google.d.ts +21 -6
- package/dist/providers/google.js +13 -9
- package/dist/providers/groq.d.ts +24 -0
- package/dist/providers/index.d.ts +9 -0
- package/dist/providers/index.js +9 -0
- package/dist/providers/meta.d.ts +22 -10
- package/dist/providers/meta.js +4 -8
- package/dist/providers/minimax.d.ts +19 -7
- package/dist/providers/moonshot.d.ts +19 -7
- package/dist/providers/moonshot.js +3 -3
- package/dist/providers/openai-compatible-responses.d.ts +2 -2
- package/dist/providers/openai-compatible.d.ts +12 -0
- package/dist/providers/openai-options.d.ts +3 -9
- package/dist/providers/openai-options.js +4 -7
- package/dist/providers/openai.d.ts +33 -12
- package/dist/providers/openai.js +17 -9
- package/dist/providers/opencode-zen.js +1 -1
- package/dist/providers/openrouter.d.ts +54 -7
- package/dist/providers/openrouter.js +10 -5
- package/dist/providers/replicate.d.ts +25 -0
- package/dist/providers/replicate.js +17 -0
- package/dist/providers/runway.d.ts +24 -0
- package/dist/providers/runway.js +17 -0
- package/dist/providers/stability.d.ts +28 -0
- package/dist/providers/stability.js +18 -0
- package/dist/providers/togetherai.d.ts +24 -0
- package/dist/providers/typesafe-ai.js +1 -1
- package/dist/providers/vercel-ai-gateway.js +1 -1
- package/dist/providers/xai.d.ts +17 -0
- package/dist/providers/xai.js +7 -9
- package/dist/providers/zai-coding-plan.d.ts +16 -4
- package/dist/providers/zai.d.ts +13 -1
- package/dist/providers/zai.js +4 -8
- package/dist/route/auth.d.ts +5 -2
- package/dist/route/auth.js +20 -13
- package/dist/route/client.d.ts +9 -7
- package/dist/route/client.js +6 -8
- package/dist/route/endpoint.d.ts +1 -0
- package/dist/route/endpoint.js +2 -2
- package/dist/route/executor-service.d.ts +4 -2
- package/dist/route/executor-service.js +2 -1
- package/dist/route/executor.d.ts +3 -1
- package/dist/route/executor.js +7 -0
- package/dist/route/framing.d.ts +15 -2
- package/dist/route/framing.js +53 -4
- package/dist/route/index.d.ts +1 -1
- package/dist/route/media-protocol.d.ts +145 -18
- package/dist/route/media-protocol.js +96 -28
- package/dist/route/media.d.ts +54 -9
- package/dist/route/media.js +194 -38
- package/dist/route/protocol.d.ts +3 -1
- package/dist/schema/events.d.ts +0 -6
- package/dist/schema/messages.d.ts +0 -3
- package/dist/schema/options.d.ts +10 -6
- package/dist/schema/options.js +10 -5
- package/dist/speech-client.d.ts +66 -0
- package/dist/speech-client.js +21 -0
- package/dist/speech.d.ts +1307 -0
- package/dist/speech.js +124 -0
- package/dist/testing.d.ts +2 -2
- package/dist/transcription-client.d.ts +82 -0
- package/dist/transcription-client.js +13 -0
- package/dist/transcription.d.ts +1492 -0
- package/dist/transcription.js +127 -0
- package/dist/utils/bytes.d.ts +1 -0
- package/dist/utils/bytes.js +10 -0
- package/dist/utils/json.d.ts +4 -0
- package/dist/utils/json.js +4 -0
- package/dist/utils/media-type.d.ts +3 -1
- package/dist/utils/media-type.js +25 -2
- package/dist/video-client.d.ts +59 -0
- package/dist/video-client.js +20 -0
- package/dist/video.d.ts +1351 -0
- package/dist/video.js +118 -0
- package/package.json +3 -3
- package/dist/protocols/utils/gemini-tool-schema.d.ts +0 -2
- package/dist/protocols/utils/gemini-tool-schema.js +0 -103
- package/dist/protocols/utils/meta-image.d.ts +0 -2
- package/dist/protocols/utils/meta-image.js +0 -13
- package/dist/protocols/utils/openai-image.d.ts +0 -5
- package/dist/protocols/utils/openai-image.js +0 -18
package/dist/video.d.ts
ADDED
|
@@ -0,0 +1,1351 @@
|
|
|
1
|
+
import { Effect, Schema, Stream } from "effect";
|
|
2
|
+
import { Generation, type AwaitOptions } from "./generation.js";
|
|
3
|
+
import { Media } from "./media.js";
|
|
4
|
+
import { MediaModel } from "./media-model.js";
|
|
5
|
+
import { MediaRoute } from "./route/media.js";
|
|
6
|
+
import { AIError, HttpOptions, type OpenString } from "./schema/index.js";
|
|
7
|
+
import { Service } from "./video-client.js";
|
|
8
|
+
export type VideoOptions = MediaModel.Options;
|
|
9
|
+
export type VideoRoute = MediaRoute.AnyRoute<VideoRequestFor, VideoEvent, VideoResponse>;
|
|
10
|
+
export declare class VideoModel<Options extends VideoOptions = VideoOptions> extends MediaModel<VideoRoute, Options> {
|
|
11
|
+
protected readonly _VideoModel: void;
|
|
12
|
+
/** The number of type arguments selects the kind: `<Options>`, `<Options, Frame, State>`, or `<Options, Token>`. */
|
|
13
|
+
static fromRoute<Options extends VideoOptions>(route: MediaModel.InlineRouteInput<VideoRequestFor<Options>, VideoResponse>, input: MediaRoute.ModelInput): VideoModel<Options>;
|
|
14
|
+
static fromRoute<Options extends VideoOptions, Frame, State>(route: MediaModel.StreamRouteInput<VideoRequestFor<Options>, VideoEvent, Frame, State>, input: MediaRoute.ModelInput): VideoModel<Options>;
|
|
15
|
+
static fromRoute<Options extends VideoOptions, Token>(route: MediaModel.QueuedRouteInput<VideoRequestFor<Options>, VideoResponse, Token>, input: MediaRoute.ModelInput): VideoModel<Options>;
|
|
16
|
+
}
|
|
17
|
+
export declare const VideoModelSchema: Schema.declare<VideoModel<MediaModel.Options>, VideoModel<MediaModel.Options>>;
|
|
18
|
+
export type VideoAspectRatio = Media.AspectRatio;
|
|
19
|
+
export declare const VideoAspectRatio: Schema.declare<`${number}:${number}`, `${number}:${number}`>;
|
|
20
|
+
export type VideoResolution = OpenString<"480p" | "720p" | "1080p" | "4k">;
|
|
21
|
+
/** Pinned frames. Routes that accept only a first frame fail typed when `last` is present. */
|
|
22
|
+
export declare const VideoFrames: Schema.Struct<{
|
|
23
|
+
readonly first: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
24
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
25
|
+
readonly type: Schema.Literal<"bytes">;
|
|
26
|
+
readonly data: Schema.Uint8Array;
|
|
27
|
+
readonly mediaType: Schema.String;
|
|
28
|
+
}>, Schema.Struct<{
|
|
29
|
+
readonly type: Schema.Literal<"base64">;
|
|
30
|
+
readonly data: Schema.String;
|
|
31
|
+
readonly mediaType: Schema.String;
|
|
32
|
+
}>, Schema.Struct<{
|
|
33
|
+
readonly type: Schema.Literal<"url">;
|
|
34
|
+
readonly url: Schema.String;
|
|
35
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
36
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
readonly type: Schema.Literal<"ref">;
|
|
39
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
40
|
+
readonly id: Schema.String;
|
|
41
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
42
|
+
}>]>;
|
|
43
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
44
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
45
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
46
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
47
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
48
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
49
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
50
|
+
readonly format: Schema.optional<Schema.String>;
|
|
51
|
+
}>>;
|
|
52
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
53
|
+
}>, never, never>>;
|
|
54
|
+
readonly last: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
55
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
56
|
+
readonly type: Schema.Literal<"bytes">;
|
|
57
|
+
readonly data: Schema.Uint8Array;
|
|
58
|
+
readonly mediaType: Schema.String;
|
|
59
|
+
}>, Schema.Struct<{
|
|
60
|
+
readonly type: Schema.Literal<"base64">;
|
|
61
|
+
readonly data: Schema.String;
|
|
62
|
+
readonly mediaType: Schema.String;
|
|
63
|
+
}>, Schema.Struct<{
|
|
64
|
+
readonly type: Schema.Literal<"url">;
|
|
65
|
+
readonly url: Schema.String;
|
|
66
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
67
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
68
|
+
}>, Schema.Struct<{
|
|
69
|
+
readonly type: Schema.Literal<"ref">;
|
|
70
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
71
|
+
readonly id: Schema.String;
|
|
72
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
73
|
+
}>]>;
|
|
74
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
75
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
76
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
77
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
78
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
79
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
80
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
81
|
+
readonly format: Schema.optional<Schema.String>;
|
|
82
|
+
}>>;
|
|
83
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
84
|
+
}>, never, never>>;
|
|
85
|
+
}>;
|
|
86
|
+
export type VideoFrames = Schema.Schema.Type<typeof VideoFrames>;
|
|
87
|
+
declare const VideoRequest_base: Schema.Class<VideoRequest, Schema.Struct<{
|
|
88
|
+
readonly model: Schema.declare<VideoModel<MediaModel.Options>, VideoModel<MediaModel.Options>>;
|
|
89
|
+
readonly prompt: Schema.String;
|
|
90
|
+
readonly frames: Schema.optional<Schema.Struct<{
|
|
91
|
+
readonly first: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
92
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
93
|
+
readonly type: Schema.Literal<"bytes">;
|
|
94
|
+
readonly data: Schema.Uint8Array;
|
|
95
|
+
readonly mediaType: Schema.String;
|
|
96
|
+
}>, Schema.Struct<{
|
|
97
|
+
readonly type: Schema.Literal<"base64">;
|
|
98
|
+
readonly data: Schema.String;
|
|
99
|
+
readonly mediaType: Schema.String;
|
|
100
|
+
}>, Schema.Struct<{
|
|
101
|
+
readonly type: Schema.Literal<"url">;
|
|
102
|
+
readonly url: Schema.String;
|
|
103
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
104
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
105
|
+
}>, Schema.Struct<{
|
|
106
|
+
readonly type: Schema.Literal<"ref">;
|
|
107
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
108
|
+
readonly id: Schema.String;
|
|
109
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
110
|
+
}>]>;
|
|
111
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
112
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
113
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
114
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
115
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
116
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
117
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
118
|
+
readonly format: Schema.optional<Schema.String>;
|
|
119
|
+
}>>;
|
|
120
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
121
|
+
}>, never, never>>;
|
|
122
|
+
readonly last: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
123
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
124
|
+
readonly type: Schema.Literal<"bytes">;
|
|
125
|
+
readonly data: Schema.Uint8Array;
|
|
126
|
+
readonly mediaType: Schema.String;
|
|
127
|
+
}>, Schema.Struct<{
|
|
128
|
+
readonly type: Schema.Literal<"base64">;
|
|
129
|
+
readonly data: Schema.String;
|
|
130
|
+
readonly mediaType: Schema.String;
|
|
131
|
+
}>, Schema.Struct<{
|
|
132
|
+
readonly type: Schema.Literal<"url">;
|
|
133
|
+
readonly url: Schema.String;
|
|
134
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
135
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly type: Schema.Literal<"ref">;
|
|
138
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
139
|
+
readonly id: Schema.String;
|
|
140
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
141
|
+
}>]>;
|
|
142
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
143
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
144
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
145
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
146
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
147
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
148
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
149
|
+
readonly format: Schema.optional<Schema.String>;
|
|
150
|
+
}>>;
|
|
151
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
152
|
+
}>, never, never>>;
|
|
153
|
+
}>>;
|
|
154
|
+
/** Style or subject references that guide the output without pinning a frame. */
|
|
155
|
+
readonly references: Schema.optional<Schema.$Array<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
156
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
157
|
+
readonly type: Schema.Literal<"bytes">;
|
|
158
|
+
readonly data: Schema.Uint8Array;
|
|
159
|
+
readonly mediaType: Schema.String;
|
|
160
|
+
}>, Schema.Struct<{
|
|
161
|
+
readonly type: Schema.Literal<"base64">;
|
|
162
|
+
readonly data: Schema.String;
|
|
163
|
+
readonly mediaType: Schema.String;
|
|
164
|
+
}>, Schema.Struct<{
|
|
165
|
+
readonly type: Schema.Literal<"url">;
|
|
166
|
+
readonly url: Schema.String;
|
|
167
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
168
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
169
|
+
}>, Schema.Struct<{
|
|
170
|
+
readonly type: Schema.Literal<"ref">;
|
|
171
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
172
|
+
readonly id: Schema.String;
|
|
173
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
174
|
+
}>]>;
|
|
175
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
176
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
177
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
178
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
179
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
180
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
181
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
182
|
+
readonly format: Schema.optional<Schema.String>;
|
|
183
|
+
}>>;
|
|
184
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
185
|
+
}>, never, never>>>;
|
|
186
|
+
/** Source video for edit or extension routes. */
|
|
187
|
+
readonly video: Schema.optional<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
188
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
189
|
+
readonly type: Schema.Literal<"bytes">;
|
|
190
|
+
readonly data: Schema.Uint8Array;
|
|
191
|
+
readonly mediaType: Schema.String;
|
|
192
|
+
}>, Schema.Struct<{
|
|
193
|
+
readonly type: Schema.Literal<"base64">;
|
|
194
|
+
readonly data: Schema.String;
|
|
195
|
+
readonly mediaType: Schema.String;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly type: Schema.Literal<"url">;
|
|
198
|
+
readonly url: Schema.String;
|
|
199
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
200
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
201
|
+
}>, Schema.Struct<{
|
|
202
|
+
readonly type: Schema.Literal<"ref">;
|
|
203
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
204
|
+
readonly id: Schema.String;
|
|
205
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
206
|
+
}>]>;
|
|
207
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
208
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
209
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
210
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
211
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
212
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
213
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
214
|
+
readonly format: Schema.optional<Schema.String>;
|
|
215
|
+
}>>;
|
|
216
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
217
|
+
}>, never, never>>;
|
|
218
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
219
|
+
readonly aspectRatio: Schema.optional<Schema.declare<`${number}:${number}`, `${number}:${number}`>>;
|
|
220
|
+
readonly resolution: Schema.optional<Schema.String>;
|
|
221
|
+
/** Whether to generate an audio track; routes whose audio is always on fail typed on `false`. */
|
|
222
|
+
readonly audio: Schema.optional<Schema.Boolean>;
|
|
223
|
+
readonly n: Schema.optional<Schema.Int>;
|
|
224
|
+
readonly seed: Schema.optional<Schema.Number>;
|
|
225
|
+
readonly negativePrompt: Schema.optional<Schema.String>;
|
|
226
|
+
readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
227
|
+
readonly http: Schema.optional<typeof HttpOptions>;
|
|
228
|
+
}>, {}>;
|
|
229
|
+
export declare class VideoRequest extends VideoRequest_base {
|
|
230
|
+
protected readonly _VideoRequest: void;
|
|
231
|
+
}
|
|
232
|
+
export type VideoRequestFor<Options extends VideoOptions = VideoOptions> = Omit<VideoRequest, "model" | "providerOptions"> & {
|
|
233
|
+
readonly model: VideoModel<Options>;
|
|
234
|
+
readonly providerOptions?: Options;
|
|
235
|
+
};
|
|
236
|
+
export type VideoModelOptions<Model> = Model extends VideoModel<infer Options> ? Options : never;
|
|
237
|
+
export type VideoRequestInput<Model extends VideoModel = VideoModel> = Omit<ConstructorParameters<typeof VideoRequest>[0], "model" | "providerOptions" | "http" | "resolution"> & {
|
|
238
|
+
readonly model: Model;
|
|
239
|
+
readonly resolution?: VideoResolution;
|
|
240
|
+
readonly providerOptions?: NoInfer<VideoModelOptions<Model>>;
|
|
241
|
+
readonly http?: HttpOptions.Input;
|
|
242
|
+
};
|
|
243
|
+
declare const VideoResponse_base: Schema.Class<VideoResponse, Schema.Struct<{
|
|
244
|
+
readonly videos: Schema.$Array<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
245
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
246
|
+
readonly type: Schema.Literal<"bytes">;
|
|
247
|
+
readonly data: Schema.Uint8Array;
|
|
248
|
+
readonly mediaType: Schema.String;
|
|
249
|
+
}>, Schema.Struct<{
|
|
250
|
+
readonly type: Schema.Literal<"base64">;
|
|
251
|
+
readonly data: Schema.String;
|
|
252
|
+
readonly mediaType: Schema.String;
|
|
253
|
+
}>, Schema.Struct<{
|
|
254
|
+
readonly type: Schema.Literal<"url">;
|
|
255
|
+
readonly url: Schema.String;
|
|
256
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
257
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
258
|
+
}>, Schema.Struct<{
|
|
259
|
+
readonly type: Schema.Literal<"ref">;
|
|
260
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
261
|
+
readonly id: Schema.String;
|
|
262
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
263
|
+
}>]>;
|
|
264
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
265
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
266
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
267
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
268
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
269
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
270
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
271
|
+
readonly format: Schema.optional<Schema.String>;
|
|
272
|
+
}>>;
|
|
273
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
274
|
+
}>, never, never>>;
|
|
275
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
276
|
+
readonly type: Schema.Literal<"tokens">;
|
|
277
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
278
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
279
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
280
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
281
|
+
}>, Schema.Struct<{
|
|
282
|
+
readonly type: Schema.Literal<"seconds">;
|
|
283
|
+
readonly seconds: Schema.Number;
|
|
284
|
+
}>, Schema.Struct<{
|
|
285
|
+
readonly type: Schema.Literal<"characters">;
|
|
286
|
+
readonly characters: Schema.Number;
|
|
287
|
+
}>, Schema.Struct<{
|
|
288
|
+
readonly type: Schema.Literal<"credits">;
|
|
289
|
+
readonly credits: Schema.Number;
|
|
290
|
+
}>, Schema.Struct<{
|
|
291
|
+
readonly type: Schema.Literal<"compute">;
|
|
292
|
+
readonly seconds: Schema.Number;
|
|
293
|
+
}>]>>;
|
|
294
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
295
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
296
|
+
readonly message: Schema.String;
|
|
297
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
298
|
+
}>>>;
|
|
299
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
300
|
+
}>, {}>;
|
|
301
|
+
export declare class VideoResponse extends VideoResponse_base {
|
|
302
|
+
get video(): Media.Asset;
|
|
303
|
+
}
|
|
304
|
+
export declare const VideoOutputEvent: Schema.Struct<{
|
|
305
|
+
readonly type: Schema.tag<"video">;
|
|
306
|
+
readonly index: Schema.Number;
|
|
307
|
+
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
308
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
309
|
+
readonly type: Schema.Literal<"bytes">;
|
|
310
|
+
readonly data: Schema.Uint8Array;
|
|
311
|
+
readonly mediaType: Schema.String;
|
|
312
|
+
}>, Schema.Struct<{
|
|
313
|
+
readonly type: Schema.Literal<"base64">;
|
|
314
|
+
readonly data: Schema.String;
|
|
315
|
+
readonly mediaType: Schema.String;
|
|
316
|
+
}>, Schema.Struct<{
|
|
317
|
+
readonly type: Schema.Literal<"url">;
|
|
318
|
+
readonly url: Schema.String;
|
|
319
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
320
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
321
|
+
}>, Schema.Struct<{
|
|
322
|
+
readonly type: Schema.Literal<"ref">;
|
|
323
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
324
|
+
readonly id: Schema.String;
|
|
325
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
326
|
+
}>]>;
|
|
327
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
328
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
329
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
330
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
331
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
332
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
333
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
334
|
+
readonly format: Schema.optional<Schema.String>;
|
|
335
|
+
}>>;
|
|
336
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
337
|
+
}>, never, never>;
|
|
338
|
+
}>;
|
|
339
|
+
export declare const VideoFinishEvent: Schema.Struct<{
|
|
340
|
+
readonly type: Schema.tag<"finish">;
|
|
341
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
342
|
+
readonly type: Schema.Literal<"tokens">;
|
|
343
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
344
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
345
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
346
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
347
|
+
}>, Schema.Struct<{
|
|
348
|
+
readonly type: Schema.Literal<"seconds">;
|
|
349
|
+
readonly seconds: Schema.Number;
|
|
350
|
+
}>, Schema.Struct<{
|
|
351
|
+
readonly type: Schema.Literal<"characters">;
|
|
352
|
+
readonly characters: Schema.Number;
|
|
353
|
+
}>, Schema.Struct<{
|
|
354
|
+
readonly type: Schema.Literal<"credits">;
|
|
355
|
+
readonly credits: Schema.Number;
|
|
356
|
+
}>, Schema.Struct<{
|
|
357
|
+
readonly type: Schema.Literal<"compute">;
|
|
358
|
+
readonly seconds: Schema.Number;
|
|
359
|
+
}>]>>;
|
|
360
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
361
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
362
|
+
readonly message: Schema.String;
|
|
363
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
364
|
+
}>>>;
|
|
365
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
366
|
+
}>;
|
|
367
|
+
declare const videoEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
|
|
368
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
369
|
+
readonly id: Schema.String;
|
|
370
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
371
|
+
}>, Schema.Struct<{
|
|
372
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
373
|
+
readonly id: Schema.String;
|
|
374
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
375
|
+
}>, Schema.Struct<{
|
|
376
|
+
readonly type: Schema.tag<"video">;
|
|
377
|
+
readonly index: Schema.Number;
|
|
378
|
+
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
379
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
380
|
+
readonly type: Schema.Literal<"bytes">;
|
|
381
|
+
readonly data: Schema.Uint8Array;
|
|
382
|
+
readonly mediaType: Schema.String;
|
|
383
|
+
}>, Schema.Struct<{
|
|
384
|
+
readonly type: Schema.Literal<"base64">;
|
|
385
|
+
readonly data: Schema.String;
|
|
386
|
+
readonly mediaType: Schema.String;
|
|
387
|
+
}>, Schema.Struct<{
|
|
388
|
+
readonly type: Schema.Literal<"url">;
|
|
389
|
+
readonly url: Schema.String;
|
|
390
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
391
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
392
|
+
}>, Schema.Struct<{
|
|
393
|
+
readonly type: Schema.Literal<"ref">;
|
|
394
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
395
|
+
readonly id: Schema.String;
|
|
396
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
397
|
+
}>]>;
|
|
398
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
399
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
400
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
401
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
402
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
403
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
404
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
405
|
+
readonly format: Schema.optional<Schema.String>;
|
|
406
|
+
}>>;
|
|
407
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
408
|
+
}>, never, never>;
|
|
409
|
+
}>, Schema.Struct<{
|
|
410
|
+
readonly type: Schema.tag<"finish">;
|
|
411
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
412
|
+
readonly type: Schema.Literal<"tokens">;
|
|
413
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
414
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
415
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
416
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
417
|
+
}>, Schema.Struct<{
|
|
418
|
+
readonly type: Schema.Literal<"seconds">;
|
|
419
|
+
readonly seconds: Schema.Number;
|
|
420
|
+
}>, Schema.Struct<{
|
|
421
|
+
readonly type: Schema.Literal<"characters">;
|
|
422
|
+
readonly characters: Schema.Number;
|
|
423
|
+
}>, Schema.Struct<{
|
|
424
|
+
readonly type: Schema.Literal<"credits">;
|
|
425
|
+
readonly credits: Schema.Number;
|
|
426
|
+
}>, Schema.Struct<{
|
|
427
|
+
readonly type: Schema.Literal<"compute">;
|
|
428
|
+
readonly seconds: Schema.Number;
|
|
429
|
+
}>]>>;
|
|
430
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
431
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
432
|
+
readonly message: Schema.String;
|
|
433
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
434
|
+
}>>>;
|
|
435
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
436
|
+
}>]>;
|
|
437
|
+
export declare const VideoEvent: Schema.Union<readonly [Schema.Struct<{
|
|
438
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
439
|
+
readonly id: Schema.String;
|
|
440
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
441
|
+
}>, Schema.Struct<{
|
|
442
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
443
|
+
readonly id: Schema.String;
|
|
444
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
445
|
+
}>, Schema.Struct<{
|
|
446
|
+
readonly type: Schema.tag<"video">;
|
|
447
|
+
readonly index: Schema.Number;
|
|
448
|
+
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
449
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
450
|
+
readonly type: Schema.Literal<"bytes">;
|
|
451
|
+
readonly data: Schema.Uint8Array;
|
|
452
|
+
readonly mediaType: Schema.String;
|
|
453
|
+
}>, Schema.Struct<{
|
|
454
|
+
readonly type: Schema.Literal<"base64">;
|
|
455
|
+
readonly data: Schema.String;
|
|
456
|
+
readonly mediaType: Schema.String;
|
|
457
|
+
}>, Schema.Struct<{
|
|
458
|
+
readonly type: Schema.Literal<"url">;
|
|
459
|
+
readonly url: Schema.String;
|
|
460
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
461
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
462
|
+
}>, Schema.Struct<{
|
|
463
|
+
readonly type: Schema.Literal<"ref">;
|
|
464
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
465
|
+
readonly id: Schema.String;
|
|
466
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
467
|
+
}>]>;
|
|
468
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
469
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
470
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
471
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
472
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
473
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
474
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
475
|
+
readonly format: Schema.optional<Schema.String>;
|
|
476
|
+
}>>;
|
|
477
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
478
|
+
}>, never, never>;
|
|
479
|
+
}>, Schema.Struct<{
|
|
480
|
+
readonly type: Schema.tag<"finish">;
|
|
481
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
482
|
+
readonly type: Schema.Literal<"tokens">;
|
|
483
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
484
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
485
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
486
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
487
|
+
}>, Schema.Struct<{
|
|
488
|
+
readonly type: Schema.Literal<"seconds">;
|
|
489
|
+
readonly seconds: Schema.Number;
|
|
490
|
+
}>, Schema.Struct<{
|
|
491
|
+
readonly type: Schema.Literal<"characters">;
|
|
492
|
+
readonly characters: Schema.Number;
|
|
493
|
+
}>, Schema.Struct<{
|
|
494
|
+
readonly type: Schema.Literal<"credits">;
|
|
495
|
+
readonly credits: Schema.Number;
|
|
496
|
+
}>, Schema.Struct<{
|
|
497
|
+
readonly type: Schema.Literal<"compute">;
|
|
498
|
+
readonly seconds: Schema.Number;
|
|
499
|
+
}>]>>;
|
|
500
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
501
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
502
|
+
readonly message: Schema.String;
|
|
503
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
504
|
+
}>>>;
|
|
505
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
506
|
+
}>]> & {
|
|
507
|
+
readonly discriminants: readonly ["generation-queued", "generation-progress", "video", "finish"];
|
|
508
|
+
readonly cases: {
|
|
509
|
+
"generation-queued": Schema.Struct<{
|
|
510
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
511
|
+
readonly id: Schema.String;
|
|
512
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
513
|
+
}>;
|
|
514
|
+
"generation-progress": Schema.Struct<{
|
|
515
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
516
|
+
readonly id: Schema.String;
|
|
517
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
518
|
+
}>;
|
|
519
|
+
video: Schema.Struct<{
|
|
520
|
+
readonly type: Schema.tag<"video">;
|
|
521
|
+
readonly index: Schema.Number;
|
|
522
|
+
readonly video: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
523
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
524
|
+
readonly type: Schema.Literal<"bytes">;
|
|
525
|
+
readonly data: Schema.Uint8Array;
|
|
526
|
+
readonly mediaType: Schema.String;
|
|
527
|
+
}>, Schema.Struct<{
|
|
528
|
+
readonly type: Schema.Literal<"base64">;
|
|
529
|
+
readonly data: Schema.String;
|
|
530
|
+
readonly mediaType: Schema.String;
|
|
531
|
+
}>, Schema.Struct<{
|
|
532
|
+
readonly type: Schema.Literal<"url">;
|
|
533
|
+
readonly url: Schema.String;
|
|
534
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
535
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
536
|
+
}>, Schema.Struct<{
|
|
537
|
+
readonly type: Schema.Literal<"ref">;
|
|
538
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
539
|
+
readonly id: Schema.String;
|
|
540
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
541
|
+
}>]>;
|
|
542
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
543
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
544
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
545
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
546
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
547
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
548
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
549
|
+
readonly format: Schema.optional<Schema.String>;
|
|
550
|
+
}>>;
|
|
551
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
552
|
+
}>, never, never>;
|
|
553
|
+
}>;
|
|
554
|
+
finish: Schema.Struct<{
|
|
555
|
+
readonly type: Schema.tag<"finish">;
|
|
556
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
557
|
+
readonly type: Schema.Literal<"tokens">;
|
|
558
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
559
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
560
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
561
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
562
|
+
}>, Schema.Struct<{
|
|
563
|
+
readonly type: Schema.Literal<"seconds">;
|
|
564
|
+
readonly seconds: Schema.Number;
|
|
565
|
+
}>, Schema.Struct<{
|
|
566
|
+
readonly type: Schema.Literal<"characters">;
|
|
567
|
+
readonly characters: Schema.Number;
|
|
568
|
+
}>, Schema.Struct<{
|
|
569
|
+
readonly type: Schema.Literal<"credits">;
|
|
570
|
+
readonly credits: Schema.Number;
|
|
571
|
+
}>, Schema.Struct<{
|
|
572
|
+
readonly type: Schema.Literal<"compute">;
|
|
573
|
+
readonly seconds: Schema.Number;
|
|
574
|
+
}>]>>;
|
|
575
|
+
readonly notices: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
576
|
+
readonly type: Schema.Literals<readonly ["moderated", "filtered", "other"]>;
|
|
577
|
+
readonly message: Schema.String;
|
|
578
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
579
|
+
}>>>;
|
|
580
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
581
|
+
}>;
|
|
582
|
+
};
|
|
583
|
+
readonly isAnyOf: <const Keys>(keys: readonly Keys[]) => (value: {
|
|
584
|
+
readonly id: string;
|
|
585
|
+
readonly type: "generation-queued";
|
|
586
|
+
readonly position?: number | undefined;
|
|
587
|
+
} | {
|
|
588
|
+
readonly id: string;
|
|
589
|
+
readonly type: "generation-progress";
|
|
590
|
+
readonly progress?: number | undefined;
|
|
591
|
+
} | {
|
|
592
|
+
readonly type: "video";
|
|
593
|
+
readonly index: number;
|
|
594
|
+
readonly video: Media.Asset;
|
|
595
|
+
} | {
|
|
596
|
+
readonly type: "finish";
|
|
597
|
+
readonly providerMetadata?: {
|
|
598
|
+
readonly [x: string]: {
|
|
599
|
+
readonly [x: string]: unknown;
|
|
600
|
+
};
|
|
601
|
+
} | undefined;
|
|
602
|
+
readonly usage?: {
|
|
603
|
+
readonly type: "tokens";
|
|
604
|
+
readonly input?: number | undefined;
|
|
605
|
+
readonly output?: number | undefined;
|
|
606
|
+
readonly total?: number | undefined;
|
|
607
|
+
readonly details?: {
|
|
608
|
+
readonly [x: string]: unknown;
|
|
609
|
+
} | undefined;
|
|
610
|
+
} | {
|
|
611
|
+
readonly type: "seconds";
|
|
612
|
+
readonly seconds: number;
|
|
613
|
+
} | {
|
|
614
|
+
readonly type: "characters";
|
|
615
|
+
readonly characters: number;
|
|
616
|
+
} | {
|
|
617
|
+
readonly type: "credits";
|
|
618
|
+
readonly credits: number;
|
|
619
|
+
} | {
|
|
620
|
+
readonly type: "compute";
|
|
621
|
+
readonly seconds: number;
|
|
622
|
+
} | undefined;
|
|
623
|
+
readonly notices?: readonly {
|
|
624
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
625
|
+
readonly message: string;
|
|
626
|
+
readonly providerMetadata?: {
|
|
627
|
+
readonly [x: string]: {
|
|
628
|
+
readonly [x: string]: unknown;
|
|
629
|
+
};
|
|
630
|
+
} | undefined;
|
|
631
|
+
}[] | undefined;
|
|
632
|
+
}) => value is Extract<{
|
|
633
|
+
readonly id: string;
|
|
634
|
+
readonly type: "generation-queued";
|
|
635
|
+
readonly position?: number | undefined;
|
|
636
|
+
}, {
|
|
637
|
+
readonly type: Keys;
|
|
638
|
+
}> | Extract<{
|
|
639
|
+
readonly id: string;
|
|
640
|
+
readonly type: "generation-progress";
|
|
641
|
+
readonly progress?: number | undefined;
|
|
642
|
+
}, {
|
|
643
|
+
readonly type: Keys;
|
|
644
|
+
}> | Extract<{
|
|
645
|
+
readonly type: "video";
|
|
646
|
+
readonly index: number;
|
|
647
|
+
readonly video: Media.Asset;
|
|
648
|
+
}, {
|
|
649
|
+
readonly type: Keys;
|
|
650
|
+
}> | Extract<{
|
|
651
|
+
readonly type: "finish";
|
|
652
|
+
readonly providerMetadata?: {
|
|
653
|
+
readonly [x: string]: {
|
|
654
|
+
readonly [x: string]: unknown;
|
|
655
|
+
};
|
|
656
|
+
} | undefined;
|
|
657
|
+
readonly usage?: {
|
|
658
|
+
readonly type: "tokens";
|
|
659
|
+
readonly input?: number | undefined;
|
|
660
|
+
readonly output?: number | undefined;
|
|
661
|
+
readonly total?: number | undefined;
|
|
662
|
+
readonly details?: {
|
|
663
|
+
readonly [x: string]: unknown;
|
|
664
|
+
} | undefined;
|
|
665
|
+
} | {
|
|
666
|
+
readonly type: "seconds";
|
|
667
|
+
readonly seconds: number;
|
|
668
|
+
} | {
|
|
669
|
+
readonly type: "characters";
|
|
670
|
+
readonly characters: number;
|
|
671
|
+
} | {
|
|
672
|
+
readonly type: "credits";
|
|
673
|
+
readonly credits: number;
|
|
674
|
+
} | {
|
|
675
|
+
readonly type: "compute";
|
|
676
|
+
readonly seconds: number;
|
|
677
|
+
} | undefined;
|
|
678
|
+
readonly notices?: readonly {
|
|
679
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
680
|
+
readonly message: string;
|
|
681
|
+
readonly providerMetadata?: {
|
|
682
|
+
readonly [x: string]: {
|
|
683
|
+
readonly [x: string]: unknown;
|
|
684
|
+
};
|
|
685
|
+
} | undefined;
|
|
686
|
+
}[] | undefined;
|
|
687
|
+
}, {
|
|
688
|
+
readonly type: Keys;
|
|
689
|
+
}>;
|
|
690
|
+
readonly guards: {
|
|
691
|
+
"generation-queued": (u: unknown) => u is {
|
|
692
|
+
readonly id: string;
|
|
693
|
+
readonly type: "generation-queued";
|
|
694
|
+
readonly position?: number | undefined;
|
|
695
|
+
};
|
|
696
|
+
"generation-progress": (u: unknown) => u is {
|
|
697
|
+
readonly id: string;
|
|
698
|
+
readonly type: "generation-progress";
|
|
699
|
+
readonly progress?: number | undefined;
|
|
700
|
+
};
|
|
701
|
+
video: (u: unknown) => u is {
|
|
702
|
+
readonly type: "video";
|
|
703
|
+
readonly index: number;
|
|
704
|
+
readonly video: Media.Asset;
|
|
705
|
+
};
|
|
706
|
+
finish: (u: unknown) => u is {
|
|
707
|
+
readonly type: "finish";
|
|
708
|
+
readonly providerMetadata?: {
|
|
709
|
+
readonly [x: string]: {
|
|
710
|
+
readonly [x: string]: unknown;
|
|
711
|
+
};
|
|
712
|
+
} | undefined;
|
|
713
|
+
readonly usage?: {
|
|
714
|
+
readonly type: "tokens";
|
|
715
|
+
readonly input?: number | undefined;
|
|
716
|
+
readonly output?: number | undefined;
|
|
717
|
+
readonly total?: number | undefined;
|
|
718
|
+
readonly details?: {
|
|
719
|
+
readonly [x: string]: unknown;
|
|
720
|
+
} | undefined;
|
|
721
|
+
} | {
|
|
722
|
+
readonly type: "seconds";
|
|
723
|
+
readonly seconds: number;
|
|
724
|
+
} | {
|
|
725
|
+
readonly type: "characters";
|
|
726
|
+
readonly characters: number;
|
|
727
|
+
} | {
|
|
728
|
+
readonly type: "credits";
|
|
729
|
+
readonly credits: number;
|
|
730
|
+
} | {
|
|
731
|
+
readonly type: "compute";
|
|
732
|
+
readonly seconds: number;
|
|
733
|
+
} | undefined;
|
|
734
|
+
readonly notices?: readonly {
|
|
735
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
736
|
+
readonly message: string;
|
|
737
|
+
readonly providerMetadata?: {
|
|
738
|
+
readonly [x: string]: {
|
|
739
|
+
readonly [x: string]: unknown;
|
|
740
|
+
};
|
|
741
|
+
} | undefined;
|
|
742
|
+
}[] | undefined;
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
readonly match: {
|
|
746
|
+
<Cases extends {
|
|
747
|
+
"generation-queued": (value: {
|
|
748
|
+
readonly id: string;
|
|
749
|
+
readonly type: "generation-queued";
|
|
750
|
+
readonly position?: number | undefined;
|
|
751
|
+
}) => any;
|
|
752
|
+
"generation-progress": (value: {
|
|
753
|
+
readonly id: string;
|
|
754
|
+
readonly type: "generation-progress";
|
|
755
|
+
readonly progress?: number | undefined;
|
|
756
|
+
}) => any;
|
|
757
|
+
video: (value: {
|
|
758
|
+
readonly type: "video";
|
|
759
|
+
readonly index: number;
|
|
760
|
+
readonly video: Media.Asset;
|
|
761
|
+
}) => any;
|
|
762
|
+
finish: (value: {
|
|
763
|
+
readonly type: "finish";
|
|
764
|
+
readonly providerMetadata?: {
|
|
765
|
+
readonly [x: string]: {
|
|
766
|
+
readonly [x: string]: unknown;
|
|
767
|
+
};
|
|
768
|
+
} | undefined;
|
|
769
|
+
readonly usage?: {
|
|
770
|
+
readonly type: "tokens";
|
|
771
|
+
readonly input?: number | undefined;
|
|
772
|
+
readonly output?: number | undefined;
|
|
773
|
+
readonly total?: number | undefined;
|
|
774
|
+
readonly details?: {
|
|
775
|
+
readonly [x: string]: unknown;
|
|
776
|
+
} | undefined;
|
|
777
|
+
} | {
|
|
778
|
+
readonly type: "seconds";
|
|
779
|
+
readonly seconds: number;
|
|
780
|
+
} | {
|
|
781
|
+
readonly type: "characters";
|
|
782
|
+
readonly characters: number;
|
|
783
|
+
} | {
|
|
784
|
+
readonly type: "credits";
|
|
785
|
+
readonly credits: number;
|
|
786
|
+
} | {
|
|
787
|
+
readonly type: "compute";
|
|
788
|
+
readonly seconds: number;
|
|
789
|
+
} | undefined;
|
|
790
|
+
readonly notices?: readonly {
|
|
791
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
792
|
+
readonly message: string;
|
|
793
|
+
readonly providerMetadata?: {
|
|
794
|
+
readonly [x: string]: {
|
|
795
|
+
readonly [x: string]: unknown;
|
|
796
|
+
};
|
|
797
|
+
} | undefined;
|
|
798
|
+
}[] | undefined;
|
|
799
|
+
}) => any;
|
|
800
|
+
}>(value: {
|
|
801
|
+
readonly id: string;
|
|
802
|
+
readonly type: "generation-queued";
|
|
803
|
+
readonly position?: number | undefined;
|
|
804
|
+
} | {
|
|
805
|
+
readonly id: string;
|
|
806
|
+
readonly type: "generation-progress";
|
|
807
|
+
readonly progress?: number | undefined;
|
|
808
|
+
} | {
|
|
809
|
+
readonly type: "video";
|
|
810
|
+
readonly index: number;
|
|
811
|
+
readonly video: Media.Asset;
|
|
812
|
+
} | {
|
|
813
|
+
readonly type: "finish";
|
|
814
|
+
readonly providerMetadata?: {
|
|
815
|
+
readonly [x: string]: {
|
|
816
|
+
readonly [x: string]: unknown;
|
|
817
|
+
};
|
|
818
|
+
} | undefined;
|
|
819
|
+
readonly usage?: {
|
|
820
|
+
readonly type: "tokens";
|
|
821
|
+
readonly input?: number | undefined;
|
|
822
|
+
readonly output?: number | undefined;
|
|
823
|
+
readonly total?: number | undefined;
|
|
824
|
+
readonly details?: {
|
|
825
|
+
readonly [x: string]: unknown;
|
|
826
|
+
} | undefined;
|
|
827
|
+
} | {
|
|
828
|
+
readonly type: "seconds";
|
|
829
|
+
readonly seconds: number;
|
|
830
|
+
} | {
|
|
831
|
+
readonly type: "characters";
|
|
832
|
+
readonly characters: number;
|
|
833
|
+
} | {
|
|
834
|
+
readonly type: "credits";
|
|
835
|
+
readonly credits: number;
|
|
836
|
+
} | {
|
|
837
|
+
readonly type: "compute";
|
|
838
|
+
readonly seconds: number;
|
|
839
|
+
} | undefined;
|
|
840
|
+
readonly notices?: readonly {
|
|
841
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
842
|
+
readonly message: string;
|
|
843
|
+
readonly providerMetadata?: {
|
|
844
|
+
readonly [x: string]: {
|
|
845
|
+
readonly [x: string]: unknown;
|
|
846
|
+
};
|
|
847
|
+
} | undefined;
|
|
848
|
+
}[] | undefined;
|
|
849
|
+
}, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
|
|
850
|
+
<Cases extends {
|
|
851
|
+
"generation-queued": (value: {
|
|
852
|
+
readonly id: string;
|
|
853
|
+
readonly type: "generation-queued";
|
|
854
|
+
readonly position?: number | undefined;
|
|
855
|
+
}) => any;
|
|
856
|
+
"generation-progress": (value: {
|
|
857
|
+
readonly id: string;
|
|
858
|
+
readonly type: "generation-progress";
|
|
859
|
+
readonly progress?: number | undefined;
|
|
860
|
+
}) => any;
|
|
861
|
+
video: (value: {
|
|
862
|
+
readonly type: "video";
|
|
863
|
+
readonly index: number;
|
|
864
|
+
readonly video: Media.Asset;
|
|
865
|
+
}) => any;
|
|
866
|
+
finish: (value: {
|
|
867
|
+
readonly type: "finish";
|
|
868
|
+
readonly providerMetadata?: {
|
|
869
|
+
readonly [x: string]: {
|
|
870
|
+
readonly [x: string]: unknown;
|
|
871
|
+
};
|
|
872
|
+
} | undefined;
|
|
873
|
+
readonly usage?: {
|
|
874
|
+
readonly type: "tokens";
|
|
875
|
+
readonly input?: number | undefined;
|
|
876
|
+
readonly output?: number | undefined;
|
|
877
|
+
readonly total?: number | undefined;
|
|
878
|
+
readonly details?: {
|
|
879
|
+
readonly [x: string]: unknown;
|
|
880
|
+
} | undefined;
|
|
881
|
+
} | {
|
|
882
|
+
readonly type: "seconds";
|
|
883
|
+
readonly seconds: number;
|
|
884
|
+
} | {
|
|
885
|
+
readonly type: "characters";
|
|
886
|
+
readonly characters: number;
|
|
887
|
+
} | {
|
|
888
|
+
readonly type: "credits";
|
|
889
|
+
readonly credits: number;
|
|
890
|
+
} | {
|
|
891
|
+
readonly type: "compute";
|
|
892
|
+
readonly seconds: number;
|
|
893
|
+
} | undefined;
|
|
894
|
+
readonly notices?: readonly {
|
|
895
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
896
|
+
readonly message: string;
|
|
897
|
+
readonly providerMetadata?: {
|
|
898
|
+
readonly [x: string]: {
|
|
899
|
+
readonly [x: string]: unknown;
|
|
900
|
+
};
|
|
901
|
+
} | undefined;
|
|
902
|
+
}[] | undefined;
|
|
903
|
+
}) => any;
|
|
904
|
+
}>(cases: Cases): (value: {
|
|
905
|
+
readonly id: string;
|
|
906
|
+
readonly type: "generation-queued";
|
|
907
|
+
readonly position?: number | undefined;
|
|
908
|
+
} | {
|
|
909
|
+
readonly id: string;
|
|
910
|
+
readonly type: "generation-progress";
|
|
911
|
+
readonly progress?: number | undefined;
|
|
912
|
+
} | {
|
|
913
|
+
readonly type: "video";
|
|
914
|
+
readonly index: number;
|
|
915
|
+
readonly video: Media.Asset;
|
|
916
|
+
} | {
|
|
917
|
+
readonly type: "finish";
|
|
918
|
+
readonly providerMetadata?: {
|
|
919
|
+
readonly [x: string]: {
|
|
920
|
+
readonly [x: string]: unknown;
|
|
921
|
+
};
|
|
922
|
+
} | undefined;
|
|
923
|
+
readonly usage?: {
|
|
924
|
+
readonly type: "tokens";
|
|
925
|
+
readonly input?: number | undefined;
|
|
926
|
+
readonly output?: number | undefined;
|
|
927
|
+
readonly total?: number | undefined;
|
|
928
|
+
readonly details?: {
|
|
929
|
+
readonly [x: string]: unknown;
|
|
930
|
+
} | undefined;
|
|
931
|
+
} | {
|
|
932
|
+
readonly type: "seconds";
|
|
933
|
+
readonly seconds: number;
|
|
934
|
+
} | {
|
|
935
|
+
readonly type: "characters";
|
|
936
|
+
readonly characters: number;
|
|
937
|
+
} | {
|
|
938
|
+
readonly type: "credits";
|
|
939
|
+
readonly credits: number;
|
|
940
|
+
} | {
|
|
941
|
+
readonly type: "compute";
|
|
942
|
+
readonly seconds: number;
|
|
943
|
+
} | undefined;
|
|
944
|
+
readonly notices?: readonly {
|
|
945
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
946
|
+
readonly message: string;
|
|
947
|
+
readonly providerMetadata?: {
|
|
948
|
+
readonly [x: string]: {
|
|
949
|
+
readonly [x: string]: unknown;
|
|
950
|
+
};
|
|
951
|
+
} | undefined;
|
|
952
|
+
}[] | undefined;
|
|
953
|
+
}) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
|
|
954
|
+
};
|
|
955
|
+
readonly matchOrElse: {
|
|
956
|
+
<Cases extends {
|
|
957
|
+
"generation-queued"?: ((value: {
|
|
958
|
+
readonly id: string;
|
|
959
|
+
readonly type: "generation-queued";
|
|
960
|
+
readonly position?: number | undefined;
|
|
961
|
+
}) => any) | undefined;
|
|
962
|
+
"generation-progress"?: ((value: {
|
|
963
|
+
readonly id: string;
|
|
964
|
+
readonly type: "generation-progress";
|
|
965
|
+
readonly progress?: number | undefined;
|
|
966
|
+
}) => any) | undefined;
|
|
967
|
+
video?: ((value: {
|
|
968
|
+
readonly type: "video";
|
|
969
|
+
readonly index: number;
|
|
970
|
+
readonly video: Media.Asset;
|
|
971
|
+
}) => any) | undefined;
|
|
972
|
+
finish?: ((value: {
|
|
973
|
+
readonly type: "finish";
|
|
974
|
+
readonly providerMetadata?: {
|
|
975
|
+
readonly [x: string]: {
|
|
976
|
+
readonly [x: string]: unknown;
|
|
977
|
+
};
|
|
978
|
+
} | undefined;
|
|
979
|
+
readonly usage?: {
|
|
980
|
+
readonly type: "tokens";
|
|
981
|
+
readonly input?: number | undefined;
|
|
982
|
+
readonly output?: number | undefined;
|
|
983
|
+
readonly total?: number | undefined;
|
|
984
|
+
readonly details?: {
|
|
985
|
+
readonly [x: string]: unknown;
|
|
986
|
+
} | undefined;
|
|
987
|
+
} | {
|
|
988
|
+
readonly type: "seconds";
|
|
989
|
+
readonly seconds: number;
|
|
990
|
+
} | {
|
|
991
|
+
readonly type: "characters";
|
|
992
|
+
readonly characters: number;
|
|
993
|
+
} | {
|
|
994
|
+
readonly type: "credits";
|
|
995
|
+
readonly credits: number;
|
|
996
|
+
} | {
|
|
997
|
+
readonly type: "compute";
|
|
998
|
+
readonly seconds: number;
|
|
999
|
+
} | undefined;
|
|
1000
|
+
readonly notices?: readonly {
|
|
1001
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1002
|
+
readonly message: string;
|
|
1003
|
+
readonly providerMetadata?: {
|
|
1004
|
+
readonly [x: string]: {
|
|
1005
|
+
readonly [x: string]: unknown;
|
|
1006
|
+
};
|
|
1007
|
+
} | undefined;
|
|
1008
|
+
}[] | undefined;
|
|
1009
|
+
}) => any) | undefined;
|
|
1010
|
+
} & { [K in Exclude<keyof Cases, "finish" | "generation-queued" | "generation-progress" | "video">]: never; }, OrElse extends (value: Exclude<{
|
|
1011
|
+
readonly id: string;
|
|
1012
|
+
readonly type: "generation-queued";
|
|
1013
|
+
readonly position?: number | undefined;
|
|
1014
|
+
}, {
|
|
1015
|
+
readonly type: keyof Cases;
|
|
1016
|
+
}> | Exclude<{
|
|
1017
|
+
readonly id: string;
|
|
1018
|
+
readonly type: "generation-progress";
|
|
1019
|
+
readonly progress?: number | undefined;
|
|
1020
|
+
}, {
|
|
1021
|
+
readonly type: keyof Cases;
|
|
1022
|
+
}> | Exclude<{
|
|
1023
|
+
readonly type: "video";
|
|
1024
|
+
readonly index: number;
|
|
1025
|
+
readonly video: Media.Asset;
|
|
1026
|
+
}, {
|
|
1027
|
+
readonly type: keyof Cases;
|
|
1028
|
+
}> | Exclude<{
|
|
1029
|
+
readonly type: "finish";
|
|
1030
|
+
readonly providerMetadata?: {
|
|
1031
|
+
readonly [x: string]: {
|
|
1032
|
+
readonly [x: string]: unknown;
|
|
1033
|
+
};
|
|
1034
|
+
} | undefined;
|
|
1035
|
+
readonly usage?: {
|
|
1036
|
+
readonly type: "tokens";
|
|
1037
|
+
readonly input?: number | undefined;
|
|
1038
|
+
readonly output?: number | undefined;
|
|
1039
|
+
readonly total?: number | undefined;
|
|
1040
|
+
readonly details?: {
|
|
1041
|
+
readonly [x: string]: unknown;
|
|
1042
|
+
} | undefined;
|
|
1043
|
+
} | {
|
|
1044
|
+
readonly type: "seconds";
|
|
1045
|
+
readonly seconds: number;
|
|
1046
|
+
} | {
|
|
1047
|
+
readonly type: "characters";
|
|
1048
|
+
readonly characters: number;
|
|
1049
|
+
} | {
|
|
1050
|
+
readonly type: "credits";
|
|
1051
|
+
readonly credits: number;
|
|
1052
|
+
} | {
|
|
1053
|
+
readonly type: "compute";
|
|
1054
|
+
readonly seconds: number;
|
|
1055
|
+
} | undefined;
|
|
1056
|
+
readonly notices?: readonly {
|
|
1057
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1058
|
+
readonly message: string;
|
|
1059
|
+
readonly providerMetadata?: {
|
|
1060
|
+
readonly [x: string]: {
|
|
1061
|
+
readonly [x: string]: unknown;
|
|
1062
|
+
};
|
|
1063
|
+
} | undefined;
|
|
1064
|
+
}[] | undefined;
|
|
1065
|
+
}, {
|
|
1066
|
+
readonly type: keyof Cases;
|
|
1067
|
+
}>) => any>(value: {
|
|
1068
|
+
readonly id: string;
|
|
1069
|
+
readonly type: "generation-queued";
|
|
1070
|
+
readonly position?: number | undefined;
|
|
1071
|
+
} | {
|
|
1072
|
+
readonly id: string;
|
|
1073
|
+
readonly type: "generation-progress";
|
|
1074
|
+
readonly progress?: number | undefined;
|
|
1075
|
+
} | {
|
|
1076
|
+
readonly type: "video";
|
|
1077
|
+
readonly index: number;
|
|
1078
|
+
readonly video: Media.Asset;
|
|
1079
|
+
} | {
|
|
1080
|
+
readonly type: "finish";
|
|
1081
|
+
readonly providerMetadata?: {
|
|
1082
|
+
readonly [x: string]: {
|
|
1083
|
+
readonly [x: string]: unknown;
|
|
1084
|
+
};
|
|
1085
|
+
} | undefined;
|
|
1086
|
+
readonly usage?: {
|
|
1087
|
+
readonly type: "tokens";
|
|
1088
|
+
readonly input?: number | undefined;
|
|
1089
|
+
readonly output?: number | undefined;
|
|
1090
|
+
readonly total?: number | undefined;
|
|
1091
|
+
readonly details?: {
|
|
1092
|
+
readonly [x: string]: unknown;
|
|
1093
|
+
} | undefined;
|
|
1094
|
+
} | {
|
|
1095
|
+
readonly type: "seconds";
|
|
1096
|
+
readonly seconds: number;
|
|
1097
|
+
} | {
|
|
1098
|
+
readonly type: "characters";
|
|
1099
|
+
readonly characters: number;
|
|
1100
|
+
} | {
|
|
1101
|
+
readonly type: "credits";
|
|
1102
|
+
readonly credits: number;
|
|
1103
|
+
} | {
|
|
1104
|
+
readonly type: "compute";
|
|
1105
|
+
readonly seconds: number;
|
|
1106
|
+
} | undefined;
|
|
1107
|
+
readonly notices?: readonly {
|
|
1108
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1109
|
+
readonly message: string;
|
|
1110
|
+
readonly providerMetadata?: {
|
|
1111
|
+
readonly [x: string]: {
|
|
1112
|
+
readonly [x: string]: unknown;
|
|
1113
|
+
};
|
|
1114
|
+
} | undefined;
|
|
1115
|
+
}[] | undefined;
|
|
1116
|
+
}, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
|
|
1117
|
+
<Cases extends {
|
|
1118
|
+
"generation-queued"?: ((value: {
|
|
1119
|
+
readonly id: string;
|
|
1120
|
+
readonly type: "generation-queued";
|
|
1121
|
+
readonly position?: number | undefined;
|
|
1122
|
+
}) => any) | undefined;
|
|
1123
|
+
"generation-progress"?: ((value: {
|
|
1124
|
+
readonly id: string;
|
|
1125
|
+
readonly type: "generation-progress";
|
|
1126
|
+
readonly progress?: number | undefined;
|
|
1127
|
+
}) => any) | undefined;
|
|
1128
|
+
video?: ((value: {
|
|
1129
|
+
readonly type: "video";
|
|
1130
|
+
readonly index: number;
|
|
1131
|
+
readonly video: Media.Asset;
|
|
1132
|
+
}) => any) | undefined;
|
|
1133
|
+
finish?: ((value: {
|
|
1134
|
+
readonly type: "finish";
|
|
1135
|
+
readonly providerMetadata?: {
|
|
1136
|
+
readonly [x: string]: {
|
|
1137
|
+
readonly [x: string]: unknown;
|
|
1138
|
+
};
|
|
1139
|
+
} | undefined;
|
|
1140
|
+
readonly usage?: {
|
|
1141
|
+
readonly type: "tokens";
|
|
1142
|
+
readonly input?: number | undefined;
|
|
1143
|
+
readonly output?: number | undefined;
|
|
1144
|
+
readonly total?: number | undefined;
|
|
1145
|
+
readonly details?: {
|
|
1146
|
+
readonly [x: string]: unknown;
|
|
1147
|
+
} | undefined;
|
|
1148
|
+
} | {
|
|
1149
|
+
readonly type: "seconds";
|
|
1150
|
+
readonly seconds: number;
|
|
1151
|
+
} | {
|
|
1152
|
+
readonly type: "characters";
|
|
1153
|
+
readonly characters: number;
|
|
1154
|
+
} | {
|
|
1155
|
+
readonly type: "credits";
|
|
1156
|
+
readonly credits: number;
|
|
1157
|
+
} | {
|
|
1158
|
+
readonly type: "compute";
|
|
1159
|
+
readonly seconds: number;
|
|
1160
|
+
} | undefined;
|
|
1161
|
+
readonly notices?: readonly {
|
|
1162
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1163
|
+
readonly message: string;
|
|
1164
|
+
readonly providerMetadata?: {
|
|
1165
|
+
readonly [x: string]: {
|
|
1166
|
+
readonly [x: string]: unknown;
|
|
1167
|
+
};
|
|
1168
|
+
} | undefined;
|
|
1169
|
+
}[] | undefined;
|
|
1170
|
+
}) => any) | undefined;
|
|
1171
|
+
} & { [K in Exclude<keyof Cases, "finish" | "generation-queued" | "generation-progress" | "video">]: never; }, OrElse extends (value: Exclude<{
|
|
1172
|
+
readonly id: string;
|
|
1173
|
+
readonly type: "generation-queued";
|
|
1174
|
+
readonly position?: number | undefined;
|
|
1175
|
+
}, {
|
|
1176
|
+
readonly type: keyof Cases;
|
|
1177
|
+
}> | Exclude<{
|
|
1178
|
+
readonly id: string;
|
|
1179
|
+
readonly type: "generation-progress";
|
|
1180
|
+
readonly progress?: number | undefined;
|
|
1181
|
+
}, {
|
|
1182
|
+
readonly type: keyof Cases;
|
|
1183
|
+
}> | Exclude<{
|
|
1184
|
+
readonly type: "video";
|
|
1185
|
+
readonly index: number;
|
|
1186
|
+
readonly video: Media.Asset;
|
|
1187
|
+
}, {
|
|
1188
|
+
readonly type: keyof Cases;
|
|
1189
|
+
}> | Exclude<{
|
|
1190
|
+
readonly type: "finish";
|
|
1191
|
+
readonly providerMetadata?: {
|
|
1192
|
+
readonly [x: string]: {
|
|
1193
|
+
readonly [x: string]: unknown;
|
|
1194
|
+
};
|
|
1195
|
+
} | undefined;
|
|
1196
|
+
readonly usage?: {
|
|
1197
|
+
readonly type: "tokens";
|
|
1198
|
+
readonly input?: number | undefined;
|
|
1199
|
+
readonly output?: number | undefined;
|
|
1200
|
+
readonly total?: number | undefined;
|
|
1201
|
+
readonly details?: {
|
|
1202
|
+
readonly [x: string]: unknown;
|
|
1203
|
+
} | undefined;
|
|
1204
|
+
} | {
|
|
1205
|
+
readonly type: "seconds";
|
|
1206
|
+
readonly seconds: number;
|
|
1207
|
+
} | {
|
|
1208
|
+
readonly type: "characters";
|
|
1209
|
+
readonly characters: number;
|
|
1210
|
+
} | {
|
|
1211
|
+
readonly type: "credits";
|
|
1212
|
+
readonly credits: number;
|
|
1213
|
+
} | {
|
|
1214
|
+
readonly type: "compute";
|
|
1215
|
+
readonly seconds: number;
|
|
1216
|
+
} | undefined;
|
|
1217
|
+
readonly notices?: readonly {
|
|
1218
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1219
|
+
readonly message: string;
|
|
1220
|
+
readonly providerMetadata?: {
|
|
1221
|
+
readonly [x: string]: {
|
|
1222
|
+
readonly [x: string]: unknown;
|
|
1223
|
+
};
|
|
1224
|
+
} | undefined;
|
|
1225
|
+
}[] | undefined;
|
|
1226
|
+
}, {
|
|
1227
|
+
readonly type: keyof Cases;
|
|
1228
|
+
}>) => any>(cases: Cases, orElse: OrElse): (value: {
|
|
1229
|
+
readonly id: string;
|
|
1230
|
+
readonly type: "generation-queued";
|
|
1231
|
+
readonly position?: number | undefined;
|
|
1232
|
+
} | {
|
|
1233
|
+
readonly id: string;
|
|
1234
|
+
readonly type: "generation-progress";
|
|
1235
|
+
readonly progress?: number | undefined;
|
|
1236
|
+
} | {
|
|
1237
|
+
readonly type: "video";
|
|
1238
|
+
readonly index: number;
|
|
1239
|
+
readonly video: Media.Asset;
|
|
1240
|
+
} | {
|
|
1241
|
+
readonly type: "finish";
|
|
1242
|
+
readonly providerMetadata?: {
|
|
1243
|
+
readonly [x: string]: {
|
|
1244
|
+
readonly [x: string]: unknown;
|
|
1245
|
+
};
|
|
1246
|
+
} | undefined;
|
|
1247
|
+
readonly usage?: {
|
|
1248
|
+
readonly type: "tokens";
|
|
1249
|
+
readonly input?: number | undefined;
|
|
1250
|
+
readonly output?: number | undefined;
|
|
1251
|
+
readonly total?: number | undefined;
|
|
1252
|
+
readonly details?: {
|
|
1253
|
+
readonly [x: string]: unknown;
|
|
1254
|
+
} | undefined;
|
|
1255
|
+
} | {
|
|
1256
|
+
readonly type: "seconds";
|
|
1257
|
+
readonly seconds: number;
|
|
1258
|
+
} | {
|
|
1259
|
+
readonly type: "characters";
|
|
1260
|
+
readonly characters: number;
|
|
1261
|
+
} | {
|
|
1262
|
+
readonly type: "credits";
|
|
1263
|
+
readonly credits: number;
|
|
1264
|
+
} | {
|
|
1265
|
+
readonly type: "compute";
|
|
1266
|
+
readonly seconds: number;
|
|
1267
|
+
} | undefined;
|
|
1268
|
+
readonly notices?: readonly {
|
|
1269
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1270
|
+
readonly message: string;
|
|
1271
|
+
readonly providerMetadata?: {
|
|
1272
|
+
readonly [x: string]: {
|
|
1273
|
+
readonly [x: string]: unknown;
|
|
1274
|
+
};
|
|
1275
|
+
} | undefined;
|
|
1276
|
+
}[] | undefined;
|
|
1277
|
+
}) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
|
|
1278
|
+
};
|
|
1279
|
+
} & {
|
|
1280
|
+
is: {
|
|
1281
|
+
generationQueued: (u: unknown) => u is {
|
|
1282
|
+
readonly id: string;
|
|
1283
|
+
readonly type: "generation-queued";
|
|
1284
|
+
readonly position?: number | undefined;
|
|
1285
|
+
};
|
|
1286
|
+
generationProgress: (u: unknown) => u is {
|
|
1287
|
+
readonly id: string;
|
|
1288
|
+
readonly type: "generation-progress";
|
|
1289
|
+
readonly progress?: number | undefined;
|
|
1290
|
+
};
|
|
1291
|
+
video: (u: unknown) => u is {
|
|
1292
|
+
readonly type: "video";
|
|
1293
|
+
readonly index: number;
|
|
1294
|
+
readonly video: Media.Asset;
|
|
1295
|
+
};
|
|
1296
|
+
finish: (u: unknown) => u is {
|
|
1297
|
+
readonly type: "finish";
|
|
1298
|
+
readonly providerMetadata?: {
|
|
1299
|
+
readonly [x: string]: {
|
|
1300
|
+
readonly [x: string]: unknown;
|
|
1301
|
+
};
|
|
1302
|
+
} | undefined;
|
|
1303
|
+
readonly usage?: {
|
|
1304
|
+
readonly type: "tokens";
|
|
1305
|
+
readonly input?: number | undefined;
|
|
1306
|
+
readonly output?: number | undefined;
|
|
1307
|
+
readonly total?: number | undefined;
|
|
1308
|
+
readonly details?: {
|
|
1309
|
+
readonly [x: string]: unknown;
|
|
1310
|
+
} | undefined;
|
|
1311
|
+
} | {
|
|
1312
|
+
readonly type: "seconds";
|
|
1313
|
+
readonly seconds: number;
|
|
1314
|
+
} | {
|
|
1315
|
+
readonly type: "characters";
|
|
1316
|
+
readonly characters: number;
|
|
1317
|
+
} | {
|
|
1318
|
+
readonly type: "credits";
|
|
1319
|
+
readonly credits: number;
|
|
1320
|
+
} | {
|
|
1321
|
+
readonly type: "compute";
|
|
1322
|
+
readonly seconds: number;
|
|
1323
|
+
} | undefined;
|
|
1324
|
+
readonly notices?: readonly {
|
|
1325
|
+
readonly type: "other" | "moderated" | "filtered";
|
|
1326
|
+
readonly message: string;
|
|
1327
|
+
readonly providerMetadata?: {
|
|
1328
|
+
readonly [x: string]: {
|
|
1329
|
+
readonly [x: string]: unknown;
|
|
1330
|
+
};
|
|
1331
|
+
} | undefined;
|
|
1332
|
+
}[] | undefined;
|
|
1333
|
+
};
|
|
1334
|
+
};
|
|
1335
|
+
};
|
|
1336
|
+
export type VideoEvent = Schema.Schema.Type<typeof videoEventTagged>;
|
|
1337
|
+
export declare function request<const Model extends VideoModel>(input: VideoRequestInput<Model>): VideoRequestFor<VideoModelOptions<Model>>;
|
|
1338
|
+
export declare function request(input: VideoRequest): VideoRequest;
|
|
1339
|
+
export declare function start<const Model extends VideoModel>(input: VideoRequest | VideoRequestInput<Model>): Effect.Effect<Generation<VideoResponse>, AIError, Service>;
|
|
1340
|
+
export declare function generate<const Model extends VideoModel>(input: VideoRequest | VideoRequestInput<Model>, options?: AwaitOptions): Effect.Effect<VideoResponse, AIError, Service>;
|
|
1341
|
+
/** Rebuild a generation handle from a persisted `Generation.token`, refreshing its status once. */
|
|
1342
|
+
export declare const resume: (model: VideoModel, token: unknown) => Effect.Effect<Generation<VideoResponse>, AIError, Service>;
|
|
1343
|
+
export declare function stream<const Model extends VideoModel>(input: VideoRequest | VideoRequestInput<Model>, options?: AwaitOptions): Stream.Stream<VideoEvent, AIError, Service>;
|
|
1344
|
+
export declare const Video: {
|
|
1345
|
+
readonly request: typeof request;
|
|
1346
|
+
readonly start: typeof start;
|
|
1347
|
+
readonly generate: typeof generate;
|
|
1348
|
+
readonly resume: (model: VideoModel, token: unknown) => Effect.Effect<Generation<VideoResponse>, AIError, Service>;
|
|
1349
|
+
readonly stream: typeof stream;
|
|
1350
|
+
};
|
|
1351
|
+
export {};
|