@llumiverse/core 0.14.0 → 0.16.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/README.md +3 -3
- package/lib/cjs/CompletionStream.js +31 -10
- package/lib/cjs/CompletionStream.js.map +1 -1
- package/lib/cjs/Driver.js +19 -21
- package/lib/cjs/Driver.js.map +1 -1
- package/lib/cjs/async.js +3 -2
- package/lib/cjs/async.js.map +1 -1
- package/lib/cjs/formatters/index.js +1 -3
- package/lib/cjs/formatters/index.js.map +1 -1
- package/lib/cjs/formatters/{claude.js → nova.js} +33 -37
- package/lib/cjs/formatters/nova.js.map +1 -0
- package/lib/cjs/formatters/openai.js +37 -7
- package/lib/cjs/formatters/openai.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/options/bedrock.js +343 -0
- package/lib/cjs/options/bedrock.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 +123 -0
- package/lib/cjs/options/openai.js.map +1 -0
- package/lib/cjs/options/vertexai.js +257 -0
- package/lib/cjs/options/vertexai.js.map +1 -0
- package/lib/cjs/options.js +54 -0
- package/lib/cjs/options.js.map +1 -0
- package/lib/cjs/types.js +34 -1
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/CompletionStream.js +31 -10
- package/lib/esm/CompletionStream.js.map +1 -1
- package/lib/esm/Driver.js +20 -22
- package/lib/esm/Driver.js.map +1 -1
- package/lib/esm/async.js +3 -2
- package/lib/esm/async.js.map +1 -1
- package/lib/esm/formatters/index.js +1 -3
- package/lib/esm/formatters/index.js.map +1 -1
- package/lib/esm/formatters/{claude.js → nova.js} +32 -36
- package/lib/esm/formatters/nova.js.map +1 -0
- package/lib/esm/formatters/openai.js +37 -7
- package/lib/esm/formatters/openai.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/options/bedrock.js +340 -0
- package/lib/esm/options/bedrock.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 +120 -0
- package/lib/esm/options/openai.js.map +1 -0
- package/lib/esm/options/vertexai.js +253 -0
- package/lib/esm/options/vertexai.js.map +1 -0
- package/lib/esm/options.js +50 -0
- package/lib/esm/options.js.map +1 -0
- package/lib/esm/types.js +33 -0
- package/lib/esm/types.js.map +1 -1
- package/lib/types/CompletionStream.d.ts +1 -1
- package/lib/types/CompletionStream.d.ts.map +1 -1
- package/lib/types/Driver.d.ts +5 -4
- package/lib/types/Driver.d.ts.map +1 -1
- package/lib/types/async.d.ts +3 -2
- package/lib/types/async.d.ts.map +1 -1
- package/lib/types/formatters/generic.d.ts.map +1 -1
- package/lib/types/formatters/index.d.ts +1 -3
- package/lib/types/formatters/index.d.ts.map +1 -1
- package/lib/types/formatters/nova.d.ts +40 -0
- package/lib/types/formatters/nova.d.ts.map +1 -0
- package/lib/types/formatters/openai.d.ts +13 -1
- package/lib/types/formatters/openai.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/options/bedrock.d.ts +32 -0
- package/lib/types/options/bedrock.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 +52 -0
- package/lib/types/options/vertexai.d.ts.map +1 -0
- package/lib/types/options.d.ts +14 -0
- package/lib/types/options.d.ts.map +1 -0
- package/lib/types/types.d.ts +133 -49
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/CompletionStream.ts +31 -11
- package/src/Driver.ts +29 -25
- package/src/async.ts +7 -5
- package/src/formatters/index.ts +1 -3
- package/src/formatters/nova.ts +141 -0
- package/src/formatters/openai.ts +55 -13
- package/src/index.ts +2 -1
- package/src/options/bedrock.ts +388 -0
- package/src/options/groq.ts +47 -0
- package/src/options/openai.ts +148 -0
- package/src/options/vertexai.ts +312 -0
- package/src/options.ts +62 -0
- package/src/types.ts +167 -52
- package/lib/cjs/formatters/claude.js.map +0 -1
- package/lib/cjs/formatters/llama2.js +0 -48
- package/lib/cjs/formatters/llama2.js.map +0 -1
- package/lib/cjs/formatters/llama3.js +0 -42
- package/lib/cjs/formatters/llama3.js.map +0 -1
- package/lib/esm/formatters/claude.js.map +0 -1
- package/lib/esm/formatters/llama2.js +0 -45
- package/lib/esm/formatters/llama2.js.map +0 -1
- package/lib/esm/formatters/llama3.js +0 -39
- package/lib/esm/formatters/llama3.js.map +0 -1
- package/lib/types/formatters/claude.d.ts +0 -25
- package/lib/types/formatters/claude.d.ts.map +0 -1
- package/lib/types/formatters/llama2.d.ts +0 -4
- package/lib/types/formatters/llama2.d.ts.map +0 -1
- package/lib/types/formatters/llama3.d.ts +0 -7
- package/lib/types/formatters/llama3.d.ts.map +0 -1
- package/src/formatters/claude.ts +0 -131
- package/src/formatters/llama2.ts +0 -58
- package/src/formatters/llama3.ts +0 -55
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { JSONSchema4 } from "json-schema";
|
|
2
|
+
import { PromptSegment } from "../index.js";
|
|
3
|
+
export interface NovaMessage {
|
|
4
|
+
role: 'user' | 'assistant';
|
|
5
|
+
content: NovaMessagePart[];
|
|
6
|
+
}
|
|
7
|
+
export interface NovaSystemMessage {
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
interface NovaMessagePart {
|
|
11
|
+
text?: string;
|
|
12
|
+
image?: {
|
|
13
|
+
format: "jpeg" | "png" | "gif" | "webp";
|
|
14
|
+
source: {
|
|
15
|
+
bytes: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
video?: {
|
|
19
|
+
format: "mkv" | "mov" | "mp4" | "webm" | "three_gp" | "flv" | "mpeg" | "mpg" | "wmv";
|
|
20
|
+
source: {
|
|
21
|
+
s3Location?: {
|
|
22
|
+
uri: string;
|
|
23
|
+
bucketOwner: string;
|
|
24
|
+
};
|
|
25
|
+
bytes?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface NovaMessagesPrompt {
|
|
30
|
+
system?: NovaSystemMessage[];
|
|
31
|
+
messages: NovaMessage[];
|
|
32
|
+
negative?: string;
|
|
33
|
+
mask?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A formatter used by Bedrock to format prompts for nova related models
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatNovaPrompt(segments: PromptSegment[], schema?: JSONSchema4): Promise<NovaMessagesPrompt>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=nova.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nova.d.ts","sourceRoot":"","sources":["../../../src/formatters/nova.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAc,aAAa,EAAsB,MAAM,aAAa,CAAC;AAI5E,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAA;CACf;AAED,UAAU,eAAe;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE;QACJ,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;QACxC,MAAM,EAAE;YACJ,KAAK,EAAE,MAAM,CAAA;SAChB,CAAA;KACJ,CAAA;IACD,KAAK,CAAC,EAAE;QACJ,MAAM,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;QACrF,MAAM,EAAE;YAEJ,UAAU,CAAC,EAAE;gBACT,GAAG,EAAE,MAAM,CAAC;gBACZ,WAAW,EAAE,MAAM,CAAA;aACtB,CAAA;YAED,KAAK,CAAC,EAAE,MAAM,CAAA;SACjB,CAAA;KACJ,CAAA;CACJ;AAED,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AAEH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA6FnH"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PromptOptions } from "../index.js";
|
|
1
2
|
import { PromptSegment } from "../types.js";
|
|
2
3
|
export interface OpenAITextMessage {
|
|
3
4
|
content: string;
|
|
@@ -8,6 +9,12 @@ export interface OpenAIMessage {
|
|
|
8
9
|
role: "system" | "user" | "assistant";
|
|
9
10
|
name?: string;
|
|
10
11
|
}
|
|
12
|
+
export interface OpenAIToolMessage {
|
|
13
|
+
role: "tool";
|
|
14
|
+
tool_call_id: string;
|
|
15
|
+
content: string;
|
|
16
|
+
}
|
|
17
|
+
export type OpenAIInputMessage = OpenAIMessage | OpenAIToolMessage;
|
|
11
18
|
export interface OpenAIContentPartText {
|
|
12
19
|
type: "text";
|
|
13
20
|
text: string;
|
|
@@ -25,5 +32,10 @@ export interface OpenAIContentPartImage {
|
|
|
25
32
|
* @returns
|
|
26
33
|
*/
|
|
27
34
|
export declare function formatOpenAILikeTextPrompt(segments: PromptSegment[]): OpenAITextMessage[];
|
|
28
|
-
export declare function formatOpenAILikeMultimodalPrompt(segments: PromptSegment[]): Promise<
|
|
35
|
+
export declare function formatOpenAILikeMultimodalPrompt(segments: PromptSegment[], opts: PromptOptions & OpenAIPromptFormatterOptions): Promise<OpenAIInputMessage[]>;
|
|
36
|
+
export interface OpenAIPromptFormatterOptions {
|
|
37
|
+
multimodal?: boolean;
|
|
38
|
+
useToolForFormatting?: boolean;
|
|
39
|
+
schema?: Object;
|
|
40
|
+
}
|
|
29
41
|
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/formatters/openai.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/formatters/openai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;CACzC;AAED,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,CAAC,qBAAqB,GAAG,sBAAsB,CAAC,EAAE,CAAA;IAC3D,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,iBAAiB,CAAC;AAEnE,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;QAChC,GAAG,EAAE,MAAM,CAAA;KACd,CAAA;CACJ;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,iBAAiB,EAAE,CAoBzF;AAGD,wBAAsB,gCAAgC,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,aAAa,GAAG,4BAA4B,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAyFnK;AAED,MAAM,WAAW,4BAA4B;IACzC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB"}
|
package/lib/types/index.d.ts
CHANGED
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ModelOptionsInfo, ModelOptions } from "../types.js";
|
|
2
|
+
export type BedrockOptions = NovaCanvasOptions | BaseConverseOptions | BedrockClaudeOptions;
|
|
3
|
+
export interface NovaCanvasOptions {
|
|
4
|
+
_option_id: "bedrock-nova-canvas";
|
|
5
|
+
taskType: "TEXT_IMAGE" | "TEXT_IMAGE_WITH_IMAGE_CONDITIONING" | "COLOR_GUIDED_GENERATION" | "IMAGE_VARIATION" | "INPAINTING" | "OUTPAINTING" | "BACKGROUND_REMOVAL";
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
quality?: "standard" | "premium";
|
|
9
|
+
cfgScale?: number;
|
|
10
|
+
seed?: number;
|
|
11
|
+
numberOfImages?: number;
|
|
12
|
+
controlMode?: "CANNY_EDGE" | "SEGMENTATION";
|
|
13
|
+
controlStrength?: number;
|
|
14
|
+
colors?: string[];
|
|
15
|
+
similarityStrength?: number;
|
|
16
|
+
outPaintingMode?: "DEFAULT" | "PRECISE";
|
|
17
|
+
}
|
|
18
|
+
export interface BaseConverseOptions {
|
|
19
|
+
_option_id: "bedrock-converse" | "bedrock-claude" | "bedrock-nova" | "bedrock-mistral" | "bedrock-ai21" | "bedrock-cohere-command";
|
|
20
|
+
max_tokens?: number;
|
|
21
|
+
temperature?: number;
|
|
22
|
+
top_p?: number;
|
|
23
|
+
stop_sequence?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface BedrockClaudeOptions extends BaseConverseOptions {
|
|
26
|
+
_option_id: "bedrock-claude";
|
|
27
|
+
top_k?: number;
|
|
28
|
+
thinking_mode?: boolean;
|
|
29
|
+
thinking_budget_tokens?: number;
|
|
30
|
+
}
|
|
31
|
+
export declare function getBedrockOptions(model: string, option?: ModelOptions): ModelOptionsInfo;
|
|
32
|
+
//# sourceMappingURL=bedrock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bedrock.d.ts","sourceRoot":"","sources":["../../../src/options/bedrock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAmC,MAAM,aAAa,CAAC;AAI9F,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAE5F,MAAM,WAAW,iBAAiB;IAC9B,UAAU,EAAE,qBAAqB,CAAA;IACjC,QAAQ,EAAE,YAAY,GAAG,oCAAoC,GAAG,yBAAyB,GAAG,iBAAiB,GAAG,YAAY,GAAG,aAAa,GAAG,oBAAoB,CAAC;IACpK,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,kBAAkB,GAAG,gBAAgB,GAAG,cAAc,GAAG,iBAAiB,GAAG,cAAc,GAAG,wBAAwB,CAAC;IACnI,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC7D,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AA4ED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAoRxF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ModelOptionsInfo, ModelOptions } from "../types.js";
|
|
2
|
+
export type GroqOptions = GroqDeepseekThinkingOptions;
|
|
3
|
+
export interface GroqDeepseekThinkingOptions {
|
|
4
|
+
_option_id: "groq-deepseek-thinking";
|
|
5
|
+
max_tokens?: number;
|
|
6
|
+
temperature?: number;
|
|
7
|
+
top_p?: number;
|
|
8
|
+
stop_sequence?: string[];
|
|
9
|
+
reasonsing_format: 'parsed' | 'raw' | 'hidden';
|
|
10
|
+
}
|
|
11
|
+
export declare function getGroqOptions(model: string, _option?: ModelOptions): ModelOptionsInfo;
|
|
12
|
+
//# sourceMappingURL=groq.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groq.d.ts","sourceRoot":"","sources":["../../../src/options/groq.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,YAAY,EAA6B,MAAM,aAAa,CAAC;AAI7G,MAAM,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAEtD,MAAM,WAAW,2BAA2B;IACxC,UAAU,EAAE,wBAAwB,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,iBAAiB,EAAE,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;CAClD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,gBAAgB,CA+BtF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ModelOptionsInfo, ModelOptions } from "../types.js";
|
|
2
|
+
export type OpenAiOptions = OpenAiThinkingOptions | OpenAiTextOptions;
|
|
3
|
+
export interface OpenAiThinkingOptions {
|
|
4
|
+
_option_id: "openai-thinking";
|
|
5
|
+
max_tokens?: number;
|
|
6
|
+
stop_sequence?: string[];
|
|
7
|
+
reasoning_effort?: "low" | "medium" | "high";
|
|
8
|
+
image_detail?: "low" | "high" | "auto";
|
|
9
|
+
}
|
|
10
|
+
export interface OpenAiTextOptions {
|
|
11
|
+
_option_id: "openai-text";
|
|
12
|
+
max_tokens?: number;
|
|
13
|
+
temperature?: number;
|
|
14
|
+
top_p?: number;
|
|
15
|
+
presence_penalty?: number;
|
|
16
|
+
frequency_penalty?: number;
|
|
17
|
+
stop_sequence?: string[];
|
|
18
|
+
image_detail?: "low" | "high" | "auto";
|
|
19
|
+
}
|
|
20
|
+
export declare function getOpenAiOptions(model: string, _option?: ModelOptions): ModelOptionsInfo;
|
|
21
|
+
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/options/openai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,YAAY,EAA6B,MAAM,aAAa,CAAC;AAI7G,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,iBAAiB,CAAC;AAEtE,MAAM,WAAW,qBAAqB;IAClC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC7C,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAC9B,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CAC1C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,gBAAgB,CA4GxF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ModelOptionsInfo, ModelOptions } from "../types.js";
|
|
2
|
+
export type VertexAIOptions = ImagenOptions | VertexAIClaudeOptions;
|
|
3
|
+
export declare enum ImagenTaskType {
|
|
4
|
+
TEXT_IMAGE = "TEXT_IMAGE",
|
|
5
|
+
EDIT_MODE_INPAINT_REMOVAL = "EDIT_MODE_INPAINT_REMOVAL",
|
|
6
|
+
EDIT_MODE_INPAINT_INSERTION = "EDIT_MODE_INPAINT_INSERTION",
|
|
7
|
+
EDIT_MODE_BGSWAP = "EDIT_MODE_BGSWAP",
|
|
8
|
+
EDIT_MODE_OUTPAINT = "EDIT_MODE_OUTPAINT",
|
|
9
|
+
CUSTOMIZATION_SUBJECT = "CUSTOMIZATION_SUBJECT",
|
|
10
|
+
CUSTOMIZATION_STYLE = "CUSTOMIZATION_STYLE",
|
|
11
|
+
CUSTOMIZATION_CONTROLLED = "CUSTOMIZATION_CONTROLLED",
|
|
12
|
+
CUSTOMIZATION_INSTRUCT = "CUSTOMIZATION_INSTRUCT"
|
|
13
|
+
}
|
|
14
|
+
export declare enum ImagenMaskMode {
|
|
15
|
+
MASK_MODE_USER_PROVIDED = "MASK_MODE_USER_PROVIDED",
|
|
16
|
+
MASK_MODE_BACKGROUND = "MASK_MODE_BACKGROUND",
|
|
17
|
+
MASK_MODE_FOREGROUND = "MASK_MODE_FOREGROUND",
|
|
18
|
+
MASK_MODE_SEMANTIC = "MASK_MODE_SEMANTIC"
|
|
19
|
+
}
|
|
20
|
+
export interface ImagenOptions {
|
|
21
|
+
_option_id: "vertexai-imagen";
|
|
22
|
+
number_of_images?: number;
|
|
23
|
+
seed?: number;
|
|
24
|
+
person_generation?: "dont_allow" | "allow_adults" | "allow_all";
|
|
25
|
+
safety_setting?: "block_none" | "block_only_high" | "block_medium_and_above" | "block_low_and_above";
|
|
26
|
+
image_file_type?: "image/jpeg" | "image/png";
|
|
27
|
+
jpeg_compression_quality?: number;
|
|
28
|
+
aspect_ratio?: "1:1" | "4:3" | "3:4" | "16:9" | "9:16";
|
|
29
|
+
add_watermark?: boolean;
|
|
30
|
+
enhance_prompt?: boolean;
|
|
31
|
+
edit_mode?: ImagenTaskType;
|
|
32
|
+
guidance_scale?: number;
|
|
33
|
+
edit_steps?: number;
|
|
34
|
+
mask_mode?: ImagenMaskMode;
|
|
35
|
+
mask_dilation?: number;
|
|
36
|
+
mask_class?: number[];
|
|
37
|
+
controlType: "CONTROL_TYPE_FACE_MESH" | "CONTROL_TYPE_CANNY" | "CONTROL_TYPE_SCRIBBLE";
|
|
38
|
+
controlImageComputation?: boolean;
|
|
39
|
+
subjectType: "SUBJECT_TYPE_PERSON" | "SUBJECT_TYPE_ANIMAL" | "SUBJECT_TYPE_PRODUCT" | "SUBJECT_TYPE_DEFAULT";
|
|
40
|
+
}
|
|
41
|
+
export interface VertexAIClaudeOptions {
|
|
42
|
+
_option_id: "vertexai-claude";
|
|
43
|
+
max_tokens?: number;
|
|
44
|
+
temperature?: number;
|
|
45
|
+
top_p?: number;
|
|
46
|
+
top_k?: number;
|
|
47
|
+
stop_sequence?: string[];
|
|
48
|
+
thinking_mode?: boolean;
|
|
49
|
+
thinking_budget_tokens?: number;
|
|
50
|
+
}
|
|
51
|
+
export declare function getVertexAiOptions(model: string, option?: ModelOptions): ModelOptionsInfo;
|
|
52
|
+
//# sourceMappingURL=vertexai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertexai.d.ts","sourceRoot":"","sources":["../../../src/options/vertexai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAkD,YAAY,EAAE,MAAM,aAAa,CAAC;AAI7G,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,qBAAqB,CAAC;AAEpE,oBAAY,cAAc;IACtB,UAAU,eAAe;IACzB,yBAAyB,8BAA8B;IACvD,2BAA2B,gCAAgC;IAC3D,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB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AAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,gBAAgB,CA8NzF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModelOptions, ModelOptionsInfo } from "./types.js";
|
|
2
|
+
export interface TextFallbackOptions {
|
|
3
|
+
_option_id: "text-fallback";
|
|
4
|
+
max_tokens?: number;
|
|
5
|
+
temperature?: number;
|
|
6
|
+
top_p?: number;
|
|
7
|
+
top_k?: number;
|
|
8
|
+
presence_penalty?: number;
|
|
9
|
+
frequency_penalty?: number;
|
|
10
|
+
stop_sequence?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare const textOptionsFallback: ModelOptionsInfo;
|
|
13
|
+
export declare function getOptions(provider?: string, model?: string, options?: ModelOptions): ModelOptionsInfo;
|
|
14
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAA6B,MAAM,YAAY,CAAC;AAMvF,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,eAAO,MAAM,mBAAmB,EAAE,gBA6BjC,CAAC;AAEF,wBAAgB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAatG"}
|
package/lib/types/types.d.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import { JSONSchema4 } from
|
|
2
|
-
import { PromptFormatter } from
|
|
3
|
-
import { JSONObject } from
|
|
1
|
+
import { JSONSchema4 } from 'json-schema';
|
|
2
|
+
import { PromptFormatter } from './formatters/index.js';
|
|
3
|
+
import { JSONObject } from './json.js';
|
|
4
|
+
import { TextFallbackOptions } from './options.js';
|
|
5
|
+
import { VertexAIOptions } from './options/vertexai.js';
|
|
6
|
+
import { BedrockOptions } from './options/bedrock.js';
|
|
7
|
+
import { OpenAiOptions } from './options/openai.js';
|
|
4
8
|
export interface EmbeddingsOptions {
|
|
5
9
|
/**
|
|
6
|
-
* The
|
|
10
|
+
* The text to generate the embeddings for. One of text or image is required.
|
|
7
11
|
*/
|
|
8
|
-
|
|
12
|
+
text?: string;
|
|
9
13
|
/**
|
|
10
|
-
* The
|
|
14
|
+
* The image to generate embeddings for
|
|
11
15
|
*/
|
|
12
|
-
|
|
16
|
+
image?: string;
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
15
|
-
* The supported properties depends on the target implementation.
|
|
18
|
+
* The model to use to generate the embeddings. Optional.
|
|
16
19
|
*/
|
|
17
|
-
|
|
20
|
+
model?: string;
|
|
18
21
|
}
|
|
19
22
|
export interface EmbeddingsResult {
|
|
20
23
|
/**
|
|
@@ -24,28 +27,48 @@ export interface EmbeddingsResult {
|
|
|
24
27
|
/**
|
|
25
28
|
* The model used to hgenerate the embeddings.
|
|
26
29
|
*/
|
|
27
|
-
model
|
|
30
|
+
model: string;
|
|
28
31
|
/**
|
|
29
32
|
* Number of tokens of the input text.
|
|
30
33
|
*/
|
|
31
34
|
token_count?: number;
|
|
32
|
-
/**
|
|
33
|
-
* Additional properties. Depends on the target implementation.
|
|
34
|
-
*/
|
|
35
|
-
[key: string]: any;
|
|
36
35
|
}
|
|
37
36
|
export interface ResultValidationError {
|
|
38
|
-
code: 'validation_error' | 'json_error';
|
|
37
|
+
code: 'validation_error' | 'json_error' | 'content_policy_violation';
|
|
39
38
|
message: string;
|
|
40
39
|
data?: string;
|
|
41
40
|
}
|
|
41
|
+
export interface CompletionChunkObject<ResultT = any> {
|
|
42
|
+
result: ResultT;
|
|
43
|
+
token_usage?: ExecutionTokenUsage;
|
|
44
|
+
finish_reason?: "stop" | "length" | string;
|
|
45
|
+
}
|
|
46
|
+
export type CompletionChunk = CompletionChunkObject | string;
|
|
47
|
+
export interface ToolDefinition {
|
|
48
|
+
name: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
input_schema: {
|
|
51
|
+
type: 'object';
|
|
52
|
+
properties?: unknown | null | undefined;
|
|
53
|
+
[k: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface ToolUse {
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
input: JSONObject | null;
|
|
60
|
+
}
|
|
42
61
|
export interface Completion<ResultT = any> {
|
|
43
62
|
result: ResultT;
|
|
44
63
|
token_usage?: ExecutionTokenUsage;
|
|
64
|
+
/**
|
|
65
|
+
* Contains the tools from which the model awaits information.
|
|
66
|
+
*/
|
|
67
|
+
tool_use?: ToolUse[];
|
|
45
68
|
/**
|
|
46
69
|
* The finish reason as reported by the model: stop | length or other model specific values
|
|
47
70
|
*/
|
|
48
|
-
finish_reason?: "stop" | "length" | string;
|
|
71
|
+
finish_reason?: "stop" | "length" | "tool_use" | string;
|
|
49
72
|
/**
|
|
50
73
|
* Set only if a result validation error occured, otherwise if the result is valid the error field is undefined
|
|
51
74
|
* This can only be set if the result_schema is set and the reuslt could not be parsed as a json or if the result does not match the schema
|
|
@@ -55,6 +78,13 @@ export interface Completion<ResultT = any> {
|
|
|
55
78
|
* 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.
|
|
56
79
|
*/
|
|
57
80
|
original_response?: Record<string, any>;
|
|
81
|
+
/**
|
|
82
|
+
* The conversation context. This is an opaque structure that can be passed to the next request to restore the context.
|
|
83
|
+
*/
|
|
84
|
+
conversation?: unknown;
|
|
85
|
+
}
|
|
86
|
+
export interface ImageGeneration {
|
|
87
|
+
images?: string[];
|
|
58
88
|
}
|
|
59
89
|
export interface ExecutionResponse<PromptT = any> extends Completion {
|
|
60
90
|
prompt: PromptT;
|
|
@@ -62,6 +92,10 @@ export interface ExecutionResponse<PromptT = any> extends Completion {
|
|
|
62
92
|
* The time it took to execute the request in seconds
|
|
63
93
|
*/
|
|
64
94
|
execution_time?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The number of chunks for streamed executions
|
|
97
|
+
*/
|
|
98
|
+
chunks?: number;
|
|
65
99
|
}
|
|
66
100
|
export interface CompletionStream<PromptT = any> extends AsyncIterable<string> {
|
|
67
101
|
completion: ExecutionResponse<PromptT> | undefined;
|
|
@@ -85,53 +119,98 @@ export interface PromptOptions {
|
|
|
85
119
|
result_schema?: JSONSchema4;
|
|
86
120
|
}
|
|
87
121
|
export interface ExecutionOptions extends PromptOptions {
|
|
88
|
-
temperature?: number;
|
|
89
|
-
max_tokens?: number;
|
|
90
|
-
stop_sequence?: string | string[];
|
|
91
|
-
/**
|
|
92
|
-
* restricts the selection of tokens to the “k” most likely options, based on their probabilities
|
|
93
|
-
* Lower values make the model more deterministic, more focused. Examples:
|
|
94
|
-
* - 10 - result will be highly controlled anc contextually relevant
|
|
95
|
-
* - 50 - result will be more creative but maintaining a balance between control and creativity
|
|
96
|
-
* - 100 - will lead to more creative and less predictable outputs
|
|
97
|
-
* It will be ignored on OpenAI since it does not support it
|
|
98
|
-
*/
|
|
99
|
-
top_k?: number;
|
|
100
|
-
/**
|
|
101
|
-
* An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
|
|
102
|
-
* Either use temperature or top_p, not both
|
|
103
|
-
*/
|
|
104
|
-
top_p?: number;
|
|
105
|
-
/**
|
|
106
|
-
* Only supported for OpenAI. Look at OpenAI documentation for more detailsx
|
|
107
|
-
*/
|
|
108
|
-
top_logprobs?: number;
|
|
109
|
-
/**
|
|
110
|
-
* Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
|
|
111
|
-
* Ignored for models which doesn;t support it
|
|
112
|
-
*/
|
|
113
|
-
presence_penalty?: number;
|
|
114
|
-
/**
|
|
115
|
-
* Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
|
|
116
|
-
* Ignored for models which doesn;t support it
|
|
117
|
-
*/
|
|
118
|
-
frequency_penalty?: number;
|
|
119
122
|
/**
|
|
120
123
|
* If set to true the original response from the target LLM will be included in the response under the original_response field.
|
|
121
124
|
* This is useful for debugging and for some advanced use cases.
|
|
122
125
|
* It is ignored on streaming requests
|
|
123
126
|
*/
|
|
124
127
|
include_original_response?: boolean;
|
|
128
|
+
model_options?: ModelOptions;
|
|
129
|
+
output_modality: Modalities;
|
|
130
|
+
/**
|
|
131
|
+
* Available tools for the request
|
|
132
|
+
*/
|
|
133
|
+
tools?: ToolDefinition[];
|
|
134
|
+
/**
|
|
135
|
+
* This is an opaque structure that provides a conversation context
|
|
136
|
+
* Each driver implementation will return a conversation property in the execution response
|
|
137
|
+
* that can be passed here to restore the context when a new prompt is sent to the model.
|
|
138
|
+
*/
|
|
139
|
+
conversation?: unknown | null;
|
|
140
|
+
}
|
|
141
|
+
export declare enum SharedOptions {
|
|
142
|
+
max_tokens = "max_tokens",
|
|
143
|
+
temperature = "temperature",
|
|
144
|
+
top_p = "top_p",
|
|
145
|
+
top_k = "top_k",
|
|
146
|
+
presence_penalty = "presence_penalty",
|
|
147
|
+
frequency_penalty = "frequency_penalty",
|
|
148
|
+
stop_sequence = "stop_sequence",
|
|
149
|
+
seed = "seed",
|
|
150
|
+
number_of_images = "number_of_images"
|
|
151
|
+
}
|
|
152
|
+
export declare enum OptionType {
|
|
153
|
+
numeric = "numeric",
|
|
154
|
+
enum = "enum",
|
|
155
|
+
boolean = "boolean",
|
|
156
|
+
string_list = "string_list"
|
|
157
|
+
}
|
|
158
|
+
export type ModelOptions = TextFallbackOptions | VertexAIOptions | BedrockOptions | OpenAiOptions;
|
|
159
|
+
export interface ModelOptionsInfo {
|
|
160
|
+
options: ModelOptionInfoItem[];
|
|
161
|
+
_option_id: string;
|
|
162
|
+
}
|
|
163
|
+
export type ModelOptionInfoItem = NumericOptionInfo | EnumOptionInfo | BooleanOptionInfo | StringListOptionInfo;
|
|
164
|
+
interface OptionInfoPrototype {
|
|
165
|
+
type: OptionType;
|
|
166
|
+
name: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
refresh?: boolean;
|
|
169
|
+
}
|
|
170
|
+
export interface NumericOptionInfo extends OptionInfoPrototype {
|
|
171
|
+
type: OptionType.numeric;
|
|
172
|
+
value?: number;
|
|
173
|
+
min?: number;
|
|
174
|
+
max?: number;
|
|
175
|
+
step?: number;
|
|
176
|
+
integer?: boolean;
|
|
177
|
+
default?: number;
|
|
178
|
+
}
|
|
179
|
+
export interface EnumOptionInfo extends OptionInfoPrototype {
|
|
180
|
+
type: OptionType.enum;
|
|
181
|
+
value?: string;
|
|
182
|
+
enum: Record<string, string>;
|
|
183
|
+
default?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface BooleanOptionInfo extends OptionInfoPrototype {
|
|
186
|
+
type: OptionType.boolean;
|
|
187
|
+
value?: boolean;
|
|
188
|
+
default?: boolean;
|
|
189
|
+
}
|
|
190
|
+
export interface StringListOptionInfo extends OptionInfoPrototype {
|
|
191
|
+
type: OptionType.string_list;
|
|
192
|
+
value?: string[];
|
|
193
|
+
default?: string[];
|
|
125
194
|
}
|
|
126
195
|
export declare enum PromptRole {
|
|
127
196
|
safety = "safety",
|
|
128
197
|
system = "system",
|
|
129
198
|
user = "user",
|
|
130
|
-
assistant = "assistant"
|
|
199
|
+
assistant = "assistant",
|
|
200
|
+
negative = "negative",
|
|
201
|
+
mask = "mask",
|
|
202
|
+
/**
|
|
203
|
+
* Used to send the response of a tool
|
|
204
|
+
*/
|
|
205
|
+
tool = "tool"
|
|
131
206
|
}
|
|
132
207
|
export interface PromptSegment {
|
|
133
208
|
role: PromptRole;
|
|
134
209
|
content: string;
|
|
210
|
+
/**
|
|
211
|
+
* The tool use id if the segment is a tool response
|
|
212
|
+
*/
|
|
213
|
+
tool_use_id?: string;
|
|
135
214
|
files?: DataSource[];
|
|
136
215
|
}
|
|
137
216
|
export interface ExecutionTokenUsage {
|
|
@@ -139,6 +218,10 @@ export interface ExecutionTokenUsage {
|
|
|
139
218
|
result?: number;
|
|
140
219
|
total?: number;
|
|
141
220
|
}
|
|
221
|
+
export declare enum Modalities {
|
|
222
|
+
text = "text",
|
|
223
|
+
image = "image"
|
|
224
|
+
}
|
|
142
225
|
export interface AIModel<ProviderKeys = string> {
|
|
143
226
|
id: string;
|
|
144
227
|
name: string;
|
|
@@ -221,4 +304,5 @@ export interface TrainingJob {
|
|
|
221
304
|
details?: string;
|
|
222
305
|
model?: string;
|
|
223
306
|
}
|
|
307
|
+
export {};
|
|
224
308
|
//# sourceMappingURL=types.d.ts.map
|
package/lib/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C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ACtC,UAAU,gBAAgB;IAC1B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,UAAU,gBAAgB;IAC1B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;CACtB;AAOD,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;IAC1D,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,oBAAY,iBAAiB;IACzB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;CAC1B;AAED,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llumiverse/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Provide an universal API to LLMs. Support for existing LLMs can be added by writing a driver.",
|
|
6
6
|
"files": [
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
},
|
|
58
58
|
"author": "Llumiverse",
|
|
59
59
|
"license": "Apache-2.0",
|
|
60
|
-
"homepage": "https://github.com/
|
|
60
|
+
"homepage": "https://github.com/vertesia/llumiverse",
|
|
61
61
|
"repository": {
|
|
62
62
|
"type": "git",
|
|
63
|
-
"url": "git+ssh://git@github.com/
|
|
63
|
+
"url": "git+ssh://git@github.com/vertesia/llumiverse.git"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/eventsource": "^1.1.15",
|
|
67
67
|
"@types/json-schema": "^7.0.15",
|
|
68
68
|
"api-fetch-client": "^0.13.0",
|
|
69
|
-
"rimraf": "^
|
|
69
|
+
"rimraf": "^6.0.0",
|
|
70
70
|
"ts-dual-module": "^0.6.3",
|
|
71
71
|
"typescript": "^5.4.2",
|
|
72
|
-
"vitest": "^
|
|
72
|
+
"vitest": "^3.0.8"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@types/node": "^22.5.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"test": "vitest run",
|
|
88
|
-
"build": "
|
|
88
|
+
"build": "pnpm exec tsmod build",
|
|
89
89
|
"clean": "rimraf ./lib tsconfig.tsbuildinfo"
|
|
90
90
|
}
|
|
91
91
|
}
|