@marinoscar/platform-api 0.1.0-next.4 → 0.1.0-next.6
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/CHANGELOG.md +18 -0
- package/dist/ai/core/ai-error.d.ts +15 -158
- package/dist/ai/core/ai-error.d.ts.map +1 -1
- package/dist/ai/core/ai-error.js +58 -221
- package/dist/ai/core/ai-error.js.map +1 -1
- package/dist/ai/core/capabilities.d.ts +3 -126
- package/dist/ai/core/capabilities.d.ts.map +1 -1
- package/dist/ai/core/capabilities.js +13 -109
- package/dist/ai/core/capabilities.js.map +1 -1
- package/dist/ai/core/conversation.d.ts +2 -15
- package/dist/ai/core/conversation.d.ts.map +1 -1
- package/dist/ai/core/conversation.js +9 -54
- package/dist/ai/core/conversation.js.map +1 -1
- package/dist/ai/core/hosted-tools.d.ts +3 -172
- package/dist/ai/core/hosted-tools.d.ts.map +1 -1
- package/dist/ai/core/hosted-tools.js +20 -286
- package/dist/ai/core/hosted-tools.js.map +1 -1
- package/dist/ai/core/provider-adapter.interface.d.ts +3 -260
- package/dist/ai/core/provider-adapter.interface.d.ts.map +1 -1
- package/dist/ai/core/provider-adapter.interface.js +7 -29
- package/dist/ai/core/provider-adapter.interface.js.map +1 -1
- package/dist/ai/core/structured-output.d.ts +3 -49
- package/dist/ai/core/structured-output.d.ts.map +1 -1
- package/dist/ai/core/structured-output.js +9 -80
- package/dist/ai/core/structured-output.js.map +1 -1
- package/dist/ai/core/tools.d.ts +3 -93
- package/dist/ai/core/tools.d.ts.map +1 -1
- package/dist/ai/core/tools.js +9 -73
- package/dist/ai/core/tools.js.map +1 -1
- package/dist/ai/core/types/file-inputs.types.d.ts +3 -102
- package/dist/ai/core/types/file-inputs.types.d.ts.map +1 -1
- package/dist/ai/core/types/file-inputs.types.js +14 -78
- package/dist/ai/core/types/file-inputs.types.js.map +1 -1
- package/dist/ai/core/types/media.types.d.ts +3 -616
- package/dist/ai/core/types/media.types.d.ts.map +1 -1
- package/dist/ai/core/types/media.types.js +33 -203
- package/dist/ai/core/types/media.types.js.map +1 -1
- package/dist/ai/core/types/responses.types.d.ts +3 -619
- package/dist/ai/core/types/responses.types.d.ts.map +1 -1
- package/dist/ai/core/types/responses.types.js +9 -57
- package/dist/ai/core/types/responses.types.js.map +1 -1
- package/dist/ai/http/dto/ai-images.dto.d.ts +4 -4
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +3 -3
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/providers/anthropic/anthropic-client.factory.d.ts +13 -15
- package/dist/ai/providers/anthropic/anthropic-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/anthropic/anthropic-client.factory.js +23 -52
- package/dist/ai/providers/anthropic/anthropic-client.factory.js.map +1 -1
- package/dist/ai/providers/anthropic/anthropic.adapter.d.ts +15 -51
- package/dist/ai/providers/anthropic/anthropic.adapter.d.ts.map +1 -1
- package/dist/ai/providers/anthropic/anthropic.adapter.js +29 -293
- package/dist/ai/providers/anthropic/anthropic.adapter.js.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.d.ts +10 -14
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.js +20 -53
- package/dist/ai/providers/azure-openai/azure-openai-client.factory.js.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai.adapter.d.ts +14 -31
- package/dist/ai/providers/azure-openai/azure-openai.adapter.d.ts.map +1 -1
- package/dist/ai/providers/azure-openai/azure-openai.adapter.js +25 -170
- package/dist/ai/providers/azure-openai/azure-openai.adapter.js.map +1 -1
- package/dist/ai/providers/gemini/gemini-client.factory.d.ts +13 -18
- package/dist/ai/providers/gemini/gemini-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/gemini/gemini-client.factory.js +24 -68
- package/dist/ai/providers/gemini/gemini-client.factory.js.map +1 -1
- package/dist/ai/providers/gemini/gemini.adapter.d.ts +15 -58
- package/dist/ai/providers/gemini/gemini.adapter.d.ts.map +1 -1
- package/dist/ai/providers/gemini/gemini.adapter.js +29 -348
- package/dist/ai/providers/gemini/gemini.adapter.js.map +1 -1
- package/dist/ai/providers/openai/openai-client.factory.d.ts +13 -35
- package/dist/ai/providers/openai/openai-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/openai/openai-client.factory.js +25 -64
- package/dist/ai/providers/openai/openai-client.factory.js.map +1 -1
- package/dist/ai/providers/openai/openai.adapter.d.ts +15 -48
- package/dist/ai/providers/openai/openai.adapter.d.ts.map +1 -1
- package/dist/ai/providers/openai/openai.adapter.js +27 -206
- package/dist/ai/providers/openai/openai.adapter.js.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.d.ts +11 -11
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.d.ts.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.js +18 -41
- package/dist/ai/providers/openai-compatible/openai-compatible-client.factory.js.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.d.ts +14 -32
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.d.ts.map +1 -1
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.js +25 -149
- package/dist/ai/providers/openai-compatible/openai-compatible.adapter.js.map +1 -1
- package/dist/ai/providers/platform-ai-tracer.d.ts +4 -0
- package/dist/ai/providers/platform-ai-tracer.d.ts.map +1 -0
- package/dist/ai/providers/platform-ai-tracer.js +20 -0
- package/dist/ai/providers/platform-ai-tracer.js.map +1 -0
- package/dist/ai/runtime/ai-image-run-request.d.ts +1 -1
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.d.ts +28 -5
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.d.ts.map +1 -1
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.js +54 -9
- package/dist/ai/testing/conformance/ai-no-sdk-leak.suite.js.map +1 -1
- package/dist/ai/testing/index.d.ts +1 -1
- package/dist/ai/testing/index.d.ts.map +1 -1
- package/dist/ai/testing/index.js +2 -1
- package/dist/ai/testing/index.js.map +1 -1
- package/dist/jobs/rate-limit.error.d.ts +2 -26
- package/dist/jobs/rate-limit.error.d.ts.map +1 -1
- package/dist/jobs/rate-limit.error.js +4 -52
- package/dist/jobs/rate-limit.error.js.map +1 -1
- package/dist/storage/config/storage-config.controller.d.ts +1 -1
- package/package.json +3 -2
- package/dist/ai/providers/anthropic/anthropic-errors.d.ts +0 -16
- package/dist/ai/providers/anthropic/anthropic-errors.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-errors.js +0 -156
- package/dist/ai/providers/anthropic/anthropic-errors.js.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.d.ts +0 -80
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.js +0 -536
- package/dist/ai/providers/anthropic/anthropic-messages.mapper.js.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-model-catalog.d.ts +0 -49
- package/dist/ai/providers/anthropic/anthropic-model-catalog.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-model-catalog.js +0 -198
- package/dist/ai/providers/anthropic/anthropic-model-catalog.js.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.d.ts +0 -35
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.js +0 -203
- package/dist/ai/providers/anthropic/anthropic-stream.mapper.js.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.d.ts +0 -18
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.js +0 -120
- package/dist/ai/providers/anthropic/testing/anthropic-fixtures.js.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.d.ts +0 -59
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.d.ts.map +0 -1
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.js +0 -206
- package/dist/ai/providers/anthropic/testing/anthropic-mock-transport.js.map +0 -1
- package/dist/ai/providers/azure-openai/azure-openai-settings.d.ts +0 -23
- package/dist/ai/providers/azure-openai/azure-openai-settings.d.ts.map +0 -1
- package/dist/ai/providers/azure-openai/azure-openai-settings.js +0 -54
- package/dist/ai/providers/azure-openai/azure-openai-settings.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-content.mapper.d.ts +0 -98
- package/dist/ai/providers/gemini/gemini-content.mapper.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-content.mapper.js +0 -665
- package/dist/ai/providers/gemini/gemini-content.mapper.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.d.ts +0 -13
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.js +0 -78
- package/dist/ai/providers/gemini/gemini-embeddings.mapper.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-errors.d.ts +0 -32
- package/dist/ai/providers/gemini/gemini-errors.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-errors.js +0 -191
- package/dist/ai/providers/gemini/gemini-errors.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-model-catalog.d.ts +0 -45
- package/dist/ai/providers/gemini/gemini-model-catalog.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-model-catalog.js +0 -264
- package/dist/ai/providers/gemini/gemini-model-catalog.js.map +0 -1
- package/dist/ai/providers/gemini/gemini-stream.mapper.d.ts +0 -31
- package/dist/ai/providers/gemini/gemini-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/gemini/gemini-stream.mapper.js +0 -118
- package/dist/ai/providers/gemini/gemini-stream.mapper.js.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-fixtures.d.ts +0 -80
- package/dist/ai/providers/gemini/testing/gemini-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-fixtures.js +0 -118
- package/dist/ai/providers/gemini/testing/gemini-fixtures.js.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.d.ts +0 -82
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.d.ts.map +0 -1
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.js +0 -342
- package/dist/ai/providers/gemini/testing/gemini-mock-transport.js.map +0 -1
- package/dist/ai/providers/openai/openai-audio.mapper.d.ts +0 -42
- package/dist/ai/providers/openai/openai-audio.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-audio.mapper.js +0 -266
- package/dist/ai/providers/openai/openai-audio.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-call-telemetry.d.ts +0 -25
- package/dist/ai/providers/openai/openai-call-telemetry.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-call-telemetry.js +0 -93
- package/dist/ai/providers/openai/openai-call-telemetry.js.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.d.ts +0 -41
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.js +0 -173
- package/dist/ai/providers/openai/openai-chat-completions-stream.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.engine.d.ts +0 -33
- package/dist/ai/providers/openai/openai-chat-completions.engine.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.engine.js +0 -165
- package/dist/ai/providers/openai/openai-chat-completions.engine.js.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.mapper.d.ts +0 -42
- package/dist/ai/providers/openai/openai-chat-completions.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-chat-completions.mapper.js +0 -304
- package/dist/ai/providers/openai/openai-chat-completions.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-embeddings.mapper.d.ts +0 -25
- package/dist/ai/providers/openai/openai-embeddings.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-embeddings.mapper.js +0 -81
- package/dist/ai/providers/openai/openai-embeddings.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-errors.d.ts +0 -45
- package/dist/ai/providers/openai/openai-errors.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-errors.js +0 -247
- package/dist/ai/providers/openai/openai-errors.js.map +0 -1
- package/dist/ai/providers/openai/openai-family-guards.d.ts +0 -4
- package/dist/ai/providers/openai/openai-family-guards.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-family-guards.js +0 -19
- package/dist/ai/providers/openai/openai-family-guards.js.map +0 -1
- package/dist/ai/providers/openai/openai-images.mapper.d.ts +0 -23
- package/dist/ai/providers/openai/openai-images.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-images.mapper.js +0 -164
- package/dist/ai/providers/openai/openai-images.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-model-catalog.d.ts +0 -36
- package/dist/ai/providers/openai/openai-model-catalog.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-model-catalog.js +0 -209
- package/dist/ai/providers/openai/openai-model-catalog.js.map +0 -1
- package/dist/ai/providers/openai/openai-realtime.mapper.d.ts +0 -18
- package/dist/ai/providers/openai/openai-realtime.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-realtime.mapper.js +0 -159
- package/dist/ai/providers/openai/openai-realtime.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-redirect-guard.d.ts +0 -9
- package/dist/ai/providers/openai/openai-redirect-guard.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-redirect-guard.js +0 -61
- package/dist/ai/providers/openai/openai-redirect-guard.js.map +0 -1
- package/dist/ai/providers/openai/openai-responses.engine.d.ts +0 -50
- package/dist/ai/providers/openai/openai-responses.engine.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-responses.engine.js +0 -206
- package/dist/ai/providers/openai/openai-responses.engine.js.map +0 -1
- package/dist/ai/providers/openai/openai-responses.mapper.d.ts +0 -64
- package/dist/ai/providers/openai/openai-responses.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-responses.mapper.js +0 -580
- package/dist/ai/providers/openai/openai-responses.mapper.js.map +0 -1
- package/dist/ai/providers/openai/openai-stream.mapper.d.ts +0 -28
- package/dist/ai/providers/openai/openai-stream.mapper.d.ts.map +0 -1
- package/dist/ai/providers/openai/openai-stream.mapper.js +0 -139
- package/dist/ai/providers/openai/openai-stream.mapper.js.map +0 -1
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.d.ts +0 -24
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.js +0 -72
- package/dist/ai/providers/openai/testing/chat-completions-fixtures.js.map +0 -1
- package/dist/ai/providers/openai/testing/conformance-responders.d.ts +0 -7
- package/dist/ai/providers/openai/testing/conformance-responders.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/conformance-responders.js +0 -64
- package/dist/ai/providers/openai/testing/conformance-responders.js.map +0 -1
- package/dist/ai/providers/openai/testing/openai-fixtures.d.ts +0 -52
- package/dist/ai/providers/openai/testing/openai-fixtures.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/openai-fixtures.js +0 -208
- package/dist/ai/providers/openai/testing/openai-fixtures.js.map +0 -1
- package/dist/ai/providers/openai/testing/openai-mock-transport.d.ts +0 -242
- package/dist/ai/providers/openai/testing/openai-mock-transport.d.ts.map +0 -1
- package/dist/ai/providers/openai/testing/openai-mock-transport.js +0 -523
- package/dist/ai/providers/openai/testing/openai-mock-transport.js.map +0 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.d.ts +0 -13
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.d.ts.map +0 -1
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.js +0 -29
- package/dist/ai/providers/openai-compatible/openai-compatible-settings.js.map +0 -1
|
@@ -1,617 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Raw media going in or out of a provider.
|
|
5
|
-
*
|
|
6
|
-
* @stability experimental
|
|
7
|
-
*/
|
|
8
|
-
export interface AiBinaryPayload {
|
|
9
|
-
/** The bytes. */
|
|
10
|
-
data: Uint8Array;
|
|
11
|
-
/** Their MIME type. */
|
|
12
|
-
mimeType: string;
|
|
13
|
-
/** A file name, when one is known. */
|
|
14
|
-
filename?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* The largest `providerOptions` a transcription request may carry, as its JSON
|
|
18
|
-
* serialisation in bytes (PP-14.17, #935): 4 KiB. The options are an escape
|
|
19
|
-
* hatch for a provider feature the neutral contract does not model (a
|
|
20
|
-
* diarization flag, a custom vocabulary id), not a payload channel. They reach
|
|
21
|
-
* the adapter and nothing else: never a log line, a span attribute or a usage
|
|
22
|
-
* row.
|
|
23
|
-
*
|
|
24
|
-
* @stability experimental
|
|
25
|
-
*/
|
|
26
|
-
export declare const AI_PROVIDER_OPTIONS_MAX_BYTES = 4096;
|
|
27
|
-
interface AiMediaRequestBase {
|
|
28
|
-
/** The provider's model id. */
|
|
29
|
-
model: string;
|
|
30
|
-
/** Keyed by provider id — same escape hatch as `AiResponseRequest`. */
|
|
31
|
-
providerOptions?: Record<string, Record<string, unknown>>;
|
|
32
|
-
}
|
|
33
|
-
interface AiMediaResultBase {
|
|
34
|
-
/** Provider id. */
|
|
35
|
-
provider: string;
|
|
36
|
-
/** Model id. */
|
|
37
|
-
model: string;
|
|
38
|
-
/** Token accounting, as the provider reported it. */
|
|
39
|
-
usage: AiUsage;
|
|
40
|
-
/** The provider's request id, for support tickets. */
|
|
41
|
-
providerRequestId?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The most images one generate/edit call may ask for (`n`).
|
|
45
|
-
*
|
|
46
|
-
* @stability experimental
|
|
47
|
-
*/
|
|
48
|
-
export declare const AI_IMAGES_MAX_N = 4;
|
|
49
|
-
/**
|
|
50
|
-
* The most source images one edit may send.
|
|
51
|
-
*
|
|
52
|
-
* @stability experimental
|
|
53
|
-
*/
|
|
54
|
-
export declare const AI_IMAGE_EDIT_MAX_INPUTS = 16;
|
|
55
|
-
/**
|
|
56
|
-
* The largest source image (or mask) an edit reads, in bytes (25 MiB).
|
|
57
|
-
*
|
|
58
|
-
* @stability experimental
|
|
59
|
-
*/
|
|
60
|
-
export declare const AI_IMAGE_INPUT_MAX_BYTES: number;
|
|
61
|
-
/**
|
|
62
|
-
* The MIME types a source image may have.
|
|
63
|
-
*
|
|
64
|
-
* @stability experimental
|
|
65
|
-
*/
|
|
66
|
-
export declare const AI_IMAGE_INPUT_MIME_TYPES: readonly ["image/png", "image/jpeg", "image/webp"];
|
|
67
|
-
/**
|
|
68
|
-
* The MIME types a mask may have (it needs an alpha channel).
|
|
69
|
-
*
|
|
70
|
-
* @stability experimental
|
|
71
|
-
*/
|
|
72
|
-
export declare const AI_IMAGE_MASK_MIME_TYPES: readonly ["image/png"];
|
|
73
|
-
/**
|
|
74
|
-
* The longest prompt accepted, in characters.
|
|
75
|
-
*
|
|
76
|
-
* @stability experimental
|
|
77
|
-
*/
|
|
78
|
-
export declare const AI_IMAGE_PROMPT_MAX_CHARS = 32000;
|
|
79
|
-
/**
|
|
80
|
-
* The image qualities a request may ask for.
|
|
81
|
-
*
|
|
82
|
-
* @stability experimental
|
|
83
|
-
*/
|
|
84
|
-
export declare const AI_IMAGE_QUALITIES: readonly ["low", "medium", "high", "auto"];
|
|
85
|
-
/**
|
|
86
|
-
* The image backgrounds a request may ask for.
|
|
87
|
-
*
|
|
88
|
-
* @stability experimental
|
|
89
|
-
*/
|
|
90
|
-
export declare const AI_IMAGE_BACKGROUNDS: readonly ["transparent", "opaque", "auto"];
|
|
91
|
-
/**
|
|
92
|
-
* The image formats a request may ask for.
|
|
93
|
-
*
|
|
94
|
-
* @stability experimental
|
|
95
|
-
*/
|
|
96
|
-
export declare const AI_IMAGE_OUTPUT_FORMATS: readonly ["png", "jpeg", "webp"];
|
|
97
|
-
/**
|
|
98
|
-
* One image-generation request.
|
|
99
|
-
*
|
|
100
|
-
* @stability experimental
|
|
101
|
-
*/
|
|
102
|
-
export interface AiImageGenerationRequest extends AiMediaRequestBase {
|
|
103
|
-
/** What to draw. */
|
|
104
|
-
prompt: string;
|
|
105
|
-
/** Provider-validated, e.g. `1024x1024` or `auto`. */
|
|
106
|
-
size?: string;
|
|
107
|
-
/** One of {@link AI_IMAGE_QUALITIES}. */
|
|
108
|
-
quality?: (typeof AI_IMAGE_QUALITIES)[number];
|
|
109
|
-
/** One of {@link AI_IMAGE_BACKGROUNDS}. */
|
|
110
|
-
background?: (typeof AI_IMAGE_BACKGROUNDS)[number];
|
|
111
|
-
/** One of {@link AI_IMAGE_OUTPUT_FORMATS}. */
|
|
112
|
-
outputFormat?: (typeof AI_IMAGE_OUTPUT_FORMATS)[number];
|
|
113
|
-
/** Number of images, 1 to `AI_IMAGES_MAX_N`; defaults to 1. */
|
|
114
|
-
n?: number;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* One image-edit request.
|
|
118
|
-
*
|
|
119
|
-
* @stability experimental
|
|
120
|
-
*/
|
|
121
|
-
export interface AiImageEditRequest extends AiImageGenerationRequest {
|
|
122
|
-
/** The source image(s) to edit. */
|
|
123
|
-
images: AiBinaryPayload[];
|
|
124
|
-
/** Optional mask; transparent areas mark what may change. */
|
|
125
|
-
mask?: AiBinaryPayload;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* One generated image.
|
|
129
|
-
*
|
|
130
|
-
* @stability experimental
|
|
131
|
-
*/
|
|
132
|
-
export interface AiGeneratedImage extends AiBinaryPayload {
|
|
133
|
-
/** The prompt as the provider rewrote it. */
|
|
134
|
-
revisedPrompt?: string;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* The result of a generate or edit call.
|
|
138
|
-
*
|
|
139
|
-
* @stability experimental
|
|
140
|
-
*/
|
|
141
|
-
export interface AiImageResult extends AiMediaResultBase {
|
|
142
|
-
/** The images, in order. */
|
|
143
|
-
images: AiGeneratedImage[];
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* The images port a provider adapter implements (`image_generation`, `image_edit`).
|
|
147
|
-
*
|
|
148
|
-
* @stability experimental
|
|
149
|
-
*/
|
|
150
|
-
export interface AiImagesPort {
|
|
151
|
-
/**
|
|
152
|
-
* Generates images.
|
|
153
|
-
*
|
|
154
|
-
* @param req - the request.
|
|
155
|
-
* @param ctx - the call's key and signal.
|
|
156
|
-
*/
|
|
157
|
-
generate(req: AiImageGenerationRequest, ctx: AiCallContext): Promise<AiImageResult>;
|
|
158
|
-
/**
|
|
159
|
-
* Edits images. Present only when the provider supports editing (`image_edit`).
|
|
160
|
-
*
|
|
161
|
-
* @param req - the request.
|
|
162
|
-
* @param ctx - the call's key and signal.
|
|
163
|
-
*/
|
|
164
|
-
edit?(req: AiImageEditRequest, ctx: AiCallContext): Promise<AiImageResult>;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Media handed to a provider as a STREAM rather than a buffer (#438): the
|
|
168
|
-
* bytes are read once, as the provider request is sent, so a 25 MB recording
|
|
169
|
-
* is never held in memory whole. `size`, when known, lets an adapter refuse
|
|
170
|
-
* an oversized input before it opens a connection.
|
|
171
|
-
*
|
|
172
|
-
* @stability experimental
|
|
173
|
-
*/
|
|
174
|
-
export interface AiStreamedPayload {
|
|
175
|
-
/** The bytes, read once. */
|
|
176
|
-
stream: AsyncIterable<Uint8Array>;
|
|
177
|
-
/** Their MIME type. */
|
|
178
|
-
mimeType: string;
|
|
179
|
-
/** A file name, when one is known. */
|
|
180
|
-
filename?: string;
|
|
181
|
-
/** Bytes, when known in advance. */
|
|
182
|
-
size?: number;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Media going INTO a provider: whole bytes, or a stream (`'stream' in input`).
|
|
186
|
-
*
|
|
187
|
-
* @stability experimental
|
|
188
|
-
*/
|
|
189
|
-
export type AiMediaInput = AiBinaryPayload | AiStreamedPayload;
|
|
190
|
-
/**
|
|
191
|
-
* Whether `input` is streamed rather than buffered.
|
|
192
|
-
*
|
|
193
|
-
* @param input - the media.
|
|
194
|
-
* @returns `true` for an {@link AiStreamedPayload}.
|
|
195
|
-
*
|
|
196
|
-
* @stability experimental
|
|
197
|
-
*/
|
|
198
|
-
export declare function isStreamedPayload(input: AiMediaInput): input is AiStreamedPayload;
|
|
199
|
-
/**
|
|
200
|
-
* The MIME types a transcription input may have: any audio, plus the two
|
|
201
|
-
* video containers people record voice memos and meetings in. `type/*` is a
|
|
202
|
-
* wildcard (`AiStorageInputResolver` understands it).
|
|
203
|
-
*
|
|
204
|
-
* @stability experimental
|
|
205
|
-
*/
|
|
206
|
-
export declare const AI_TRANSCRIPTION_INPUT_MIME_TYPES: readonly ["audio/*", "video/mp4", "video/webm"];
|
|
207
|
-
/**
|
|
208
|
-
* The largest transcription input when the provider's audio port declares
|
|
209
|
-
* no limit of its own (`AiAudioPort.transcriptionMaxBytes`): 25 MiB, OpenAI's.
|
|
210
|
-
*
|
|
211
|
-
* @stability experimental
|
|
212
|
-
*/
|
|
213
|
-
export declare const AI_TRANSCRIPTION_DEFAULT_MAX_BYTES: number;
|
|
214
|
-
/**
|
|
215
|
-
* The longest vocabulary/context prompt accepted, in characters.
|
|
216
|
-
*
|
|
217
|
-
* @stability experimental
|
|
218
|
-
*/
|
|
219
|
-
export declare const AI_TRANSCRIPTION_PROMPT_MAX_CHARS = 4000;
|
|
220
|
-
/**
|
|
221
|
-
* The provider answer shapes a transcription may ask for.
|
|
222
|
-
*
|
|
223
|
-
* @stability experimental
|
|
224
|
-
*/
|
|
225
|
-
export declare const AI_TRANSCRIPTION_RESPONSE_FORMATS: readonly ["text", "json", "verbose_json"];
|
|
226
|
-
/**
|
|
227
|
-
* The timestamp granularities a transcription may ask for.
|
|
228
|
-
*
|
|
229
|
-
* @stability experimental
|
|
230
|
-
*/
|
|
231
|
-
export declare const AI_TRANSCRIPTION_TIMESTAMP_GRANULARITIES: readonly ["segment", "word"];
|
|
232
|
-
/**
|
|
233
|
-
* One of {@link AI_TRANSCRIPTION_TIMESTAMP_GRANULARITIES}.
|
|
234
|
-
*
|
|
235
|
-
* @stability experimental
|
|
236
|
-
*/
|
|
237
|
-
export type AiTranscriptionTimestampGranularity = (typeof AI_TRANSCRIPTION_TIMESTAMP_GRANULARITIES)[number];
|
|
238
|
-
/**
|
|
239
|
-
* One transcription request.
|
|
240
|
-
*
|
|
241
|
-
* @stability experimental
|
|
242
|
-
*/
|
|
243
|
-
export interface AiTranscriptionRequest extends AiMediaRequestBase {
|
|
244
|
-
/** The recording. */
|
|
245
|
-
audio: AiMediaInput;
|
|
246
|
-
/** ISO-639-1 hint. */
|
|
247
|
-
language?: string;
|
|
248
|
-
/** Vocabulary/context hint. */
|
|
249
|
-
prompt?: string;
|
|
250
|
-
/**
|
|
251
|
-
* The provider's answer shape. Omit and the adapter asks for the richest
|
|
252
|
-
* one the model supports (OpenAI: `verbose_json` for Whisper, `json` for
|
|
253
|
-
* the GPT-4o transcribe family).
|
|
254
|
-
*/
|
|
255
|
-
responseFormat?: (typeof AI_TRANSCRIPTION_RESPONSE_FORMATS)[number];
|
|
256
|
-
/** Per-segment and/or per-word timestamps, where the model supports them. */
|
|
257
|
-
timestampGranularities?: AiTranscriptionTimestampGranularity[];
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* One timed segment of a transcript.
|
|
261
|
-
*
|
|
262
|
-
* @stability experimental
|
|
263
|
-
*/
|
|
264
|
-
export interface AiTranscriptionSegment {
|
|
265
|
-
/** Start, in seconds from the beginning. */
|
|
266
|
-
startSeconds: number;
|
|
267
|
-
/** End, in seconds from the beginning. */
|
|
268
|
-
endSeconds: number;
|
|
269
|
-
/** The segment's text. */
|
|
270
|
-
text: string;
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* One timed word of a transcript.
|
|
274
|
-
*
|
|
275
|
-
* @stability experimental
|
|
276
|
-
*/
|
|
277
|
-
export interface AiTranscriptionWord {
|
|
278
|
-
/** Start, in seconds from the beginning. */
|
|
279
|
-
startSeconds: number;
|
|
280
|
-
/** End, in seconds from the beginning. */
|
|
281
|
-
endSeconds: number;
|
|
282
|
-
/** The word. */
|
|
283
|
-
word: string;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* The largest `extras` a transcription result may keep, as its JSON
|
|
287
|
-
* serialisation in bytes (PP-14.17, #935): 64 KiB, which also bounds how many
|
|
288
|
-
* segments it can carry. A result whose extras are
|
|
289
|
-
* larger, not JSON, or malformed (a segment without a start, an end and a
|
|
290
|
-
* text) keeps its transcript and drops the extras; the call is still billed
|
|
291
|
-
* and recorded.
|
|
292
|
-
*
|
|
293
|
-
* @stability experimental
|
|
294
|
-
*/
|
|
295
|
-
export declare const AI_TRANSCRIPTION_EXTRAS_MAX_BYTES: number;
|
|
296
|
-
/**
|
|
297
|
-
* One timed, optionally speaker-labelled segment of a transcript's `extras`.
|
|
298
|
-
*
|
|
299
|
-
* @stability experimental
|
|
300
|
-
*/
|
|
301
|
-
export interface AiTranscriptionExtrasSegment {
|
|
302
|
-
/** Start, in seconds from the beginning. */
|
|
303
|
-
start: number;
|
|
304
|
-
/** End, in seconds from the beginning. */
|
|
305
|
-
end: number;
|
|
306
|
-
/** The segment's text. */
|
|
307
|
-
text: string;
|
|
308
|
-
/** Who spoke it, as the provider labels speakers (`A`, `speaker_1`). */
|
|
309
|
-
speaker?: string;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* What a provider reports about a transcript beyond its text (PP-14.17,
|
|
313
|
-
* #935): speaker-labelled segments and the language, plus any other JSON the
|
|
314
|
-
* provider adds. Bounded by {@link AI_TRANSCRIPTION_EXTRAS_MAX_BYTES}. The runtime keeps it on the
|
|
315
|
-
* run's output and nowhere else: not a log line, a span or a usage row.
|
|
316
|
-
*
|
|
317
|
-
* @stability experimental
|
|
318
|
-
*/
|
|
319
|
-
export interface AiTranscriptionExtras {
|
|
320
|
-
/** Speaker-labelled, timed segments. */
|
|
321
|
-
segments?: AiTranscriptionExtrasSegment[];
|
|
322
|
-
/** The language the provider detected. */
|
|
323
|
-
language?: string;
|
|
324
|
-
/** Anything else the provider adds (JSON-serialisable only). */
|
|
325
|
-
[key: string]: unknown;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* The result of a transcription.
|
|
329
|
-
*
|
|
330
|
-
* @stability experimental
|
|
331
|
-
*/
|
|
332
|
-
export interface AiTranscriptionResult extends AiMediaResultBase {
|
|
333
|
-
/** The whole transcript. */
|
|
334
|
-
text: string;
|
|
335
|
-
/** The language detected (or hinted). */
|
|
336
|
-
language?: string;
|
|
337
|
-
/** The audio's length, when the provider reports it — what `audioSeconds` usage is metered on. */
|
|
338
|
-
durationSeconds?: number;
|
|
339
|
-
/** Timed segments, when asked for and supported. */
|
|
340
|
-
segments?: AiTranscriptionSegment[];
|
|
341
|
-
/** Timed words, when asked for and supported. */
|
|
342
|
-
words?: AiTranscriptionWord[];
|
|
343
|
-
/**
|
|
344
|
-
* Provider-reported detail beyond the neutral fields: speaker-labelled
|
|
345
|
-
* segments (diarization), the language, anything else. Bounded (see
|
|
346
|
-
* {@link AiTranscriptionExtras}); the runtime drops extras that are too
|
|
347
|
-
* large or malformed rather than failing a billed call.
|
|
348
|
-
*/
|
|
349
|
-
extras?: AiTranscriptionExtras;
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* The longest text one speech call may speak, in characters (OpenAI's limit).
|
|
353
|
-
*
|
|
354
|
-
* @stability experimental
|
|
355
|
-
*/
|
|
356
|
-
export declare const AI_SPEECH_INPUT_MAX_CHARS = 4096;
|
|
357
|
-
/**
|
|
358
|
-
* The longest style/tone instruction accepted, in characters.
|
|
359
|
-
*
|
|
360
|
-
* @stability experimental
|
|
361
|
-
*/
|
|
362
|
-
export declare const AI_SPEECH_INSTRUCTIONS_MAX_CHARS = 4096;
|
|
363
|
-
/**
|
|
364
|
-
* The audio formats speech may be produced in.
|
|
365
|
-
*
|
|
366
|
-
* @stability experimental
|
|
367
|
-
*/
|
|
368
|
-
export declare const AI_SPEECH_FORMATS: readonly ["mp3", "wav", "opus", "aac", "flac", "pcm"];
|
|
369
|
-
/**
|
|
370
|
-
* One of {@link AI_SPEECH_FORMATS}.
|
|
371
|
-
*
|
|
372
|
-
* @stability experimental
|
|
373
|
-
*/
|
|
374
|
-
export type AiSpeechFormat = (typeof AI_SPEECH_FORMATS)[number];
|
|
375
|
-
/**
|
|
376
|
-
* The MIME type each speech format is stored and served as (`pcm`: raw 24 kHz 16-bit LE).
|
|
377
|
-
*
|
|
378
|
-
* @stability experimental
|
|
379
|
-
*/
|
|
380
|
-
export declare const AI_SPEECH_FORMAT_MIME: Record<AiSpeechFormat, string>;
|
|
381
|
-
/**
|
|
382
|
-
* The slowest speaking rate (1 is normal).
|
|
383
|
-
*
|
|
384
|
-
* @stability experimental
|
|
385
|
-
*/
|
|
386
|
-
export declare const AI_SPEECH_SPEED_MIN = 0.25;
|
|
387
|
-
/**
|
|
388
|
-
* The fastest speaking rate (1 is normal).
|
|
389
|
-
*
|
|
390
|
-
* @stability experimental
|
|
391
|
-
*/
|
|
392
|
-
export declare const AI_SPEECH_SPEED_MAX = 4;
|
|
393
|
-
/**
|
|
394
|
-
* One text-to-speech request.
|
|
395
|
-
*
|
|
396
|
-
* @stability experimental
|
|
397
|
-
*/
|
|
398
|
-
export interface AiSpeechRequest extends AiMediaRequestBase {
|
|
399
|
-
/** 1 to `AI_SPEECH_INPUT_MAX_CHARS` characters. */
|
|
400
|
-
input: string;
|
|
401
|
-
/** The voice (one the model speaks). */
|
|
402
|
-
voice: string;
|
|
403
|
-
/** Defaults to `mp3`. */
|
|
404
|
-
format?: AiSpeechFormat;
|
|
405
|
-
/** Style/tone instructions where supported (OpenAI: not the `tts-1` family). */
|
|
406
|
-
instructions?: string;
|
|
407
|
-
/** `AI_SPEECH_SPEED_MIN` to `AI_SPEECH_SPEED_MAX`; 1 is normal. */
|
|
408
|
-
speed?: number;
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* The result of a speech call.
|
|
412
|
-
*
|
|
413
|
-
* @stability experimental
|
|
414
|
-
*/
|
|
415
|
-
export interface AiSpeechResult extends AiMediaResultBase {
|
|
416
|
-
/** The spoken audio. */
|
|
417
|
-
audio: AiBinaryPayload;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* The audio port a provider adapter implements (`audio_transcription`, `audio_speech`).
|
|
421
|
-
*
|
|
422
|
-
* @stability experimental
|
|
423
|
-
*/
|
|
424
|
-
export interface AiAudioPort {
|
|
425
|
-
/**
|
|
426
|
-
* Transcribes a recording. Present only when the provider supports `audio_transcription`.
|
|
427
|
-
*
|
|
428
|
-
* @param req - the request.
|
|
429
|
-
* @param ctx - the call's key and signal.
|
|
430
|
-
*/
|
|
431
|
-
transcribe?(req: AiTranscriptionRequest, ctx: AiCallContext): Promise<AiTranscriptionResult>;
|
|
432
|
-
/**
|
|
433
|
-
* The largest audio input `transcribe` accepts, in bytes. The runtime
|
|
434
|
-
* refuses a larger input with `AI_INVALID_REQUEST` BEFORE calling. Omitted:
|
|
435
|
-
* `AI_TRANSCRIPTION_DEFAULT_MAX_BYTES`.
|
|
436
|
-
*/
|
|
437
|
-
readonly transcriptionMaxBytes?: number;
|
|
438
|
-
/**
|
|
439
|
-
* Speaks text. Present only when the provider supports `audio_speech`.
|
|
440
|
-
*
|
|
441
|
-
* @param req - the request.
|
|
442
|
-
* @param ctx - the call's key and signal.
|
|
443
|
-
*/
|
|
444
|
-
speech?(req: AiSpeechRequest, ctx: AiCallContext): Promise<AiSpeechResult>;
|
|
445
|
-
/**
|
|
446
|
-
* Every voice `speech` accepts, as static data (#439). A model may offer a
|
|
447
|
-
* subset — its catalog capabilities' `voices`; this is the provider-wide
|
|
448
|
-
* list the runtime falls back to when a model does not say.
|
|
449
|
-
*/
|
|
450
|
-
readonly voices?: readonly string[];
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* The most inputs one `embed` call accepts. A larger batch is refused with
|
|
454
|
-
* `AI_INVALID_REQUEST` rather than silently split: chunk it yourself, and for
|
|
455
|
-
* a backfill of thousands of rows enqueue your own job type that calls
|
|
456
|
-
* `embed` per chunk (docs/specs/ai-platform.md, "Embeddings").
|
|
457
|
-
*
|
|
458
|
-
* @stability experimental
|
|
459
|
-
*/
|
|
460
|
-
export declare const AI_EMBEDDINGS_MAX_INPUTS = 256;
|
|
461
|
-
/**
|
|
462
|
-
* One embeddings request.
|
|
463
|
-
*
|
|
464
|
-
* @stability experimental
|
|
465
|
-
*/
|
|
466
|
-
export interface AiEmbeddingRequest extends AiMediaRequestBase {
|
|
467
|
-
/** One text, or up to `AI_EMBEDDINGS_MAX_INPUTS` texts. None may be empty. */
|
|
468
|
-
input: string | string[];
|
|
469
|
-
/**
|
|
470
|
-
* Shorten every vector to this many dimensions where the model supports it
|
|
471
|
-
* (OpenAI: `text-embedding-3-*`). A model that cannot is refused with
|
|
472
|
-
* `AI_INVALID_REQUEST` rather than answered at its native length.
|
|
473
|
-
*/
|
|
474
|
-
dimensions?: number;
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* The result of an embeddings call.
|
|
478
|
-
*
|
|
479
|
-
* @stability experimental
|
|
480
|
-
*/
|
|
481
|
-
export interface AiEmbeddingResult extends AiMediaResultBase {
|
|
482
|
-
/** One vector per input, in input order (a single string input yields one). */
|
|
483
|
-
vectors: number[][];
|
|
484
|
-
/** The length of every vector in `vectors`. */
|
|
485
|
-
dimensions: number;
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* The embeddings port a provider adapter implements (`embeddings`).
|
|
489
|
-
*
|
|
490
|
-
* @stability experimental
|
|
491
|
-
*/
|
|
492
|
-
export interface AiEmbeddingsPort {
|
|
493
|
-
/**
|
|
494
|
-
* Embeds texts.
|
|
495
|
-
*
|
|
496
|
-
* @param req - the request.
|
|
497
|
-
* @param ctx - the call's key and signal.
|
|
498
|
-
*/
|
|
499
|
-
embed(req: AiEmbeddingRequest, ctx: AiCallContext): Promise<AiEmbeddingResult>;
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* How long a minted client secret may be used to OPEN a session (seconds).
|
|
503
|
-
*
|
|
504
|
-
* @stability experimental
|
|
505
|
-
*/
|
|
506
|
-
export declare const AI_REALTIME_CLIENT_SECRET_TTL_SECONDS = 60;
|
|
507
|
-
/**
|
|
508
|
-
* The longest initial `instructions` accepted, in characters.
|
|
509
|
-
*
|
|
510
|
-
* @stability experimental
|
|
511
|
-
*/
|
|
512
|
-
export declare const AI_REALTIME_INSTRUCTIONS_MAX_CHARS = 16000;
|
|
513
|
-
/**
|
|
514
|
-
* How the provider decides a user's turn has ended. `server_vad` detects
|
|
515
|
-
* silence; `semantic_vad` judges whether the user has finished their
|
|
516
|
-
* thought. `null` on a request switches detection off (push-to-talk: the
|
|
517
|
-
* client commits the audio buffer itself).
|
|
518
|
-
*
|
|
519
|
-
* @stability experimental
|
|
520
|
-
*/
|
|
521
|
-
export type AiRealtimeTurnDetection = {
|
|
522
|
-
/** Silence detection. */
|
|
523
|
-
type: 'server_vad';
|
|
524
|
-
/** Activation threshold, 0-1. */
|
|
525
|
-
threshold?: number;
|
|
526
|
-
/** Audio kept from before speech started, in milliseconds. */
|
|
527
|
-
prefixPaddingMs?: number;
|
|
528
|
-
/** Silence that ends a turn, in milliseconds. */
|
|
529
|
-
silenceDurationMs?: number;
|
|
530
|
-
} | {
|
|
531
|
-
/** Semantic end-of-turn detection. */
|
|
532
|
-
type: 'semantic_vad';
|
|
533
|
-
/** How quickly the model answers. */
|
|
534
|
-
eagerness?: 'low' | 'medium' | 'high' | 'auto';
|
|
535
|
-
};
|
|
536
|
-
/**
|
|
537
|
-
* One realtime (voice) session request.
|
|
538
|
-
*
|
|
539
|
-
* @stability experimental
|
|
540
|
-
*/
|
|
541
|
-
export interface AiRealtimeSessionRequest extends AiMediaRequestBase {
|
|
542
|
-
/** Initial system instructions — the client may change them over its data channel. */
|
|
543
|
-
instructions?: string;
|
|
544
|
-
/** The voice the model answers in; the runtime has already checked the model speaks it. */
|
|
545
|
-
voice?: string;
|
|
546
|
-
/** Output modalities; the provider's default (audio, with its transcript) when omitted. */
|
|
547
|
-
modalities?: Array<'text' | 'audio'>;
|
|
548
|
-
/** Client-executed function tools the session starts with. */
|
|
549
|
-
tools?: AiFunctionTool[];
|
|
550
|
-
/** Omitted: the provider's default. `null`: no automatic turn detection. */
|
|
551
|
-
turnDetection?: AiRealtimeTurnDetection | null;
|
|
552
|
-
/** Initial per-response output-token cap (a default the client can change, not an enforcement). */
|
|
553
|
-
maxOutputTokens?: number;
|
|
554
|
-
/** Seconds the client secret may open a session; defaults to `AI_REALTIME_CLIENT_SECRET_TTL_SECONDS`. */
|
|
555
|
-
expiresInSeconds?: number;
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* A short-lived session the BROWSER connects to directly. `clientSecret` is
|
|
559
|
-
* an ephemeral, provider-minted token scoped to this one session
|
|
560
|
-
* configuration — never the provider API key the server called with.
|
|
561
|
-
*
|
|
562
|
-
* ⚠ Treat `clientSecret` as a bearer credential: it is returned to the
|
|
563
|
-
* caller (that is its purpose) and nowhere else — never logged, never put on
|
|
564
|
-
* a span, never stored.
|
|
565
|
-
*
|
|
566
|
-
* @stability experimental
|
|
567
|
-
*/
|
|
568
|
-
export interface AiRealtimeSession {
|
|
569
|
-
/** The provider's session id, when it reports one. */
|
|
570
|
-
id?: string;
|
|
571
|
-
/** Provider id. */
|
|
572
|
-
provider: string;
|
|
573
|
-
/** Model id. */
|
|
574
|
-
model: string;
|
|
575
|
-
/** The ephemeral secret the browser authenticates the connection with. */
|
|
576
|
-
clientSecret: string;
|
|
577
|
-
/** When `clientSecret` stops being able to open a session. */
|
|
578
|
-
expiresAt: Date;
|
|
579
|
-
/** Where the browser POSTs its WebRTC SDP offer, with `Authorization: Bearer <clientSecret>`. */
|
|
580
|
-
connectUrl: string;
|
|
581
|
-
/** The voice the session speaks in, as the provider confirmed it. */
|
|
582
|
-
voice?: string;
|
|
583
|
-
/** The effective initial configuration, as neutral non-secret fields. */
|
|
584
|
-
sessionConfig?: {
|
|
585
|
-
/** Output modalities. */
|
|
586
|
-
modalities?: Array<'text' | 'audio'>;
|
|
587
|
-
/** Initial instructions. */
|
|
588
|
-
instructions?: string;
|
|
589
|
-
/** Turn detection; `null` when off. */
|
|
590
|
-
turnDetection?: AiRealtimeTurnDetection | null;
|
|
591
|
-
/** Initial per-response output-token cap. */
|
|
592
|
-
maxOutputTokens?: number;
|
|
593
|
-
};
|
|
594
|
-
/** The provider's request id, for support tickets. */
|
|
595
|
-
providerRequestId?: string;
|
|
596
|
-
}
|
|
597
|
-
/**
|
|
598
|
-
* The realtime port a provider adapter implements (`realtime`).
|
|
599
|
-
*
|
|
600
|
-
* @stability experimental
|
|
601
|
-
*/
|
|
602
|
-
export interface AiRealtimePort {
|
|
603
|
-
/**
|
|
604
|
-
* Mints a session the browser connects to.
|
|
605
|
-
*
|
|
606
|
-
* @param req - the request.
|
|
607
|
-
* @param ctx - the call's key and signal.
|
|
608
|
-
*/
|
|
609
|
-
createSession(req: AiRealtimeSessionRequest, ctx: AiCallContext): Promise<AiRealtimeSession>;
|
|
610
|
-
/**
|
|
611
|
-
* Every voice `createSession` accepts, as static data. A model may offer a
|
|
612
|
-
* subset — its catalog capabilities' `voices`; this is the fallback.
|
|
613
|
-
*/
|
|
614
|
-
readonly voices?: readonly string[];
|
|
615
|
-
}
|
|
616
|
-
export {};
|
|
1
|
+
import '../ai-error';
|
|
2
|
+
export { AI_EMBEDDINGS_MAX_INPUTS, AI_IMAGE_BACKGROUNDS, AI_IMAGE_EDIT_MAX_INPUTS, AI_IMAGE_INPUT_MAX_BYTES, AI_IMAGE_INPUT_MIME_TYPES, AI_IMAGE_MASK_MIME_TYPES, AI_IMAGE_OUTPUT_FORMATS, AI_IMAGE_PROMPT_MAX_CHARS, AI_IMAGE_QUALITIES, AI_IMAGES_MAX_N, AI_PROVIDER_OPTIONS_MAX_BYTES, AI_REALTIME_CLIENT_SECRET_TTL_SECONDS, AI_REALTIME_INSTRUCTIONS_MAX_CHARS, AI_SPEECH_FORMAT_MIME, AI_SPEECH_FORMATS, AI_SPEECH_INPUT_MAX_CHARS, AI_SPEECH_INSTRUCTIONS_MAX_CHARS, AI_SPEECH_SPEED_MAX, AI_SPEECH_SPEED_MIN, AI_TRANSCRIPTION_DEFAULT_MAX_BYTES, AI_TRANSCRIPTION_EXTRAS_MAX_BYTES, AI_TRANSCRIPTION_INPUT_MIME_TYPES, AI_TRANSCRIPTION_PROMPT_MAX_CHARS, AI_TRANSCRIPTION_RESPONSE_FORMATS, AI_TRANSCRIPTION_TIMESTAMP_GRANULARITIES, isStreamedPayload, } from '@marinoscar/platform-ai-providers';
|
|
3
|
+
export type { AiAudioPort, AiBinaryPayload, AiEmbeddingRequest, AiEmbeddingResult, AiEmbeddingsPort, AiGeneratedImage, AiImageEditRequest, AiImageGenerationRequest, AiImageResult, AiImagesPort, AiMediaInput, AiRealtimePort, AiRealtimeSession, AiRealtimeSessionRequest, AiRealtimeTurnDetection, AiSpeechFormat, AiSpeechRequest, AiSpeechResult, AiStreamedPayload, AiTranscriptionExtras, AiTranscriptionExtrasSegment, AiTranscriptionRequest, AiTranscriptionResult, AiTranscriptionSegment, AiTranscriptionTimestampGranularity, AiTranscriptionWord, } from '@marinoscar/platform-ai-providers';
|
|
617
4
|
//# sourceMappingURL=media.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.types.d.ts","sourceRoot":"","sources":["../../../../src/ai/core/types/media.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media.types.d.ts","sourceRoot":"","sources":["../../../../src/ai/core/types/media.types.ts"],"names":[],"mappings":"AAKA,OAAO,aAAa,CAAC;AAErB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,6BAA6B,EAC7B,qCAAqC,EACrC,kCAAkC,EAClC,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,gCAAgC,EAChC,mBAAmB,EACnB,mBAAmB,EACnB,kCAAkC,EAClC,iCAAiC,EACjC,iCAAiC,EACjC,iCAAiC,EACjC,iCAAiC,EACjC,wCAAwC,EACxC,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACV,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,mCAAmC,EACnC,mBAAmB,GACpB,MAAM,mCAAmC,CAAC"}
|