@llumiverse/common 1.2.0 → 1.4.0-dev.20260629.090753Z

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 (184) hide show
  1. package/lib/capability/anthropic.d.ts +3 -0
  2. package/lib/capability/anthropic.d.ts.map +1 -0
  3. package/lib/capability/anthropic.js +92 -0
  4. package/lib/capability/anthropic.js.map +1 -0
  5. package/lib/{types/capability → capability}/azure_foundry.d.ts +1 -1
  6. package/lib/capability/azure_foundry.d.ts.map +1 -0
  7. package/lib/capability/azure_foundry.js +394 -0
  8. package/lib/capability/azure_foundry.js.map +1 -0
  9. package/lib/{types/capability → capability}/bedrock.d.ts +1 -1
  10. package/lib/capability/bedrock.d.ts.map +1 -0
  11. package/lib/capability/bedrock.js +300 -0
  12. package/lib/capability/bedrock.js.map +1 -0
  13. package/lib/{types/capability → capability}/openai.d.ts +1 -1
  14. package/lib/capability/openai.d.ts.map +1 -0
  15. package/lib/capability/openai.js +179 -0
  16. package/lib/capability/openai.js.map +1 -0
  17. package/lib/{types/capability → capability}/vertexai.d.ts +1 -1
  18. package/lib/capability/vertexai.d.ts.map +1 -0
  19. package/lib/capability/vertexai.js +137 -0
  20. package/lib/capability/vertexai.js.map +1 -0
  21. package/lib/{types/capability.d.ts → capability.d.ts} +1 -1
  22. package/lib/capability.d.ts.map +1 -0
  23. package/lib/{esm/capability.js → capability.js} +21 -15
  24. package/lib/capability.js.map +1 -0
  25. package/lib/index.d.ts +14 -0
  26. package/lib/index.d.ts.map +1 -0
  27. package/lib/index.js +14 -0
  28. package/lib/index.js.map +1 -0
  29. package/lib/options/anthropic.d.ts +16 -0
  30. package/lib/options/anthropic.d.ts.map +1 -0
  31. package/lib/options/anthropic.js +34 -0
  32. package/lib/options/anthropic.js.map +1 -0
  33. package/lib/{types/options → options}/azure_foundry.d.ts +14 -14
  34. package/lib/options/azure_foundry.d.ts.map +1 -0
  35. package/lib/{esm/options → options}/azure_foundry.js +126 -126
  36. package/lib/options/azure_foundry.js.map +1 -0
  37. package/lib/options/bedrock.d.ts +61 -0
  38. package/lib/options/bedrock.d.ts.map +1 -0
  39. package/lib/options/bedrock.js +489 -0
  40. package/lib/options/bedrock.js.map +1 -0
  41. package/lib/options/context-windows.d.ts.map +1 -0
  42. package/lib/options/context-windows.js.map +1 -0
  43. package/lib/options/embedding.d.ts +38 -0
  44. package/lib/options/embedding.d.ts.map +1 -0
  45. package/lib/options/embedding.js +77 -0
  46. package/lib/options/embedding.js.map +1 -0
  47. package/lib/{types/options → options}/fallback.d.ts +2 -2
  48. package/lib/options/fallback.d.ts.map +1 -0
  49. package/lib/options/fallback.js +65 -0
  50. package/lib/options/fallback.js.map +1 -0
  51. package/lib/{types/options → options}/groq.d.ts +2 -2
  52. package/lib/options/groq.d.ts.map +1 -0
  53. package/lib/options/groq.js +54 -0
  54. package/lib/options/groq.js.map +1 -0
  55. package/lib/options/openai.d.ts +40 -0
  56. package/lib/options/openai.d.ts.map +1 -0
  57. package/lib/options/openai.js +284 -0
  58. package/lib/options/openai.js.map +1 -0
  59. package/lib/{types/options → options}/shared-parsing.d.ts +1 -1
  60. package/lib/options/shared-parsing.d.ts.map +1 -0
  61. package/lib/{esm/options → options}/shared-parsing.js +14 -17
  62. package/lib/options/shared-parsing.js.map +1 -0
  63. package/lib/options/version-parsing.d.ts.map +1 -0
  64. package/lib/{esm/options → options}/version-parsing.js +15 -15
  65. package/lib/options/version-parsing.js.map +1 -0
  66. package/lib/{types/options → options}/vertexai.d.ts +18 -15
  67. package/lib/options/vertexai.d.ts.map +1 -0
  68. package/lib/options/vertexai.js +606 -0
  69. package/lib/options/vertexai.js.map +1 -0
  70. package/lib/{types/options.d.ts → options.d.ts} +1 -1
  71. package/lib/options.d.ts.map +1 -0
  72. package/lib/{esm/options.js → options.js} +10 -7
  73. package/lib/options.js.map +1 -0
  74. package/lib/{types/types.d.ts → types.d.ts} +161 -42
  75. package/lib/types.d.ts.map +1 -0
  76. package/lib/{esm/types.js → types.js} +28 -22
  77. package/lib/types.js.map +1 -0
  78. package/package.json +12 -34
  79. package/src/LlumiverseError.test.ts +18 -72
  80. package/src/capability/anthropic.ts +99 -0
  81. package/src/capability/azure_foundry.ts +303 -65
  82. package/src/capability/bedrock.ts +201 -56
  83. package/src/capability/openai.ts +135 -41
  84. package/src/capability/vertexai.ts +105 -35
  85. package/src/capability.ts +21 -16
  86. package/src/index.ts +13 -11
  87. package/src/options/anthropic.ts +59 -0
  88. package/src/options/azure_foundry.ts +157 -143
  89. package/src/options/bedrock.ts +266 -187
  90. package/src/options/context-windows.ts +2 -2
  91. package/src/options/embedding.ts +92 -0
  92. package/src/options/fallback.ts +50 -17
  93. package/src/options/groq.ts +48 -21
  94. package/src/options/openai.ts +231 -183
  95. package/src/options/shared-parsing.ts +16 -21
  96. package/src/options/version-parsing.ts +17 -17
  97. package/src/options/vertexai.ts +385 -288
  98. package/src/options.ts +11 -8
  99. package/src/types.ts +284 -160
  100. package/lib/cjs/capability/azure_foundry.js +0 -160
  101. package/lib/cjs/capability/azure_foundry.js.map +0 -1
  102. package/lib/cjs/capability/bedrock.js +0 -158
  103. package/lib/cjs/capability/bedrock.js.map +0 -1
  104. package/lib/cjs/capability/openai.js +0 -98
  105. package/lib/cjs/capability/openai.js.map +0 -1
  106. package/lib/cjs/capability/vertexai.js +0 -80
  107. package/lib/cjs/capability/vertexai.js.map +0 -1
  108. package/lib/cjs/capability.js +0 -109
  109. package/lib/cjs/capability.js.map +0 -1
  110. package/lib/cjs/index.js +0 -27
  111. package/lib/cjs/index.js.map +0 -1
  112. package/lib/cjs/options/azure_foundry.js +0 -423
  113. package/lib/cjs/options/azure_foundry.js.map +0 -1
  114. package/lib/cjs/options/bedrock.js +0 -427
  115. package/lib/cjs/options/bedrock.js.map +0 -1
  116. package/lib/cjs/options/context-windows.js +0 -138
  117. package/lib/cjs/options/context-windows.js.map +0 -1
  118. package/lib/cjs/options/fallback.js +0 -35
  119. package/lib/cjs/options/fallback.js.map +0 -1
  120. package/lib/cjs/options/groq.js +0 -37
  121. package/lib/cjs/options/groq.js.map +0 -1
  122. package/lib/cjs/options/openai.js +0 -246
  123. package/lib/cjs/options/openai.js.map +0 -1
  124. package/lib/cjs/options/shared-parsing.js +0 -144
  125. package/lib/cjs/options/shared-parsing.js.map +0 -1
  126. package/lib/cjs/options/version-parsing.js +0 -326
  127. package/lib/cjs/options/version-parsing.js.map +0 -1
  128. package/lib/cjs/options/vertexai.js +0 -525
  129. package/lib/cjs/options/vertexai.js.map +0 -1
  130. package/lib/cjs/options.js +0 -30
  131. package/lib/cjs/options.js.map +0 -1
  132. package/lib/cjs/package.json +0 -3
  133. package/lib/cjs/types.js +0 -299
  134. package/lib/cjs/types.js.map +0 -1
  135. package/lib/esm/capability/azure_foundry.js +0 -157
  136. package/lib/esm/capability/azure_foundry.js.map +0 -1
  137. package/lib/esm/capability/bedrock.js +0 -155
  138. package/lib/esm/capability/bedrock.js.map +0 -1
  139. package/lib/esm/capability/openai.js +0 -95
  140. package/lib/esm/capability/openai.js.map +0 -1
  141. package/lib/esm/capability/vertexai.js +0 -77
  142. package/lib/esm/capability/vertexai.js.map +0 -1
  143. package/lib/esm/capability.js.map +0 -1
  144. package/lib/esm/index.js +0 -11
  145. package/lib/esm/index.js.map +0 -1
  146. package/lib/esm/options/azure_foundry.js.map +0 -1
  147. package/lib/esm/options/bedrock.js +0 -423
  148. package/lib/esm/options/bedrock.js.map +0 -1
  149. package/lib/esm/options/context-windows.js.map +0 -1
  150. package/lib/esm/options/fallback.js +0 -32
  151. package/lib/esm/options/fallback.js.map +0 -1
  152. package/lib/esm/options/groq.js +0 -34
  153. package/lib/esm/options/groq.js.map +0 -1
  154. package/lib/esm/options/openai.js +0 -243
  155. package/lib/esm/options/openai.js.map +0 -1
  156. package/lib/esm/options/shared-parsing.js.map +0 -1
  157. package/lib/esm/options/version-parsing.js.map +0 -1
  158. package/lib/esm/options/vertexai.js +0 -519
  159. package/lib/esm/options/vertexai.js.map +0 -1
  160. package/lib/esm/options.js.map +0 -1
  161. package/lib/esm/types.js.map +0 -1
  162. package/lib/types/capability/azure_foundry.d.ts.map +0 -1
  163. package/lib/types/capability/bedrock.d.ts.map +0 -1
  164. package/lib/types/capability/openai.d.ts.map +0 -1
  165. package/lib/types/capability/vertexai.d.ts.map +0 -1
  166. package/lib/types/capability.d.ts.map +0 -1
  167. package/lib/types/index.d.ts +0 -11
  168. package/lib/types/index.d.ts.map +0 -1
  169. package/lib/types/options/azure_foundry.d.ts.map +0 -1
  170. package/lib/types/options/bedrock.d.ts +0 -54
  171. package/lib/types/options/bedrock.d.ts.map +0 -1
  172. package/lib/types/options/context-windows.d.ts.map +0 -1
  173. package/lib/types/options/fallback.d.ts.map +0 -1
  174. package/lib/types/options/groq.d.ts.map +0 -1
  175. package/lib/types/options/openai.d.ts +0 -37
  176. package/lib/types/options/openai.d.ts.map +0 -1
  177. package/lib/types/options/shared-parsing.d.ts.map +0 -1
  178. package/lib/types/options/version-parsing.d.ts.map +0 -1
  179. package/lib/types/options/vertexai.d.ts.map +0 -1
  180. package/lib/types/options.d.ts.map +0 -1
  181. package/lib/types/types.d.ts.map +0 -1
  182. /package/lib/{types/options → options}/context-windows.d.ts +0 -0
  183. /package/lib/{esm/options → options}/context-windows.js +0 -0
  184. /package/lib/{types/options → options}/version-parsing.d.ts +0 -0
@@ -1,5 +1,11 @@
1
- import { ModelOptionsInfo, ModelOptionInfoItem, ModelOptions, OptionType, SharedOptions } from "../types.js";
2
- import { getMaxOutputTokens } from "./context-windows.js";
1
+ import {
2
+ type ModelOptionInfoItem,
3
+ type ModelOptions,
4
+ type ModelOptionsInfo,
5
+ OptionType,
6
+ SharedOptions,
7
+ } from '../types.js';
8
+ import { getMaxOutputTokens } from './context-windows.js';
3
9
 
4
10
  // Helper function to parse composite model IDs
5
11
  function parseAzureFoundryModelId(compositeId: string): { deploymentName: string; baseModel: string } {
@@ -7,34 +13,39 @@ function parseAzureFoundryModelId(compositeId: string): { deploymentName: string
7
13
  if (parts.length === 2) {
8
14
  return {
9
15
  deploymentName: parts[0],
10
- baseModel: parts[1]
16
+ baseModel: parts[1],
11
17
  };
12
18
  }
13
19
 
14
20
  // Backwards compatibility: if no delimiter found, treat as deployment name
15
21
  return {
16
22
  deploymentName: compositeId,
17
- baseModel: compositeId
23
+ baseModel: compositeId,
18
24
  };
19
25
  }
20
26
 
21
27
  // Union type of all Azure Foundry options
22
- export type AzureFoundryOptions = AzureFoundryOpenAIOptions | AzureFoundryDeepSeekOptions | AzureFoundryThinkingOptions | AzureFoundryTextOptions | AzureFoundryImageOptions;
28
+ export type AzureFoundryOptions =
29
+ | AzureFoundryOpenAIOptions
30
+ | AzureFoundryDeepSeekOptions
31
+ | AzureFoundryThinkingOptions
32
+ | AzureFoundryTextOptions
33
+ | AzureFoundryImageOptions;
23
34
 
24
35
  export interface AzureFoundryOpenAIOptions {
25
- _option_id: "azure-foundry-openai";
36
+ _option_id: 'azure-foundry-openai';
26
37
  max_tokens?: number;
27
38
  temperature?: number;
28
39
  top_p?: number;
29
40
  presence_penalty?: number;
30
41
  frequency_penalty?: number;
31
42
  stop_sequence?: string[];
32
- image_detail?: "low" | "high" | "auto";
33
- reasoning_effort?: "low" | "medium" | "high";
43
+ image_detail?: 'low' | 'high' | 'auto';
44
+ reasoning_effort?: 'low' | 'medium' | 'high';
34
45
  }
35
46
 
36
47
  export interface AzureFoundryDeepSeekOptions {
37
- _option_id: "azure-foundry-deepseek";
48
+ _option_id: 'azure-foundry-deepseek';
38
49
  max_tokens?: number;
39
50
  temperature?: number;
40
51
  top_p?: number;
@@ -42,17 +53,17 @@ export interface AzureFoundryDeepSeekOptions {
42
53
  }
43
54
 
44
55
  export interface AzureFoundryThinkingOptions {
45
- _option_id: "azure-foundry-thinking";
56
+ _option_id: 'azure-foundry-thinking';
46
57
  max_tokens?: number;
47
58
  temperature?: number;
48
59
  top_p?: number;
49
60
  stop_sequence?: string[];
50
- reasoning_effort?: "low" | "medium" | "high";
51
- image_detail?: "low" | "high" | "auto";
61
+ reasoning_effort?: 'low' | 'medium' | 'high';
62
+ image_detail?: 'low' | 'high' | 'auto';
52
63
  }
53
64
 
54
65
  export interface AzureFoundryTextOptions {
55
- _option_id: "azure-foundry-text";
66
+ _option_id: 'azure-foundry-text';
56
67
  max_tokens?: number;
57
68
  temperature?: number;
58
69
  top_p?: number;
@@ -64,13 +75,13 @@ export interface AzureFoundryTextOptions {
64
75
  }
65
76
 
66
77
  export interface AzureFoundryImageOptions {
67
- _option_id: "azure-foundry-image";
78
+ _option_id: 'azure-foundry-image';
68
79
  width?: number;
69
80
  height?: number;
70
- quality?: "standard" | "hd";
71
- style?: "vivid" | "natural";
72
- response_format?: "url" | "b64_json";
73
- size?: "256x256" | "512x512" | "1024x1024" | "1792x1024" | "1024x1792";
81
+ quality?: 'standard' | 'hd';
82
+ style?: 'vivid' | 'natural';
83
+ response_format?: 'url' | 'b64_json';
84
+ size?: '256x256' | '512x512' | '1024x1024' | '1792x1024' | '1024x1792';
74
85
  }
75
86
 
76
87
  export function getMaxTokensLimitAzureFoundry(model: string): number | undefined {
@@ -78,96 +89,96 @@ export function getMaxTokensLimitAzureFoundry(model: string): number | undefined
78
89
  const { baseModel } = parseAzureFoundryModelId(model);
79
90
  const modelLower = baseModel.toLowerCase();
80
91
  // GPT models
81
- if (modelLower.includes("gpt-4o")) {
82
- if (modelLower.includes("mini")) {
92
+ if (modelLower.includes('gpt-4o')) {
93
+ if (modelLower.includes('mini')) {
83
94
  return 16384;
84
95
  }
85
96
  return 16384;
86
97
  }
87
- if (modelLower.includes("gpt-4")) {
88
- if (modelLower.includes("turbo")) {
98
+ if (modelLower.includes('gpt-4')) {
99
+ if (modelLower.includes('turbo')) {
89
100
  return 4096;
90
101
  }
91
- if (modelLower.includes("32k")) {
102
+ if (modelLower.includes('32k')) {
92
103
  return 32768;
93
104
  }
94
105
  return 8192;
95
106
  }
96
- if (modelLower.includes("gpt-35") || modelLower.includes("gpt-3.5")) {
107
+ if (modelLower.includes('gpt-35') || modelLower.includes('gpt-3.5')) {
97
108
  return 4096;
98
109
  }
99
- if (model.includes("gpt-5")) {
110
+ if (model.includes('gpt-5')) {
100
111
  return 128000;
101
112
  }
102
113
  // O-series models
103
- if (modelLower.includes("o1")) {
104
- if (modelLower.includes("preview")) {
114
+ if (modelLower.includes('o1')) {
115
+ if (modelLower.includes('preview')) {
105
116
  return 32768;
106
117
  }
107
- if (modelLower.includes("mini")) {
118
+ if (modelLower.includes('mini')) {
108
119
  return 65536;
109
120
  }
110
121
  return 100000;
111
122
  }
112
- if (modelLower.includes("o3")) {
113
- if (modelLower.includes("mini")) {
123
+ if (modelLower.includes('o3')) {
124
+ if (modelLower.includes('mini')) {
114
125
  return 100000;
115
126
  }
116
127
  return 100000;
117
128
  }
118
- if (modelLower.includes("o4")) {
129
+ if (modelLower.includes('o4')) {
119
130
  return 100000;
120
131
  }
121
132
  // DeepSeek models
122
- if (modelLower.includes("deepseek")) {
123
- if (modelLower.includes("r1")) {
133
+ if (modelLower.includes('deepseek')) {
134
+ if (modelLower.includes('r1')) {
124
135
  return 163840;
125
136
  }
126
- if (modelLower.includes("v3")) {
137
+ if (modelLower.includes('v3')) {
127
138
  return 131072;
128
139
  }
129
140
  }
130
141
  // Claude models — delegate to provider-agnostic limits
131
- if (modelLower.includes("claude")) {
142
+ if (modelLower.includes('claude')) {
132
143
  return getMaxOutputTokens(modelLower);
133
144
  }
134
145
  // Llama models
135
- if (modelLower.includes("llama")) {
136
- if (modelLower.includes("3.1") || modelLower.includes("3.3")) {
146
+ if (modelLower.includes('llama')) {
147
+ if (modelLower.includes('3.1') || modelLower.includes('3.3')) {
137
148
  return 8192;
138
149
  }
139
- if (modelLower.includes("4")) {
150
+ if (modelLower.includes('4')) {
140
151
  return 1000000; // 1M context
141
152
  }
142
153
  return 8192;
143
154
  }
144
155
  // Mistral models
145
- if (modelLower.includes("mistral")) {
146
- if (modelLower.includes("large")) {
156
+ if (modelLower.includes('mistral')) {
157
+ if (modelLower.includes('large')) {
147
158
  return 4096;
148
159
  }
149
- if (modelLower.includes("small")) {
160
+ if (modelLower.includes('small')) {
150
161
  return 4096;
151
162
  }
152
163
  return 4096;
153
164
  }
154
165
  // Phi models
155
- if (modelLower.includes("phi")) {
166
+ if (modelLower.includes('phi')) {
156
167
  return 4096;
157
168
  }
158
169
  // AI21 Jamba models
159
- if (modelLower.includes("jamba")) {
170
+ if (modelLower.includes('jamba')) {
160
171
  return 4096;
161
172
  }
162
173
  // Cohere models
163
- if (modelLower.includes("cohere")) {
164
- if (modelLower.includes("command-a")) {
174
+ if (modelLower.includes('cohere')) {
175
+ if (modelLower.includes('command-a')) {
165
176
  return 8000;
166
177
  }
167
178
  return 4096;
168
179
  }
169
180
  // Grok models
170
- if (modelLower.includes("grok")) {
181
+ if (modelLower.includes('grok')) {
171
182
  return 131072;
172
183
  }
173
184
  return undefined;
@@ -179,70 +190,75 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
179
190
  const modelLower = baseModel.toLowerCase();
180
191
  const max_tokens_limit = getMaxTokensLimitAzureFoundry(model);
181
192
  // Image generation models
182
- if (modelLower.includes("dall-e") || modelLower.includes("gpt-image")) {
193
+ if (modelLower.includes('dall-e') || modelLower.includes('gpt-image')) {
183
194
  return {
184
- _option_id: "azure-foundry-image",
195
+ _option_id: 'azure-foundry-image',
185
196
  options: [
186
197
  {
187
- name: "size",
198
+ name: 'size',
188
199
  type: OptionType.enum,
189
200
  enum: {
190
- "256x256": "256x256",
191
- "512x512": "512x512",
192
- "1024x1024": "1024x1024",
193
- "1792x1024": "1792x1024",
194
- "1024x1792": "1024x1792"
201
+ '256x256': '256x256',
202
+ '512x512': '512x512',
203
+ '1024x1024': '1024x1024',
204
+ '1792x1024': '1792x1024',
205
+ '1024x1792': '1024x1792',
195
206
  },
196
- default: "1024x1024",
197
- description: "The size of the generated image"
207
+ default: '1024x1024',
208
+ description: 'The size of the generated image',
198
209
  },
199
210
  {
200
- name: "quality",
211
+ name: 'quality',
201
212
  type: OptionType.enum,
202
- enum: { "Standard": "standard", "HD": "hd" },
203
- default: "standard",
204
- description: "The quality of the generated image"
213
+ enum: { Standard: 'standard', HD: 'hd' },
214
+ default: 'standard',
215
+ description: 'The quality of the generated image',
205
216
  },
206
217
  {
207
- name: "style",
218
+ name: 'style',
208
219
  type: OptionType.enum,
209
- enum: { "Vivid": "vivid", "Natural": "natural" },
210
- default: "vivid",
211
- description: "The style of the generated image"
220
+ enum: { Vivid: 'vivid', Natural: 'natural' },
221
+ default: 'vivid',
222
+ description: 'The style of the generated image',
212
223
  },
213
224
  {
214
- name: "response_format",
225
+ name: 'response_format',
215
226
  type: OptionType.enum,
216
- enum: { "URL": "url", "Base64 JSON": "b64_json" },
217
- default: "url",
218
- description: "The format of the response"
219
- }
220
- ]
227
+ enum: { URL: 'url', 'Base64 JSON': 'b64_json' },
228
+ default: 'url',
229
+ description: 'The format of the response',
230
+ },
231
+ ],
221
232
  };
222
233
  }
223
234
  // Vision model options
224
- const visionOptions: ModelOptionInfoItem[] = isVisionModel(modelLower) ? [
225
- {
226
- name: "image_detail",
227
- type: OptionType.enum,
228
- enum: { "Low": "low", "High": "high", "Auto": "auto" },
229
- default: "auto",
230
- description: "Controls how the model processes input images"
231
- }
232
- ] : [];
235
+ const visionOptions: ModelOptionInfoItem[] = isVisionModel(modelLower)
236
+ ? [
237
+ {
238
+ name: 'image_detail',
239
+ type: OptionType.enum,
240
+ enum: { Low: 'low', High: 'high', Auto: 'auto' },
241
+ default: 'auto',
242
+ description: 'Controls how the model processes input images',
243
+ },
244
+ ]
245
+ : [];
233
246
  // O-series and thinking models
234
- if (modelLower.includes("o1") || modelLower.includes("o3") || modelLower.includes("o4")) {
235
- const reasoningOptions: ModelOptionInfoItem[] = (modelLower.includes("o3") || isO1Full(modelLower)) ? [
236
- {
237
- name: "reasoning_effort",
238
- type: OptionType.enum,
239
- enum: { "Low": "low", "Medium": "medium", "High": "high" },
240
- default: "medium",
241
- description: "How much effort the model should put into reasoning"
242
- }
243
- ] : [];
247
+ if (modelLower.includes('o1') || modelLower.includes('o3') || modelLower.includes('o4')) {
248
+ const reasoningOptions: ModelOptionInfoItem[] =
249
+ modelLower.includes('o3') || isO1Full(modelLower)
250
+ ? [
251
+ {
252
+ name: 'reasoning_effort',
253
+ type: OptionType.enum,
254
+ enum: { Low: 'low', Medium: 'medium', High: 'high' },
255
+ default: 'medium',
256
+ description: 'How much effort the model should put into reasoning',
257
+ },
258
+ ]
259
+ : [];
244
260
  return {
245
- _option_id: "azure-foundry-thinking",
261
+ _option_id: 'azure-foundry-thinking',
246
262
  options: [
247
263
  {
248
264
  name: SharedOptions.max_tokens,
@@ -250,7 +266,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
250
266
  min: 1,
251
267
  max: max_tokens_limit,
252
268
  integer: true,
253
- description: "The maximum number of tokens to generate"
269
+ description: 'The maximum number of tokens to generate',
254
270
  },
255
271
  {
256
272
  name: SharedOptions.temperature,
@@ -259,7 +275,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
259
275
  max: 2.0,
260
276
  default: 1.0,
261
277
  step: 0.1,
262
- description: "Controls randomness in the output"
278
+ description: 'Controls randomness in the output',
263
279
  },
264
280
  {
265
281
  name: SharedOptions.top_p,
@@ -267,23 +283,23 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
267
283
  min: 0,
268
284
  max: 1,
269
285
  step: 0.1,
270
- description: "Nucleus sampling parameter"
286
+ description: 'Nucleus sampling parameter',
271
287
  },
272
288
  {
273
289
  name: SharedOptions.stop_sequence,
274
290
  type: OptionType.string_list,
275
291
  value: [],
276
- description: "Sequences where the model will stop generating"
292
+ description: 'Sequences where the model will stop generating',
277
293
  },
278
294
  ...reasoningOptions,
279
- ...visionOptions
280
- ]
295
+ ...visionOptions,
296
+ ],
281
297
  };
282
298
  }
283
299
  // DeepSeek R1 models
284
- if (modelLower.includes("deepseek") && modelLower.includes("r1")) {
300
+ if (modelLower.includes('deepseek') && modelLower.includes('r1')) {
285
301
  return {
286
- _option_id: "azure-foundry-deepseek",
302
+ _option_id: 'azure-foundry-deepseek',
287
303
  options: [
288
304
  {
289
305
  name: SharedOptions.max_tokens,
@@ -291,7 +307,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
291
307
  min: 1,
292
308
  max: max_tokens_limit,
293
309
  integer: true,
294
- description: "The maximum number of tokens to generate"
310
+ description: 'The maximum number of tokens to generate',
295
311
  },
296
312
  {
297
313
  name: SharedOptions.temperature,
@@ -300,7 +316,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
300
316
  max: 2.0,
301
317
  default: 0.7,
302
318
  step: 0.1,
303
- description: "Lower temperatures recommended for DeepSeek R1 (0.3-0.7)"
319
+ description: 'Lower temperatures recommended for DeepSeek R1 (0.3-0.7)',
304
320
  },
305
321
  {
306
322
  name: SharedOptions.top_p,
@@ -308,21 +324,21 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
308
324
  min: 0,
309
325
  max: 1,
310
326
  step: 0.1,
311
- description: "Nucleus sampling parameter"
327
+ description: 'Nucleus sampling parameter',
312
328
  },
313
329
  {
314
330
  name: SharedOptions.stop_sequence,
315
331
  type: OptionType.string_list,
316
332
  value: [],
317
- description: "Sequences where the model will stop generating"
318
- }
319
- ]
333
+ description: 'Sequences where the model will stop generating',
334
+ },
335
+ ],
320
336
  };
321
337
  }
322
338
  // OpenAI models (GPT-4, GPT-4o, GPT-3.5)
323
- if (modelLower.includes("gpt-")) {
339
+ if (modelLower.includes('gpt-')) {
324
340
  return {
325
- _option_id: "azure-foundry-openai",
341
+ _option_id: 'azure-foundry-openai',
326
342
  options: [
327
343
  {
328
344
  name: SharedOptions.max_tokens,
@@ -331,7 +347,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
331
347
  max: max_tokens_limit,
332
348
  integer: true,
333
349
  step: 200,
334
- description: "The maximum number of tokens to generate"
350
+ description: 'The maximum number of tokens to generate',
335
351
  },
336
352
  {
337
353
  name: SharedOptions.temperature,
@@ -340,7 +356,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
340
356
  max: 2.0,
341
357
  default: 0.7,
342
358
  step: 0.1,
343
- description: "Controls randomness in the output"
359
+ description: 'Controls randomness in the output',
344
360
  },
345
361
  {
346
362
  name: SharedOptions.top_p,
@@ -348,7 +364,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
348
364
  min: 0,
349
365
  max: 1,
350
366
  step: 0.1,
351
- description: "Nucleus sampling parameter"
367
+ description: 'Nucleus sampling parameter',
352
368
  },
353
369
  {
354
370
  name: SharedOptions.presence_penalty,
@@ -356,7 +372,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
356
372
  min: -2.0,
357
373
  max: 2.0,
358
374
  step: 0.1,
359
- description: "Penalize new tokens based on their presence in the text"
375
+ description: 'Penalize new tokens based on their presence in the text',
360
376
  },
361
377
  {
362
378
  name: SharedOptions.frequency_penalty,
@@ -364,16 +380,16 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
364
380
  min: -2.0,
365
381
  max: 2.0,
366
382
  step: 0.1,
367
- description: "Penalize new tokens based on their frequency in the text"
383
+ description: 'Penalize new tokens based on their frequency in the text',
368
384
  },
369
385
  {
370
386
  name: SharedOptions.stop_sequence,
371
387
  type: OptionType.string_list,
372
388
  value: [],
373
- description: "Sequences where the model will stop generating"
389
+ description: 'Sequences where the model will stop generating',
374
390
  },
375
- ...visionOptions
376
- ]
391
+ ...visionOptions,
392
+ ],
377
393
  };
378
394
  }
379
395
  // General text models (Claude, Llama, Mistral, Phi, etc.)
@@ -385,7 +401,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
385
401
  max: max_tokens_limit,
386
402
  integer: true,
387
403
  step: 200,
388
- description: "The maximum number of tokens to generate"
404
+ description: 'The maximum number of tokens to generate',
389
405
  },
390
406
  {
391
407
  name: SharedOptions.temperature,
@@ -394,7 +410,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
394
410
  max: 2.0,
395
411
  default: 0.7,
396
412
  step: 0.1,
397
- description: "Controls randomness in the output"
413
+ description: 'Controls randomness in the output',
398
414
  },
399
415
  {
400
416
  name: SharedOptions.top_p,
@@ -402,31 +418,31 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
402
418
  min: 0,
403
419
  max: 1,
404
420
  step: 0.1,
405
- description: "Nucleus sampling parameter"
421
+ description: 'Nucleus sampling parameter',
406
422
  },
407
423
  {
408
424
  name: SharedOptions.stop_sequence,
409
425
  type: OptionType.string_list,
410
426
  value: [],
411
- description: "Sequences where the model will stop generating"
412
- }
427
+ description: 'Sequences where the model will stop generating',
428
+ },
413
429
  ];
414
430
  // Add model-specific options
415
431
  const additionalOptions: ModelOptionInfoItem[] = [];
416
432
  // Add top_k for certain models
417
- if (modelLower.includes("claude") || modelLower.includes("mistral") || modelLower.includes("phi")) {
433
+ if (modelLower.includes('claude') || modelLower.includes('mistral') || modelLower.includes('phi')) {
418
434
  additionalOptions.push({
419
435
  name: SharedOptions.top_k,
420
436
  type: OptionType.numeric,
421
437
  min: 1,
422
438
  integer: true,
423
439
  step: 1,
424
- description: "Limits token sampling to the top k tokens"
440
+ description: 'Limits token sampling to the top k tokens',
425
441
  });
426
442
  }
427
443
 
428
444
  // Add penalty options for certain models
429
- if (modelLower.includes("claude") || modelLower.includes("jamba") || modelLower.includes("cohere")) {
445
+ if (modelLower.includes('claude') || modelLower.includes('jamba') || modelLower.includes('cohere')) {
430
446
  additionalOptions.push(
431
447
  {
432
448
  name: SharedOptions.presence_penalty,
@@ -434,7 +450,7 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
434
450
  min: -2.0,
435
451
  max: 2.0,
436
452
  step: 0.1,
437
- description: "Penalize new tokens based on their presence in the text"
453
+ description: 'Penalize new tokens based on their presence in the text',
438
454
  },
439
455
  {
440
456
  name: SharedOptions.frequency_penalty,
@@ -442,42 +458,40 @@ export function getAzureFoundryOptions(model: string, _option?: ModelOptions): M
442
458
  min: -2.0,
443
459
  max: 2.0,
444
460
  step: 0.1,
445
- description: "Penalize new tokens based on their frequency in the text"
446
- }
461
+ description: 'Penalize new tokens based on their frequency in the text',
462
+ },
447
463
  );
448
464
  }
449
465
  // Add seed option for certain models
450
- if (modelLower.includes("mistral") || modelLower.includes("phi") || modelLower.includes("gemini")) {
466
+ if (modelLower.includes('mistral') || modelLower.includes('phi') || modelLower.includes('gemini')) {
451
467
  additionalOptions.push({
452
468
  name: SharedOptions.seed,
453
469
  type: OptionType.numeric,
454
470
  integer: true,
455
- description: "Random seed for reproducible generation"
471
+ description: 'Random seed for reproducible generation',
456
472
  });
457
473
  }
458
474
  return {
459
- _option_id: "azure-foundry-text",
460
- options: [
461
- ...baseOptions,
462
- ...additionalOptions,
463
- ...visionOptions
464
- ]
475
+ _option_id: 'azure-foundry-text',
476
+ options: [...baseOptions, ...additionalOptions, ...visionOptions],
465
477
  };
466
478
  }
467
479
 
468
480
  function isVisionModel(modelLower: string): boolean {
469
- return modelLower.includes("gpt-4o") ||
470
- modelLower.includes("gpt-4-turbo") ||
471
- modelLower.includes("claude-3") ||
472
- modelLower.includes("llama-3.2") ||
473
- modelLower.includes("llama-4") ||
474
- modelLower.includes("gemini") ||
475
- isO1Full(modelLower);
481
+ return (
482
+ modelLower.includes('gpt-4o') ||
483
+ modelLower.includes('gpt-4-turbo') ||
484
+ modelLower.includes('claude-3') ||
485
+ modelLower.includes('llama-3.2') ||
486
+ modelLower.includes('llama-4') ||
487
+ modelLower.includes('gemini') ||
488
+ isO1Full(modelLower)
489
+ );
476
490
  }
477
491
 
478
492
  function isO1Full(modelLower: string): boolean {
479
- if (modelLower.includes("o1")) {
480
- return !modelLower.includes("mini") && !modelLower.includes("preview");
493
+ if (modelLower.includes('o1')) {
494
+ return !modelLower.includes('mini') && !modelLower.includes('preview');
481
495
  }
482
496
  return false;
483
- }
497
+ }