@llumiverse/common 1.2.0 → 1.4.0-dev.20260629.090753Z
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/lib/capability/anthropic.d.ts +3 -0
- package/lib/capability/anthropic.d.ts.map +1 -0
- package/lib/capability/anthropic.js +92 -0
- package/lib/capability/anthropic.js.map +1 -0
- package/lib/{types/capability → capability}/azure_foundry.d.ts +1 -1
- package/lib/capability/azure_foundry.d.ts.map +1 -0
- package/lib/capability/azure_foundry.js +394 -0
- package/lib/capability/azure_foundry.js.map +1 -0
- package/lib/{types/capability → capability}/bedrock.d.ts +1 -1
- package/lib/capability/bedrock.d.ts.map +1 -0
- package/lib/capability/bedrock.js +300 -0
- package/lib/capability/bedrock.js.map +1 -0
- package/lib/{types/capability → capability}/openai.d.ts +1 -1
- package/lib/capability/openai.d.ts.map +1 -0
- package/lib/capability/openai.js +179 -0
- package/lib/capability/openai.js.map +1 -0
- package/lib/{types/capability → capability}/vertexai.d.ts +1 -1
- package/lib/capability/vertexai.d.ts.map +1 -0
- package/lib/capability/vertexai.js +137 -0
- package/lib/capability/vertexai.js.map +1 -0
- package/lib/{types/capability.d.ts → capability.d.ts} +1 -1
- package/lib/capability.d.ts.map +1 -0
- package/lib/{esm/capability.js → capability.js} +21 -15
- package/lib/capability.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/lib/options/anthropic.d.ts +16 -0
- package/lib/options/anthropic.d.ts.map +1 -0
- package/lib/options/anthropic.js +34 -0
- package/lib/options/anthropic.js.map +1 -0
- package/lib/{types/options → options}/azure_foundry.d.ts +14 -14
- package/lib/options/azure_foundry.d.ts.map +1 -0
- package/lib/{esm/options → options}/azure_foundry.js +126 -126
- package/lib/options/azure_foundry.js.map +1 -0
- package/lib/options/bedrock.d.ts +61 -0
- package/lib/options/bedrock.d.ts.map +1 -0
- package/lib/options/bedrock.js +489 -0
- package/lib/options/bedrock.js.map +1 -0
- package/lib/options/context-windows.d.ts.map +1 -0
- package/lib/options/context-windows.js.map +1 -0
- package/lib/options/embedding.d.ts +38 -0
- package/lib/options/embedding.d.ts.map +1 -0
- package/lib/options/embedding.js +77 -0
- package/lib/options/embedding.js.map +1 -0
- package/lib/{types/options → options}/fallback.d.ts +2 -2
- package/lib/options/fallback.d.ts.map +1 -0
- package/lib/options/fallback.js +65 -0
- package/lib/options/fallback.js.map +1 -0
- package/lib/{types/options → options}/groq.d.ts +2 -2
- package/lib/options/groq.d.ts.map +1 -0
- package/lib/options/groq.js +54 -0
- package/lib/options/groq.js.map +1 -0
- package/lib/options/openai.d.ts +40 -0
- package/lib/options/openai.d.ts.map +1 -0
- package/lib/options/openai.js +284 -0
- package/lib/options/openai.js.map +1 -0
- package/lib/{types/options → options}/shared-parsing.d.ts +1 -1
- package/lib/options/shared-parsing.d.ts.map +1 -0
- package/lib/{esm/options → options}/shared-parsing.js +14 -17
- package/lib/options/shared-parsing.js.map +1 -0
- package/lib/options/version-parsing.d.ts.map +1 -0
- package/lib/{esm/options → options}/version-parsing.js +15 -15
- package/lib/options/version-parsing.js.map +1 -0
- package/lib/{types/options → options}/vertexai.d.ts +18 -15
- package/lib/options/vertexai.d.ts.map +1 -0
- package/lib/options/vertexai.js +606 -0
- package/lib/options/vertexai.js.map +1 -0
- package/lib/{types/options.d.ts → options.d.ts} +1 -1
- package/lib/options.d.ts.map +1 -0
- package/lib/{esm/options.js → options.js} +10 -7
- package/lib/options.js.map +1 -0
- package/lib/{types/types.d.ts → types.d.ts} +161 -42
- package/lib/types.d.ts.map +1 -0
- package/lib/{esm/types.js → types.js} +28 -22
- package/lib/types.js.map +1 -0
- package/package.json +12 -34
- package/src/LlumiverseError.test.ts +18 -72
- package/src/capability/anthropic.ts +99 -0
- package/src/capability/azure_foundry.ts +303 -65
- package/src/capability/bedrock.ts +201 -56
- package/src/capability/openai.ts +135 -41
- package/src/capability/vertexai.ts +105 -35
- package/src/capability.ts +21 -16
- package/src/index.ts +13 -11
- package/src/options/anthropic.ts +59 -0
- package/src/options/azure_foundry.ts +157 -143
- package/src/options/bedrock.ts +266 -187
- package/src/options/context-windows.ts +2 -2
- package/src/options/embedding.ts +92 -0
- package/src/options/fallback.ts +50 -17
- package/src/options/groq.ts +48 -21
- package/src/options/openai.ts +231 -183
- package/src/options/shared-parsing.ts +16 -21
- package/src/options/version-parsing.ts +17 -17
- package/src/options/vertexai.ts +385 -288
- package/src/options.ts +11 -8
- package/src/types.ts +284 -160
- package/lib/cjs/capability/azure_foundry.js +0 -160
- package/lib/cjs/capability/azure_foundry.js.map +0 -1
- package/lib/cjs/capability/bedrock.js +0 -158
- package/lib/cjs/capability/bedrock.js.map +0 -1
- package/lib/cjs/capability/openai.js +0 -98
- package/lib/cjs/capability/openai.js.map +0 -1
- package/lib/cjs/capability/vertexai.js +0 -80
- package/lib/cjs/capability/vertexai.js.map +0 -1
- package/lib/cjs/capability.js +0 -109
- package/lib/cjs/capability.js.map +0 -1
- package/lib/cjs/index.js +0 -27
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/options/azure_foundry.js +0 -423
- package/lib/cjs/options/azure_foundry.js.map +0 -1
- package/lib/cjs/options/bedrock.js +0 -427
- package/lib/cjs/options/bedrock.js.map +0 -1
- package/lib/cjs/options/context-windows.js +0 -138
- package/lib/cjs/options/context-windows.js.map +0 -1
- package/lib/cjs/options/fallback.js +0 -35
- package/lib/cjs/options/fallback.js.map +0 -1
- package/lib/cjs/options/groq.js +0 -37
- package/lib/cjs/options/groq.js.map +0 -1
- package/lib/cjs/options/openai.js +0 -246
- package/lib/cjs/options/openai.js.map +0 -1
- package/lib/cjs/options/shared-parsing.js +0 -144
- package/lib/cjs/options/shared-parsing.js.map +0 -1
- package/lib/cjs/options/version-parsing.js +0 -326
- package/lib/cjs/options/version-parsing.js.map +0 -1
- package/lib/cjs/options/vertexai.js +0 -525
- package/lib/cjs/options/vertexai.js.map +0 -1
- package/lib/cjs/options.js +0 -30
- package/lib/cjs/options.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/types.js +0 -299
- package/lib/cjs/types.js.map +0 -1
- package/lib/esm/capability/azure_foundry.js +0 -157
- package/lib/esm/capability/azure_foundry.js.map +0 -1
- package/lib/esm/capability/bedrock.js +0 -155
- package/lib/esm/capability/bedrock.js.map +0 -1
- package/lib/esm/capability/openai.js +0 -95
- package/lib/esm/capability/openai.js.map +0 -1
- package/lib/esm/capability/vertexai.js +0 -77
- package/lib/esm/capability/vertexai.js.map +0 -1
- package/lib/esm/capability.js.map +0 -1
- package/lib/esm/index.js +0 -11
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/options/azure_foundry.js.map +0 -1
- package/lib/esm/options/bedrock.js +0 -423
- package/lib/esm/options/bedrock.js.map +0 -1
- package/lib/esm/options/context-windows.js.map +0 -1
- package/lib/esm/options/fallback.js +0 -32
- package/lib/esm/options/fallback.js.map +0 -1
- package/lib/esm/options/groq.js +0 -34
- package/lib/esm/options/groq.js.map +0 -1
- package/lib/esm/options/openai.js +0 -243
- package/lib/esm/options/openai.js.map +0 -1
- package/lib/esm/options/shared-parsing.js.map +0 -1
- package/lib/esm/options/version-parsing.js.map +0 -1
- package/lib/esm/options/vertexai.js +0 -519
- package/lib/esm/options/vertexai.js.map +0 -1
- package/lib/esm/options.js.map +0 -1
- package/lib/esm/types.js.map +0 -1
- package/lib/types/capability/azure_foundry.d.ts.map +0 -1
- package/lib/types/capability/bedrock.d.ts.map +0 -1
- package/lib/types/capability/openai.d.ts.map +0 -1
- package/lib/types/capability/vertexai.d.ts.map +0 -1
- package/lib/types/capability.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -11
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/options/azure_foundry.d.ts.map +0 -1
- package/lib/types/options/bedrock.d.ts +0 -54
- package/lib/types/options/bedrock.d.ts.map +0 -1
- package/lib/types/options/context-windows.d.ts.map +0 -1
- package/lib/types/options/fallback.d.ts.map +0 -1
- package/lib/types/options/groq.d.ts.map +0 -1
- package/lib/types/options/openai.d.ts +0 -37
- package/lib/types/options/openai.d.ts.map +0 -1
- package/lib/types/options/shared-parsing.d.ts.map +0 -1
- package/lib/types/options/version-parsing.d.ts.map +0 -1
- package/lib/types/options/vertexai.d.ts.map +0 -1
- package/lib/types/options.d.ts.map +0 -1
- package/lib/types/types.d.ts.map +0 -1
- /package/lib/{types/options → options}/context-windows.d.ts +0 -0
- /package/lib/{esm/options → options}/context-windows.js +0 -0
- /package/lib/{types/options → options}/version-parsing.d.ts +0 -0
package/src/types.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BedrockOptions } from './options/bedrock.js';
|
|
2
|
-
import { TextFallbackOptions } from './options/fallback.js';
|
|
3
|
-
import { GroqOptions } from './options/groq.js';
|
|
4
|
-
import { OpenAiOptions } from './options/openai.js';
|
|
5
|
-
import { VertexAIOptions } from './options/vertexai.js';
|
|
1
|
+
import type { BedrockOptions } from './options/bedrock.js';
|
|
2
|
+
import type { TextFallbackOptions } from './options/fallback.js';
|
|
3
|
+
import type { GroqOptions } from './options/groq.js';
|
|
4
|
+
import type { OpenAiOptions } from './options/openai.js';
|
|
5
|
+
import type { VertexAIOptions } from './options/vertexai.js';
|
|
6
6
|
|
|
7
7
|
// ============== Provider details ===============
|
|
8
8
|
|
|
@@ -19,7 +19,8 @@ export enum Providers {
|
|
|
19
19
|
mistralai = 'mistralai',
|
|
20
20
|
groq = 'groq',
|
|
21
21
|
watsonx = 'watsonx',
|
|
22
|
-
xai = 'xai'
|
|
22
|
+
xai = 'xai',
|
|
23
|
+
anthropic = 'anthropic',
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export interface ProviderParams {
|
|
@@ -32,138 +33,210 @@ export interface ProviderParams {
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export const ProviderList: Record<Providers, ProviderParams> = {
|
|
35
|
-
openai:
|
|
36
|
-
{
|
|
36
|
+
openai: {
|
|
37
37
|
id: Providers.openai,
|
|
38
|
-
name:
|
|
38
|
+
name: 'OpenAI',
|
|
39
39
|
requiresApiKey: true,
|
|
40
40
|
requiresEndpointUrl: false,
|
|
41
41
|
supportSearch: false,
|
|
42
42
|
},
|
|
43
|
-
azure_openai:
|
|
44
|
-
{
|
|
43
|
+
azure_openai: {
|
|
45
44
|
id: Providers.azure_openai,
|
|
46
|
-
name:
|
|
45
|
+
name: 'Azure OpenAI',
|
|
47
46
|
requiresApiKey: false,
|
|
48
47
|
requiresEndpointUrl: true,
|
|
49
48
|
supportSearch: false,
|
|
50
49
|
},
|
|
51
|
-
azure_foundry:
|
|
52
|
-
{
|
|
50
|
+
azure_foundry: {
|
|
53
51
|
id: Providers.azure_foundry,
|
|
54
|
-
name:
|
|
52
|
+
name: 'Microsoft Foundry',
|
|
55
53
|
requiresApiKey: true,
|
|
56
54
|
requiresEndpointUrl: true,
|
|
57
55
|
supportSearch: false,
|
|
58
56
|
},
|
|
59
|
-
huggingface_ie:
|
|
60
|
-
{
|
|
57
|
+
huggingface_ie: {
|
|
61
58
|
id: Providers.huggingface_ie,
|
|
62
|
-
name:
|
|
59
|
+
name: 'HuggingFace Inference Endpoint',
|
|
63
60
|
requiresApiKey: true,
|
|
64
61
|
requiresEndpointUrl: true,
|
|
65
62
|
},
|
|
66
|
-
replicate:
|
|
67
|
-
{
|
|
63
|
+
replicate: {
|
|
68
64
|
id: Providers.replicate,
|
|
69
|
-
name:
|
|
65
|
+
name: 'Replicate',
|
|
70
66
|
requiresApiKey: true,
|
|
71
67
|
requiresEndpointUrl: false,
|
|
72
68
|
supportSearch: true,
|
|
73
69
|
},
|
|
74
|
-
bedrock:
|
|
75
|
-
{
|
|
70
|
+
bedrock: {
|
|
76
71
|
id: Providers.bedrock,
|
|
77
|
-
name:
|
|
72
|
+
name: 'Amazon Bedrock',
|
|
78
73
|
requiresApiKey: false,
|
|
79
74
|
requiresEndpointUrl: false,
|
|
80
|
-
endpointPlaceholder:
|
|
75
|
+
endpointPlaceholder: 'region name (eg. us-east-1)',
|
|
81
76
|
supportSearch: false,
|
|
82
77
|
},
|
|
83
78
|
vertexai: {
|
|
84
79
|
id: Providers.vertexai,
|
|
85
|
-
name:
|
|
80
|
+
name: 'Google Agent Platform (Vertex AI)',
|
|
86
81
|
requiresApiKey: false,
|
|
87
82
|
requiresEndpointUrl: false,
|
|
88
83
|
supportSearch: false,
|
|
89
84
|
},
|
|
90
85
|
togetherai: {
|
|
91
86
|
id: Providers.togetherai,
|
|
92
|
-
name:
|
|
93
|
-
requiresApiKey:
|
|
87
|
+
name: 'Together AI',
|
|
88
|
+
requiresApiKey: true,
|
|
94
89
|
requiresEndpointUrl: false,
|
|
95
90
|
supportSearch: false,
|
|
96
91
|
},
|
|
97
92
|
mistralai: {
|
|
98
93
|
id: Providers.mistralai,
|
|
99
|
-
name:
|
|
94
|
+
name: 'Mistral AI',
|
|
100
95
|
requiresApiKey: false,
|
|
101
96
|
requiresEndpointUrl: false,
|
|
102
97
|
supportSearch: false,
|
|
103
98
|
},
|
|
104
99
|
groq: {
|
|
105
100
|
id: Providers.groq,
|
|
106
|
-
name:
|
|
101
|
+
name: 'Groq Cloud',
|
|
107
102
|
requiresApiKey: false,
|
|
108
103
|
requiresEndpointUrl: false,
|
|
109
104
|
supportSearch: false,
|
|
110
105
|
},
|
|
111
106
|
watsonx: {
|
|
112
107
|
id: Providers.watsonx,
|
|
113
|
-
name:
|
|
108
|
+
name: 'IBM WatsonX',
|
|
114
109
|
requiresApiKey: true,
|
|
115
110
|
requiresEndpointUrl: true,
|
|
116
|
-
supportSearch: false
|
|
111
|
+
supportSearch: false,
|
|
117
112
|
},
|
|
118
113
|
xai: {
|
|
119
114
|
id: Providers.xai,
|
|
120
|
-
name:
|
|
115
|
+
name: 'xAI (Grok)',
|
|
121
116
|
requiresApiKey: true,
|
|
122
117
|
requiresEndpointUrl: false,
|
|
123
|
-
supportSearch: false
|
|
118
|
+
supportSearch: false,
|
|
124
119
|
},
|
|
125
120
|
openai_compatible: {
|
|
126
121
|
id: Providers.openai_compatible,
|
|
127
|
-
name:
|
|
122
|
+
name: 'OpenAI Compatible',
|
|
128
123
|
requiresApiKey: true,
|
|
129
124
|
requiresEndpointUrl: true,
|
|
130
|
-
endpointPlaceholder:
|
|
131
|
-
supportSearch: false
|
|
125
|
+
endpointPlaceholder: 'https://api.example.com/v1',
|
|
126
|
+
supportSearch: false,
|
|
132
127
|
},
|
|
133
|
-
|
|
128
|
+
anthropic: {
|
|
129
|
+
id: Providers.anthropic,
|
|
130
|
+
name: 'Anthropic',
|
|
131
|
+
requiresApiKey: true,
|
|
132
|
+
requiresEndpointUrl: false,
|
|
133
|
+
supportSearch: false,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
134
136
|
|
|
135
137
|
// ============== Embeddings ===============
|
|
136
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Semantic task type for embedding models. Drivers map these to provider-
|
|
141
|
+
* specific values (e.g. "RETRIEVAL_QUERY" for Vertex, "search_query" for Cohere).
|
|
142
|
+
* - "query" — a search query to find relevant documents
|
|
143
|
+
* - "document" — a document to be indexed and retrieved
|
|
144
|
+
*/
|
|
145
|
+
export type EmbeddingTaskType = 'query' | 'document';
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* One input to an embedding model. Discriminated by `type`.
|
|
149
|
+
* Drivers consume binary content via DataSource and may pass a provider-native
|
|
150
|
+
* URL (gs://, s3://, https://) when one is available.
|
|
151
|
+
*/
|
|
152
|
+
export type EmbeddingInput = TextEmbeddingInput | ImageEmbeddingInput | VideoEmbeddingInput | AudioEmbeddingInput;
|
|
153
|
+
|
|
154
|
+
export interface TextEmbeddingInput {
|
|
155
|
+
type: 'text';
|
|
156
|
+
text: string;
|
|
157
|
+
/** Overrides EmbeddingsOptions.task_type for this input. */
|
|
158
|
+
task_type?: EmbeddingTaskType;
|
|
159
|
+
/** Document title hint — used by Vertex AI for RETRIEVAL_DOCUMENT. */
|
|
160
|
+
title?: string;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface ImageEmbeddingInput {
|
|
164
|
+
type: 'image';
|
|
165
|
+
source: DataSource;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface VideoEmbeddingInput {
|
|
169
|
+
type: 'video';
|
|
170
|
+
source: DataSource;
|
|
171
|
+
start_sec?: number;
|
|
172
|
+
length_sec?: number;
|
|
173
|
+
/** Vertex multimodal segment length. */
|
|
174
|
+
interval_sec?: number;
|
|
175
|
+
/** TwelveLabs Marengo. */
|
|
176
|
+
use_fixed_length_sec?: boolean;
|
|
177
|
+
/** TwelveLabs Marengo. */
|
|
178
|
+
min_clip_sec?: number;
|
|
179
|
+
/** TwelveLabs Marengo: which views to extract per segment. */
|
|
180
|
+
embedding_option?: ('visual-text' | 'visual-image' | 'audio')[];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface AudioEmbeddingInput {
|
|
184
|
+
type: 'audio';
|
|
185
|
+
source: DataSource;
|
|
186
|
+
start_sec?: number;
|
|
187
|
+
length_sec?: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
137
190
|
export interface EmbeddingsOptions {
|
|
191
|
+
inputs: EmbeddingInput[];
|
|
138
192
|
/**
|
|
139
|
-
*
|
|
140
|
-
|
|
141
|
-
text?: string;
|
|
142
|
-
/**
|
|
143
|
-
* The image to generate embeddings for
|
|
144
|
-
*/
|
|
145
|
-
image?: string
|
|
146
|
-
/**
|
|
147
|
-
* The model to use to generate the embeddings. Optional.
|
|
193
|
+
* Provider model id. When omitted the driver picks a sensible default
|
|
194
|
+
* for the modalities present in `inputs`.
|
|
148
195
|
*/
|
|
149
196
|
model?: string;
|
|
150
197
|
|
|
198
|
+
/** Default task type applied to text inputs that don't set their own. */
|
|
199
|
+
task_type?: EmbeddingTaskType;
|
|
200
|
+
/** Output dimension truncation (MRL). Vertex/OpenAI where supported. */
|
|
201
|
+
dimensions?: number;
|
|
151
202
|
}
|
|
152
203
|
|
|
153
204
|
export interface EmbeddingsResult {
|
|
154
|
-
/**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
values: number[];
|
|
158
|
-
/**
|
|
159
|
-
* The model used to generate the embeddings.
|
|
160
|
-
*/
|
|
205
|
+
/** One result item per input, in the same order as EmbeddingsOptions.inputs. */
|
|
206
|
+
results: EmbeddingResultItem[];
|
|
207
|
+
/** The provider model id that produced the result. */
|
|
161
208
|
model: string;
|
|
209
|
+
/** Aggregate token usage when reported by the provider. */
|
|
210
|
+
usage?: EmbeddingsTokenUsage;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface EmbeddingResultItem {
|
|
162
214
|
/**
|
|
163
|
-
*
|
|
215
|
+
* One or more vectors produced for this input.
|
|
216
|
+
* Single vector for text/image; multiple for segmented video/audio or
|
|
217
|
+
* joint-multimodal models that return per-modality vectors.
|
|
164
218
|
*/
|
|
165
|
-
|
|
219
|
+
outputs: EmbeddingOutput[];
|
|
220
|
+
/** Token count attributed to this input, when reported by the provider. */
|
|
221
|
+
input_tokens?: number;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export interface EmbeddingOutput {
|
|
225
|
+
values: number[];
|
|
226
|
+
/** Which modality this vector represents (useful for joint-multimodal results). */
|
|
227
|
+
modality?: 'text' | 'image' | 'video' | 'audio';
|
|
228
|
+
/** Segment start time for video/audio. */
|
|
229
|
+
start_sec?: number;
|
|
230
|
+
/** Segment end time for video/audio. */
|
|
231
|
+
end_sec?: number;
|
|
232
|
+
/** TwelveLabs Marengo: which view of the segment this vector represents. */
|
|
233
|
+
embedding_option?: string;
|
|
234
|
+
}
|
|
166
235
|
|
|
236
|
+
export interface EmbeddingsTokenUsage {
|
|
237
|
+
input_tokens?: number;
|
|
238
|
+
input_text_tokens?: number;
|
|
239
|
+
input_image_tokens?: number;
|
|
167
240
|
}
|
|
168
241
|
|
|
169
242
|
export interface ResultValidationError {
|
|
@@ -187,11 +260,11 @@ export interface LlumiverseErrorContext {
|
|
|
187
260
|
|
|
188
261
|
/**
|
|
189
262
|
* Standardized error class for Llumiverse driver errors.
|
|
190
|
-
*
|
|
263
|
+
*
|
|
191
264
|
* Normalizes errors from different LLM providers (OpenAI, Anthropic, Bedrock, VertexAI, etc.)
|
|
192
265
|
* into a consistent format. The primary value is the `retryable` flag, which enables upstream
|
|
193
266
|
* consumers to implement smart retry logic.
|
|
194
|
-
*
|
|
267
|
+
*
|
|
195
268
|
* @example
|
|
196
269
|
* ```typescript
|
|
197
270
|
* try {
|
|
@@ -201,7 +274,7 @@ export interface LlumiverseErrorContext {
|
|
|
201
274
|
* console.log(`Provider: ${error.context.provider}`);
|
|
202
275
|
* console.log(`Model: ${error.context.model}`);
|
|
203
276
|
* console.log(`Retryable: ${error.retryable}`);
|
|
204
|
-
*
|
|
277
|
+
*
|
|
205
278
|
* if (error.retryable) {
|
|
206
279
|
* // Implement retry logic with exponential backoff
|
|
207
280
|
* await retryWithBackoff(() => driver.execute(segments, options));
|
|
@@ -215,7 +288,7 @@ export interface LlumiverseErrorContext {
|
|
|
215
288
|
* ```
|
|
216
289
|
*/
|
|
217
290
|
export class LlumiverseError extends Error {
|
|
218
|
-
/**
|
|
291
|
+
/**
|
|
219
292
|
* HTTP status code (e.g., 429, 500) if available.
|
|
220
293
|
* Undefined if the error doesn't have a numeric status code.
|
|
221
294
|
*/
|
|
@@ -227,12 +300,12 @@ export class LlumiverseError extends Error {
|
|
|
227
300
|
*/
|
|
228
301
|
readonly name: string;
|
|
229
302
|
|
|
230
|
-
/**
|
|
303
|
+
/**
|
|
231
304
|
* Whether this error is retryable.
|
|
232
305
|
* - True: Definitely retryable (rate limits, timeouts, server errors)
|
|
233
306
|
* - False: Definitely not retryable (auth failures, invalid requests, malformed schemas)
|
|
234
307
|
* - Undefined: Unknown retryability - allows consumers to decide default behavior
|
|
235
|
-
*
|
|
308
|
+
*
|
|
236
309
|
* When undefined, consumers can choose their retry strategy:
|
|
237
310
|
* - Conservative: Don't retry unknown errors (avoid spam)
|
|
238
311
|
* - Resilient: Retry unknown errors (prioritize success)
|
|
@@ -257,7 +330,7 @@ export class LlumiverseError extends Error {
|
|
|
257
330
|
context: LlumiverseErrorContext,
|
|
258
331
|
originalError: unknown,
|
|
259
332
|
code?: number,
|
|
260
|
-
name?: string
|
|
333
|
+
name?: string,
|
|
261
334
|
) {
|
|
262
335
|
super(message);
|
|
263
336
|
this.name = name || 'LlumiverseError';
|
|
@@ -285,16 +358,15 @@ export class LlumiverseError extends Error {
|
|
|
285
358
|
context: this.context,
|
|
286
359
|
stack: this.stack,
|
|
287
360
|
// Include original error message if available
|
|
288
|
-
originalErrorMessage:
|
|
289
|
-
? this.originalError.message
|
|
290
|
-
: String(this.originalError),
|
|
361
|
+
originalErrorMessage:
|
|
362
|
+
this.originalError instanceof Error ? this.originalError.message : String(this.originalError),
|
|
291
363
|
};
|
|
292
364
|
}
|
|
293
365
|
|
|
294
366
|
/**
|
|
295
367
|
* Type guard to check if an error is a LlumiverseError.
|
|
296
368
|
* Useful for conditional error handling.
|
|
297
|
-
*
|
|
369
|
+
*
|
|
298
370
|
* @param error - The error to check
|
|
299
371
|
* @returns True if the error is a LlumiverseError
|
|
300
372
|
*/
|
|
@@ -306,37 +378,42 @@ export class LlumiverseError extends Error {
|
|
|
306
378
|
// ============== Result Types ===============
|
|
307
379
|
|
|
308
380
|
export interface BaseResult {
|
|
309
|
-
type:
|
|
310
|
-
value:
|
|
381
|
+
type: 'text' | 'json' | 'image';
|
|
382
|
+
value: unknown;
|
|
311
383
|
}
|
|
312
384
|
|
|
313
385
|
export interface TextResult extends BaseResult {
|
|
314
|
-
type:
|
|
386
|
+
type: 'text';
|
|
315
387
|
value: string;
|
|
316
388
|
}
|
|
317
389
|
|
|
318
390
|
export interface JsonResult extends BaseResult {
|
|
319
|
-
type:
|
|
391
|
+
type: 'json';
|
|
392
|
+
value: JSONValue;
|
|
320
393
|
}
|
|
321
394
|
|
|
322
395
|
export interface ImageResult extends BaseResult {
|
|
323
|
-
type:
|
|
396
|
+
type: 'image';
|
|
324
397
|
value: string; // base64 data url or real url
|
|
325
398
|
}
|
|
326
399
|
|
|
400
|
+
/**
|
|
401
|
+
* @discriminator type
|
|
402
|
+
*/
|
|
327
403
|
export type CompletionResult = TextResult | JsonResult | ImageResult;
|
|
328
404
|
|
|
329
|
-
|
|
330
405
|
//Internal structure used in driver implementation.
|
|
331
406
|
export interface CompletionChunkObject {
|
|
332
407
|
result: CompletionResult[];
|
|
333
408
|
token_usage?: ExecutionTokenUsage;
|
|
334
|
-
finish_reason?:
|
|
409
|
+
finish_reason?: 'stop' | 'length' | string;
|
|
335
410
|
/**
|
|
336
411
|
* Tool calls returned by the model during streaming.
|
|
337
412
|
* Each chunk may contain partial tool call information that needs to be aggregated.
|
|
413
|
+
* Typed with `unknown` params because streamed chunks carry partial (often string)
|
|
414
|
+
* tool_input that is only parsed into a JSONObject once fully accumulated.
|
|
338
415
|
*/
|
|
339
|
-
tool_use?: ToolUse[];
|
|
416
|
+
tool_use?: ToolUse<unknown>[];
|
|
340
417
|
}
|
|
341
418
|
|
|
342
419
|
/**
|
|
@@ -346,29 +423,29 @@ export interface CompletionChunkObject {
|
|
|
346
423
|
* - Plain object schemas for simpler cases
|
|
347
424
|
*/
|
|
348
425
|
export interface ToolDefinition {
|
|
349
|
-
name: string
|
|
350
|
-
description?: string
|
|
426
|
+
name: string;
|
|
427
|
+
description?: string;
|
|
351
428
|
input_schema: {
|
|
352
429
|
type?: unknown;
|
|
353
430
|
properties?: Record<string, unknown> | null | undefined;
|
|
354
431
|
required?: readonly string[] | string[];
|
|
355
432
|
additionalProperties?: unknown;
|
|
356
433
|
[k: string]: unknown;
|
|
357
|
-
}
|
|
434
|
+
};
|
|
358
435
|
}
|
|
359
436
|
/**
|
|
360
437
|
* A tool use instance represents a call to a tool.
|
|
361
438
|
* The id property is used to identify the tool call.
|
|
362
439
|
*/
|
|
363
440
|
export interface ToolUse<ParamsT = JSONObject> {
|
|
364
|
-
id: string
|
|
365
|
-
tool_name: string
|
|
366
|
-
tool_input: ParamsT | null
|
|
441
|
+
id: string;
|
|
442
|
+
tool_name: string;
|
|
443
|
+
tool_input: ParamsT | null;
|
|
367
444
|
/**
|
|
368
445
|
* Gemini thinking models require thought_signature to be passed back with tool results.
|
|
369
446
|
* This preserves the model's reasoning state during multi-turn tool use.
|
|
370
447
|
*/
|
|
371
|
-
thought_signature?: string
|
|
448
|
+
thought_signature?: string;
|
|
372
449
|
}
|
|
373
450
|
|
|
374
451
|
export interface Completion {
|
|
@@ -378,11 +455,11 @@ export interface Completion {
|
|
|
378
455
|
/**
|
|
379
456
|
* Contains the tools from which the model awaits information.
|
|
380
457
|
*/
|
|
381
|
-
tool_use?: ToolUse[];
|
|
458
|
+
tool_use?: ToolUse<unknown>[];
|
|
382
459
|
/**
|
|
383
460
|
* The finish reason as reported by the model: stop | length or other model specific values
|
|
384
461
|
*/
|
|
385
|
-
finish_reason?:
|
|
462
|
+
finish_reason?: 'stop' | 'length' | 'tool_use' | string;
|
|
386
463
|
|
|
387
464
|
/**
|
|
388
465
|
* Set only if a result validation error occurred, otherwise if the result is valid the error field is undefined
|
|
@@ -393,7 +470,7 @@ export interface Completion {
|
|
|
393
470
|
/**
|
|
394
471
|
* The original response. Only included if the option include_original_response is set to true and the request is made using execute. Not supported when streaming.
|
|
395
472
|
*/
|
|
396
|
-
original_response?:
|
|
473
|
+
original_response?: unknown;
|
|
397
474
|
|
|
398
475
|
/**
|
|
399
476
|
* The conversation context. This is an opaque structure that can be passed to the next request to restore the context.
|
|
@@ -401,7 +478,7 @@ export interface Completion {
|
|
|
401
478
|
conversation?: unknown;
|
|
402
479
|
}
|
|
403
480
|
|
|
404
|
-
export interface ExecutionResponse<PromptT =
|
|
481
|
+
export interface ExecutionResponse<PromptT = unknown> extends Completion {
|
|
405
482
|
prompt: PromptT;
|
|
406
483
|
/**
|
|
407
484
|
* The time it took to execute the request in seconds
|
|
@@ -413,8 +490,7 @@ export interface ExecutionResponse<PromptT = any> extends Completion {
|
|
|
413
490
|
chunks?: number;
|
|
414
491
|
}
|
|
415
492
|
|
|
416
|
-
|
|
417
|
-
export interface CompletionStream<PromptT = any> extends AsyncIterable<string> {
|
|
493
|
+
export interface CompletionStream<PromptT = unknown> extends AsyncIterable<string> {
|
|
418
494
|
completion: ExecutionResponse<PromptT> | undefined;
|
|
419
495
|
}
|
|
420
496
|
|
|
@@ -424,7 +500,7 @@ export interface CompletionStream<PromptT = any> extends AsyncIterable<string> {
|
|
|
424
500
|
* - Message-only: logger.info("message")
|
|
425
501
|
* - Object-first: logger.info({ data }, "message")
|
|
426
502
|
* - PREVENTS: logger.info("message", { data }) - compile error (objects not allowed in ...args)
|
|
427
|
-
*
|
|
503
|
+
*
|
|
428
504
|
* Additional args must be primitives (string | number | boolean) for string interpolation.
|
|
429
505
|
*/
|
|
430
506
|
export interface Logger {
|
|
@@ -438,19 +514,52 @@ export interface Logger {
|
|
|
438
514
|
error<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
439
515
|
}
|
|
440
516
|
|
|
517
|
+
/**
|
|
518
|
+
* HTTP timeouts applied to a driver's upstream LLM-provider calls.
|
|
519
|
+
*
|
|
520
|
+
* All values are in milliseconds. Drivers should map these onto whatever
|
|
521
|
+
* HTTP client their SDK uses; the defaults applied in
|
|
522
|
+
* `@llumiverse/core/createDriverHttpAgent` are:
|
|
523
|
+
* - headersTimeout: 60_000
|
|
524
|
+
* - bodyTimeout: 60_000
|
|
525
|
+
* - connectTimeout: 10_000
|
|
526
|
+
* - keepAliveTimeout: 30_000
|
|
527
|
+
*
|
|
528
|
+
* The defaults are deliberately tighter than Node's undici default
|
|
529
|
+
* (5 minutes for headers/body) so a hung upstream surfaces quickly. Bump
|
|
530
|
+
* `bodyTimeout` for streaming flows that have legitimate silent gaps
|
|
531
|
+
* (e.g. tool-using agents).
|
|
532
|
+
*/
|
|
533
|
+
export interface HttpTimeoutOptions {
|
|
534
|
+
/** Time (ms) to wait for the first response byte after the request is sent. */
|
|
535
|
+
headersTimeout?: number;
|
|
536
|
+
/** Time (ms) between body chunks once streaming has started. */
|
|
537
|
+
bodyTimeout?: number;
|
|
538
|
+
/** TCP/TLS connect timeout (ms). */
|
|
539
|
+
connectTimeout?: number;
|
|
540
|
+
/** Idle socket reuse timeout (ms). */
|
|
541
|
+
keepAliveTimeout?: number;
|
|
542
|
+
}
|
|
543
|
+
|
|
441
544
|
export interface DriverOptions {
|
|
442
|
-
logger?: Logger |
|
|
545
|
+
logger?: Logger | 'console';
|
|
546
|
+
/**
|
|
547
|
+
* Optional HTTP timeouts applied to the driver's upstream LLM-provider
|
|
548
|
+
* calls. Drivers that don't make HTTP calls (e.g. the in-process test
|
|
549
|
+
* driver) ignore this. See {@link HttpTimeoutOptions} for defaults.
|
|
550
|
+
*/
|
|
551
|
+
httpTimeout?: HttpTimeoutOptions;
|
|
443
552
|
}
|
|
444
553
|
|
|
445
554
|
export type JSONSchemaTypeName =
|
|
446
|
-
|
|
|
447
|
-
|
|
|
448
|
-
|
|
|
449
|
-
|
|
|
450
|
-
|
|
|
451
|
-
|
|
|
452
|
-
|
|
|
453
|
-
|
|
|
555
|
+
| 'string' //
|
|
556
|
+
| 'number'
|
|
557
|
+
| 'integer'
|
|
558
|
+
| 'boolean'
|
|
559
|
+
| 'object'
|
|
560
|
+
| 'array'
|
|
561
|
+
| 'null'
|
|
562
|
+
| 'any';
|
|
454
563
|
|
|
455
564
|
export type JSONSchemaType =
|
|
456
565
|
| string //
|
|
@@ -464,17 +573,26 @@ export interface JSONSchemaObject {
|
|
|
464
573
|
[key: string]: JSONSchemaType;
|
|
465
574
|
}
|
|
466
575
|
|
|
467
|
-
export interface JSONSchemaArray extends Array<JSONSchemaType> {
|
|
576
|
+
export interface JSONSchemaArray extends Array<JSONSchemaType> {}
|
|
577
|
+
|
|
578
|
+
export interface JSONSchemaProperties {
|
|
579
|
+
[key: string]: JSONSchema;
|
|
580
|
+
}
|
|
468
581
|
|
|
469
582
|
export interface JSONSchema {
|
|
470
583
|
type?: JSONSchemaTypeName | JSONSchemaTypeName[];
|
|
471
584
|
description?: string;
|
|
472
|
-
properties?:
|
|
585
|
+
properties?: JSONSchemaProperties;
|
|
586
|
+
items?: JSONSchema;
|
|
587
|
+
format?: string;
|
|
588
|
+
editor?: unknown;
|
|
589
|
+
default?: unknown;
|
|
590
|
+
additionalProperties?: boolean | JSONSchema;
|
|
473
591
|
required?: string[];
|
|
474
|
-
[k: string]:
|
|
592
|
+
[k: string]: unknown;
|
|
475
593
|
}
|
|
476
594
|
|
|
477
|
-
export type PromptFormatter<T =
|
|
595
|
+
export type PromptFormatter<T = unknown> = (messages: PromptSegment[], schema?: JSONSchema) => T;
|
|
478
596
|
|
|
479
597
|
//Options are split into PromptOptions, ModelOptions and ExecutionOptions.
|
|
480
598
|
//ExecutionOptions are most often used within llumiverse as they are the most complete.
|
|
@@ -498,6 +616,12 @@ export interface StatelessExecutionOptions extends PromptOptions {
|
|
|
498
616
|
include_original_response?: boolean;
|
|
499
617
|
model_options?: ModelOptions;
|
|
500
618
|
|
|
619
|
+
/**
|
|
620
|
+
* Per-call HTTP timeouts for upstream LLM-provider calls. These override
|
|
621
|
+
* the driver's default `DriverOptions.httpTimeout` for this execution only.
|
|
622
|
+
*/
|
|
623
|
+
httpTimeout?: HttpTimeoutOptions;
|
|
624
|
+
|
|
501
625
|
/**
|
|
502
626
|
* @deprecated This is deprecated. Use CompletionResult.type information instead.
|
|
503
627
|
*/
|
|
@@ -552,31 +676,34 @@ export interface ExecutionOptions extends StatelessExecutionOptions {
|
|
|
552
676
|
//Common names to share between different models
|
|
553
677
|
export enum SharedOptions {
|
|
554
678
|
//Text
|
|
555
|
-
max_tokens =
|
|
556
|
-
temperature =
|
|
557
|
-
top_p =
|
|
558
|
-
top_k =
|
|
559
|
-
presence_penalty =
|
|
560
|
-
frequency_penalty =
|
|
561
|
-
stop_sequence =
|
|
562
|
-
effort =
|
|
679
|
+
max_tokens = 'max_tokens',
|
|
680
|
+
temperature = 'temperature',
|
|
681
|
+
top_p = 'top_p',
|
|
682
|
+
top_k = 'top_k',
|
|
683
|
+
presence_penalty = 'presence_penalty',
|
|
684
|
+
frequency_penalty = 'frequency_penalty',
|
|
685
|
+
stop_sequence = 'stop_sequence',
|
|
686
|
+
effort = 'effort',
|
|
563
687
|
|
|
564
688
|
//Image
|
|
565
|
-
seed =
|
|
566
|
-
number_of_images =
|
|
689
|
+
seed = 'seed',
|
|
690
|
+
number_of_images = 'number_of_images',
|
|
567
691
|
}
|
|
568
692
|
|
|
569
693
|
export enum OptionType {
|
|
570
|
-
numeric =
|
|
571
|
-
enum =
|
|
572
|
-
boolean =
|
|
573
|
-
string_list =
|
|
694
|
+
numeric = 'numeric',
|
|
695
|
+
enum = 'enum',
|
|
696
|
+
boolean = 'boolean',
|
|
697
|
+
string_list = 'string_list',
|
|
574
698
|
}
|
|
575
699
|
|
|
576
|
-
export type ReasoningEffort =
|
|
700
|
+
export type ReasoningEffort = 'low' | 'medium' | 'high';
|
|
577
701
|
|
|
578
702
|
// ============== Model Options ===============
|
|
579
703
|
|
|
704
|
+
/**
|
|
705
|
+
* @discriminator _option_id
|
|
706
|
+
*/
|
|
580
707
|
export type ModelOptions = TextFallbackOptions | VertexAIOptions | BedrockOptions | OpenAiOptions | GroqOptions;
|
|
581
708
|
|
|
582
709
|
// ============== Option Info ===============
|
|
@@ -628,16 +755,16 @@ export interface StringListOptionInfo extends OptionInfoPrototype {
|
|
|
628
755
|
|
|
629
756
|
// ============== Prompts ===============
|
|
630
757
|
export enum PromptRole {
|
|
631
|
-
safety =
|
|
632
|
-
system =
|
|
633
|
-
user =
|
|
634
|
-
assistant =
|
|
635
|
-
negative =
|
|
636
|
-
mask =
|
|
758
|
+
safety = 'safety',
|
|
759
|
+
system = 'system',
|
|
760
|
+
user = 'user',
|
|
761
|
+
assistant = 'assistant',
|
|
762
|
+
negative = 'negative',
|
|
763
|
+
mask = 'mask',
|
|
637
764
|
/**
|
|
638
765
|
* Used to send the response of a tool
|
|
639
766
|
*/
|
|
640
|
-
tool =
|
|
767
|
+
tool = 'tool',
|
|
641
768
|
}
|
|
642
769
|
|
|
643
770
|
export interface PromptSegment {
|
|
@@ -652,7 +779,7 @@ export interface PromptSegment {
|
|
|
652
779
|
* This should be copied from the ToolUse.thought_signature when sending tool responses.
|
|
653
780
|
*/
|
|
654
781
|
thought_signature?: string;
|
|
655
|
-
files?: DataSource[]
|
|
782
|
+
files?: DataSource[];
|
|
656
783
|
}
|
|
657
784
|
|
|
658
785
|
export interface ExecutionTokenUsage {
|
|
@@ -676,8 +803,8 @@ export interface ExecutionTokenUsage {
|
|
|
676
803
|
* @deprecated This is deprecated. Use CompletionResult.type information instead.
|
|
677
804
|
*/
|
|
678
805
|
export enum Modalities {
|
|
679
|
-
text =
|
|
680
|
-
image =
|
|
806
|
+
text = 'text',
|
|
807
|
+
image = 'image',
|
|
681
808
|
}
|
|
682
809
|
|
|
683
810
|
/**
|
|
@@ -712,7 +839,7 @@ export interface AIModel<ProviderKeys = string> {
|
|
|
712
839
|
status?: AIModelStatus; //status of the model
|
|
713
840
|
can_stream?: boolean; //if the model's response can be streamed
|
|
714
841
|
is_custom?: boolean; //if the model is a custom model (a trained model)
|
|
715
|
-
is_multimodal?: boolean //if the model support files and images
|
|
842
|
+
is_multimodal?: boolean; //if the model support files and images
|
|
716
843
|
input_modalities?: string[]; //Input modalities supported by the model (e.g. text, image, video, audio)
|
|
717
844
|
output_modalities?: string[]; //Output modalities supported by the model (e.g. text, image, video, audio)
|
|
718
845
|
tool_support?: boolean; //if the model supports tool use
|
|
@@ -720,12 +847,12 @@ export interface AIModel<ProviderKeys = string> {
|
|
|
720
847
|
}
|
|
721
848
|
|
|
722
849
|
export enum AIModelStatus {
|
|
723
|
-
Available =
|
|
724
|
-
Pending =
|
|
725
|
-
Stopped =
|
|
726
|
-
Unavailable =
|
|
727
|
-
Unknown =
|
|
728
|
-
Legacy =
|
|
850
|
+
Available = 'available',
|
|
851
|
+
Pending = 'pending',
|
|
852
|
+
Stopped = 'stopped',
|
|
853
|
+
Unavailable = 'unavailable',
|
|
854
|
+
Unknown = 'unknown',
|
|
855
|
+
Legacy = 'legacy',
|
|
729
856
|
}
|
|
730
857
|
|
|
731
858
|
/**
|
|
@@ -742,37 +869,34 @@ export interface ModelSearchPayload {
|
|
|
742
869
|
owner?: string;
|
|
743
870
|
}
|
|
744
871
|
|
|
745
|
-
|
|
746
872
|
export enum ModelType {
|
|
747
|
-
Classifier =
|
|
748
|
-
Regressor =
|
|
749
|
-
Clustering =
|
|
750
|
-
AnomalyDetection =
|
|
751
|
-
TimeSeries =
|
|
752
|
-
Text =
|
|
753
|
-
Image =
|
|
754
|
-
Audio =
|
|
755
|
-
Video =
|
|
756
|
-
Embedding =
|
|
757
|
-
Chat =
|
|
758
|
-
Code =
|
|
759
|
-
NLP =
|
|
760
|
-
MultiModal =
|
|
761
|
-
Test =
|
|
762
|
-
Other =
|
|
763
|
-
Unknown =
|
|
873
|
+
Classifier = 'classifier',
|
|
874
|
+
Regressor = 'regressor',
|
|
875
|
+
Clustering = 'clustering',
|
|
876
|
+
AnomalyDetection = 'anomaly-detection',
|
|
877
|
+
TimeSeries = 'time-series',
|
|
878
|
+
Text = 'text',
|
|
879
|
+
Image = 'image',
|
|
880
|
+
Audio = 'audio',
|
|
881
|
+
Video = 'video',
|
|
882
|
+
Embedding = 'embedding',
|
|
883
|
+
Chat = 'chat',
|
|
884
|
+
Code = 'code',
|
|
885
|
+
NLP = 'nlp',
|
|
886
|
+
MultiModal = 'multi-modal',
|
|
887
|
+
Test = 'test',
|
|
888
|
+
Other = 'other',
|
|
889
|
+
Unknown = 'unknown',
|
|
764
890
|
}
|
|
765
891
|
|
|
766
|
-
|
|
767
892
|
// ============== training =====================
|
|
768
893
|
|
|
769
|
-
|
|
770
|
-
|
|
771
894
|
export interface DataSource {
|
|
772
895
|
name: string;
|
|
773
896
|
mime_type: string;
|
|
774
897
|
getStream(): Promise<ReadableStream<Uint8Array | string>>;
|
|
775
898
|
getURL(): Promise<string>;
|
|
899
|
+
getURI(): Promise<string>;
|
|
776
900
|
}
|
|
777
901
|
|
|
778
902
|
export interface TrainingOptions {
|
|
@@ -783,16 +907,16 @@ export interface TrainingOptions {
|
|
|
783
907
|
|
|
784
908
|
export interface TrainingPromptOptions {
|
|
785
909
|
segments: PromptSegment[];
|
|
786
|
-
completion: CompletionResult[]
|
|
910
|
+
completion: CompletionResult[];
|
|
787
911
|
model: string; // the model to train
|
|
788
912
|
schema?: JSONSchema; // the result schema f any
|
|
789
913
|
}
|
|
790
914
|
|
|
791
915
|
export enum TrainingJobStatus {
|
|
792
|
-
running =
|
|
793
|
-
succeeded =
|
|
794
|
-
failed =
|
|
795
|
-
cancelled =
|
|
916
|
+
running = 'running',
|
|
917
|
+
succeeded = 'succeeded',
|
|
918
|
+
failed = 'failed',
|
|
919
|
+
cancelled = 'cancelled',
|
|
796
920
|
}
|
|
797
921
|
|
|
798
922
|
export interface TrainingJob {
|