@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/package.json
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
2
|
+
"name": "@llumiverse/common",
|
|
3
|
+
"version": "0.23.0-dev-20251118",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Public types, enums and options used by Llumiverse API.",
|
|
6
|
+
"files": [
|
|
7
|
+
"lib",
|
|
8
|
+
"src"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"llm",
|
|
12
|
+
"ai",
|
|
13
|
+
"prompt",
|
|
14
|
+
"prompt engineering",
|
|
15
|
+
"ml",
|
|
16
|
+
"machine learning",
|
|
17
|
+
"embeddings",
|
|
18
|
+
"training",
|
|
19
|
+
"model",
|
|
20
|
+
"universal",
|
|
21
|
+
"api",
|
|
22
|
+
"chatgpt",
|
|
23
|
+
"openai",
|
|
24
|
+
"vertexai",
|
|
25
|
+
"bedrock",
|
|
26
|
+
"replicate",
|
|
27
|
+
"huggingface",
|
|
28
|
+
"togetherai"
|
|
29
|
+
],
|
|
30
|
+
"types": "./lib/types/index.d.ts",
|
|
31
|
+
"typesVersions": {
|
|
32
|
+
"*": {
|
|
33
|
+
"async": [
|
|
34
|
+
"./lib/types/async.d.ts"
|
|
35
|
+
],
|
|
36
|
+
"formatters": [
|
|
37
|
+
"./lib/types/formatters/index.d.ts"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./lib/types/index.d.ts",
|
|
44
|
+
"import": "./lib/esm/index.js",
|
|
45
|
+
"require": "./lib/cjs/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./async": {
|
|
48
|
+
"types": "./lib/types/async.d.ts",
|
|
49
|
+
"import": "./lib/esm/async.js",
|
|
50
|
+
"require": "./lib/cjs/async.js"
|
|
51
|
+
},
|
|
52
|
+
"./formatters": {
|
|
53
|
+
"types": "./lib/types/formatters/index.d.ts",
|
|
54
|
+
"import": "./lib/esm/formatters/index.js",
|
|
55
|
+
"require": "./lib/cjs/formatters/index.js"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"build": "pnpm exec tsmod build",
|
|
61
|
+
"clean": "rimraf ./lib tsconfig.tsbuildinfo"
|
|
62
|
+
},
|
|
63
|
+
"author": "Llumiverse",
|
|
64
|
+
"license": "Apache-2.0",
|
|
65
|
+
"homepage": "https://github.com/vertesia/llumiverse",
|
|
66
|
+
"repository": {
|
|
67
|
+
"type": "git",
|
|
68
|
+
"url": "git+ssh://git@github.com/vertesia/llumiverse.git"
|
|
46
69
|
},
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"rimraf": "^6.1.0",
|
|
72
|
+
"ts-dual-module": "^0.6.3",
|
|
73
|
+
"typescript": "^5.9.3",
|
|
74
|
+
"vitest": "^3.2.4",
|
|
75
|
+
"@types/node": "^22.19.0"
|
|
51
76
|
},
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"require": "./lib/cjs/formatters/index.js"
|
|
77
|
+
"dependencies": {},
|
|
78
|
+
"ts_dual_module": {
|
|
79
|
+
"outDir": "lib"
|
|
56
80
|
}
|
|
57
|
-
|
|
58
|
-
"author": "Llumiverse",
|
|
59
|
-
"license": "Apache-2.0",
|
|
60
|
-
"homepage": "https://github.com/vertesia/llumiverse",
|
|
61
|
-
"repository": {
|
|
62
|
-
"type": "git",
|
|
63
|
-
"url": "git+ssh://git@github.com/vertesia/llumiverse.git"
|
|
64
|
-
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"rimraf": "^6.0.1",
|
|
67
|
-
"ts-dual-module": "^0.6.3",
|
|
68
|
-
"typescript": "^5.8.3",
|
|
69
|
-
"vitest": "^3.2.4",
|
|
70
|
-
"@types/node": "^22.17.0"
|
|
71
|
-
},
|
|
72
|
-
"dependencies": {},
|
|
73
|
-
"ts_dual_module": {
|
|
74
|
-
"outDir": "lib"
|
|
75
|
-
},
|
|
76
|
-
"scripts": {
|
|
77
|
-
"test": "vitest run",
|
|
78
|
-
"build": "pnpm exec tsmod build",
|
|
79
|
-
"clean": "rimraf ./lib tsconfig.tsbuildinfo"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
81
|
+
}
|
|
@@ -29,6 +29,7 @@ const RECORD_FAMILY_CAPABILITIES: Record<string, ModelCapabilities> = {
|
|
|
29
29
|
"gpt-4.1": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
|
|
30
30
|
"gpt-4.5": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
|
|
31
31
|
"gpt-4o": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
|
|
32
|
+
"gpt": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true},
|
|
32
33
|
|
|
33
34
|
// OpenAI O-series families
|
|
34
35
|
"o1": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
@@ -36,6 +36,8 @@ const RECORD_MODEL_CAPABILITIES: Record<string, ModelCapabilities> = {
|
|
|
36
36
|
"foundation-model/mistral.mistral-large-2402-v1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
37
37
|
"foundation-model/mistral.mistral-large-2407-v1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
38
38
|
"foundation-model/mistral.mistral-small-2402-v1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
39
|
+
"foundation-model/openai.gpt-oss-20b-1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
40
|
+
"foundation-model/openai.gpt-oss-120b-1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
39
41
|
"inference-profile/us.amazon.nova-lite-v1:0": { input: { text: true, image: true, video: true, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
|
|
40
42
|
"inference-profile/us.amazon.nova-micro-v1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
|
|
41
43
|
"inference-profile/us.amazon.nova-premier-v1:0": { input: { text: true, image: true, video: true, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
|
|
@@ -61,7 +63,7 @@ const RECORD_MODEL_CAPABILITIES: Record<string, ModelCapabilities> = {
|
|
|
61
63
|
"inference-profile/us.meta.llama4-scout-17b-instruct-v1:0": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
62
64
|
"inference-profile/us.mistral.pixtral-large-2502-v1:0": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
63
65
|
"inference-profile/us.writer.palmyra-x4-v1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
64
|
-
"inference-profile/us.writer.palmyra-x5-v1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false }
|
|
66
|
+
"inference-profile/us.writer.palmyra-x5-v1:0": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
// Populate RECORD_FAMILY_CAPABILITIES as a const record (lowest common denominator for each family)
|
|
@@ -78,6 +80,8 @@ const RECORD_FAMILY_CAPABILITIES: Record<string, ModelCapabilities> = {
|
|
|
78
80
|
"foundation-model/mistral.mistral": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
79
81
|
"foundation-model/mistral.mistral-large": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
80
82
|
"foundation-model/mistral.mixtral": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
83
|
+
"foundation-model/qwen.": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
84
|
+
"foundation-model/openai.gpt-oss": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
81
85
|
"inference-profile/us.anthropic.claude-3-haiku": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
82
86
|
"inference-profile/us.anthropic.claude-3-5-sonnet": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
|
|
83
87
|
"inference-profile/us.anthropic.claude-3-opus": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
@@ -88,7 +92,8 @@ const RECORD_FAMILY_CAPABILITIES: Record<string, ModelCapabilities> = {
|
|
|
88
92
|
"inference-profile/us.meta.llama4-maverick-17b": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
89
93
|
"inference-profile/us.meta.llama4-scout-17b": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
|
|
90
94
|
"inference-profile/us.mistral.pixtral": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
91
|
-
"inference-profile/us.writer.palmyra": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false }
|
|
95
|
+
"inference-profile/us.writer.palmyra": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
96
|
+
"inference-profile/us.twelvelabs.": { input: { text: true, image: false, video: true, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: false },
|
|
92
97
|
};
|
|
93
98
|
|
|
94
99
|
/**
|
package/src/capability/openai.ts
CHANGED
|
@@ -53,6 +53,8 @@ const RECORD_MODEL_CAPABILITIES: Record<string, { input: ModelModalities; output
|
|
|
53
53
|
|
|
54
54
|
// Populate RECORD_FAMILY_CAPABILITIES as a const record (lowest common denominator for each family)
|
|
55
55
|
const RECORD_FAMILY_CAPABILITIES: Record<string, { input: ModelModalities; output: ModelModalities; tool_support?: boolean }> = {
|
|
56
|
+
"gpt": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true },
|
|
57
|
+
"gpt-3.5": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false },
|
|
56
58
|
"gpt-3.5-turbo": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false },
|
|
57
59
|
"gpt-4": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: false },
|
|
58
60
|
"gpt-4.1": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true },
|
|
@@ -26,6 +26,7 @@ const RECORD_FAMILY_CAPABILITIES: Record<string, { input: ModelModalities; outpu
|
|
|
26
26
|
"gemini-1.5": { input: { text: true, image: true, video: true, audio: true, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true },
|
|
27
27
|
"gemini-2.0": { input: { text: true, image: true, video: true, audio: true, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true },
|
|
28
28
|
"gemini-2.5": { input: { text: true, image: true, video: true, audio: true, embed: false }, output: { text: true, image: false, video: false, audio: false, embed: false }, tool_support: true },
|
|
29
|
+
"gemini-2.5-flash-image": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: true, image: true, video: false, audio: false, embed: false }, tool_support: false },
|
|
29
30
|
"imagen-3.0-generate": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: false, image: true, video: false, audio: false, embed: false }, tool_support: false },
|
|
30
31
|
"imagen-3.0-fast-generate": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: false, image: true, video: false, audio: false, embed: false }, tool_support: false },
|
|
31
32
|
"imagen-3.0-capability": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { text: false, image: true, video: false, audio: false, embed: false }, tool_support: false },
|
package/src/capability.ts
CHANGED
|
@@ -5,6 +5,13 @@ import { getModelCapabilitiesVertexAI } from "./capability/vertexai.js";
|
|
|
5
5
|
import { ModelCapabilities, ModelModalities, Providers } from "./types.js";
|
|
6
6
|
|
|
7
7
|
export function getModelCapabilities(model: string, provider?: string | Providers): ModelCapabilities {
|
|
8
|
+
//Check for locations/<location>/ prefix and remove it
|
|
9
|
+
if (model.startsWith("locations/")) {
|
|
10
|
+
const parts = model.split("/");
|
|
11
|
+
if (parts.length >= 3) {
|
|
12
|
+
model = parts.slice(2).join("/");
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
const capabilities = _getModelCapabilities(model, provider);
|
|
9
16
|
// Globally disable audio and video for all models, as we don't support them yet
|
|
10
17
|
// We also do not support tool use while streaming
|
|
@@ -95,6 +95,9 @@ export function getMaxTokensLimitAzureFoundry(model: string): number | undefined
|
|
|
95
95
|
if (modelLower.includes("gpt-35") || modelLower.includes("gpt-3.5")) {
|
|
96
96
|
return 4096;
|
|
97
97
|
}
|
|
98
|
+
if (model.includes("gpt-5")) {
|
|
99
|
+
return 128000;
|
|
100
|
+
}
|
|
98
101
|
// O-series models
|
|
99
102
|
if (modelLower.includes("o1")) {
|
|
100
103
|
if (modelLower.includes("preview")) {
|
package/src/options/bedrock.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ModelOptionsInfo, ModelOptions, OptionType, ModelOptionInfoItem } from
|
|
|
2
2
|
import { textOptionsFallback } from "./fallback.js";
|
|
3
3
|
|
|
4
4
|
// Union type of all Bedrock options
|
|
5
|
-
export type BedrockOptions = NovaCanvasOptions | BaseConverseOptions | BedrockClaudeOptions | BedrockPalmyraOptions;
|
|
5
|
+
export type BedrockOptions = NovaCanvasOptions | BaseConverseOptions | BedrockClaudeOptions | BedrockPalmyraOptions | BedrockGptOssOptions | TwelvelabsPegasusOptions;
|
|
6
6
|
|
|
7
7
|
export interface NovaCanvasOptions {
|
|
8
8
|
_option_id: "bedrock-nova-canvas"
|
|
@@ -21,7 +21,7 @@ export interface NovaCanvasOptions {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface BaseConverseOptions {
|
|
24
|
-
_option_id: "bedrock-converse" | "bedrock-claude" | "bedrock-nova" | "bedrock-mistral" | "bedrock-ai21" | "bedrock-cohere-command" | "bedrock-palmyra";
|
|
24
|
+
_option_id: "bedrock-converse" | "bedrock-claude" | "bedrock-nova" | "bedrock-mistral" | "bedrock-ai21" | "bedrock-cohere-command" | "bedrock-palmyra" | "bedrock-gpt-oss";
|
|
25
25
|
max_tokens?: number;
|
|
26
26
|
temperature?: number;
|
|
27
27
|
top_p?: number;
|
|
@@ -44,6 +44,19 @@ export interface BedrockPalmyraOptions extends BaseConverseOptions {
|
|
|
44
44
|
presence_penalty?: number;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
export interface BedrockGptOssOptions extends BaseConverseOptions {
|
|
48
|
+
_option_id: "bedrock-gpt-oss";
|
|
49
|
+
reasoning_effort?: "low" | "medium" | "high";
|
|
50
|
+
frequency_penalty?: number;
|
|
51
|
+
presence_penalty?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface TwelvelabsPegasusOptions {
|
|
55
|
+
_option_id: "bedrock-twelvelabs-pegasus";
|
|
56
|
+
temperature?: number;
|
|
57
|
+
max_tokens?: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
47
60
|
export function getMaxTokensLimitBedrock(model: string): number | undefined {
|
|
48
61
|
// Claude models
|
|
49
62
|
if (model.includes("claude")) {
|
|
@@ -124,6 +137,18 @@ export function getMaxTokensLimitBedrock(model: string): number | undefined {
|
|
|
124
137
|
return 8192;
|
|
125
138
|
}
|
|
126
139
|
}
|
|
140
|
+
// OpenAI gpt-oss models
|
|
141
|
+
if (model.includes("gpt-oss")) {
|
|
142
|
+
return 128000;
|
|
143
|
+
}
|
|
144
|
+
// TwelveLabs models
|
|
145
|
+
else if (model.includes("twelvelabs")) {
|
|
146
|
+
if (model.includes("pegasus")) {
|
|
147
|
+
return 4096; // Max output tokens for Pegasus
|
|
148
|
+
}
|
|
149
|
+
// Marengo is an embedding model, doesn't generate text
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
127
152
|
|
|
128
153
|
// Default fallback
|
|
129
154
|
return undefined;
|
|
@@ -442,6 +467,57 @@ export function getBedrockOptions(model: string, option?: ModelOptions): ModelOp
|
|
|
442
467
|
options: [...baseConverseOptions, ...palmyraConverseOptions]
|
|
443
468
|
}
|
|
444
469
|
}
|
|
470
|
+
else if (model.includes("gpt-oss")) {
|
|
471
|
+
const gptOssOptions: ModelOptionInfoItem[] = [
|
|
472
|
+
{
|
|
473
|
+
name: "reasoning_effort",
|
|
474
|
+
type: OptionType.enum,
|
|
475
|
+
enum: {
|
|
476
|
+
"low": "low",
|
|
477
|
+
"medium": "medium",
|
|
478
|
+
"high": "high"
|
|
479
|
+
},
|
|
480
|
+
default: "medium",
|
|
481
|
+
description: "The reasoning effort of the model, which affects the quality and speed of the response"
|
|
482
|
+
},
|
|
483
|
+
];
|
|
484
|
+
|
|
485
|
+
const baseConverseOptionsNoStop: ModelOptionInfoItem[] = [...baseConverseOptions];
|
|
486
|
+
// Remove stop_sequence for gpt-oss
|
|
487
|
+
baseConverseOptionsNoStop.splice(baseConverseOptionsNoStop.findIndex(o => o.name === "stop_sequence"), 1);
|
|
488
|
+
return {
|
|
489
|
+
_option_id: "bedrock-gpt-oss",
|
|
490
|
+
options: [...baseConverseOptionsNoStop, ...gptOssOptions]
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
else if (model.includes("twelvelabs")) {
|
|
494
|
+
if (model.includes("pegasus")) {
|
|
495
|
+
const pegasusOptions: ModelOptionInfoItem[] = [
|
|
496
|
+
{
|
|
497
|
+
name: "temperature",
|
|
498
|
+
type: OptionType.numeric,
|
|
499
|
+
min: 0.0,
|
|
500
|
+
max: 1.0,
|
|
501
|
+
default: 0.2,
|
|
502
|
+
step: 0.1,
|
|
503
|
+
description: "Controls randomness in the output"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
name: "max_tokens",
|
|
507
|
+
type: OptionType.numeric,
|
|
508
|
+
min: 1,
|
|
509
|
+
max: 4096,
|
|
510
|
+
integer: true,
|
|
511
|
+
step: 100,
|
|
512
|
+
description: "The maximum number of tokens to generate"
|
|
513
|
+
}
|
|
514
|
+
];
|
|
515
|
+
return {
|
|
516
|
+
_option_id: "bedrock-twelvelabs-pegasus",
|
|
517
|
+
options: pegasusOptions
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
}
|
|
445
521
|
|
|
446
522
|
//Fallback to converse standard.
|
|
447
523
|
return {
|
package/src/options/openai.ts
CHANGED
|
@@ -93,6 +93,9 @@ export function getOpenAiOptions(model: string, _option?: ModelOptions): ModelOp
|
|
|
93
93
|
else if (model.includes("gpt-3-5")) {
|
|
94
94
|
max_tokens_limit = 4096;
|
|
95
95
|
}
|
|
96
|
+
else if (model.includes("gpt-5")) {
|
|
97
|
+
max_tokens_limit = 128000;
|
|
98
|
+
}
|
|
96
99
|
|
|
97
100
|
//Is non-thinking text model
|
|
98
101
|
const commonOptions: ModelOptionInfoItem[] = [
|
package/src/options/vertexai.ts
CHANGED
|
@@ -75,6 +75,7 @@ export interface VertexAIGeminiOptions {
|
|
|
75
75
|
seed?: number;
|
|
76
76
|
include_thoughts?: boolean;
|
|
77
77
|
thinking_budget_tokens?: number;
|
|
78
|
+
image_aspect_ratio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "9:16" | "16:9" | "21:9";
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
export function getVertexAiOptions(model: string, option?: ModelOptions): ModelOptionsInfo {
|
|
@@ -245,9 +246,108 @@ function getImagenOptions(model: string, option?: ModelOptions): ModelOptionsInf
|
|
|
245
246
|
}
|
|
246
247
|
|
|
247
248
|
function getGeminiOptions(model: string, _option?: ModelOptions): ModelOptionsInfo {
|
|
249
|
+
// Special handling for gemini-2.5-flash-image
|
|
250
|
+
if (model.includes("gemini-2.5-flash-image")) {
|
|
251
|
+
const options: ModelOptionInfoItem[] = [
|
|
252
|
+
{
|
|
253
|
+
name: SharedOptions.temperature,
|
|
254
|
+
type: OptionType.numeric,
|
|
255
|
+
min: 0.0,
|
|
256
|
+
max: 2.0,
|
|
257
|
+
default: 0.7,
|
|
258
|
+
step: 0.01,
|
|
259
|
+
description: "Sampling temperature"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: SharedOptions.top_p,
|
|
263
|
+
type: OptionType.numeric,
|
|
264
|
+
min: 0.0,
|
|
265
|
+
max: 1.0,
|
|
266
|
+
step: 0.01,
|
|
267
|
+
description: "Nucleus sampling probability"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "candidate_count",
|
|
271
|
+
type: OptionType.numeric,
|
|
272
|
+
min: 1,
|
|
273
|
+
max: 8,
|
|
274
|
+
default: 1,
|
|
275
|
+
integer: true,
|
|
276
|
+
description: "Number of candidates to generate"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: SharedOptions.max_tokens,
|
|
280
|
+
type: OptionType.numeric,
|
|
281
|
+
min: 1,
|
|
282
|
+
max: 32768,
|
|
283
|
+
integer: true,
|
|
284
|
+
step: 200,
|
|
285
|
+
description: "Maximum output tokens"
|
|
286
|
+
}
|
|
287
|
+
];
|
|
288
|
+
return {
|
|
289
|
+
_option_id: "vertexai-gemini",
|
|
290
|
+
options
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
// Special handling for gemini-2.5-flash-image
|
|
294
|
+
if (model.includes("gemini-2.5-flash-image")) {
|
|
295
|
+
const max_tokens_limit = 32768;
|
|
296
|
+
const excludeOptions = ["max_tokens", "presence_penalty", "frequency_penalty", "seed", "top_k"];
|
|
297
|
+
let commonOptions = textOptionsFallback.options.filter((option) => !excludeOptions.includes(option.name));
|
|
298
|
+
|
|
299
|
+
// Set max temperature to 2.0 for gemini-2.5-flash-image
|
|
300
|
+
commonOptions = commonOptions.map((option) => {
|
|
301
|
+
if (
|
|
302
|
+
option.name === SharedOptions.temperature &&
|
|
303
|
+
option.type === OptionType.numeric
|
|
304
|
+
) {
|
|
305
|
+
return {
|
|
306
|
+
...option,
|
|
307
|
+
max: 2.0,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
return option;
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
const max_tokens: ModelOptionInfoItem[] = [{
|
|
314
|
+
name: SharedOptions.max_tokens,
|
|
315
|
+
type: OptionType.numeric,
|
|
316
|
+
min: 1,
|
|
317
|
+
max: max_tokens_limit,
|
|
318
|
+
integer: true,
|
|
319
|
+
step: 200,
|
|
320
|
+
description: "Maximum output tokens"
|
|
321
|
+
}];
|
|
322
|
+
|
|
323
|
+
const imageAspectRatio: ModelOptionInfoItem[] = [{
|
|
324
|
+
name: "image_aspect_ratio",
|
|
325
|
+
type: OptionType.enum,
|
|
326
|
+
enum: {
|
|
327
|
+
"1:1": "1:1",
|
|
328
|
+
"2:3": "2:3",
|
|
329
|
+
"3:2": "3:2",
|
|
330
|
+
"3:4": "3:4",
|
|
331
|
+
"4:3": "4:3",
|
|
332
|
+
"9:16": "9:16",
|
|
333
|
+
"16:9": "16:9",
|
|
334
|
+
"21:9": "21:9"
|
|
335
|
+
},
|
|
336
|
+
description: "Aspect ratio of the generated images"
|
|
337
|
+
}];
|
|
338
|
+
|
|
339
|
+
return {
|
|
340
|
+
_option_id: "vertexai-gemini",
|
|
341
|
+
options: [
|
|
342
|
+
...max_tokens,
|
|
343
|
+
...commonOptions,
|
|
344
|
+
...imageAspectRatio,
|
|
345
|
+
]
|
|
346
|
+
};
|
|
347
|
+
}
|
|
248
348
|
const max_tokens_limit = getGeminiMaxTokensLimit(model);
|
|
249
349
|
const excludeOptions = ["max_tokens"];
|
|
250
|
-
|
|
350
|
+
const commonOptions = textOptionsFallback.options.filter((option) => !excludeOptions.includes(option.name));
|
|
251
351
|
|
|
252
352
|
const max_tokens: ModelOptionInfoItem[] = [{
|
|
253
353
|
name: SharedOptions.max_tokens, type: OptionType.numeric, min: 1, max: max_tokens_limit,
|
|
@@ -260,7 +360,7 @@ function getGeminiOptions(model: string, _option?: ModelOptions): ModelOptionsIn
|
|
|
260
360
|
|
|
261
361
|
if (model.includes("-2.5-")) {
|
|
262
362
|
// Gemini 2.5 thinking models
|
|
263
|
-
|
|
363
|
+
|
|
264
364
|
// Set budget token ranges based on model variant
|
|
265
365
|
let budgetMin = -1;
|
|
266
366
|
let budgetMax = 24576;
|
|
@@ -287,7 +387,7 @@ function getGeminiOptions(model: string, _option?: ModelOptions): ModelOptionsIn
|
|
|
287
387
|
"Range: 128-32768 tokens. " +
|
|
288
388
|
"Cannot disable thinking - minimum 128 tokens. Set to -1 for dynamic thinking.";
|
|
289
389
|
}
|
|
290
|
-
|
|
390
|
+
|
|
291
391
|
const geminiThinkingOptions: ModelOptionInfoItem[] = [
|
|
292
392
|
{
|
|
293
393
|
name: "include_thoughts",
|
|
@@ -331,7 +431,7 @@ function getGeminiOptions(model: string, _option?: ModelOptions): ModelOptionsIn
|
|
|
331
431
|
function getClaudeOptions(model: string, option?: ModelOptions): ModelOptionsInfo {
|
|
332
432
|
const max_tokens_limit = getClaudeMaxTokensLimit(model);
|
|
333
433
|
const excludeOptions = ["max_tokens", "presence_penalty", "frequency_penalty"];
|
|
334
|
-
|
|
434
|
+
const commonOptions = textOptionsFallback.options.filter((option) => !excludeOptions.includes(option.name));
|
|
335
435
|
const max_tokens: ModelOptionInfoItem[] = [{
|
|
336
436
|
name: SharedOptions.max_tokens, type: OptionType.numeric, min: 1, max: max_tokens_limit,
|
|
337
437
|
integer: true, step: 200, description: "The maximum number of tokens to generate"
|
|
@@ -391,7 +491,7 @@ function getLlamaOptions(model: string): ModelOptionsInfo {
|
|
|
391
491
|
name: SharedOptions.max_tokens, type: OptionType.numeric, min: 1, max: max_tokens_limit,
|
|
392
492
|
integer: true, step: 200, description: "The maximum number of tokens to generate"
|
|
393
493
|
}];
|
|
394
|
-
|
|
494
|
+
|
|
395
495
|
// Set max temperature to 1.0 for Llama models
|
|
396
496
|
commonOptions = commonOptions.map((option) => {
|
|
397
497
|
if (
|
|
@@ -416,6 +516,9 @@ function getLlamaOptions(model: string): ModelOptionsInfo {
|
|
|
416
516
|
}
|
|
417
517
|
|
|
418
518
|
function getGeminiMaxTokensLimit(model: string): number {
|
|
519
|
+
if (model.includes("gemini-2.5-flash-image")) {
|
|
520
|
+
return 32768;
|
|
521
|
+
}
|
|
419
522
|
if (model.includes("thinking") || model.includes("-2.5-")) {
|
|
420
523
|
return 65536;
|
|
421
524
|
}
|
|
@@ -427,7 +530,7 @@ function getGeminiMaxTokensLimit(model: string): number {
|
|
|
427
530
|
|
|
428
531
|
function getClaudeMaxTokensLimit(model: string): number {
|
|
429
532
|
if (model.includes("-4-")) {
|
|
430
|
-
if(model.includes("opus-")) {
|
|
533
|
+
if (model.includes("opus-")) {
|
|
431
534
|
return 32768;
|
|
432
535
|
}
|
|
433
536
|
return 65536;
|