@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,620 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { AiBinaryPayload } from './media.types';
|
|
5
|
-
/**
|
|
6
|
-
* Who a message is from. `system` and `developer` carry instructions; a
|
|
7
|
-
* provider without a `developer` role maps it onto its system prompt.
|
|
8
|
-
*
|
|
9
|
-
* @stability experimental
|
|
10
|
-
*/
|
|
11
|
-
export type AiMessageRole = 'user' | 'assistant' | 'system' | 'developer';
|
|
12
|
-
/**
|
|
13
|
-
* One part of a message. Media parts point at bytes (exactly one of a URL or
|
|
14
|
-
* a storage object id) rather than embedding them: resolving a storage
|
|
15
|
-
* object into something a provider can read is the runtime's job (#441 —
|
|
16
|
-
* see `file-inputs.types.ts`), so it happens once per call, under the
|
|
17
|
-
* caller's own authorization, and the request itself keeps only the id.
|
|
18
|
-
*
|
|
19
|
-
* @stability experimental
|
|
20
|
-
*/
|
|
21
|
-
export type AiContentPart = {
|
|
22
|
-
/** A text part. */
|
|
23
|
-
type: 'text';
|
|
24
|
-
/** The text. */
|
|
25
|
-
text: string;
|
|
26
|
-
} | {
|
|
27
|
-
/** An image part. */
|
|
28
|
-
type: 'image';
|
|
29
|
-
/** A URL the provider fetches the image from. */
|
|
30
|
-
url?: string;
|
|
31
|
-
/** A storage object the caller may read; resolved by the runtime. */
|
|
32
|
-
storageObjectId?: string;
|
|
33
|
-
/** How closely the model looks at the image (provider default when absent). */
|
|
34
|
-
detail?: 'low' | 'high' | 'auto';
|
|
35
|
-
} | {
|
|
36
|
-
/** A file part (a PDF, a document). */
|
|
37
|
-
type: 'file';
|
|
38
|
-
/** A storage object the caller may read; resolved by the runtime. */
|
|
39
|
-
storageObjectId?: string;
|
|
40
|
-
/** A URL the provider fetches the file from. */
|
|
41
|
-
url?: string;
|
|
42
|
-
/** The file name the provider is told. */
|
|
43
|
-
filename?: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The symbol key provider continuation state travels under (see above).
|
|
47
|
-
*
|
|
48
|
-
* @stability experimental
|
|
49
|
-
*/
|
|
50
|
-
export declare const AI_PROVIDER_STATE: unique symbol;
|
|
51
|
-
/**
|
|
52
|
-
* Opaque, provider-owned continuation state. ⚠ Never exposed: it may hold a
|
|
53
|
-
* signature or encrypted reasoning, which a caller must not see.
|
|
54
|
-
*
|
|
55
|
-
* @stability experimental
|
|
56
|
-
*/
|
|
57
|
-
export interface AiProviderState {
|
|
58
|
-
/** The adapter id that produced it — only that adapter reads it. */
|
|
59
|
-
provider: string;
|
|
60
|
-
/** The adapter's own material; opaque to everything else. */
|
|
61
|
-
data: unknown;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* A reasoning summary, plus the provider's opaque state for replaying it.
|
|
65
|
-
*
|
|
66
|
-
* @stability experimental
|
|
67
|
-
*/
|
|
68
|
-
export interface AiReasoningItem {
|
|
69
|
-
/** Discriminator. */
|
|
70
|
-
type: 'reasoning';
|
|
71
|
-
/** The summary paragraphs, in order (empty when the provider gave none). */
|
|
72
|
-
summary: string[];
|
|
73
|
-
/** The provider's continuation state; never serialised (a symbol key). */
|
|
74
|
-
[AI_PROVIDER_STATE]?: AiProviderState;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A request's input. Beyond messages and tool outputs, an input may REPLAY
|
|
78
|
-
* the model's own earlier `function_call` and `reasoning` items (#446) — how
|
|
79
|
-
* a caller, or the tool loop, carries a conversation to a provider that
|
|
80
|
-
* cannot chain with `previousResponseId` (see
|
|
81
|
-
* `AiProviderAdapter.supportsPreviousResponseId`). A provider that chains may
|
|
82
|
-
* ignore replayed reasoning it cannot use.
|
|
83
|
-
*
|
|
84
|
-
* @stability experimental
|
|
85
|
-
*/
|
|
86
|
-
export type AiInputItem = {
|
|
87
|
-
/** A message. */
|
|
88
|
-
type: 'message';
|
|
89
|
-
/** Who it is from. */
|
|
90
|
-
role: AiMessageRole;
|
|
91
|
-
/** Its parts, in order. */
|
|
92
|
-
content: AiContentPart[];
|
|
93
|
-
} | {
|
|
94
|
-
/** A replayed function call the model made earlier. */
|
|
95
|
-
type: 'function_call';
|
|
96
|
-
/** The provider's call id; the matching output names it. */
|
|
97
|
-
callId: string;
|
|
98
|
-
/** The function's name. */
|
|
99
|
-
name: string;
|
|
100
|
-
/** The arguments, as the JSON text the model produced. */
|
|
101
|
-
arguments: string;
|
|
102
|
-
} | {
|
|
103
|
-
/** The result of a function call, sent back to the model. */
|
|
104
|
-
type: 'function_call_output';
|
|
105
|
-
/** The call this answers. */
|
|
106
|
-
callId: string;
|
|
107
|
-
/** The result, as text (usually JSON). */
|
|
108
|
-
output: string;
|
|
109
|
-
} | AiReasoningItem;
|
|
110
|
-
/**
|
|
111
|
-
* A function the model may call. `parameters` is a Zod schema; it is both
|
|
112
|
-
* what the provider is told (via `toJsonSchema`) and what the model's
|
|
113
|
-
* arguments are validated against before `execute` runs (see `tools.ts`).
|
|
114
|
-
*
|
|
115
|
-
* @typeParam P - the parameters' Zod schema.
|
|
116
|
-
*
|
|
117
|
-
* @stability experimental
|
|
118
|
-
*/
|
|
119
|
-
export interface AiFunctionTool<P extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
120
|
-
/** Discriminator. */
|
|
121
|
-
type: 'function';
|
|
122
|
-
/** The name the model calls it by (`[a-zA-Z0-9_-]`). */
|
|
123
|
-
name: string;
|
|
124
|
-
/** What it does, for the model. */
|
|
125
|
-
description: string;
|
|
126
|
-
/** The parameters' schema. */
|
|
127
|
-
parameters: P;
|
|
128
|
-
/** Ask the provider to hold the model's arguments to the schema exactly. */
|
|
129
|
-
strict?: boolean;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* The tools the PROVIDER executes inside one response (issue #442): live web
|
|
133
|
-
* search, file search over provider-side vector stores, sandboxed code
|
|
134
|
-
* execution, image generation and remote MCP servers. Each is gated twice —
|
|
135
|
-
* the model must declare `hosted_tools` AND an administrator must have
|
|
136
|
-
* switched that tool type on (`ai.hostedTools.<type>`, all off by default) —
|
|
137
|
-
* see `AiService.prepare` and `core/hosted-tools.ts`.
|
|
138
|
-
*
|
|
139
|
-
* @stability experimental
|
|
140
|
-
*/
|
|
141
|
-
export declare const AI_HOSTED_TOOL_TYPES: readonly ["web_search", "file_search", "code_interpreter", "image_generation", "mcp"];
|
|
142
|
-
/**
|
|
143
|
-
* One of {@link AI_HOSTED_TOOL_TYPES}.
|
|
144
|
-
*
|
|
145
|
-
* @stability experimental
|
|
146
|
-
*/
|
|
147
|
-
export type AiHostedToolType = (typeof AI_HOSTED_TOOL_TYPES)[number];
|
|
148
|
-
/**
|
|
149
|
-
* Hosted live web search.
|
|
150
|
-
*
|
|
151
|
-
* @stability experimental
|
|
152
|
-
*/
|
|
153
|
-
export interface AiWebSearchTool {
|
|
154
|
-
/** Discriminator. */
|
|
155
|
-
type: 'web_search';
|
|
156
|
-
/** How much retrieved context the provider feeds the model. */
|
|
157
|
-
searchContextSize?: 'low' | 'medium' | 'high';
|
|
158
|
-
/** Approximate location to bias results toward (ISO-3166 alpha-2 `country`). */
|
|
159
|
-
userLocation?: {
|
|
160
|
-
/** ISO-3166 alpha-2 country code. */
|
|
161
|
-
country?: string;
|
|
162
|
-
/** City name. */
|
|
163
|
-
city?: string;
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Hosted file search over provider-side vector stores.
|
|
168
|
-
*
|
|
169
|
-
* @stability experimental
|
|
170
|
-
*/
|
|
171
|
-
export interface AiFileSearchTool {
|
|
172
|
-
/** Discriminator. */
|
|
173
|
-
type: 'file_search';
|
|
174
|
-
/** Provider-side vector store ids to search (at least one). */
|
|
175
|
-
vectorStoreIds: string[];
|
|
176
|
-
/** The most chunks to retrieve. */
|
|
177
|
-
maxResults?: number;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Hosted sandboxed code execution.
|
|
181
|
-
*
|
|
182
|
-
* @stability experimental
|
|
183
|
-
*/
|
|
184
|
-
export interface AiCodeInterpreterTool {
|
|
185
|
-
/** Discriminator. */
|
|
186
|
-
type: 'code_interpreter';
|
|
187
|
-
/** The sandbox; only a provider-managed `auto` container is modelled. */
|
|
188
|
-
container?: {
|
|
189
|
-
/** A provider-managed container. */
|
|
190
|
-
type: 'auto';
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Hosted image generation inside a response.
|
|
195
|
-
*
|
|
196
|
-
* @stability experimental
|
|
197
|
-
*/
|
|
198
|
-
export interface AiImageGenerationTool {
|
|
199
|
-
/** Discriminator. */
|
|
200
|
-
type: 'image_generation';
|
|
201
|
-
/** Provider-validated, e.g. `1024x1024` or `auto`. */
|
|
202
|
-
size?: string;
|
|
203
|
-
/** Provider-validated, e.g. `low` / `medium` / `high` / `auto`. */
|
|
204
|
-
quality?: string;
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* A remote MCP server the provider calls.
|
|
208
|
-
*
|
|
209
|
-
* @stability experimental
|
|
210
|
-
*/
|
|
211
|
-
export interface AiMcpTool {
|
|
212
|
-
/** Discriminator. */
|
|
213
|
-
type: 'mcp';
|
|
214
|
-
/** A short label the model and the output items name the server by. */
|
|
215
|
-
serverLabel: string;
|
|
216
|
-
/** MUST be `https://`; the host must pass `ai.hostedTools.mcpAllowedHosts` when that list is set. */
|
|
217
|
-
serverUrl: string;
|
|
218
|
-
/** Restrict the model to these of the server's tools. */
|
|
219
|
-
allowedTools?: string[];
|
|
220
|
-
/** Whether a call waits for the caller's approval (`never` by default). */
|
|
221
|
-
requireApproval?: 'never' | 'always';
|
|
222
|
-
/**
|
|
223
|
-
* Sent to the MCP server with each request (typically `Authorization`).
|
|
224
|
-
*
|
|
225
|
-
* ⚠ SECRET MATERIAL. Header values are never logged, never put on a span or
|
|
226
|
-
* a usage row, never stored in `ai_runs.request` (a background run carrying
|
|
227
|
-
* them is refused), never part of an `AiError`, and scrubbed from the
|
|
228
|
-
* response should the server echo one back (`AiService`).
|
|
229
|
-
*/
|
|
230
|
-
headers?: Record<string, string>;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Any provider-executed tool.
|
|
234
|
-
*
|
|
235
|
-
* @stability experimental
|
|
236
|
-
*/
|
|
237
|
-
export type AiHostedTool = AiWebSearchTool | AiFileSearchTool | AiCodeInterpreterTool | AiImageGenerationTool | AiMcpTool;
|
|
238
|
-
/**
|
|
239
|
-
* A tool of a request: a function the caller executes, or a hosted tool.
|
|
240
|
-
*
|
|
241
|
-
* @stability experimental
|
|
242
|
-
*/
|
|
243
|
-
export type AiTool = AiFunctionTool | AiHostedTool;
|
|
244
|
-
/**
|
|
245
|
-
* Whether, and which, tool the model must call.
|
|
246
|
-
*
|
|
247
|
-
* @stability experimental
|
|
248
|
-
*/
|
|
249
|
-
export type AiToolChoice = 'auto' | 'none' | 'required' | {
|
|
250
|
-
/** Force one function. */
|
|
251
|
-
type: 'function';
|
|
252
|
-
/** The function's name. */
|
|
253
|
-
name: string;
|
|
254
|
-
};
|
|
255
|
-
/**
|
|
256
|
-
* Ask for output that matches a schema; the runtime validates it and sets
|
|
257
|
-
* `AiResponse.parsed`.
|
|
258
|
-
*
|
|
259
|
-
* @typeParam S - the output's Zod schema.
|
|
260
|
-
*
|
|
261
|
-
* @stability experimental
|
|
262
|
-
*/
|
|
263
|
-
export interface AiStructuredOutputSpec<S extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
264
|
-
/** A short identifier for the schema (`[a-zA-Z0-9_-]`); some providers require one. */
|
|
265
|
-
name: string;
|
|
266
|
-
/** The output's schema. */
|
|
267
|
-
schema: S;
|
|
268
|
-
/** Ask the provider to hold the output to the schema exactly. */
|
|
269
|
-
strict?: boolean;
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* One text/reasoning/tool request (`AiService.forUser(...).respond`).
|
|
273
|
-
*
|
|
274
|
-
* @typeParam S - the structured output's Zod schema, when one is asked for.
|
|
275
|
-
*
|
|
276
|
-
* @stability experimental
|
|
277
|
-
*/
|
|
278
|
-
export interface AiResponseRequest<S extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
279
|
-
/** The provider's model id. */
|
|
280
|
-
model: string;
|
|
281
|
-
/** System-level instructions. */
|
|
282
|
-
instructions?: string;
|
|
283
|
-
/** A prompt, or the conversation so far. */
|
|
284
|
-
input: string | AiInputItem[];
|
|
285
|
-
/** Tools the model may call. */
|
|
286
|
-
tools?: AiTool[];
|
|
287
|
-
/** Whether, and which, tool the model must call. */
|
|
288
|
-
toolChoice?: AiToolChoice;
|
|
289
|
-
/** Ask for output matching a schema. */
|
|
290
|
-
structuredOutput?: AiStructuredOutputSpec<S>;
|
|
291
|
-
/** Reasoning effort and summary, for a model that reasons. */
|
|
292
|
-
reasoning?: {
|
|
293
|
-
/** How hard the model thinks (one of the model's `reasoningEfforts`). */
|
|
294
|
-
effort?: AiReasoningEffort;
|
|
295
|
-
/** Whether, and how fully, to return a reasoning summary. */
|
|
296
|
-
summary?: 'auto' | 'concise' | 'detailed';
|
|
297
|
-
};
|
|
298
|
-
/** The most output tokens; clamped by the deployment's and the model's caps. */
|
|
299
|
-
maxOutputTokens?: number;
|
|
300
|
-
/** Sampling temperature. */
|
|
301
|
-
temperature?: number;
|
|
302
|
-
/**
|
|
303
|
-
* Chain onto an earlier response instead of resending history. Only for a
|
|
304
|
-
* provider that stores responses — one declaring
|
|
305
|
-
* `supportsPreviousResponseId: false` (Anthropic) refuses it with
|
|
306
|
-
* `AI_CAPABILITY_UNSUPPORTED`; send the full history as `input` instead.
|
|
307
|
-
*/
|
|
308
|
-
previousResponseId?: string;
|
|
309
|
-
/** Free-form string tags passed to the provider. */
|
|
310
|
-
metadata?: Record<string, string>;
|
|
311
|
-
/**
|
|
312
|
-
* Keyed by provider id (`{ openai: { ... } }`). The escape hatch for a
|
|
313
|
-
* provider feature this contract does not model; an adapter reads only its
|
|
314
|
-
* own key and ignores the rest, so one request stays portable.
|
|
315
|
-
*/
|
|
316
|
-
providerOptions?: Record<string, Record<string, unknown>>;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* A web-search citation on a message: `text.slice(startIndex, endIndex)` is what it supports.
|
|
320
|
-
*
|
|
321
|
-
* @stability experimental
|
|
322
|
-
*/
|
|
323
|
-
export interface AiUrlCitation {
|
|
324
|
-
/** The source. */
|
|
325
|
-
url: string;
|
|
326
|
-
/** The source's title. */
|
|
327
|
-
title: string;
|
|
328
|
-
/** Start of the cited span in the message text. */
|
|
329
|
-
startIndex: number;
|
|
330
|
-
/** End (exclusive) of the cited span. */
|
|
331
|
-
endIndex: number;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* A message the model produced.
|
|
335
|
-
*
|
|
336
|
-
* @stability experimental
|
|
337
|
-
*/
|
|
338
|
-
export interface AiMessageOutputItem {
|
|
339
|
-
/** Discriminator. */
|
|
340
|
-
type: 'message';
|
|
341
|
-
/** The message text. */
|
|
342
|
-
text: string;
|
|
343
|
-
/** Web sources the text cites (hosted `web_search`), in the provider's order. */
|
|
344
|
-
citations?: AiUrlCitation[];
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* `web_search`: what was searched and the sources consulted.
|
|
348
|
-
*
|
|
349
|
-
* @stability experimental
|
|
350
|
-
*/
|
|
351
|
-
export interface AiWebSearchCallResult {
|
|
352
|
-
/** The queries run. */
|
|
353
|
-
queries: string[];
|
|
354
|
-
/** The sources consulted. */
|
|
355
|
-
sources: Array<{
|
|
356
|
-
/** The source's URL. */
|
|
357
|
-
url: string;
|
|
358
|
-
}>;
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* `file_search`: the queries run and the chunks retrieved (when the provider returned them).
|
|
362
|
-
*
|
|
363
|
-
* @stability experimental
|
|
364
|
-
*/
|
|
365
|
-
export interface AiFileSearchCallResult {
|
|
366
|
-
/** The queries run. */
|
|
367
|
-
queries: string[];
|
|
368
|
-
/** The chunks retrieved. */
|
|
369
|
-
results: Array<{
|
|
370
|
-
/** The provider's file id. */
|
|
371
|
-
fileId?: string;
|
|
372
|
-
/** The file's name. */
|
|
373
|
-
filename?: string;
|
|
374
|
-
/** Relevance score. */
|
|
375
|
-
score?: number;
|
|
376
|
-
/** The chunk's text. */
|
|
377
|
-
text?: string;
|
|
378
|
-
}>;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* `code_interpreter`: the code run and what it printed or drew.
|
|
382
|
-
*
|
|
383
|
-
* @stability experimental
|
|
384
|
-
*/
|
|
385
|
-
export interface AiCodeInterpreterCallResult {
|
|
386
|
-
/** The code run, when the provider reported it. */
|
|
387
|
-
code: string | null;
|
|
388
|
-
/** The provider's sandbox id. */
|
|
389
|
-
containerId: string;
|
|
390
|
-
/** What the code printed or drew. */
|
|
391
|
-
outputs: Array<{
|
|
392
|
-
/** Printed output. */
|
|
393
|
-
type: 'logs';
|
|
394
|
-
/** The text printed. */
|
|
395
|
-
logs: string;
|
|
396
|
-
} | {
|
|
397
|
-
/** A drawn image. */
|
|
398
|
-
type: 'image';
|
|
399
|
-
/** Where the provider serves it. */
|
|
400
|
-
url: string;
|
|
401
|
-
}>;
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* `image_generation`: the generated image.
|
|
405
|
-
*
|
|
406
|
-
* `image` holds the raw BYTES between the adapter and the facade ONLY — the
|
|
407
|
-
* facade's hosted-output settler (`runtime/ai-hosted-outputs.ts`) always
|
|
408
|
-
* removes it before a response leaves the runtime, so no API response, SSE
|
|
409
|
-
* frame or `ai_runs.output` row ever carries image data inline.
|
|
410
|
-
* `storageObjectId` is the user-owned storage object the image was persisted
|
|
411
|
-
* as, or `null` when it could not be stored — `storageError` then says why.
|
|
412
|
-
*
|
|
413
|
-
* @stability experimental
|
|
414
|
-
*/
|
|
415
|
-
export interface AiImageGenerationCallResult {
|
|
416
|
-
/** The storage object the image was saved as; `null` when it could not be stored. */
|
|
417
|
-
storageObjectId: string | null;
|
|
418
|
-
/** Set when the image was generated but could not be stored. */
|
|
419
|
-
storageError?: 'AI_STORAGE_UNAVAILABLE';
|
|
420
|
-
/** The image's MIME type. */
|
|
421
|
-
mimeType?: string;
|
|
422
|
-
/** The prompt as the provider rewrote it. */
|
|
423
|
-
revisedPrompt?: string;
|
|
424
|
-
/** The size generated. */
|
|
425
|
-
size?: string;
|
|
426
|
-
/** The quality generated. */
|
|
427
|
-
quality?: string;
|
|
428
|
-
/** The bytes, between adapter and facade only (see above). */
|
|
429
|
-
image?: AiBinaryPayload;
|
|
430
|
-
}
|
|
431
|
-
/**
|
|
432
|
-
* `mcp`: one of the three things a remote MCP server contributes to a response.
|
|
433
|
-
*
|
|
434
|
-
* @stability experimental
|
|
435
|
-
*/
|
|
436
|
-
export type AiMcpCallResult = {
|
|
437
|
-
/** A tool call on the server. */
|
|
438
|
-
kind: 'call';
|
|
439
|
-
/** The server's label. */
|
|
440
|
-
serverLabel: string;
|
|
441
|
-
/** The tool called. */
|
|
442
|
-
name: string;
|
|
443
|
-
/** The arguments, as JSON text. */
|
|
444
|
-
arguments: string;
|
|
445
|
-
/** The tool's output. */
|
|
446
|
-
output: string | null;
|
|
447
|
-
/** The call's error. */
|
|
448
|
-
error: string | null;
|
|
449
|
-
} | {
|
|
450
|
-
/** The server's tool listing. */
|
|
451
|
-
kind: 'list_tools';
|
|
452
|
-
/** The server's label. */
|
|
453
|
-
serverLabel: string;
|
|
454
|
-
/** The tools the server offers. */
|
|
455
|
-
tools: Array<{
|
|
456
|
-
/** The tool's name. */
|
|
457
|
-
name: string;
|
|
458
|
-
/** What it does. */
|
|
459
|
-
description?: string;
|
|
460
|
-
}>;
|
|
461
|
-
/** The listing's error. */
|
|
462
|
-
error: string | null;
|
|
463
|
-
} | {
|
|
464
|
-
/** A call waiting for the caller's approval. */
|
|
465
|
-
kind: 'approval_request';
|
|
466
|
-
/** The server's label. */
|
|
467
|
-
serverLabel: string;
|
|
468
|
-
/** The tool to be called. */
|
|
469
|
-
name: string;
|
|
470
|
-
/** The arguments, as JSON text. */
|
|
471
|
-
arguments: string;
|
|
472
|
-
};
|
|
473
|
-
/**
|
|
474
|
-
* Result shape per hosted tool type.
|
|
475
|
-
*
|
|
476
|
-
* @stability experimental
|
|
477
|
-
*/
|
|
478
|
-
export interface AiHostedToolResults {
|
|
479
|
-
/** `web_search`. */
|
|
480
|
-
web_search: AiWebSearchCallResult;
|
|
481
|
-
/** `file_search`. */
|
|
482
|
-
file_search: AiFileSearchCallResult;
|
|
483
|
-
/** `code_interpreter`. */
|
|
484
|
-
code_interpreter: AiCodeInterpreterCallResult;
|
|
485
|
-
/** `image_generation`. */
|
|
486
|
-
image_generation: AiImageGenerationCallResult;
|
|
487
|
-
/** `mcp`. */
|
|
488
|
-
mcp: AiMcpCallResult;
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* A provider-executed tool call, discriminated by `tool`.
|
|
492
|
-
*
|
|
493
|
-
* @stability experimental
|
|
494
|
-
*/
|
|
495
|
-
export type AiHostedToolCallItem = {
|
|
496
|
-
[T in AiHostedToolType]: {
|
|
497
|
-
/** Discriminator. */
|
|
498
|
-
type: 'hosted_tool_call';
|
|
499
|
-
/** The provider's id for this output item. */
|
|
500
|
-
id?: string;
|
|
501
|
-
/** Which hosted tool. */
|
|
502
|
-
tool: T;
|
|
503
|
-
/** Provider status, e.g. `in_progress`, `searching`, `completed`, `failed`. */
|
|
504
|
-
status: string;
|
|
505
|
-
/** The tool's result, when it has one. */
|
|
506
|
-
result?: AiHostedToolResults[T];
|
|
507
|
-
};
|
|
508
|
-
}[AiHostedToolType];
|
|
509
|
-
/**
|
|
510
|
-
* One item of a response's output.
|
|
511
|
-
*
|
|
512
|
-
* @stability experimental
|
|
513
|
-
*/
|
|
514
|
-
export type AiOutputItem = AiMessageOutputItem | AiReasoningItem | {
|
|
515
|
-
/** A function call the caller is to execute. */
|
|
516
|
-
type: 'function_call';
|
|
517
|
-
/** The provider's call id. */
|
|
518
|
-
callId: string;
|
|
519
|
-
/** The function's name. */
|
|
520
|
-
name: string;
|
|
521
|
-
/** The arguments, as the JSON text the model produced. */
|
|
522
|
-
arguments: string;
|
|
523
|
-
} | AiHostedToolCallItem;
|
|
524
|
-
/**
|
|
525
|
-
* Token accounting of one response, as the provider reported it.
|
|
526
|
-
*
|
|
527
|
-
* @stability experimental
|
|
528
|
-
*/
|
|
529
|
-
export interface AiUsage {
|
|
530
|
-
/** Input tokens. */
|
|
531
|
-
inputTokens?: number;
|
|
532
|
-
/** Output tokens (including reasoning). */
|
|
533
|
-
outputTokens?: number;
|
|
534
|
-
/** Reasoning tokens, a subset of the output. */
|
|
535
|
-
reasoningTokens?: number;
|
|
536
|
-
/** Input tokens served from the provider's cache. */
|
|
537
|
-
cachedInputTokens?: number;
|
|
538
|
-
}
|
|
539
|
-
/**
|
|
540
|
-
* Why a response ended.
|
|
541
|
-
*
|
|
542
|
-
* @stability experimental
|
|
543
|
-
*/
|
|
544
|
-
export type AiFinishReason = 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'error';
|
|
545
|
-
/**
|
|
546
|
-
* One completed response.
|
|
547
|
-
*
|
|
548
|
-
* @typeParam T - the parsed structured output's type.
|
|
549
|
-
*
|
|
550
|
-
* @stability experimental
|
|
551
|
-
*/
|
|
552
|
-
export interface AiResponse<T = unknown> {
|
|
553
|
-
/** The provider's response id (the `previousResponseId` of a follow-up). */
|
|
554
|
-
id: string;
|
|
555
|
-
/** Provider id. */
|
|
556
|
-
provider: string;
|
|
557
|
-
/** Model id. */
|
|
558
|
-
model: string;
|
|
559
|
-
/** The output items, in order. */
|
|
560
|
-
output: AiOutputItem[];
|
|
561
|
-
/** Every `message` item's text, concatenated in order. */
|
|
562
|
-
outputText: string;
|
|
563
|
-
/** Present only when the request carried `structuredOutput`, already validated. */
|
|
564
|
-
parsed?: T;
|
|
565
|
-
/** Token accounting. */
|
|
566
|
-
usage: AiUsage;
|
|
567
|
-
/** Why it ended. */
|
|
568
|
-
finishReason: AiFinishReason;
|
|
569
|
-
/** The provider's request id, for support tickets. */
|
|
570
|
-
providerRequestId?: string;
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Streaming events. A well-formed stream starts with `response.created`, ends
|
|
574
|
-
* with exactly one of `response.completed` or `error`, and the concatenation
|
|
575
|
-
* of its `output_text.delta` events equals the completed response's
|
|
576
|
-
* `outputText` (the conformance kit asserts all three).
|
|
577
|
-
*
|
|
578
|
-
* @stability experimental
|
|
579
|
-
*/
|
|
580
|
-
export type AiStreamEvent = {
|
|
581
|
-
/** The response started. */
|
|
582
|
-
type: 'response.created';
|
|
583
|
-
/** Its id. */
|
|
584
|
-
id: string;
|
|
585
|
-
} | {
|
|
586
|
-
/** More message text. */
|
|
587
|
-
type: 'output_text.delta';
|
|
588
|
-
/** The new text. */
|
|
589
|
-
delta: string;
|
|
590
|
-
} | {
|
|
591
|
-
/** More reasoning summary. */
|
|
592
|
-
type: 'reasoning_summary.delta';
|
|
593
|
-
/** The new text. */
|
|
594
|
-
delta: string;
|
|
595
|
-
} | {
|
|
596
|
-
/** More of a function call's arguments. */
|
|
597
|
-
type: 'function_call.arguments.delta';
|
|
598
|
-
/** The call. */
|
|
599
|
-
callId: string;
|
|
600
|
-
/** The new JSON text. */
|
|
601
|
-
delta: string;
|
|
602
|
-
} | {
|
|
603
|
-
/** One output item is complete. */
|
|
604
|
-
type: 'output_item.done';
|
|
605
|
-
/** The item. */
|
|
606
|
-
item: AiOutputItem;
|
|
607
|
-
} | {
|
|
608
|
-
/** The response completed. */
|
|
609
|
-
type: 'response.completed';
|
|
610
|
-
/** The whole response. */
|
|
611
|
-
response: AiResponse;
|
|
612
|
-
} | {
|
|
613
|
-
/** The response failed. */
|
|
614
|
-
type: 'error';
|
|
615
|
-
/** The failure's code. */
|
|
616
|
-
code: AiErrorCode;
|
|
617
|
-
/** A message safe to show. */
|
|
618
|
-
message: string;
|
|
619
|
-
};
|
|
1
|
+
import '../ai-error';
|
|
2
|
+
export { AI_HOSTED_TOOL_TYPES, AI_PROVIDER_STATE, } from '@marinoscar/platform-ai-providers';
|
|
3
|
+
export type { AiCodeInterpreterCallResult, AiCodeInterpreterTool, AiContentPart, AiFileSearchCallResult, AiFileSearchTool, AiFinishReason, AiFunctionTool, AiHostedTool, AiHostedToolCallItem, AiHostedToolResults, AiHostedToolType, AiImageGenerationCallResult, AiImageGenerationTool, AiInputItem, AiMcpCallResult, AiMcpTool, AiMessageOutputItem, AiMessageRole, AiOutputItem, AiProviderState, AiReasoningItem, AiResponse, AiResponseRequest, AiStreamEvent, AiStructuredOutputSpec, AiTool, AiToolChoice, AiUrlCitation, AiUsage, AiWebSearchCallResult, AiWebSearchTool, } from '@marinoscar/platform-ai-providers';
|
|
620
4
|
//# sourceMappingURL=responses.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.types.d.ts","sourceRoot":"","sources":["../../../../src/ai/core/types/responses.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"responses.types.d.ts","sourceRoot":"","sources":["../../../../src/ai/core/types/responses.types.ts"],"names":[],"mappings":"AAKA,OAAO,aAAa,CAAC;AAErB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAE3C,YAAY,EACV,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,MAAM,EACN,YAAY,EACZ,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,eAAe,GAChB,MAAM,mCAAmC,CAAC"}
|