@llumiverse/common 0.23.0-dev.20251201 → 0.24.0
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 +160 -0
- package/lib/cjs/capability/azure_foundry.js.map +1 -0
- package/lib/cjs/capability/bedrock.js +158 -0
- package/lib/cjs/capability/bedrock.js.map +1 -0
- package/lib/cjs/capability/openai.js +95 -0
- package/lib/cjs/capability/openai.js.map +1 -0
- package/lib/cjs/capability/vertexai.js +80 -0
- package/lib/cjs/capability/vertexai.js.map +1 -0
- package/lib/cjs/capability.js +82 -0
- package/lib/cjs/capability.js.map +1 -0
- package/lib/cjs/index.js +25 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/options/azure_foundry.js +428 -0
- package/lib/cjs/options/azure_foundry.js.map +1 -0
- package/lib/cjs/options/bedrock.js +462 -0
- package/lib/cjs/options/bedrock.js.map +1 -0
- package/lib/cjs/options/fallback.js +35 -0
- package/lib/cjs/options/fallback.js.map +1 -0
- package/lib/cjs/options/groq.js +37 -0
- package/lib/cjs/options/groq.js.map +1 -0
- package/lib/cjs/options/openai.js +126 -0
- package/lib/cjs/options/openai.js.map +1 -0
- package/lib/cjs/options/vertexai.js +503 -0
- package/lib/cjs/options/vertexai.js.map +1 -0
- package/lib/cjs/options.js +30 -0
- package/lib/cjs/options.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/types.js +195 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/esm/capability/azure_foundry.js +157 -0
- package/lib/esm/capability/azure_foundry.js.map +1 -0
- package/lib/esm/capability/bedrock.js +155 -0
- package/lib/esm/capability/bedrock.js.map +1 -0
- package/lib/esm/capability/openai.js +92 -0
- package/lib/esm/capability/openai.js.map +1 -0
- package/lib/esm/capability/vertexai.js +77 -0
- package/lib/esm/capability/vertexai.js.map +1 -0
- package/lib/esm/capability.js +77 -0
- package/lib/esm/capability.js.map +1 -0
- package/lib/esm/index.js +9 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/options/azure_foundry.js +424 -0
- package/lib/esm/options/azure_foundry.js.map +1 -0
- package/lib/esm/options/bedrock.js +458 -0
- package/lib/esm/options/bedrock.js.map +1 -0
- package/lib/esm/options/fallback.js +32 -0
- package/lib/esm/options/fallback.js.map +1 -0
- package/lib/esm/options/groq.js +34 -0
- package/lib/esm/options/groq.js.map +1 -0
- package/lib/esm/options/openai.js +123 -0
- package/lib/esm/options/openai.js.map +1 -0
- package/lib/esm/options/vertexai.js +498 -0
- package/lib/esm/options/vertexai.js.map +1 -0
- package/lib/esm/options.js +27 -0
- package/lib/esm/options.js.map +1 -0
- package/lib/esm/types.js +192 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/types/capability/azure_foundry.d.ts +7 -0
- package/lib/types/capability/azure_foundry.d.ts.map +1 -0
- package/lib/types/capability/bedrock.d.ts +7 -0
- package/lib/types/capability/bedrock.d.ts.map +1 -0
- package/lib/types/capability/openai.d.ts +13 -0
- package/lib/types/capability/openai.d.ts.map +1 -0
- package/lib/types/capability/vertexai.d.ts +11 -0
- package/lib/types/capability/vertexai.d.ts.map +1 -0
- package/lib/types/capability.d.ts +5 -0
- package/lib/types/capability.d.ts.map +1 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/options/azure_foundry.d.ts +52 -0
- package/lib/types/options/azure_foundry.d.ts.map +1 -0
- package/lib/types/options/bedrock.d.ts +52 -0
- package/lib/types/options/bedrock.d.ts.map +1 -0
- package/lib/types/options/fallback.d.ts +13 -0
- package/lib/types/options/fallback.d.ts.map +1 -0
- package/lib/types/options/groq.d.ts +12 -0
- package/lib/types/options/groq.d.ts.map +1 -0
- package/lib/types/options/openai.d.ts +21 -0
- package/lib/types/options/openai.d.ts.map +1 -0
- package/lib/types/options/vertexai.d.ts +74 -0
- package/lib/types/options/vertexai.d.ts.map +1 -0
- package/lib/types/options.d.ts +3 -0
- package/lib/types/options.d.ts.map +1 -0
- package/lib/types/types.d.ts +442 -0
- package/lib/types/types.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/capability/azure_foundry.ts +1 -0
- package/src/capability/bedrock.ts +98 -128
- package/src/capability/openai.ts +43 -68
- package/src/capability/vertexai.ts +15 -36
- package/src/capability.ts +19 -2
- package/src/types.ts +52 -2
package/src/types.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { VertexAIOptions } from './options/vertexai.js';
|
|
|
8
8
|
|
|
9
9
|
export enum Providers {
|
|
10
10
|
openai = 'openai',
|
|
11
|
+
openai_compatible = 'openai_compatible',
|
|
11
12
|
azure_openai = 'azure_openai',
|
|
12
13
|
azure_foundry = 'azure_foundry',
|
|
13
14
|
huggingface_ie = 'huggingface_ie',
|
|
@@ -17,7 +18,8 @@ export enum Providers {
|
|
|
17
18
|
togetherai = 'togetherai',
|
|
18
19
|
mistralai = 'mistralai',
|
|
19
20
|
groq = 'groq',
|
|
20
|
-
watsonx = 'watsonx'
|
|
21
|
+
watsonx = 'watsonx',
|
|
22
|
+
xai = 'xai'
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export interface ProviderParams {
|
|
@@ -113,6 +115,21 @@ export const ProviderList: Record<Providers, ProviderParams> = {
|
|
|
113
115
|
requiresEndpointUrl: true,
|
|
114
116
|
supportSearch: false
|
|
115
117
|
},
|
|
118
|
+
xai: {
|
|
119
|
+
id: Providers.xai,
|
|
120
|
+
name: "xAI (Grok)",
|
|
121
|
+
requiresApiKey: true,
|
|
122
|
+
requiresEndpointUrl: false,
|
|
123
|
+
supportSearch: false
|
|
124
|
+
},
|
|
125
|
+
openai_compatible: {
|
|
126
|
+
id: Providers.openai_compatible,
|
|
127
|
+
name: "OpenAI Compatible",
|
|
128
|
+
requiresApiKey: true,
|
|
129
|
+
requiresEndpointUrl: true,
|
|
130
|
+
endpointPlaceholder: "https://api.example.com/v1",
|
|
131
|
+
supportSearch: false
|
|
132
|
+
},
|
|
116
133
|
}
|
|
117
134
|
|
|
118
135
|
// ============== Embeddings ===============
|
|
@@ -184,6 +201,11 @@ export interface CompletionChunkObject {
|
|
|
184
201
|
result: CompletionResult[];
|
|
185
202
|
token_usage?: ExecutionTokenUsage;
|
|
186
203
|
finish_reason?: "stop" | "length" | string;
|
|
204
|
+
/**
|
|
205
|
+
* Tool calls returned by the model during streaming.
|
|
206
|
+
* Each chunk may contain partial tool call information that needs to be aggregated.
|
|
207
|
+
*/
|
|
208
|
+
tool_use?: ToolUse[];
|
|
187
209
|
}
|
|
188
210
|
|
|
189
211
|
export interface ToolDefinition {
|
|
@@ -202,7 +224,12 @@ export interface ToolDefinition {
|
|
|
202
224
|
export interface ToolUse<ParamsT = JSONObject> {
|
|
203
225
|
id: string,
|
|
204
226
|
tool_name: string,
|
|
205
|
-
tool_input: ParamsT | null
|
|
227
|
+
tool_input: ParamsT | null,
|
|
228
|
+
/**
|
|
229
|
+
* Gemini thinking models require thought_signature to be passed back with tool results.
|
|
230
|
+
* This preserves the model's reasoning state during multi-turn tool use.
|
|
231
|
+
*/
|
|
232
|
+
thought_signature?: string,
|
|
206
233
|
}
|
|
207
234
|
|
|
208
235
|
export interface Completion {
|
|
@@ -349,6 +376,24 @@ export interface ExecutionOptions extends StatelessExecutionOptions {
|
|
|
349
376
|
* that can be passed here to restore the context when a new prompt is sent to the model.
|
|
350
377
|
*/
|
|
351
378
|
conversation?: unknown | null;
|
|
379
|
+
/**
|
|
380
|
+
* Number of turns to keep images in conversation history before stripping them.
|
|
381
|
+
* - 0 (default): Strip images immediately after each turn
|
|
382
|
+
* - 1: Keep images for current turn only, strip in next turn
|
|
383
|
+
* - N: Keep images for N turns before stripping
|
|
384
|
+
* - undefined: Same as 0, strip immediately
|
|
385
|
+
*
|
|
386
|
+
* Images are stripped to prevent JSON.stringify corruption (Uint8Array) and reduce storage bloat (base64).
|
|
387
|
+
*/
|
|
388
|
+
stripImagesAfterTurns?: number;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Maximum tokens to keep for text content in tool results.
|
|
392
|
+
* Text exceeding this limit will be truncated with a "[Content truncated...]" marker.
|
|
393
|
+
* - undefined/0: No text truncation (default)
|
|
394
|
+
* - N > 0: Truncate text to approximately N tokens (using ~4 chars/token estimate)
|
|
395
|
+
*/
|
|
396
|
+
stripTextMaxTokens?: number;
|
|
352
397
|
}
|
|
353
398
|
|
|
354
399
|
//Common names to share between different models
|
|
@@ -446,6 +491,11 @@ export interface PromptSegment {
|
|
|
446
491
|
* The tool use id if the segment is a tool response
|
|
447
492
|
*/
|
|
448
493
|
tool_use_id?: string;
|
|
494
|
+
/**
|
|
495
|
+
* Gemini thinking models require thought_signature to be passed back with tool results.
|
|
496
|
+
* This should be copied from the ToolUse.thought_signature when sending tool responses.
|
|
497
|
+
*/
|
|
498
|
+
thought_signature?: string;
|
|
449
499
|
files?: DataSource[]
|
|
450
500
|
}
|
|
451
501
|
|