@opencode/ai 2.2.5 → 2.2.7
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 +228 -72
- package/dist/ai-client.d.ts +2 -2
- package/dist/ai-client.js +2 -1
- package/dist/cache-policy.d.ts +1 -1
- package/dist/cache-policy.js +16 -4
- package/dist/decision-client.d.ts +3 -3
- package/dist/decision.d.ts +30 -125
- package/dist/decision.js +27 -15
- package/dist/effect.d.ts +10 -15
- package/dist/effect.js +6 -6
- package/dist/effort-updates.d.ts +3 -3
- package/dist/effort-updates.js +2 -2
- package/dist/embedding-client.d.ts +21 -0
- package/dist/embedding-client.js +30 -0
- package/dist/embedding.d.ts +111 -0
- package/dist/embedding.js +75 -0
- package/dist/experimental/cloudflare-run-extraction.d.ts +7 -3
- package/dist/experimental/cloudflare-run-extraction.js +4 -1
- package/dist/experimental/extraction.d.ts +10 -40
- package/dist/experimental/extraction.js +14 -13
- package/dist/experimental.d.ts +8 -8
- package/dist/experimental.js +4 -4
- package/dist/generation.d.ts +0 -2
- package/dist/generation.js +2 -2
- package/dist/image-client.d.ts +13 -7
- package/dist/image-client.js +1 -1
- package/dist/image.d.ts +357 -465
- package/dist/image.js +17 -18
- package/dist/index.d.ts +35 -467
- package/dist/index.js +23 -17
- package/dist/llm.d.ts +65 -266
- package/dist/llm.js +101 -92
- package/dist/loop.d.ts +38 -0
- package/dist/loop.js +136 -0
- package/dist/media-model.d.ts +1 -1
- package/dist/media-model.js +8 -6
- package/dist/media.d.ts +9 -0
- package/dist/media.js +37 -2
- package/dist/protocols/alibaba-chat.d.ts +9 -1
- package/dist/protocols/alibaba-chat.js +3 -3
- package/dist/protocols/alibaba-images.d.ts +2 -2
- package/dist/protocols/alibaba-messages.js +3 -3
- package/dist/protocols/alibaba-responses.js +8 -20
- package/dist/protocols/anthropic-messages.d.ts +1 -1
- package/dist/protocols/anthropic-messages.js +57 -176
- package/dist/protocols/assemblyai-transcription.d.ts +2 -2
- package/dist/protocols/bedrock-converse.js +10 -16
- package/dist/protocols/cartesia-speech.d.ts +2 -2
- package/dist/protocols/cloudflare-workers-ai-images.d.ts +2 -2
- package/dist/protocols/cohere-chat.js +9 -12
- package/dist/protocols/deepgram-speech.d.ts +2 -2
- package/dist/protocols/deepgram-transcription.d.ts +2 -2
- package/dist/protocols/elevenlabs-speech.d.ts +2 -2
- package/dist/protocols/elevenlabs-transcription.d.ts +2 -2
- package/dist/protocols/gemini.d.ts +3 -0
- package/dist/protocols/gemini.js +54 -72
- package/dist/protocols/google-embed-content.d.ts +34 -0
- package/dist/protocols/google-embed-content.js +110 -0
- package/dist/protocols/google-images.d.ts +2 -2
- package/dist/protocols/google-interactions.d.ts +3 -4
- package/dist/protocols/google-interactions.js +44 -30
- package/dist/protocols/google-speech.d.ts +2 -2
- package/dist/protocols/google-transcription.d.ts +2 -2
- package/dist/protocols/google-vertex-predict-embeddings.d.ts +18 -0
- package/dist/protocols/google-vertex-predict-embeddings.js +74 -0
- package/dist/protocols/google-video.d.ts +2 -2
- package/dist/protocols/index.d.ts +3 -0
- package/dist/protocols/index.js +3 -0
- package/dist/protocols/meta-images.d.ts +2 -2
- package/dist/protocols/meta-responses.js +26 -23
- package/dist/protocols/minimax-images.d.ts +2 -2
- package/dist/protocols/mistral-chat.js +7 -10
- package/dist/protocols/open-responses-channel.js +6 -19
- package/dist/protocols/open-responses-continuation.d.ts +1 -5
- package/dist/protocols/open-responses-continuation.js +1 -3
- package/dist/protocols/open-responses.d.ts +2 -22
- package/dist/protocols/open-responses.js +41 -23
- package/dist/protocols/openai-chat.d.ts +27 -23
- package/dist/protocols/openai-chat.js +62 -57
- package/dist/protocols/openai-compatible-chat.d.ts +2 -1
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-compatible-responses.js +1 -1
- package/dist/protocols/openai-decisions.js +15 -2
- package/dist/protocols/openai-embeddings.d.ts +16 -0
- package/dist/protocols/openai-embeddings.js +76 -0
- package/dist/protocols/openai-images.d.ts +2 -2
- package/dist/protocols/openai-responses.js +10 -29
- package/dist/protocols/openai-speech.d.ts +2 -2
- package/dist/protocols/openai-transcription.d.ts +2 -2
- package/dist/protocols/runway-video.d.ts +2 -2
- package/dist/protocols/shared.d.ts +14 -7
- package/dist/protocols/shared.js +40 -15
- package/dist/protocols/system-one.d.ts +4 -4
- package/dist/protocols/system-one.js +8 -1
- package/dist/protocols/utils/bedrock-cache.js +2 -5
- package/dist/protocols/utils/bedrock-media.d.ts +0 -3
- package/dist/protocols/utils/cache.d.ts +3 -0
- package/dist/protocols/utils/cache.js +15 -2
- package/dist/protocols/utils/image-sizing.d.ts +1 -1
- package/dist/protocols/utils/responses-checkpoint.js +1 -1
- package/dist/protocols/utils/responses-compaction.d.ts +1 -1
- package/dist/protocols/utils/responses-compaction.js +6 -5
- package/dist/protocols/utils/responses-hosted-tools.d.ts +97 -1
- package/dist/protocols/utils/responses-hosted-tools.js +31 -0
- package/dist/protocols/utils/tool-stream.d.ts +5 -271
- package/dist/protocols/utils/tool-stream.js +3 -13
- package/dist/protocols/venice-chat.d.ts +7 -1
- package/dist/protocols/venice-chat.js +4 -4
- package/dist/protocols/xai-images.d.ts +2 -2
- package/dist/protocols/xai-responses.js +5 -25
- package/dist/protocols/xai-video.d.ts +2 -2
- package/dist/protocols/zai-chat.d.ts +9 -1
- package/dist/protocols/zai-chat.js +1 -1
- package/dist/protocols/zai-images.d.ts +2 -2
- package/dist/protocols/zai-messages.js +3 -3
- package/dist/provider-error.d.ts +0 -1
- package/dist/provider-error.js +7 -80
- package/dist/providers/alibaba/embeddings.d.ts +2 -0
- package/dist/providers/alibaba/embeddings.js +1 -0
- package/dist/providers/alibaba.d.ts +70 -4
- package/dist/providers/alibaba.js +20 -2
- package/dist/providers/amazon-bedrock-mantle.d.ts +7 -3
- package/dist/providers/amazon-bedrock-mantle.js +6 -3
- package/dist/providers/amazon-bedrock.d.ts +6 -7
- package/dist/providers/amazon-bedrock.js +1 -1
- package/dist/providers/anthropic-compatible.d.ts +7 -8
- package/dist/providers/anthropic-compatible.js +2 -5
- package/dist/providers/anthropic.d.ts +8 -9
- package/dist/providers/anthropic.js +2 -7
- package/dist/providers/assemblyai.d.ts +2 -2
- package/dist/providers/assemblyai.js +2 -7
- package/dist/providers/azure/embeddings.d.ts +2 -0
- package/dist/providers/azure/embeddings.js +1 -0
- package/dist/providers/azure/messages.d.ts +2 -0
- package/dist/providers/azure/messages.js +1 -0
- package/dist/providers/azure.d.ts +325 -7
- package/dist/providers/azure.js +40 -9
- package/dist/providers/baseten.d.ts +7 -5
- package/dist/providers/baseten.js +7 -21
- package/dist/providers/cartesia.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +7 -5
- package/dist/providers/cerebras.js +4 -15
- package/dist/providers/cloudflare-ai-gateway.d.ts +23 -13
- package/dist/providers/cloudflare-ai-gateway.js +28 -40
- package/dist/providers/cloudflare-shared.d.ts +9 -0
- package/dist/providers/cloudflare-shared.js +25 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +6 -4
- package/dist/providers/cloudflare-workers-ai.js +4 -20
- package/dist/providers/cohere/chat.js +2 -7
- package/dist/providers/cohere/embeddings.d.ts +2 -0
- package/dist/providers/cohere/embeddings.js +1 -0
- package/dist/providers/cohere.d.ts +14 -5
- package/dist/providers/cohere.js +23 -13
- package/dist/providers/deepgram.d.ts +2 -2
- package/dist/providers/deepgram.js +2 -7
- package/dist/providers/deepinfra/embeddings.d.ts +2 -0
- package/dist/providers/deepinfra/embeddings.js +1 -0
- package/dist/providers/deepinfra.d.ts +10 -5
- package/dist/providers/deepinfra.js +20 -14
- package/dist/providers/deepseek.d.ts +7 -5
- package/dist/providers/deepseek.js +3 -14
- package/dist/providers/digitalocean/embeddings.d.ts +2 -0
- package/dist/providers/digitalocean/embeddings.js +1 -0
- package/dist/providers/digitalocean.d.ts +18 -5
- package/dist/providers/digitalocean.js +28 -14
- package/dist/providers/elevenlabs.d.ts +2 -2
- package/dist/providers/elevenlabs.js +2 -7
- package/dist/providers/fireworks/embeddings.d.ts +2 -0
- package/dist/providers/fireworks/embeddings.js +1 -0
- package/dist/providers/fireworks.d.ts +10 -5
- package/dist/providers/fireworks.js +17 -14
- package/dist/providers/google/embeddings.d.ts +2 -0
- package/dist/providers/google/embeddings.js +1 -0
- package/dist/providers/google/interactions.d.ts +1 -1
- package/dist/providers/google/interactions.js +2 -7
- package/dist/providers/google-vertex/embeddings.d.ts +2 -0
- package/dist/providers/google-vertex/embeddings.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +4 -3
- package/dist/providers/google-vertex-chat.js +3 -29
- package/dist/providers/google-vertex-interactions.d.ts +3 -3
- package/dist/providers/google-vertex-messages.d.ts +3 -3
- package/dist/providers/google-vertex-messages.js +3 -29
- package/dist/providers/google-vertex-mistral.d.ts +3 -3
- package/dist/providers/google-vertex-mistral.js +3 -29
- package/dist/providers/google-vertex-responses.d.ts +3 -3
- package/dist/providers/google-vertex-responses.js +4 -30
- package/dist/providers/google-vertex-shared.d.ts +31 -0
- package/dist/providers/google-vertex-shared.js +25 -0
- package/dist/providers/google-vertex.d.ts +10 -3
- package/dist/providers/google-vertex.js +52 -0
- package/dist/providers/google.d.ts +21 -13
- package/dist/providers/google.js +23 -19
- package/dist/providers/groq.d.ts +10 -5
- package/dist/providers/groq.js +4 -15
- package/dist/providers/meta.d.ts +6 -5
- package/dist/providers/meta.js +10 -23
- package/dist/providers/minimax/chat.js +2 -7
- package/dist/providers/minimax/responses.js +2 -7
- package/dist/providers/minimax.d.ts +6 -5
- package/dist/providers/minimax.js +7 -22
- package/dist/providers/mistral.d.ts +10 -11
- package/dist/providers/mistral.js +3 -14
- package/dist/providers/moonshot/messages.js +2 -7
- package/dist/providers/moonshot/responses.js +2 -7
- package/dist/providers/moonshot.d.ts +6 -5
- package/dist/providers/moonshot.js +4 -16
- package/dist/providers/openai/embeddings.d.ts +2 -0
- package/dist/providers/openai/embeddings.js +1 -0
- package/dist/providers/openai-compatible/embeddings.d.ts +2 -0
- package/dist/providers/openai-compatible/embeddings.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +6 -7
- package/dist/providers/openai-compatible-responses.js +2 -8
- package/dist/providers/openai-compatible.d.ts +10 -7
- package/dist/providers/openai-compatible.js +17 -10
- package/dist/providers/openai.d.ts +11 -4
- package/dist/providers/openai.js +17 -3
- package/dist/providers/opencode.d.ts +4 -4
- package/dist/providers/opencode.js +6 -2
- package/dist/providers/openrouter/embeddings.d.ts +2 -0
- package/dist/providers/openrouter/embeddings.js +1 -0
- package/dist/providers/openrouter.d.ts +24 -5
- package/dist/providers/openrouter.js +31 -24
- package/dist/providers/runway.d.ts +1 -1
- package/dist/providers/settings.d.ts +40 -0
- package/dist/providers/settings.js +19 -0
- package/dist/providers/togetherai.d.ts +7 -5
- package/dist/providers/togetherai.js +5 -15
- package/dist/providers/typesafe-ai.d.ts +4 -4
- package/dist/providers/typesafe-ai.js +6 -2
- package/dist/providers/venice.d.ts +5 -4
- package/dist/providers/venice.js +6 -2
- package/dist/providers/vercel-ai-gateway/embeddings.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/embeddings.js +1 -0
- package/dist/providers/vercel-ai-gateway.d.ts +9 -5
- package/dist/providers/vercel-ai-gateway.js +30 -29
- package/dist/providers/xai.d.ts +5 -4
- package/dist/providers/xai.js +4 -12
- package/dist/providers/zai-coding-plan/messages.js +2 -7
- package/dist/providers/zai-coding-plan/responses.js +2 -7
- package/dist/providers/zai-coding-plan.d.ts +6 -5
- package/dist/providers/zai-coding-plan.js +8 -15
- package/dist/providers/zai.d.ts +6 -5
- package/dist/providers/zai.js +10 -22
- package/dist/public.d.ts +14 -0
- package/dist/public.js +6 -0
- package/dist/route/auth-options.d.ts +9 -5
- package/dist/route/auth-options.js +10 -7
- package/dist/route/client.d.ts +50 -37
- package/dist/route/client.js +42 -53
- package/dist/route/decision.d.ts +8 -8
- package/dist/route/decision.js +3 -3
- package/dist/route/embedding.d.ts +61 -0
- package/dist/route/embedding.js +88 -0
- package/dist/route/executor.d.ts +5 -0
- package/dist/route/executor.js +10 -0
- package/dist/route/index.d.ts +5 -7
- package/dist/route/index.js +1 -1
- package/dist/route/media.d.ts +7 -11
- package/dist/route/media.js +22 -26
- package/dist/route/transport/http.js +6 -5
- package/dist/route/transport/websocket.js +7 -1
- package/dist/schema/errors.d.ts +16 -17
- package/dist/schema/errors.js +63 -12
- package/dist/schema/events.d.ts +2563 -2954
- package/dist/schema/events.js +54 -109
- package/dist/schema/messages.d.ts +194 -137
- package/dist/schema/messages.js +66 -83
- package/dist/schema/options.d.ts +112 -65
- package/dist/schema/options.js +52 -101
- package/dist/speech-client.d.ts +7 -7
- package/dist/speech.d.ts +306 -316
- package/dist/speech.js +16 -14
- package/dist/testing.d.ts +31 -175
- package/dist/testing.js +60 -5
- package/dist/tool-history.d.ts +1 -1
- package/dist/tool-history.js +3 -10
- package/dist/tool-runtime.d.ts +9 -2
- package/dist/tool-runtime.js +17 -31
- package/dist/tool.d.ts +39 -43
- package/dist/tool.js +16 -26
- package/dist/transcription-client.d.ts +7 -7
- package/dist/transcription.d.ts +314 -265
- package/dist/transcription.js +16 -14
- package/dist/utils/provider-codes.d.ts +3 -0
- package/dist/utils/provider-codes.js +41 -0
- package/dist/video-client.d.ts +7 -7
- package/dist/video-client.js +1 -1
- package/dist/video.d.ts +269 -287
- package/dist/video.js +16 -14
- package/package.json +309 -257
- package/dist/experimental/testing.d.ts +0 -3
- package/dist/experimental/testing.js +0 -3
- package/dist/testing/decision.d.ts +0 -16
- package/dist/testing/decision.js +0 -20
- package/dist/testing/image.d.ts +0 -14
- package/dist/testing/image.js +0 -12
- package/dist/testing/media.d.ts +0 -18
- package/dist/testing/media.js +0 -36
- package/dist/testing/script.d.ts +0 -28
- package/dist/testing/script.js +0 -60
- package/dist/testing/speech.d.ts +0 -14
- package/dist/testing/speech.js +0 -12
- package/dist/testing/transcription.d.ts +0 -14
- package/dist/testing/transcription.js +0 -12
- package/dist/testing/video.d.ts +0 -14
- package/dist/testing/video.js +0 -12
package/dist/image.d.ts
CHANGED
|
@@ -3,16 +3,16 @@ import { Generation, type AwaitOptions } from "./generation.js";
|
|
|
3
3
|
import { Media } from "./media.js";
|
|
4
4
|
import { MediaModel } from "./media-model.js";
|
|
5
5
|
import { MediaRoute } from "./route/media.js";
|
|
6
|
-
import { AIError,
|
|
6
|
+
import { AIError, type OpenString, type BaseRequest } from "./schema/index.js";
|
|
7
7
|
import { Service } from "./image-client.js";
|
|
8
8
|
export type ImageOptions = MediaModel.Options;
|
|
9
|
-
export type ImageRoute = MediaRoute.AnyRoute<
|
|
9
|
+
export type ImageRoute = MediaRoute.AnyRoute<ImageRequest, ImageEvent, ImageResponse>;
|
|
10
10
|
export declare class ImageModel<Options extends ImageOptions = ImageOptions> extends MediaModel<ImageRoute, Options> {
|
|
11
11
|
protected readonly _ImageModel: void;
|
|
12
12
|
/** The number of type arguments selects the kind: `<Options>`, `<Options, Frame, State>`, or `<Options, Token>`. */
|
|
13
|
-
static fromRoute<Options extends ImageOptions>(route: MediaModel.InlineRouteInput<
|
|
14
|
-
static fromRoute<Options extends ImageOptions, Frame, State>(route: MediaModel.StreamRouteInput<
|
|
15
|
-
static fromRoute<Options extends ImageOptions, Token>(route: MediaModel.QueuedRouteInput<
|
|
13
|
+
static fromRoute<Options extends ImageOptions>(route: MediaModel.InlineRouteInput<ImageRequest<ImageModel<Options>>, ImageResponse>, input: MediaRoute.ModelInput): ImageModel<Options>;
|
|
14
|
+
static fromRoute<Options extends ImageOptions, Frame, State>(route: MediaModel.StreamRouteInput<ImageRequest<ImageModel<Options>>, ImageEvent, Frame, State>, input: MediaRoute.ModelInput): ImageModel<Options>;
|
|
15
|
+
static fromRoute<Options extends ImageOptions, Token>(route: MediaModel.QueuedRouteInput<ImageRequest<ImageModel<Options>>, ImageResponse, Token>, input: MediaRoute.ModelInput): ImageModel<Options>;
|
|
16
16
|
}
|
|
17
17
|
export declare const ImageModelSchema: Schema.declare<ImageModel<{
|
|
18
18
|
readonly [x: string]: unknown;
|
|
@@ -23,64 +23,21 @@ export type ImageAspectRatio = Media.AspectRatio;
|
|
|
23
23
|
export declare const ImageAspectRatio: Schema.declare<`${number}:${number}`, `${number}:${number}`>;
|
|
24
24
|
/** Size tier: `1K` is about as many pixels as 1024×1024 at the requested aspect, `2K` as 2048×2048. */
|
|
25
25
|
export type ImageResolution = OpenString<"1K" | "2K" | "4K">;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}>, ImageModel<{
|
|
30
|
-
readonly [x: string]: unknown;
|
|
31
|
-
}>>;
|
|
32
|
-
readonly prompt: Schema.String;
|
|
26
|
+
/** A normalized image request, the plain object `ai.image.request(...)` returns. */
|
|
27
|
+
export interface ImageRequest<Model extends ImageModel = ImageModel> extends BaseRequest<Model, ImageModelOptions<Model>> {
|
|
28
|
+
readonly prompt: string;
|
|
33
29
|
/** Edit sources or style/subject references, in order. */
|
|
34
|
-
readonly images
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
readonly mediaType: Schema.String;
|
|
39
|
-
}>, Schema.Struct<{
|
|
40
|
-
readonly type: Schema.Literal<"base64">;
|
|
41
|
-
readonly data: Schema.String;
|
|
42
|
-
readonly mediaType: Schema.String;
|
|
43
|
-
}>, Schema.Struct<{
|
|
44
|
-
readonly type: Schema.Literal<"url">;
|
|
45
|
-
readonly url: Schema.String;
|
|
46
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
47
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
48
|
-
}>, Schema.Struct<{
|
|
49
|
-
readonly type: Schema.Literal<"ref">;
|
|
50
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
51
|
-
readonly id: Schema.String;
|
|
52
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
53
|
-
}>]>;
|
|
54
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
55
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
56
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
57
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
58
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
59
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
60
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
61
|
-
readonly format: Schema.optional<Schema.String>;
|
|
62
|
-
}>>;
|
|
63
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
64
|
-
}>, never, never>>>;
|
|
65
|
-
readonly n: Schema.optional<Schema.Int>;
|
|
66
|
-
readonly aspect: Schema.optional<Schema.declare<`${number}:${number}`, `${number}:${number}`>>;
|
|
67
|
-
readonly resolution: Schema.optional<Schema.String>;
|
|
68
|
-
readonly providerOptions: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
69
|
-
readonly http: Schema.optional<typeof HttpOptions>;
|
|
70
|
-
}>, {}>;
|
|
71
|
-
export declare class ImageRequest extends ImageRequest_base {
|
|
72
|
-
protected readonly _ImageRequest: void;
|
|
30
|
+
readonly images?: ReadonlyArray<Media.Asset>;
|
|
31
|
+
readonly n?: number;
|
|
32
|
+
readonly aspect?: ImageAspectRatio;
|
|
33
|
+
readonly resolution?: ImageResolution;
|
|
73
34
|
}
|
|
74
|
-
export type ImageRequestFor<Options extends ImageOptions = ImageOptions> = Omit<ImageRequest, "model" | "providerOptions"> & {
|
|
75
|
-
readonly model: ImageModel<Options>;
|
|
76
|
-
readonly providerOptions?: Options;
|
|
77
|
-
};
|
|
78
35
|
export type ImageModelOptions<Model> = Model extends ImageModel<infer Options> ? Options : never;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
36
|
+
/** Input accepted by `ai.image.request`, `generate`, `stream` and `start`. An `ImageRequest` is also a valid input. */
|
|
37
|
+
export type ImageRequestInput<Model extends ImageModel = ImageModel> = Omit<ImageRequest<Model>, "images" | "providerOptions"> & {
|
|
38
|
+
/** Edit sources or style/subject references, in order: assets or plain data with a detectable type. */
|
|
39
|
+
readonly images?: ReadonlyArray<Media.Input>;
|
|
82
40
|
readonly providerOptions?: NoInfer<ImageModelOptions<Model>>;
|
|
83
|
-
readonly http?: HttpOptions.Input;
|
|
84
41
|
};
|
|
85
42
|
declare const ImageResponse_base: Schema.Class<ImageResponse, Schema.Struct<{
|
|
86
43
|
readonly images: Schema.$Array<Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
@@ -136,7 +93,6 @@ declare const ImageResponse_base: Schema.Class<ImageResponse, Schema.Struct<{
|
|
|
136
93
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
137
94
|
}>, {}>;
|
|
138
95
|
export declare class ImageResponse extends ImageResponse_base {
|
|
139
|
-
get image(): Media.Asset;
|
|
140
96
|
}
|
|
141
97
|
/** The `index`-th lower-fidelity preview of an image still generating; the `image` event supersedes it. */
|
|
142
98
|
export declare const ImagePartialEvent: Schema.Struct<{
|
|
@@ -688,105 +644,111 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
688
644
|
};
|
|
689
645
|
};
|
|
690
646
|
readonly match: {
|
|
691
|
-
<
|
|
692
|
-
readonly
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
readonly type: Schema.tag<"image-partial">;
|
|
701
|
-
readonly index: Schema.Number;
|
|
702
|
-
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
703
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
704
|
-
readonly type: Schema.Literal<"bytes">;
|
|
705
|
-
readonly data: Schema.Uint8Array;
|
|
706
|
-
readonly mediaType: Schema.String;
|
|
707
|
-
}>, Schema.Struct<{
|
|
708
|
-
readonly type: Schema.Literal<"base64">;
|
|
709
|
-
readonly data: Schema.String;
|
|
710
|
-
readonly mediaType: Schema.String;
|
|
711
|
-
}>, Schema.Struct<{
|
|
712
|
-
readonly type: Schema.Literal<"url">;
|
|
713
|
-
readonly url: Schema.String;
|
|
714
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
715
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
647
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial"]: (value: {
|
|
648
|
+
readonly finish: Schema.Struct<{
|
|
649
|
+
readonly type: Schema.tag<"finish">;
|
|
650
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
651
|
+
readonly type: Schema.Literal<"tokens">;
|
|
652
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
653
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
654
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
655
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
716
656
|
}>, Schema.Struct<{
|
|
717
|
-
readonly type: Schema.Literal<"
|
|
718
|
-
readonly
|
|
719
|
-
readonly id: Schema.String;
|
|
720
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
721
|
-
}>]>;
|
|
722
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
723
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
724
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
725
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
726
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
727
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
728
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
729
|
-
readonly format: Schema.optional<Schema.String>;
|
|
730
|
-
}>>;
|
|
731
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
732
|
-
}>, never, never>;
|
|
733
|
-
}> | Schema.Struct<{
|
|
734
|
-
readonly type: Schema.tag<"image">;
|
|
735
|
-
readonly index: Schema.Number;
|
|
736
|
-
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
737
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
738
|
-
readonly type: Schema.Literal<"bytes">;
|
|
739
|
-
readonly data: Schema.Uint8Array;
|
|
740
|
-
readonly mediaType: Schema.String;
|
|
657
|
+
readonly type: Schema.Literal<"seconds">;
|
|
658
|
+
readonly seconds: Schema.Number;
|
|
741
659
|
}>, Schema.Struct<{
|
|
742
|
-
readonly type: Schema.Literal<"
|
|
743
|
-
readonly
|
|
744
|
-
readonly mediaType: Schema.String;
|
|
660
|
+
readonly type: Schema.Literal<"characters">;
|
|
661
|
+
readonly characters: Schema.Number;
|
|
745
662
|
}>, Schema.Struct<{
|
|
746
|
-
readonly type: Schema.Literal<"
|
|
747
|
-
readonly
|
|
748
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
749
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
663
|
+
readonly type: Schema.Literal<"credits">;
|
|
664
|
+
readonly credits: Schema.Number;
|
|
750
665
|
}>, Schema.Struct<{
|
|
751
|
-
readonly type: Schema.Literal<"
|
|
752
|
-
readonly
|
|
753
|
-
|
|
754
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
755
|
-
}>]>;
|
|
756
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
757
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
758
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
759
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
760
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
761
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
762
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
763
|
-
readonly format: Schema.optional<Schema.String>;
|
|
764
|
-
}>>;
|
|
666
|
+
readonly type: Schema.Literal<"compute">;
|
|
667
|
+
readonly seconds: Schema.Number;
|
|
668
|
+
}>]>>;
|
|
765
669
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
readonly
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
readonly
|
|
774
|
-
readonly
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
readonly
|
|
780
|
-
readonly
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
670
|
+
}>;
|
|
671
|
+
readonly "generation-progress": Schema.Struct<{
|
|
672
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
673
|
+
readonly id: Schema.String;
|
|
674
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
675
|
+
}>;
|
|
676
|
+
readonly "generation-queued": Schema.Struct<{
|
|
677
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
678
|
+
readonly id: Schema.String;
|
|
679
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
680
|
+
}>;
|
|
681
|
+
readonly image: Schema.Struct<{
|
|
682
|
+
readonly type: Schema.tag<"image">;
|
|
683
|
+
readonly index: Schema.Number;
|
|
684
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
685
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
686
|
+
readonly type: Schema.Literal<"bytes">;
|
|
687
|
+
readonly data: Schema.Uint8Array;
|
|
688
|
+
readonly mediaType: Schema.String;
|
|
689
|
+
}>, Schema.Struct<{
|
|
690
|
+
readonly type: Schema.Literal<"base64">;
|
|
691
|
+
readonly data: Schema.String;
|
|
692
|
+
readonly mediaType: Schema.String;
|
|
693
|
+
}>, Schema.Struct<{
|
|
694
|
+
readonly type: Schema.Literal<"url">;
|
|
695
|
+
readonly url: Schema.String;
|
|
696
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
697
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
698
|
+
}>, Schema.Struct<{
|
|
699
|
+
readonly type: Schema.Literal<"ref">;
|
|
700
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
701
|
+
readonly id: Schema.String;
|
|
702
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
703
|
+
}>]>;
|
|
704
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
705
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
706
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
707
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
708
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
709
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
710
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
711
|
+
readonly format: Schema.optional<Schema.String>;
|
|
712
|
+
}>>;
|
|
713
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
714
|
+
}>, never, never>;
|
|
715
|
+
}>;
|
|
716
|
+
readonly "image-partial": Schema.Struct<{
|
|
717
|
+
readonly type: Schema.tag<"image-partial">;
|
|
718
|
+
readonly index: Schema.Number;
|
|
719
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
720
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
721
|
+
readonly type: Schema.Literal<"bytes">;
|
|
722
|
+
readonly data: Schema.Uint8Array;
|
|
723
|
+
readonly mediaType: Schema.String;
|
|
724
|
+
}>, Schema.Struct<{
|
|
725
|
+
readonly type: Schema.Literal<"base64">;
|
|
726
|
+
readonly data: Schema.String;
|
|
727
|
+
readonly mediaType: Schema.String;
|
|
728
|
+
}>, Schema.Struct<{
|
|
729
|
+
readonly type: Schema.Literal<"url">;
|
|
730
|
+
readonly url: Schema.String;
|
|
731
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
732
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
733
|
+
}>, Schema.Struct<{
|
|
734
|
+
readonly type: Schema.Literal<"ref">;
|
|
735
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
736
|
+
readonly id: Schema.String;
|
|
737
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
738
|
+
}>]>;
|
|
739
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
740
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
741
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
742
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
743
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
744
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
745
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
746
|
+
readonly format: Schema.optional<Schema.String>;
|
|
747
|
+
}>>;
|
|
748
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
749
|
+
}>, never, never>;
|
|
750
|
+
}>;
|
|
751
|
+
}[K]["Type"]) => any; }>(value: {
|
|
790
752
|
readonly type: "image-partial";
|
|
791
753
|
readonly index: number;
|
|
792
754
|
readonly image: Media.Asset;
|
|
@@ -830,106 +792,112 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
830
792
|
readonly [x: string]: unknown;
|
|
831
793
|
};
|
|
832
794
|
} | undefined;
|
|
833
|
-
}, cases:
|
|
834
|
-
<
|
|
835
|
-
readonly
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
readonly type: Schema.tag<"image-partial">;
|
|
844
|
-
readonly index: Schema.Number;
|
|
845
|
-
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
846
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
847
|
-
readonly type: Schema.Literal<"bytes">;
|
|
848
|
-
readonly data: Schema.Uint8Array;
|
|
849
|
-
readonly mediaType: Schema.String;
|
|
795
|
+
}, cases: Handlers): import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "image" | "image-partial"]>>;
|
|
796
|
+
<Handlers extends { [K in "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial"]: (value: {
|
|
797
|
+
readonly finish: Schema.Struct<{
|
|
798
|
+
readonly type: Schema.tag<"finish">;
|
|
799
|
+
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
800
|
+
readonly type: Schema.Literal<"tokens">;
|
|
801
|
+
readonly input: Schema.optional<Schema.Number>;
|
|
802
|
+
readonly output: Schema.optional<Schema.Number>;
|
|
803
|
+
readonly total: Schema.optional<Schema.Number>;
|
|
804
|
+
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
850
805
|
}>, Schema.Struct<{
|
|
851
|
-
readonly type: Schema.Literal<"
|
|
852
|
-
readonly
|
|
853
|
-
readonly mediaType: Schema.String;
|
|
854
|
-
}>, Schema.Struct<{
|
|
855
|
-
readonly type: Schema.Literal<"url">;
|
|
856
|
-
readonly url: Schema.String;
|
|
857
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
858
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
859
|
-
}>, Schema.Struct<{
|
|
860
|
-
readonly type: Schema.Literal<"ref">;
|
|
861
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
862
|
-
readonly id: Schema.String;
|
|
863
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
864
|
-
}>]>;
|
|
865
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
866
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
867
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
868
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
869
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
870
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
871
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
872
|
-
readonly format: Schema.optional<Schema.String>;
|
|
873
|
-
}>>;
|
|
874
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
875
|
-
}>, never, never>;
|
|
876
|
-
}> | Schema.Struct<{
|
|
877
|
-
readonly type: Schema.tag<"image">;
|
|
878
|
-
readonly index: Schema.Number;
|
|
879
|
-
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
880
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
881
|
-
readonly type: Schema.Literal<"bytes">;
|
|
882
|
-
readonly data: Schema.Uint8Array;
|
|
883
|
-
readonly mediaType: Schema.String;
|
|
806
|
+
readonly type: Schema.Literal<"seconds">;
|
|
807
|
+
readonly seconds: Schema.Number;
|
|
884
808
|
}>, Schema.Struct<{
|
|
885
|
-
readonly type: Schema.Literal<"
|
|
886
|
-
readonly
|
|
887
|
-
readonly mediaType: Schema.String;
|
|
809
|
+
readonly type: Schema.Literal<"characters">;
|
|
810
|
+
readonly characters: Schema.Number;
|
|
888
811
|
}>, Schema.Struct<{
|
|
889
|
-
readonly type: Schema.Literal<"
|
|
890
|
-
readonly
|
|
891
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
892
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
812
|
+
readonly type: Schema.Literal<"credits">;
|
|
813
|
+
readonly credits: Schema.Number;
|
|
893
814
|
}>, Schema.Struct<{
|
|
894
|
-
readonly type: Schema.Literal<"
|
|
895
|
-
readonly
|
|
896
|
-
|
|
897
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
898
|
-
}>]>;
|
|
899
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
900
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
901
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
902
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
903
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
904
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
905
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
906
|
-
readonly format: Schema.optional<Schema.String>;
|
|
907
|
-
}>>;
|
|
815
|
+
readonly type: Schema.Literal<"compute">;
|
|
816
|
+
readonly seconds: Schema.Number;
|
|
817
|
+
}>]>>;
|
|
908
818
|
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
readonly
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
readonly
|
|
917
|
-
readonly
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
readonly
|
|
923
|
-
readonly
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
819
|
+
}>;
|
|
820
|
+
readonly "generation-progress": Schema.Struct<{
|
|
821
|
+
readonly type: Schema.tag<"generation-progress">;
|
|
822
|
+
readonly id: Schema.String;
|
|
823
|
+
readonly progress: Schema.optional<Schema.Number>;
|
|
824
|
+
}>;
|
|
825
|
+
readonly "generation-queued": Schema.Struct<{
|
|
826
|
+
readonly type: Schema.tag<"generation-queued">;
|
|
827
|
+
readonly id: Schema.String;
|
|
828
|
+
readonly position: Schema.optional<Schema.Number>;
|
|
829
|
+
}>;
|
|
830
|
+
readonly image: Schema.Struct<{
|
|
831
|
+
readonly type: Schema.tag<"image">;
|
|
832
|
+
readonly index: Schema.Number;
|
|
833
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
834
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
835
|
+
readonly type: Schema.Literal<"bytes">;
|
|
836
|
+
readonly data: Schema.Uint8Array;
|
|
837
|
+
readonly mediaType: Schema.String;
|
|
838
|
+
}>, Schema.Struct<{
|
|
839
|
+
readonly type: Schema.Literal<"base64">;
|
|
840
|
+
readonly data: Schema.String;
|
|
841
|
+
readonly mediaType: Schema.String;
|
|
842
|
+
}>, Schema.Struct<{
|
|
843
|
+
readonly type: Schema.Literal<"url">;
|
|
844
|
+
readonly url: Schema.String;
|
|
845
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
846
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
847
|
+
}>, Schema.Struct<{
|
|
848
|
+
readonly type: Schema.Literal<"ref">;
|
|
849
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
850
|
+
readonly id: Schema.String;
|
|
851
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
852
|
+
}>]>;
|
|
853
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
854
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
855
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
856
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
857
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
858
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
859
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
860
|
+
readonly format: Schema.optional<Schema.String>;
|
|
861
|
+
}>>;
|
|
862
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
863
|
+
}>, never, never>;
|
|
864
|
+
}>;
|
|
865
|
+
readonly "image-partial": Schema.Struct<{
|
|
866
|
+
readonly type: Schema.tag<"image-partial">;
|
|
867
|
+
readonly index: Schema.Number;
|
|
868
|
+
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
869
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
870
|
+
readonly type: Schema.Literal<"bytes">;
|
|
871
|
+
readonly data: Schema.Uint8Array;
|
|
872
|
+
readonly mediaType: Schema.String;
|
|
873
|
+
}>, Schema.Struct<{
|
|
874
|
+
readonly type: Schema.Literal<"base64">;
|
|
875
|
+
readonly data: Schema.String;
|
|
876
|
+
readonly mediaType: Schema.String;
|
|
877
|
+
}>, Schema.Struct<{
|
|
878
|
+
readonly type: Schema.Literal<"url">;
|
|
879
|
+
readonly url: Schema.String;
|
|
880
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
881
|
+
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
882
|
+
}>, Schema.Struct<{
|
|
883
|
+
readonly type: Schema.Literal<"ref">;
|
|
884
|
+
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
885
|
+
readonly id: Schema.String;
|
|
886
|
+
readonly mediaType: Schema.optional<Schema.String>;
|
|
887
|
+
}>]>;
|
|
888
|
+
readonly info: Schema.optional<Schema.Struct<{
|
|
889
|
+
readonly width: Schema.optional<Schema.Number>;
|
|
890
|
+
readonly height: Schema.optional<Schema.Number>;
|
|
891
|
+
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
892
|
+
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
893
|
+
readonly channels: Schema.optional<Schema.Number>;
|
|
894
|
+
readonly encoding: Schema.optional<Schema.String>;
|
|
895
|
+
readonly format: Schema.optional<Schema.String>;
|
|
896
|
+
}>>;
|
|
897
|
+
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
898
|
+
}>, never, never>;
|
|
899
|
+
}>;
|
|
900
|
+
}[K]["Type"]) => any; }>(cases: Handlers): (value: {
|
|
933
901
|
readonly type: "image-partial";
|
|
934
902
|
readonly index: number;
|
|
935
903
|
readonly image: Media.Asset;
|
|
@@ -973,108 +941,10 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
973
941
|
readonly [x: string]: unknown;
|
|
974
942
|
};
|
|
975
943
|
} | undefined;
|
|
976
|
-
}) =>
|
|
944
|
+
}) => import("effect/Unify").Unify<ReturnType<Handlers["finish" | "generation-progress" | "generation-queued" | "image" | "image-partial"]>>;
|
|
977
945
|
};
|
|
978
946
|
readonly matchOrElse: {
|
|
979
|
-
<
|
|
980
|
-
readonly type: Schema.tag<"generation-queued">;
|
|
981
|
-
readonly id: Schema.String;
|
|
982
|
-
readonly position: Schema.optional<Schema.Number>;
|
|
983
|
-
}> | Schema.Struct<{
|
|
984
|
-
readonly type: Schema.tag<"generation-progress">;
|
|
985
|
-
readonly id: Schema.String;
|
|
986
|
-
readonly progress: Schema.optional<Schema.Number>;
|
|
987
|
-
}> | Schema.Struct<{
|
|
988
|
-
readonly type: Schema.tag<"image-partial">;
|
|
989
|
-
readonly index: Schema.Number;
|
|
990
|
-
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
991
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
992
|
-
readonly type: Schema.Literal<"bytes">;
|
|
993
|
-
readonly data: Schema.Uint8Array;
|
|
994
|
-
readonly mediaType: Schema.String;
|
|
995
|
-
}>, Schema.Struct<{
|
|
996
|
-
readonly type: Schema.Literal<"base64">;
|
|
997
|
-
readonly data: Schema.String;
|
|
998
|
-
readonly mediaType: Schema.String;
|
|
999
|
-
}>, Schema.Struct<{
|
|
1000
|
-
readonly type: Schema.Literal<"url">;
|
|
1001
|
-
readonly url: Schema.String;
|
|
1002
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
1003
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
1004
|
-
}>, Schema.Struct<{
|
|
1005
|
-
readonly type: Schema.Literal<"ref">;
|
|
1006
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
1007
|
-
readonly id: Schema.String;
|
|
1008
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
1009
|
-
}>]>;
|
|
1010
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
1011
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
1012
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
1013
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
1014
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
1015
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
1016
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
1017
|
-
readonly format: Schema.optional<Schema.String>;
|
|
1018
|
-
}>>;
|
|
1019
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1020
|
-
}>, never, never>;
|
|
1021
|
-
}> | Schema.Struct<{
|
|
1022
|
-
readonly type: Schema.tag<"image">;
|
|
1023
|
-
readonly index: Schema.Number;
|
|
1024
|
-
readonly image: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
|
|
1025
|
-
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
1026
|
-
readonly type: Schema.Literal<"bytes">;
|
|
1027
|
-
readonly data: Schema.Uint8Array;
|
|
1028
|
-
readonly mediaType: Schema.String;
|
|
1029
|
-
}>, Schema.Struct<{
|
|
1030
|
-
readonly type: Schema.Literal<"base64">;
|
|
1031
|
-
readonly data: Schema.String;
|
|
1032
|
-
readonly mediaType: Schema.String;
|
|
1033
|
-
}>, Schema.Struct<{
|
|
1034
|
-
readonly type: Schema.Literal<"url">;
|
|
1035
|
-
readonly url: Schema.String;
|
|
1036
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
1037
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
1038
|
-
}>, Schema.Struct<{
|
|
1039
|
-
readonly type: Schema.Literal<"ref">;
|
|
1040
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
1041
|
-
readonly id: Schema.String;
|
|
1042
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
1043
|
-
}>]>;
|
|
1044
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
1045
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
1046
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
1047
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
1048
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
1049
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
1050
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
1051
|
-
readonly format: Schema.optional<Schema.String>;
|
|
1052
|
-
}>>;
|
|
1053
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1054
|
-
}>, never, never>;
|
|
1055
|
-
}> | Schema.Struct<{
|
|
1056
|
-
readonly type: Schema.tag<"finish">;
|
|
1057
|
-
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
1058
|
-
readonly type: Schema.Literal<"tokens">;
|
|
1059
|
-
readonly input: Schema.optional<Schema.Number>;
|
|
1060
|
-
readonly output: Schema.optional<Schema.Number>;
|
|
1061
|
-
readonly total: Schema.optional<Schema.Number>;
|
|
1062
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
1063
|
-
}>, Schema.Struct<{
|
|
1064
|
-
readonly type: Schema.Literal<"seconds">;
|
|
1065
|
-
readonly seconds: Schema.Number;
|
|
1066
|
-
}>, Schema.Struct<{
|
|
1067
|
-
readonly type: Schema.Literal<"characters">;
|
|
1068
|
-
readonly characters: Schema.Number;
|
|
1069
|
-
}>, Schema.Struct<{
|
|
1070
|
-
readonly type: Schema.Literal<"credits">;
|
|
1071
|
-
readonly credits: Schema.Number;
|
|
1072
|
-
}>, Schema.Struct<{
|
|
1073
|
-
readonly type: Schema.Literal<"compute">;
|
|
1074
|
-
readonly seconds: Schema.Number;
|
|
1075
|
-
}>]>>;
|
|
1076
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1077
|
-
}> 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<{
|
|
947
|
+
<Handlers, OrElse>(value: {
|
|
1078
948
|
readonly type: "image-partial";
|
|
1079
949
|
readonly index: number;
|
|
1080
950
|
readonly image: Media.Asset;
|
|
@@ -1118,23 +988,81 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1118
988
|
readonly [x: string]: unknown;
|
|
1119
989
|
};
|
|
1120
990
|
} | undefined;
|
|
1121
|
-
},
|
|
991
|
+
}, cases: Handlers & {
|
|
992
|
+
readonly finish?: ((value: {
|
|
993
|
+
readonly type: "finish";
|
|
994
|
+
readonly usage?: {
|
|
995
|
+
readonly type: "seconds";
|
|
996
|
+
readonly seconds: number;
|
|
997
|
+
} | {
|
|
998
|
+
readonly type: "characters";
|
|
999
|
+
readonly characters: number;
|
|
1000
|
+
} | {
|
|
1001
|
+
readonly type: "credits";
|
|
1002
|
+
readonly credits: number;
|
|
1003
|
+
} | {
|
|
1004
|
+
readonly type: "compute";
|
|
1005
|
+
readonly seconds: number;
|
|
1006
|
+
} | {
|
|
1007
|
+
readonly type: "tokens";
|
|
1008
|
+
readonly input?: number | undefined;
|
|
1009
|
+
readonly output?: number | undefined;
|
|
1010
|
+
readonly total?: number | undefined;
|
|
1011
|
+
readonly details?: {
|
|
1012
|
+
readonly [x: string]: unknown;
|
|
1013
|
+
} | undefined;
|
|
1014
|
+
} | undefined;
|
|
1015
|
+
readonly providerMetadata?: {
|
|
1016
|
+
readonly [x: string]: {
|
|
1017
|
+
readonly [x: string]: unknown;
|
|
1018
|
+
};
|
|
1019
|
+
} | undefined;
|
|
1020
|
+
}) => any) | undefined;
|
|
1021
|
+
readonly "generation-progress"?: ((value: {
|
|
1022
|
+
readonly type: "generation-progress";
|
|
1023
|
+
readonly id: string;
|
|
1024
|
+
readonly progress?: number | undefined;
|
|
1025
|
+
}) => any) | undefined;
|
|
1026
|
+
readonly "generation-queued"?: ((value: {
|
|
1027
|
+
readonly type: "generation-queued";
|
|
1028
|
+
readonly id: string;
|
|
1029
|
+
readonly position?: number | undefined;
|
|
1030
|
+
}) => any) | undefined;
|
|
1031
|
+
readonly image?: ((value: {
|
|
1032
|
+
readonly type: "image";
|
|
1033
|
+
readonly index: number;
|
|
1034
|
+
readonly image: Media.Asset;
|
|
1035
|
+
}) => any) | undefined;
|
|
1036
|
+
readonly "image-partial"?: ((value: {
|
|
1037
|
+
readonly type: "image-partial";
|
|
1038
|
+
readonly index: number;
|
|
1039
|
+
readonly image: Media.Asset;
|
|
1040
|
+
}) => any) | undefined;
|
|
1041
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
1122
1042
|
readonly type: "image-partial";
|
|
1123
1043
|
readonly index: number;
|
|
1124
1044
|
readonly image: Media.Asset;
|
|
1125
|
-
}
|
|
1045
|
+
}, {
|
|
1046
|
+
readonly type: keyof Handlers;
|
|
1047
|
+
}> | Exclude<{
|
|
1126
1048
|
readonly type: "image";
|
|
1127
1049
|
readonly index: number;
|
|
1128
1050
|
readonly image: Media.Asset;
|
|
1129
|
-
}
|
|
1051
|
+
}, {
|
|
1052
|
+
readonly type: keyof Handlers;
|
|
1053
|
+
}> | Exclude<{
|
|
1130
1054
|
readonly type: "generation-queued";
|
|
1131
1055
|
readonly id: string;
|
|
1132
1056
|
readonly position?: number | undefined;
|
|
1133
|
-
}
|
|
1057
|
+
}, {
|
|
1058
|
+
readonly type: keyof Handlers;
|
|
1059
|
+
}> | Exclude<{
|
|
1134
1060
|
readonly type: "generation-progress";
|
|
1135
1061
|
readonly id: string;
|
|
1136
1062
|
readonly progress?: number | undefined;
|
|
1137
|
-
}
|
|
1063
|
+
}, {
|
|
1064
|
+
readonly type: keyof Handlers;
|
|
1065
|
+
}> | Exclude<{
|
|
1138
1066
|
readonly type: "finish";
|
|
1139
1067
|
readonly usage?: {
|
|
1140
1068
|
readonly type: "seconds";
|
|
@@ -1162,122 +1090,84 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1162
1090
|
readonly [x: string]: unknown;
|
|
1163
1091
|
};
|
|
1164
1092
|
} | undefined;
|
|
1165
|
-
},
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
readonly
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
readonly
|
|
1180
|
-
|
|
1181
|
-
readonly
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
readonly
|
|
1185
|
-
readonly
|
|
1186
|
-
|
|
1187
|
-
readonly
|
|
1188
|
-
readonly
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
readonly
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
readonly
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
readonly mediaType: Schema.String;
|
|
1220
|
-
}>, Schema.Struct<{
|
|
1221
|
-
readonly type: Schema.Literal<"url">;
|
|
1222
|
-
readonly url: Schema.String;
|
|
1223
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
1224
|
-
readonly expiresAt: Schema.optional<Schema.Number>;
|
|
1225
|
-
}>, Schema.Struct<{
|
|
1226
|
-
readonly type: Schema.Literal<"ref">;
|
|
1227
|
-
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
1228
|
-
readonly id: Schema.String;
|
|
1229
|
-
readonly mediaType: Schema.optional<Schema.String>;
|
|
1230
|
-
}>]>;
|
|
1231
|
-
readonly info: Schema.optional<Schema.Struct<{
|
|
1232
|
-
readonly width: Schema.optional<Schema.Number>;
|
|
1233
|
-
readonly height: Schema.optional<Schema.Number>;
|
|
1234
|
-
readonly durationSeconds: Schema.optional<Schema.Number>;
|
|
1235
|
-
readonly sampleRate: Schema.optional<Schema.Number>;
|
|
1236
|
-
readonly channels: Schema.optional<Schema.Number>;
|
|
1237
|
-
readonly encoding: Schema.optional<Schema.String>;
|
|
1238
|
-
readonly format: Schema.optional<Schema.String>;
|
|
1239
|
-
}>>;
|
|
1240
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1241
|
-
}>, never, never>;
|
|
1242
|
-
}> | Schema.Struct<{
|
|
1243
|
-
readonly type: Schema.tag<"finish">;
|
|
1244
|
-
readonly usage: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
1245
|
-
readonly type: Schema.Literal<"tokens">;
|
|
1246
|
-
readonly input: Schema.optional<Schema.Number>;
|
|
1247
|
-
readonly output: Schema.optional<Schema.Number>;
|
|
1248
|
-
readonly total: Schema.optional<Schema.Number>;
|
|
1249
|
-
readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
1250
|
-
}>, Schema.Struct<{
|
|
1251
|
-
readonly type: Schema.Literal<"seconds">;
|
|
1252
|
-
readonly seconds: Schema.Number;
|
|
1253
|
-
}>, Schema.Struct<{
|
|
1254
|
-
readonly type: Schema.Literal<"characters">;
|
|
1255
|
-
readonly characters: Schema.Number;
|
|
1256
|
-
}>, Schema.Struct<{
|
|
1257
|
-
readonly type: Schema.Literal<"credits">;
|
|
1258
|
-
readonly credits: Schema.Number;
|
|
1259
|
-
}>, Schema.Struct<{
|
|
1260
|
-
readonly type: Schema.Literal<"compute">;
|
|
1261
|
-
readonly seconds: Schema.Number;
|
|
1262
|
-
}>]>>;
|
|
1263
|
-
readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
1264
|
-
}> 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<{
|
|
1093
|
+
}, {
|
|
1094
|
+
readonly type: keyof Handlers;
|
|
1095
|
+
}>) => any)): import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
1096
|
+
<Handlers, OrElse>(cases: Handlers & {
|
|
1097
|
+
readonly finish?: ((value: {
|
|
1098
|
+
readonly type: "finish";
|
|
1099
|
+
readonly usage?: {
|
|
1100
|
+
readonly type: "seconds";
|
|
1101
|
+
readonly seconds: number;
|
|
1102
|
+
} | {
|
|
1103
|
+
readonly type: "characters";
|
|
1104
|
+
readonly characters: number;
|
|
1105
|
+
} | {
|
|
1106
|
+
readonly type: "credits";
|
|
1107
|
+
readonly credits: number;
|
|
1108
|
+
} | {
|
|
1109
|
+
readonly type: "compute";
|
|
1110
|
+
readonly seconds: number;
|
|
1111
|
+
} | {
|
|
1112
|
+
readonly type: "tokens";
|
|
1113
|
+
readonly input?: number | undefined;
|
|
1114
|
+
readonly output?: number | undefined;
|
|
1115
|
+
readonly total?: number | undefined;
|
|
1116
|
+
readonly details?: {
|
|
1117
|
+
readonly [x: string]: unknown;
|
|
1118
|
+
} | undefined;
|
|
1119
|
+
} | undefined;
|
|
1120
|
+
readonly providerMetadata?: {
|
|
1121
|
+
readonly [x: string]: {
|
|
1122
|
+
readonly [x: string]: unknown;
|
|
1123
|
+
};
|
|
1124
|
+
} | undefined;
|
|
1125
|
+
}) => any) | undefined;
|
|
1126
|
+
readonly "generation-progress"?: ((value: {
|
|
1127
|
+
readonly type: "generation-progress";
|
|
1128
|
+
readonly id: string;
|
|
1129
|
+
readonly progress?: number | undefined;
|
|
1130
|
+
}) => any) | undefined;
|
|
1131
|
+
readonly "generation-queued"?: ((value: {
|
|
1132
|
+
readonly type: "generation-queued";
|
|
1133
|
+
readonly id: string;
|
|
1134
|
+
readonly position?: number | undefined;
|
|
1135
|
+
}) => any) | undefined;
|
|
1136
|
+
readonly image?: ((value: {
|
|
1137
|
+
readonly type: "image";
|
|
1138
|
+
readonly index: number;
|
|
1139
|
+
readonly image: Media.Asset;
|
|
1140
|
+
}) => any) | undefined;
|
|
1141
|
+
readonly "image-partial"?: ((value: {
|
|
1142
|
+
readonly type: "image-partial";
|
|
1143
|
+
readonly index: number;
|
|
1144
|
+
readonly image: Media.Asset;
|
|
1145
|
+
}) => any) | undefined;
|
|
1146
|
+
} & (Exclude<keyof Handlers, "finish" | "generation-progress" | "generation-queued" | "image" | "image-partial"> extends never ? unknown : never), orElse: OrElse & ((value: Exclude<{
|
|
1265
1147
|
readonly type: "image-partial";
|
|
1266
1148
|
readonly index: number;
|
|
1267
1149
|
readonly image: Media.Asset;
|
|
1268
|
-
}
|
|
1150
|
+
}, {
|
|
1151
|
+
readonly type: keyof Handlers;
|
|
1152
|
+
}> | Exclude<{
|
|
1269
1153
|
readonly type: "image";
|
|
1270
1154
|
readonly index: number;
|
|
1271
1155
|
readonly image: Media.Asset;
|
|
1272
|
-
}
|
|
1156
|
+
}, {
|
|
1157
|
+
readonly type: keyof Handlers;
|
|
1158
|
+
}> | Exclude<{
|
|
1273
1159
|
readonly type: "generation-queued";
|
|
1274
1160
|
readonly id: string;
|
|
1275
1161
|
readonly position?: number | undefined;
|
|
1276
|
-
}
|
|
1162
|
+
}, {
|
|
1163
|
+
readonly type: keyof Handlers;
|
|
1164
|
+
}> | Exclude<{
|
|
1277
1165
|
readonly type: "generation-progress";
|
|
1278
1166
|
readonly id: string;
|
|
1279
1167
|
readonly progress?: number | undefined;
|
|
1280
|
-
}
|
|
1168
|
+
}, {
|
|
1169
|
+
readonly type: keyof Handlers;
|
|
1170
|
+
}> | Exclude<{
|
|
1281
1171
|
readonly type: "finish";
|
|
1282
1172
|
readonly usage?: {
|
|
1283
1173
|
readonly type: "seconds";
|
|
@@ -1305,7 +1195,9 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1305
1195
|
readonly [x: string]: unknown;
|
|
1306
1196
|
};
|
|
1307
1197
|
} | undefined;
|
|
1308
|
-
}, {
|
|
1198
|
+
}, {
|
|
1199
|
+
readonly type: keyof Handlers;
|
|
1200
|
+
}>) => any)): (value: {
|
|
1309
1201
|
readonly type: "image-partial";
|
|
1310
1202
|
readonly index: number;
|
|
1311
1203
|
readonly image: Media.Asset;
|
|
@@ -1349,7 +1241,7 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1349
1241
|
readonly [x: string]: unknown;
|
|
1350
1242
|
};
|
|
1351
1243
|
} | undefined;
|
|
1352
|
-
}) => import("effect/Unify").Unify<{ [K in keyof
|
|
1244
|
+
}) => import("effect/Unify").Unify<{ [K in keyof Handlers]-?: NonNullable<Handlers[K]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Handlers] | (OrElse extends (...args: Array<any>) => infer R ? R : never)>;
|
|
1353
1245
|
};
|
|
1354
1246
|
} & {
|
|
1355
1247
|
is: {
|
|
@@ -1405,12 +1297,12 @@ export declare const ImageEvent: Schema.Union<readonly [Schema.Struct<{
|
|
|
1405
1297
|
};
|
|
1406
1298
|
};
|
|
1407
1299
|
export type ImageEvent = Schema.Schema.Type<typeof imageEventTagged>;
|
|
1408
|
-
|
|
1409
|
-
export declare
|
|
1410
|
-
export declare function generate<const Model extends ImageModel>(input:
|
|
1411
|
-
export declare function stream<const Model extends ImageModel>(input:
|
|
1300
|
+
/** Normalize image request input into a plain `ImageRequest`. */
|
|
1301
|
+
export declare const request: <const Model extends ImageModel>(input: ImageRequestInput<Model>) => ImageRequest<Model>;
|
|
1302
|
+
export declare function generate<const Model extends ImageModel>(input: ImageRequestInput<Model>, options?: AwaitOptions): Effect.Effect<ImageResponse, AIError, Service>;
|
|
1303
|
+
export declare function stream<const Model extends ImageModel>(input: ImageRequestInput<Model>, options?: AwaitOptions): Stream.Stream<ImageEvent, AIError, Service>;
|
|
1412
1304
|
/** Inline and streaming routes fail with `UnsupportedOperation`. */
|
|
1413
|
-
export declare function start<const Model extends ImageModel>(input:
|
|
1305
|
+
export declare function start<const Model extends ImageModel>(input: ImageRequestInput<Model>): Effect.Effect<Generation<ImageResponse>, AIError, Service>;
|
|
1414
1306
|
export declare const resume: (model: ImageModel, token: unknown) => Effect.Effect<Generation<ImageResponse>, AIError, Service>;
|
|
1415
1307
|
export declare const Image: {
|
|
1416
1308
|
readonly request: typeof request;
|