@llumiverse/common 0.22.0 → 0.23.0-dev-20251118
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/cjs/capability/azure_foundry.js +1 -0
- package/lib/cjs/capability/azure_foundry.js.map +1 -1
- package/lib/cjs/capability/bedrock.js +7 -2
- package/lib/cjs/capability/bedrock.js.map +1 -1
- package/lib/cjs/capability/openai.js +2 -0
- package/lib/cjs/capability/openai.js.map +1 -1
- package/lib/cjs/capability/vertexai.js +1 -0
- package/lib/cjs/capability/vertexai.js.map +1 -1
- package/lib/cjs/capability.js +7 -0
- package/lib/cjs/capability.js.map +1 -1
- package/lib/cjs/options/azure_foundry.js +3 -0
- package/lib/cjs/options/azure_foundry.js.map +1 -1
- package/lib/cjs/options/bedrock.js +62 -0
- package/lib/cjs/options/bedrock.js.map +1 -1
- package/lib/cjs/options/openai.js +3 -0
- package/lib/cjs/options/openai.js.map +1 -1
- package/lib/cjs/options/vertexai.js +98 -2
- package/lib/cjs/options/vertexai.js.map +1 -1
- package/lib/cjs/types.js +1 -1
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/capability/azure_foundry.js +1 -0
- package/lib/esm/capability/azure_foundry.js.map +1 -1
- package/lib/esm/capability/bedrock.js +7 -2
- package/lib/esm/capability/bedrock.js.map +1 -1
- package/lib/esm/capability/openai.js +2 -0
- package/lib/esm/capability/openai.js.map +1 -1
- package/lib/esm/capability/vertexai.js +1 -0
- package/lib/esm/capability/vertexai.js.map +1 -1
- package/lib/esm/capability.js +7 -0
- package/lib/esm/capability.js.map +1 -1
- package/lib/esm/options/azure_foundry.js +3 -0
- package/lib/esm/options/azure_foundry.js.map +1 -1
- package/lib/esm/options/bedrock.js +62 -0
- package/lib/esm/options/bedrock.js.map +1 -1
- package/lib/esm/options/openai.js +3 -0
- package/lib/esm/options/openai.js.map +1 -1
- package/lib/esm/options/vertexai.js +98 -2
- package/lib/esm/options/vertexai.js.map +1 -1
- package/lib/esm/types.js +1 -1
- package/lib/esm/types.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/capability/azure_foundry.d.ts.map +1 -1
- package/lib/types/capability/bedrock.d.ts.map +1 -1
- package/lib/types/capability/openai.d.ts.map +1 -1
- package/lib/types/capability/vertexai.d.ts.map +1 -1
- package/lib/types/capability.d.ts.map +1 -1
- package/lib/types/options/azure_foundry.d.ts.map +1 -1
- package/lib/types/options/bedrock.d.ts +13 -2
- package/lib/types/options/bedrock.d.ts.map +1 -1
- package/lib/types/options/openai.d.ts.map +1 -1
- package/lib/types/options/vertexai.d.ts +1 -0
- package/lib/types/options/vertexai.d.ts.map +1 -1
- package/lib/types/types.d.ts +39 -14
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +77 -77
- package/src/capability/azure_foundry.ts +1 -0
- package/src/capability/bedrock.ts +7 -2
- package/src/capability/openai.ts +2 -0
- package/src/capability/vertexai.ts +1 -0
- package/src/capability.ts +7 -0
- package/src/options/azure_foundry.ts +3 -0
- package/src/options/bedrock.ts +78 -2
- package/src/options/openai.ts +3 -0
- package/src/options/vertexai.ts +109 -6
- package/src/types.ts +48 -22
package/src/types.ts
CHANGED
|
@@ -64,7 +64,7 @@ export const ProviderList: Record<Providers, ProviderParams> = {
|
|
|
64
64
|
replicate:
|
|
65
65
|
{
|
|
66
66
|
id: Providers.replicate,
|
|
67
|
-
name: "
|
|
67
|
+
name: "Replicate",
|
|
68
68
|
requiresApiKey: true,
|
|
69
69
|
requiresEndpointUrl: false,
|
|
70
70
|
supportSearch: true,
|
|
@@ -152,20 +152,40 @@ export interface EmbeddingsResult {
|
|
|
152
152
|
export interface ResultValidationError {
|
|
153
153
|
code: 'validation_error' | 'json_error' | 'content_policy_violation';
|
|
154
154
|
message: string;
|
|
155
|
-
data?:
|
|
155
|
+
data?: CompletionResult[];
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
//
|
|
158
|
+
// ============== Result Types ===============
|
|
159
|
+
|
|
160
|
+
export interface BaseResult {
|
|
161
|
+
type: "text" | "json" | "image";
|
|
162
|
+
value: any;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface TextResult extends BaseResult {
|
|
166
|
+
type: "text";
|
|
167
|
+
value: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface JsonResult extends BaseResult {
|
|
171
|
+
type: "json";
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface ImageResult extends BaseResult {
|
|
175
|
+
type: "image";
|
|
176
|
+
value: string; // base64 data url or real url
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type CompletionResult = TextResult | JsonResult | ImageResult;
|
|
180
|
+
|
|
181
|
+
|
|
159
182
|
//Internal structure used in driver implementation.
|
|
160
|
-
export interface CompletionChunkObject
|
|
161
|
-
result:
|
|
183
|
+
export interface CompletionChunkObject {
|
|
184
|
+
result: CompletionResult[];
|
|
162
185
|
token_usage?: ExecutionTokenUsage;
|
|
163
186
|
finish_reason?: "stop" | "length" | string;
|
|
164
187
|
}
|
|
165
188
|
|
|
166
|
-
//Internal structure used in driver implementation.
|
|
167
|
-
export type CompletionChunk = CompletionChunkObject | string;
|
|
168
|
-
|
|
169
189
|
export interface ToolDefinition {
|
|
170
190
|
name: string,
|
|
171
191
|
description?: string,
|
|
@@ -185,10 +205,9 @@ export interface ToolUse<ParamsT = JSONObject> {
|
|
|
185
205
|
tool_input: ParamsT | null
|
|
186
206
|
}
|
|
187
207
|
|
|
188
|
-
|
|
189
|
-
export interface Completion<ResultT = any> {
|
|
208
|
+
export interface Completion {
|
|
190
209
|
// the driver impl must return the result and optionally the token_usage. the execution time is computed by the extended abstract driver
|
|
191
|
-
result:
|
|
210
|
+
result: CompletionResult[];
|
|
192
211
|
token_usage?: ExecutionTokenUsage;
|
|
193
212
|
/**
|
|
194
213
|
* Contains the tools from which the model awaits information.
|
|
@@ -216,12 +235,6 @@ export interface Completion<ResultT = any> {
|
|
|
216
235
|
conversation?: unknown;
|
|
217
236
|
}
|
|
218
237
|
|
|
219
|
-
export interface ImageGeneration {
|
|
220
|
-
|
|
221
|
-
images?: string[];
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
|
|
225
238
|
export interface ExecutionResponse<PromptT = any> extends Completion {
|
|
226
239
|
prompt: PromptT;
|
|
227
240
|
/**
|
|
@@ -239,11 +252,24 @@ export interface CompletionStream<PromptT = any> extends AsyncIterable<string> {
|
|
|
239
252
|
completion: ExecutionResponse<PromptT> | undefined;
|
|
240
253
|
}
|
|
241
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Minimal logger interface for LLM drivers.
|
|
257
|
+
* Follows pino v10 signature: supports message-only or object-first (never message-first).
|
|
258
|
+
* - Message-only: logger.info("message")
|
|
259
|
+
* - Object-first: logger.info({ data }, "message")
|
|
260
|
+
* - PREVENTS: logger.info("message", { data }) - compile error (objects not allowed in ...args)
|
|
261
|
+
*
|
|
262
|
+
* Additional args must be primitives (string | number | boolean) for string interpolation.
|
|
263
|
+
*/
|
|
242
264
|
export interface Logger {
|
|
243
|
-
debug:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
265
|
+
debug(msg: string, ...args: (string | number | boolean)[]): void;
|
|
266
|
+
debug<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
267
|
+
info(msg: string, ...args: (string | number | boolean)[]): void;
|
|
268
|
+
info<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
269
|
+
warn(msg: string, ...args: (string | number | boolean)[]): void;
|
|
270
|
+
warn<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
271
|
+
error(msg: string, ...args: (string | number | boolean)[]): void;
|
|
272
|
+
error<T>(obj: T, msg?: T extends string ? never : string, ...args: (string | number | boolean)[]): void;
|
|
247
273
|
}
|
|
248
274
|
|
|
249
275
|
export interface DriverOptions {
|
|
@@ -533,7 +559,7 @@ export interface TrainingOptions {
|
|
|
533
559
|
|
|
534
560
|
export interface TrainingPromptOptions {
|
|
535
561
|
segments: PromptSegment[];
|
|
536
|
-
completion:
|
|
562
|
+
completion: CompletionResult[]
|
|
537
563
|
model: string; // the model to train
|
|
538
564
|
schema?: JSONSchema; // the result schema f any
|
|
539
565
|
}
|