@llumiverse/core 0.21.0 → 0.22.0-dev.1

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.
Files changed (100) hide show
  1. package/lib/cjs/CompletionStream.js +124 -36
  2. package/lib/cjs/CompletionStream.js.map +1 -1
  3. package/lib/cjs/Driver.js +4 -1
  4. package/lib/cjs/Driver.js.map +1 -1
  5. package/lib/cjs/async.js.map +1 -1
  6. package/lib/cjs/stream.js +16 -10
  7. package/lib/cjs/stream.js.map +1 -1
  8. package/lib/cjs/validation.js +15 -7
  9. package/lib/cjs/validation.js.map +1 -1
  10. package/lib/esm/CompletionStream.js +124 -36
  11. package/lib/esm/CompletionStream.js.map +1 -1
  12. package/lib/esm/Driver.js +4 -1
  13. package/lib/esm/Driver.js.map +1 -1
  14. package/lib/esm/async.js.map +1 -1
  15. package/lib/esm/stream.js +16 -10
  16. package/lib/esm/stream.js.map +1 -1
  17. package/lib/esm/validation.js +15 -7
  18. package/lib/esm/validation.js.map +1 -1
  19. package/lib/tsconfig.tsbuildinfo +1 -1
  20. package/lib/types/CompletionStream.d.ts +2 -2
  21. package/lib/types/CompletionStream.d.ts.map +1 -1
  22. package/lib/types/Driver.d.ts +3 -3
  23. package/lib/types/Driver.d.ts.map +1 -1
  24. package/lib/types/async.d.ts +2 -2
  25. package/lib/types/async.d.ts.map +1 -1
  26. package/lib/types/stream.d.ts.map +1 -1
  27. package/lib/types/validation.d.ts +2 -2
  28. package/lib/types/validation.d.ts.map +1 -1
  29. package/package.json +8 -8
  30. package/src/CompletionStream.ts +121 -39
  31. package/src/Driver.ts +7 -5
  32. package/src/async.ts +4 -4
  33. package/src/stream.ts +19 -11
  34. package/src/validation.ts +15 -10
  35. package/lib/cjs/capability/bedrock.js +0 -186
  36. package/lib/cjs/capability/bedrock.js.map +0 -1
  37. package/lib/cjs/capability/openai.js +0 -122
  38. package/lib/cjs/capability/openai.js.map +0 -1
  39. package/lib/cjs/capability/vertexai.js +0 -90
  40. package/lib/cjs/capability/vertexai.js.map +0 -1
  41. package/lib/cjs/capability.js +0 -52
  42. package/lib/cjs/capability.js.map +0 -1
  43. package/lib/cjs/formatters/openai.js +0 -113
  44. package/lib/cjs/formatters/openai.js.map +0 -1
  45. package/lib/cjs/options/bedrock.js +0 -343
  46. package/lib/cjs/options/bedrock.js.map +0 -1
  47. package/lib/cjs/options/groq.js +0 -37
  48. package/lib/cjs/options/groq.js.map +0 -1
  49. package/lib/cjs/options/openai.js +0 -123
  50. package/lib/cjs/options/openai.js.map +0 -1
  51. package/lib/cjs/options/vertexai.js +0 -257
  52. package/lib/cjs/options/vertexai.js.map +0 -1
  53. package/lib/cjs/options.js +0 -19
  54. package/lib/cjs/options.js.map +0 -1
  55. package/lib/cjs/types.js +0 -80
  56. package/lib/cjs/types.js.map +0 -1
  57. package/lib/esm/capability/bedrock.js +0 -183
  58. package/lib/esm/capability/bedrock.js.map +0 -1
  59. package/lib/esm/capability/openai.js +0 -119
  60. package/lib/esm/capability/openai.js.map +0 -1
  61. package/lib/esm/capability/vertexai.js +0 -87
  62. package/lib/esm/capability/vertexai.js.map +0 -1
  63. package/lib/esm/capability.js +0 -47
  64. package/lib/esm/capability.js.map +0 -1
  65. package/lib/esm/formatters/openai.js +0 -109
  66. package/lib/esm/formatters/openai.js.map +0 -1
  67. package/lib/esm/options/bedrock.js +0 -340
  68. package/lib/esm/options/bedrock.js.map +0 -1
  69. package/lib/esm/options/groq.js +0 -34
  70. package/lib/esm/options/groq.js.map +0 -1
  71. package/lib/esm/options/openai.js +0 -120
  72. package/lib/esm/options/openai.js.map +0 -1
  73. package/lib/esm/options/vertexai.js +0 -253
  74. package/lib/esm/options/vertexai.js.map +0 -1
  75. package/lib/esm/options.js +0 -16
  76. package/lib/esm/options.js.map +0 -1
  77. package/lib/esm/types.js +0 -77
  78. package/lib/esm/types.js.map +0 -1
  79. package/lib/types/capability/bedrock.d.ts +0 -6
  80. package/lib/types/capability/bedrock.d.ts.map +0 -1
  81. package/lib/types/capability/openai.d.ts +0 -10
  82. package/lib/types/capability/openai.d.ts.map +0 -1
  83. package/lib/types/capability/vertexai.d.ts +0 -10
  84. package/lib/types/capability/vertexai.d.ts.map +0 -1
  85. package/lib/types/capability.d.ts +0 -4
  86. package/lib/types/capability.d.ts.map +0 -1
  87. package/lib/types/formatters/openai.d.ts +0 -41
  88. package/lib/types/formatters/openai.d.ts.map +0 -1
  89. package/lib/types/options/bedrock.d.ts +0 -31
  90. package/lib/types/options/bedrock.d.ts.map +0 -1
  91. package/lib/types/options/groq.d.ts +0 -11
  92. package/lib/types/options/groq.d.ts.map +0 -1
  93. package/lib/types/options/openai.d.ts +0 -20
  94. package/lib/types/options/openai.d.ts.map +0 -1
  95. package/lib/types/options/vertexai.d.ts +0 -51
  96. package/lib/types/options/vertexai.d.ts.map +0 -1
  97. package/lib/types/options.d.ts +0 -2
  98. package/lib/types/options.d.ts.map +0 -1
  99. package/lib/types/types.d.ts +0 -322
  100. package/lib/types/types.d.ts.map +0 -1
@@ -1,257 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImagenMaskMode = exports.ImagenTaskType = void 0;
4
- exports.getVertexAiOptions = getVertexAiOptions;
5
- const types_js_1 = require("../types.js");
6
- const options_js_1 = require("../options.js");
7
- var ImagenTaskType;
8
- (function (ImagenTaskType) {
9
- ImagenTaskType["TEXT_IMAGE"] = "TEXT_IMAGE";
10
- ImagenTaskType["EDIT_MODE_INPAINT_REMOVAL"] = "EDIT_MODE_INPAINT_REMOVAL";
11
- ImagenTaskType["EDIT_MODE_INPAINT_INSERTION"] = "EDIT_MODE_INPAINT_INSERTION";
12
- ImagenTaskType["EDIT_MODE_BGSWAP"] = "EDIT_MODE_BGSWAP";
13
- ImagenTaskType["EDIT_MODE_OUTPAINT"] = "EDIT_MODE_OUTPAINT";
14
- ImagenTaskType["CUSTOMIZATION_SUBJECT"] = "CUSTOMIZATION_SUBJECT";
15
- ImagenTaskType["CUSTOMIZATION_STYLE"] = "CUSTOMIZATION_STYLE";
16
- ImagenTaskType["CUSTOMIZATION_CONTROLLED"] = "CUSTOMIZATION_CONTROLLED";
17
- ImagenTaskType["CUSTOMIZATION_INSTRUCT"] = "CUSTOMIZATION_INSTRUCT";
18
- })(ImagenTaskType || (exports.ImagenTaskType = ImagenTaskType = {}));
19
- var ImagenMaskMode;
20
- (function (ImagenMaskMode) {
21
- ImagenMaskMode["MASK_MODE_USER_PROVIDED"] = "MASK_MODE_USER_PROVIDED";
22
- ImagenMaskMode["MASK_MODE_BACKGROUND"] = "MASK_MODE_BACKGROUND";
23
- ImagenMaskMode["MASK_MODE_FOREGROUND"] = "MASK_MODE_FOREGROUND";
24
- ImagenMaskMode["MASK_MODE_SEMANTIC"] = "MASK_MODE_SEMANTIC";
25
- })(ImagenMaskMode || (exports.ImagenMaskMode = ImagenMaskMode = {}));
26
- function getVertexAiOptions(model, option) {
27
- if (model.includes("imagen-3.0")) {
28
- const commonOptions = [
29
- {
30
- name: types_js_1.SharedOptions.number_of_images, type: types_js_1.OptionType.numeric, min: 1, max: 4, default: 1,
31
- integer: true, description: "Number of Images to generate",
32
- },
33
- {
34
- name: types_js_1.SharedOptions.seed, type: types_js_1.OptionType.numeric, min: 0, max: 4294967295, default: 12,
35
- integer: true, description: "The seed of the generated image"
36
- },
37
- {
38
- name: "person_generation", type: types_js_1.OptionType.enum, enum: { "Disallow the inclusion of people or faces in images": "dont_allow", "Allow generation of adults only": "allow_adult", "Allow generation of people of all ages": "allow_all" },
39
- default: "allow_adult", description: "The safety setting for allowing the generation of people in the image"
40
- },
41
- {
42
- name: "safety_setting", type: types_js_1.OptionType.enum, enum: { "Block very few problematic prompts and responses": "block_none", "Block only few problematic prompts and responses": "block_only_high", "Block some problematic prompts and responses": "block_medium_and_above", "Strictest filtering": "block_low_and_above" },
43
- default: "block_medium_and_above", description: "The overall safety setting"
44
- },
45
- ];
46
- const outputOptions = [
47
- {
48
- name: "image_file_type", type: types_js_1.OptionType.enum, enum: { "JPEG": "image/jpeg", "PNG": "image/png" },
49
- default: "image/png", description: "The file type of the generated image",
50
- refresh: true,
51
- },
52
- ];
53
- const jpegQuality = {
54
- name: "jpeg_compression_quality", type: types_js_1.OptionType.numeric, min: 0, max: 100, default: 75,
55
- integer: true, description: "The compression quality of the JPEG image",
56
- };
57
- if (option?.image_file_type === "image/jpeg") {
58
- outputOptions.push(jpegQuality);
59
- }
60
- if (model.includes("generate")) {
61
- //Generate models
62
- const modeOptions = [
63
- {
64
- name: "aspect_ratio", type: types_js_1.OptionType.enum, enum: { "1:1": "1:1", "4:3": "4:3", "3:4": "3:4", "16:9": "16:9", "9:16": "9:16" },
65
- default: "1:1", description: "The aspect ratio of the generated image"
66
- },
67
- {
68
- name: "add_watermark", type: types_js_1.OptionType.boolean, default: false, description: "Add an invisible watermark to the generated image, useful for detection of AI images"
69
- },
70
- ];
71
- const enhanceOptions = !model.includes("generate-001") ? [
72
- {
73
- name: "enhance_prompt", type: types_js_1.OptionType.boolean, default: true, description: "VertexAI automatically rewrites the prompt to better reflect the prompt's intent."
74
- },
75
- ] : [];
76
- return {
77
- _option_id: "vertexai-imagen",
78
- options: [
79
- ...commonOptions,
80
- ...modeOptions,
81
- ...outputOptions,
82
- ...enhanceOptions,
83
- ]
84
- };
85
- }
86
- if (model.includes("capability")) {
87
- //Edit models
88
- let guidanceScaleDefault = 75;
89
- if (option?.edit_mode === ImagenTaskType.EDIT_MODE_INPAINT_INSERTION) {
90
- guidanceScaleDefault = 60;
91
- }
92
- const modeOptions = [
93
- {
94
- name: "edit_mode", type: types_js_1.OptionType.enum,
95
- enum: {
96
- "EDIT_MODE_INPAINT_REMOVAL": "EDIT_MODE_INPAINT_REMOVAL",
97
- "EDIT_MODE_INPAINT_INSERTION": "EDIT_MODE_INPAINT_INSERTION",
98
- "EDIT_MODE_BGSWAP": "EDIT_MODE_BGSWAP",
99
- "EDIT_MODE_OUTPAINT": "EDIT_MODE_OUTPAINT",
100
- "CUSTOMIZATION_SUBJECT": "CUSTOMIZATION_SUBJECT",
101
- "CUSTOMIZATION_STYLE": "CUSTOMIZATION_STYLE",
102
- "CUSTOMIZATION_CONTROLLED": "CUSTOMIZATION_CONTROLLED",
103
- "CUSTOMIZATION_INSTRUCT": "CUSTOMIZATION_INSTRUCT",
104
- },
105
- description: "The editing mode. CUSTOMIZATION options use few-shot learning to generate images based on a few examples."
106
- },
107
- {
108
- name: "guidance_scale", type: types_js_1.OptionType.numeric, min: 0, max: 500, default: guidanceScaleDefault,
109
- integer: true, description: "How closely the generation follows the prompt"
110
- }
111
- ];
112
- const maskOptions = (option?.edit_mode?.includes("EDIT")) ? [
113
- {
114
- name: "mask_mode", type: types_js_1.OptionType.enum,
115
- enum: {
116
- "MASK_MODE_USER_PROVIDED": "MASK_MODE_USER_PROVIDED",
117
- "MASK_MODE_BACKGROUND": "MASK_MODE_BACKGROUND",
118
- "MASK_MODE_FOREGROUND": "MASK_MODE_FOREGROUND",
119
- "MASK_MODE_SEMANTIC": "MASK_MODE_SEMANTIC",
120
- },
121
- default: "MASK_MODE_USER_PROVIDED",
122
- description: "How should the mask for the generation be provided"
123
- },
124
- {
125
- name: "mask_dilation", type: types_js_1.OptionType.numeric, min: 0, max: 1,
126
- integer: true, description: "The mask dilation, grows the mask by a percetage of image width to compensate for imprecise masks."
127
- },
128
- ] : [];
129
- const maskClassOptions = (option?.mask_mode === ImagenMaskMode.MASK_MODE_SEMANTIC) ? [
130
- {
131
- name: "mask_class", type: types_js_1.OptionType.string_list, default: [],
132
- description: "Input Class IDs. Create a mask based on image class, based on https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/imagen-api-customization#segment-ids"
133
- }
134
- ] : [];
135
- const editOptions = option?.edit_mode?.includes("EDIT") ? [
136
- {
137
- name: "edit_steps", type: types_js_1.OptionType.numeric, default: 75,
138
- integer: true, description: "The number of steps for the base image generation, more steps means more time and better quality"
139
- },
140
- ] : [];
141
- const customizationOptions = option?.edit_mode === ImagenTaskType.CUSTOMIZATION_CONTROLLED
142
- || option?.edit_mode === ImagenTaskType.CUSTOMIZATION_SUBJECT ? [
143
- {
144
- name: "controlType", type: types_js_1.OptionType.enum, enum: { "Face Mesh": "CONTROL_TYPE_FACE_MESH", "Canny": "CONTROL_TYPE_CANNY", "Scribble": "CONTROL_TYPE_SCRIBBLE" },
145
- default: "CONTROL_TYPE_CANNY", description: "Method used to generate the control image"
146
- },
147
- {
148
- name: "controlImageComputation", type: types_js_1.OptionType.boolean, default: true, description: "Should the control image be computed from the input image, or is it provided"
149
- }
150
- ] : [];
151
- return {
152
- _option_id: "vertexai-imagen",
153
- options: [
154
- ...modeOptions,
155
- ...commonOptions,
156
- ...maskOptions,
157
- ...maskClassOptions,
158
- ...editOptions,
159
- ...customizationOptions,
160
- ...outputOptions,
161
- ]
162
- };
163
- }
164
- }
165
- else if (model.includes("gemini")) {
166
- const max_tokens_limit = getGeminiMaxTokensLimit(model);
167
- const excludeOptions = ["max_tokens", "presence_penalty"];
168
- let commonOptions = options_js_1.textOptionsFallback.options.filter((option) => !excludeOptions.includes(option.name));
169
- if (model.includes("1.5")) {
170
- commonOptions = commonOptions.filter((option) => option.name !== "frequency_penalty");
171
- }
172
- const max_tokens = [{
173
- name: types_js_1.SharedOptions.max_tokens, type: types_js_1.OptionType.numeric, min: 1, max: max_tokens_limit,
174
- integer: true, step: 200, description: "The maximum number of tokens to generate"
175
- }];
176
- return {
177
- _option_id: "vertexai-gemini",
178
- options: [
179
- ...max_tokens,
180
- ...commonOptions,
181
- ]
182
- };
183
- }
184
- else if (model.includes("claude")) {
185
- const max_tokens_limit = getClaudeMaxTokensLimit(model, option);
186
- const excludeOptions = ["max_tokens", "presence_penalty", "frequency_penalty"];
187
- let commonOptions = options_js_1.textOptionsFallback.options.filter((option) => !excludeOptions.includes(option.name));
188
- const max_tokens = [{
189
- name: types_js_1.SharedOptions.max_tokens, type: types_js_1.OptionType.numeric, min: 1, max: max_tokens_limit,
190
- integer: true, step: 200, description: "The maximum number of tokens to generate"
191
- }];
192
- if (model.includes("3-7")) {
193
- const claudeModeOptions = [
194
- {
195
- name: "thinking_mode",
196
- type: types_js_1.OptionType.boolean,
197
- default: false,
198
- description: "If true, use the extended reasoning mode"
199
- },
200
- ];
201
- const claudeThinkingOptions = option?.thinking_mode ? [
202
- {
203
- name: "thinking_budget_tokens",
204
- type: types_js_1.OptionType.numeric,
205
- min: 1024,
206
- default: 4000,
207
- integer: true,
208
- step: 100,
209
- description: "The target number of tokens to use for reasoning, not a hard limit."
210
- },
211
- ] : [];
212
- return {
213
- _option_id: "vertexai-claude",
214
- options: [
215
- ...max_tokens,
216
- ...commonOptions,
217
- ...claudeModeOptions,
218
- ...claudeThinkingOptions,
219
- ]
220
- };
221
- }
222
- return {
223
- _option_id: "vertexai-claude",
224
- options: [
225
- ...max_tokens,
226
- ...commonOptions,
227
- ]
228
- };
229
- }
230
- return options_js_1.textOptionsFallback;
231
- }
232
- function getGeminiMaxTokensLimit(model) {
233
- if (model.includes("thinking")) {
234
- return 65536;
235
- }
236
- if (model.includes("ultra") || model.includes("vision")) {
237
- return 2048;
238
- }
239
- return 8192;
240
- }
241
- function getClaudeMaxTokensLimit(model, option) {
242
- if (model.includes("3-7")) {
243
- if (option && option?.thinking_mode) {
244
- return 128000;
245
- }
246
- else {
247
- return 8192;
248
- }
249
- }
250
- else if (model.includes("3-5")) {
251
- return 8192;
252
- }
253
- else {
254
- return 4096;
255
- }
256
- }
257
- //# sourceMappingURL=vertexai.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vertexai.js","sourceRoot":"","sources":["../../../src/options/vertexai.ts"],"names":[],"mappings":";;;AAgEA,gDA8NC;AA9RD,0CAA6G;AAC7G,8CAAoD;AAKpD,IAAY,cAUX;AAVD,WAAY,cAAc;IACtB,2CAAyB,CAAA;IACzB,yEAAuD,CAAA;IACvD,6EAA2D,CAAA;IAC3D,uDAAqC,CAAA;IACrC,2DAAyC,CAAA;IACzC,iEAA+C,CAAA;IAC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,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;SACI,CAAC;QACF,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getOptions = getOptions;
4
- const common_1 = require("@llumiverse/common");
5
- function getOptions(model, provider, options) {
6
- switch (provider?.toLowerCase()) {
7
- case "bedrock":
8
- return (0, common_1.getBedrockOptions)(model ?? "", options);
9
- case "vertexai":
10
- return (0, common_1.getVertexAiOptions)(model ?? "", options);
11
- case "openai":
12
- return (0, common_1.getOpenAiOptions)(model ?? "", options);
13
- case "groq":
14
- return (0, common_1.getGroqOptions)(model ?? "", options);
15
- default:
16
- return common_1.textOptionsFallback;
17
- }
18
- }
19
- //# sourceMappingURL=options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":";;AAUA,gCAaC;AAvBD,+CAQ4B;AAE5B,SAAgB,UAAU,CAAC,KAAa,EAAE,QAAiB,EAAE,OAAsB;IAC/E,QAAQ,QAAQ,EAAE,WAAW,EAAE,EAAE,CAAC;QAC9B,KAAK,SAAS;YACV,OAAO,IAAA,0BAAiB,EAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QACnD,KAAK,UAAU;YACX,OAAO,IAAA,2BAAkB,EAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QACpD,KAAK,QAAQ;YACT,OAAO,IAAA,yBAAgB,EAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAClD,KAAK,MAAM;YACP,OAAO,IAAA,uBAAc,EAAC,KAAK,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAChD;YACI,OAAO,4BAAmB,CAAC;IACnC,CAAC;AACL,CAAC"}
package/lib/cjs/types.js DELETED
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TrainingJobStatus = exports.ModelType = exports.AIModelStatus = exports.Modalities = exports.PromptRole = exports.OptionType = exports.SharedOptions = void 0;
4
- //Common names to share between different models
5
- var SharedOptions;
6
- (function (SharedOptions) {
7
- //Text
8
- SharedOptions["max_tokens"] = "max_tokens";
9
- SharedOptions["temperature"] = "temperature";
10
- SharedOptions["top_p"] = "top_p";
11
- SharedOptions["top_k"] = "top_k";
12
- SharedOptions["presence_penalty"] = "presence_penalty";
13
- SharedOptions["frequency_penalty"] = "frequency_penalty";
14
- SharedOptions["stop_sequence"] = "stop_sequence";
15
- //Image
16
- SharedOptions["seed"] = "seed";
17
- SharedOptions["number_of_images"] = "number_of_images";
18
- })(SharedOptions || (exports.SharedOptions = SharedOptions = {}));
19
- var OptionType;
20
- (function (OptionType) {
21
- OptionType["numeric"] = "numeric";
22
- OptionType["enum"] = "enum";
23
- OptionType["boolean"] = "boolean";
24
- OptionType["string_list"] = "string_list";
25
- })(OptionType || (exports.OptionType = OptionType = {}));
26
- // ============== Prompts ===============
27
- var PromptRole;
28
- (function (PromptRole) {
29
- PromptRole["safety"] = "safety";
30
- PromptRole["system"] = "system";
31
- PromptRole["user"] = "user";
32
- PromptRole["assistant"] = "assistant";
33
- PromptRole["negative"] = "negative";
34
- PromptRole["mask"] = "mask";
35
- /**
36
- * Used to send the response of a tool
37
- */
38
- PromptRole["tool"] = "tool";
39
- })(PromptRole || (exports.PromptRole = PromptRole = {}));
40
- var Modalities;
41
- (function (Modalities) {
42
- Modalities["text"] = "text";
43
- Modalities["image"] = "image";
44
- })(Modalities || (exports.Modalities = Modalities = {}));
45
- var AIModelStatus;
46
- (function (AIModelStatus) {
47
- AIModelStatus["Available"] = "available";
48
- AIModelStatus["Pending"] = "pending";
49
- AIModelStatus["Stopped"] = "stopped";
50
- AIModelStatus["Unavailable"] = "unavailable";
51
- AIModelStatus["Unknown"] = "unknown";
52
- })(AIModelStatus || (exports.AIModelStatus = AIModelStatus = {}));
53
- var ModelType;
54
- (function (ModelType) {
55
- ModelType["Classifier"] = "classifier";
56
- ModelType["Regressor"] = "regressor";
57
- ModelType["Clustering"] = "clustering";
58
- ModelType["AnomalyDetection"] = "anomaly-detection";
59
- ModelType["TimeSeries"] = "time-series";
60
- ModelType["Text"] = "text";
61
- ModelType["Image"] = "image";
62
- ModelType["Audio"] = "audio";
63
- ModelType["Video"] = "video";
64
- ModelType["Embedding"] = "embedding";
65
- ModelType["Chat"] = "chat";
66
- ModelType["Code"] = "code";
67
- ModelType["NLP"] = "nlp";
68
- ModelType["MultiModal"] = "multi-modal";
69
- ModelType["Test"] = "test";
70
- ModelType["Other"] = "other";
71
- ModelType["Unknown"] = "unknown";
72
- })(ModelType || (exports.ModelType = ModelType = {}));
73
- var TrainingJobStatus;
74
- (function (TrainingJobStatus) {
75
- TrainingJobStatus["running"] = "running";
76
- TrainingJobStatus["succeeded"] = "succeeded";
77
- TrainingJobStatus["failed"] = "failed";
78
- TrainingJobStatus["cancelled"] = "cancelled";
79
- })(TrainingJobStatus || (exports.TrainingJobStatus = TrainingJobStatus = {}));
80
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAmMA,gDAAgD;AAChD,IAAY,aAaX;AAbD,WAAY,aAAa;IACrB,MAAM;IACN,0CAAyB,CAAA;IACzB,4CAA2B,CAAA;IAC3B,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,sDAAqC,CAAA;IACrC,wDAAuC,CAAA;IACvC,gDAA+B,CAAA;IAE/B,OAAO;IACP,8BAAa,CAAA;IACb,sDAAqC,CAAA;AACzC,CAAC,EAbW,aAAa,6BAAb,aAAa,QAaxB;AAED,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,yCAA2B,CAAA;AAC/B,CAAC,EALW,U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PABILITIES = {
3
- "foundation-model/ai21.jamba-1-5-large-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 },
4
- "foundation-model/ai21.jamba-1-5-mini-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 },
5
- "foundation-model/ai21.jamba-instruct-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: false, tool_support_streaming: false },
6
- "foundation-model/amazon.nova-canvas-v1:0": { input: { text: true, image: true, video: false, audio: false, embed: false }, output: { image: true, text: false, video: false, audio: false, embed: false }, tool_support: false, tool_support_streaming: false },
7
- "foundation-model/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 },
8
- "foundation-model/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 },
9
- "foundation-model/amazon.nova-pro-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 },
10
- "foundation-model/amazon.titan-text-express-v1": { 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 },
11
- "foundation-model/amazon.titan-text-lite-v1": { 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 },
12
- "foundation-model/amazon.titan-text-premier-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: false, tool_support_streaming: false },
13
- "foundation-model/amazon.titan-tg1-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: false, tool_support_streaming: false },
14
- "foundation-model/anthropic.claude-3-5-haiku-20241022-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 },
15
- "foundation-model/anthropic.claude-3-5-sonnet-20240620-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: true },
16
- "foundation-model/anthropic.claude-3-5-sonnet-20241022-v2: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: true },
17
- "foundation-model/anthropic.claude-3-haiku-20240307-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 },
18
- "foundation-model/anthropic.claude-3-opus-20240229-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 },
19
- "foundation-model/anthropic.claude-3-sonnet-20240229-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 },
20
- "foundation-model/anthropic.claude-instant-v1": { 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 },
21
- "foundation-model/anthropic.claude-v2": { 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 },
22
- "foundation-model/anthropic.claude-v2:1": { 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 },
23
- "foundation-model/cohere.command-light-text-v14": { 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 },
24
- "foundation-model/cohere.command-r-plus-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 },
25
- "foundation-model/cohere.command-r-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 },
26
- "foundation-model/cohere.command-text-v14": { 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 },
27
- "foundation-model/meta.llama3-1-405b-instruct-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 },
28
- "foundation-model/meta.llama3-1-70b-instruct-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 },
29
- "foundation-model/meta.llama3-1-8b-instruct-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 },
30
- "foundation-model/meta.llama3-70b-instruct-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: false, tool_support_streaming: false },
31
- "foundation-model/meta.llama3-8b-instruct-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: false, tool_support_streaming: false },
32
- "foundation-model/mistral.mixtral-8x7b-instruct-v0:1": { 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 },
33
- "foundation-model/mistral.mistral-7b-instruct-v0:2": { 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 },
34
- "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 },
35
- "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 },
36
- "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 },
37
- "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 },
38
- "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 },
39
- "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 },
40
- "inference-profile/us.amazon.nova-pro-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 },
41
- "inference-profile/us.anthropic.claude-3-5-haiku-20241022-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 },
42
- "inference-profile/us.anthropic.claude-3-5-sonnet-20240620-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: true },
43
- "inference-profile/us.anthropic.claude-3-5-sonnet-20241022-v2: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: true },
44
- "inference-profile/us.anthropic.claude-3-7-sonnet-20250219-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: true },
45
- "inference-profile/us.anthropic.claude-3-haiku-20240307-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 },
46
- "inference-profile/us.anthropic.claude-3-opus-20240229-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 },
47
- "inference-profile/us.anthropic.claude-3-sonnet-20240229-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 },
48
- "inference-profile/us.anthropic.claude-opus-4-20250514-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 },
49
- "inference-profile/us.anthropic.claude-sonnet-4-20250514-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 },
50
- "inference-profile/us.deepseek.r1-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: false, tool_support_streaming: false },
51
- "inference-profile/us.meta.llama3-1-70b-instruct-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: false, tool_support_streaming: false },
52
- "inference-profile/us.meta.llama3-1-8b-instruct-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: false, tool_support_streaming: false },
53
- "inference-profile/us.meta.llama3-2-1b-instruct-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: false, tool_support_streaming: false },
54
- "inference-profile/us.meta.llama3-2-11b-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: true, tool_support_streaming: false },
55
- "inference-profile/us.meta.llama3-2-3b-instruct-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: false, tool_support_streaming: false },
56
- "inference-profile/us.meta.llama3-2-90b-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: true, tool_support_streaming: false },
57
- "inference-profile/us.meta.llama3-3-70b-instruct-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: false, tool_support_streaming: false },
58
- "inference-profile/us.meta.llama4-maverick-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 },
59
- "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 },
60
- "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 },
61
- "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 },
62
- "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 }
63
- };
64
- // Populate RECORD_FAMILY_CAPABILITIES as a const record (lowest common denominator for each family)
65
- const RECORD_FAMILY_CAPABILITIES = {
66
- "foundation-model/ai21.jamba": { 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 },
67
- "foundation-model/amazon.nova": { input: { text: true, image: false, video: false, audio: false, embed: false }, output: { text: false, image: false, video: false, audio: false, embed: false }, tool_support: true, tool_support_streaming: true },
68
- "foundation-model/amazon.titan": { 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 },
69
- "foundation-model/anthropic.claude": { 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 },
70
- "foundation-model/anthropic.claude-3": { 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 },
71
- "foundation-model/anthropic.claude-3-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 },
72
- "foundation-model/anthropic.claude-3-7": { 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 },
73
- "foundation-model/cohere.command": { 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 },
74
- "foundation-model/meta.llama3": { 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 },
75
- "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 },
76
- "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 },
77
- "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 },
78
- "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 },
79
- "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 },
80
- "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 },
81
- "inference-profile/us.anthropic.claude-3-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: false },
82
- "inference-profile/us.anthropic.claude": { 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 },
83
- "inference-profile/us.deepseek.r1": { 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
- "inference-profile/us.meta.llama3": { 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 },
85
- "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 },
86
- "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 },
87
- "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 },
88
- "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 }
89
- };
90
- /**
91
- * Extract the model identifier from an ARN or inference profile
92
- * @param modelName The full model ARN or name
93
- * @returns The normalized model identifier
94
- */
95
- function normalizeModelName(modelName) {
96
- const modelLower = modelName.toLowerCase();
97
- if (modelLower.includes("inference-profile")) {
98
- const parts = modelLower.split("/");
99
- if (parts.length > 1) {
100
- const providerModel = parts[parts.length - 1];
101
- const modelParts = providerModel.split(".");
102
- if (modelParts.length > 1 && modelParts[1] === "deepseek") {
103
- return `deepseek-${modelParts.slice(2).join(".")}`;
104
- }
105
- return modelParts.length > 2 ? modelParts.slice(2).join(".") : providerModel;
106
- }
107
- }
108
- return modelLower;
109
- }
110
- // Fallback pattern lists for inferring modalities and tool support
111
- const IMAGE_INPUT_MODELS = ["image"]; // fallback: if model id contains 'image', supports image input
112
- const VIDEO_INPUT_MODELS = ["video"];
113
- const AUDIO_INPUT_MODELS = ["audio"];
114
- const TEXT_INPUT_MODELS = ["text"];
115
- const IMAGE_OUTPUT_MODELS = ["image"];
116
- const VIDEO_OUTPUT_MODELS = ["video"];
117
- const AUDIO_OUTPUT_MODELS = ["audio"];
118
- const TEXT_OUTPUT_MODELS = ["text"];
119
- const EMBEDDING_OUTPUT_MODELS = ["embed"];
120
- const TOOL_SUPPORT_MODELS = ["tool", "sonnet", "opus", "nova", "palmyra", "command-r", "mistral-large", "pixtral"];
121
- function modelMatches(modelName, patterns) {
122
- return patterns.some(pattern => modelName.includes(pattern));
123
- }
124
- /**
125
- * Get the full ModelCapabilities for a Bedrock model.
126
- * Checks RECORD_MODEL_CAPABILITIES first, then falls back to pattern-based inference.
127
- */
128
- export function getModelCapabilitiesBedrock(model) {
129
- // Normalize ARN or inference-profile to model ID
130
- let normalized = model;
131
- const arnPattern = /^arn:aws:bedrock:[^:]+:[^:]*:(inference-profile|foundation-model)\/.+/i;
132
- if (arnPattern.test(model)) {
133
- // Extract after last occurrence of 'foundation-model/' or 'inference-profile/'
134
- const foundationIdx = model.lastIndexOf('foundation-model/');
135
- const inferenceIdx = model.lastIndexOf('inference-profile/');
136
- if (foundationIdx !== -1) {
137
- normalized = model.substring(foundationIdx);
138
- }
139
- else if (inferenceIdx !== -1) {
140
- normalized = model.substring(inferenceIdx);
141
- }
142
- }
143
- // Standardize region for inference-profile to 'us' for record lookup
144
- // This allows support for different AWS regions by mapping all to 'us'
145
- if (normalized.startsWith("inference-profile/")) {
146
- normalized = normalized.replace(/^inference-profile\/[^.]+\./, "inference-profile/us.");
147
- }
148
- // 1. Exact match in record
149
- const record = RECORD_MODEL_CAPABILITIES[normalized];
150
- if (record)
151
- return record;
152
- // 2. Fallback: find the longest matching family prefix in RECORD_FAMILY_CAPABILITIES
153
- let bestFamilyKey = undefined;
154
- let bestFamilyLength = 0;
155
- for (const key of Object.keys(RECORD_FAMILY_CAPABILITIES)) {
156
- if (normalized.startsWith(key) && key.length > bestFamilyLength) {
157
- bestFamilyKey = key;
158
- bestFamilyLength = key.length;
159
- }
160
- }
161
- if (bestFamilyKey) {
162
- return RECORD_FAMILY_CAPABILITIES[bestFamilyKey];
163
- }
164
- // 3. Fallback: infer from normalized name
165
- normalized = normalizeModelName(normalized);
166
- const input = {
167
- text: modelMatches(normalized, TEXT_INPUT_MODELS) || undefined,
168
- image: modelMatches(normalized, IMAGE_INPUT_MODELS) || undefined,
169
- video: modelMatches(normalized, VIDEO_INPUT_MODELS) || undefined,
170
- audio: modelMatches(normalized, AUDIO_INPUT_MODELS) || undefined,
171
- embed: false
172
- };
173
- const output = {
174
- text: modelMatches(normalized, TEXT_OUTPUT_MODELS) || undefined,
175
- image: modelMatches(normalized, IMAGE_OUTPUT_MODELS) || undefined,
176
- video: modelMatches(normalized, VIDEO_OUTPUT_MODELS) || undefined,
177
- audio: modelMatches(normalized, AUDIO_OUTPUT_MODELS) || undefined,
178
- embed: modelMatches(normalized, EMBEDDING_OUTPUT_MODELS) || undefined
179
- };
180
- const tool_support = modelMatches(normalized, TOOL_SUPPORT_MODELS) || undefined;
181
- return { input, output, tool_support };
182
- }
183
- //# sourceMappingURL=bedrock.js.map