@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.
- package/lib/capability/anthropic.d.ts +3 -0
- package/lib/capability/anthropic.d.ts.map +1 -0
- package/lib/capability/anthropic.js +92 -0
- package/lib/capability/anthropic.js.map +1 -0
- package/lib/{types/capability → capability}/azure_foundry.d.ts +1 -1
- package/lib/capability/azure_foundry.d.ts.map +1 -0
- package/lib/capability/azure_foundry.js +394 -0
- package/lib/capability/azure_foundry.js.map +1 -0
- package/lib/{types/capability → capability}/bedrock.d.ts +1 -1
- package/lib/capability/bedrock.d.ts.map +1 -0
- package/lib/capability/bedrock.js +300 -0
- package/lib/capability/bedrock.js.map +1 -0
- package/lib/{types/capability → capability}/openai.d.ts +1 -1
- package/lib/capability/openai.d.ts.map +1 -0
- package/lib/capability/openai.js +179 -0
- package/lib/capability/openai.js.map +1 -0
- package/lib/{types/capability → capability}/vertexai.d.ts +1 -1
- package/lib/capability/vertexai.d.ts.map +1 -0
- package/lib/capability/vertexai.js +137 -0
- package/lib/capability/vertexai.js.map +1 -0
- package/lib/{types/capability.d.ts → capability.d.ts} +1 -1
- package/lib/capability.d.ts.map +1 -0
- package/lib/{esm/capability.js → capability.js} +21 -15
- package/lib/capability.js.map +1 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/lib/options/anthropic.d.ts +16 -0
- package/lib/options/anthropic.d.ts.map +1 -0
- package/lib/options/anthropic.js +34 -0
- package/lib/options/anthropic.js.map +1 -0
- package/lib/{types/options → options}/azure_foundry.d.ts +14 -14
- package/lib/options/azure_foundry.d.ts.map +1 -0
- package/lib/{esm/options → options}/azure_foundry.js +126 -126
- package/lib/options/azure_foundry.js.map +1 -0
- package/lib/options/bedrock.d.ts +61 -0
- package/lib/options/bedrock.d.ts.map +1 -0
- package/lib/options/bedrock.js +489 -0
- package/lib/options/bedrock.js.map +1 -0
- package/lib/options/context-windows.d.ts.map +1 -0
- package/lib/options/context-windows.js.map +1 -0
- package/lib/options/embedding.d.ts +38 -0
- package/lib/options/embedding.d.ts.map +1 -0
- package/lib/options/embedding.js +77 -0
- package/lib/options/embedding.js.map +1 -0
- package/lib/{types/options → options}/fallback.d.ts +2 -2
- package/lib/options/fallback.d.ts.map +1 -0
- package/lib/options/fallback.js +65 -0
- package/lib/options/fallback.js.map +1 -0
- package/lib/{types/options → options}/groq.d.ts +2 -2
- package/lib/options/groq.d.ts.map +1 -0
- package/lib/options/groq.js +54 -0
- package/lib/options/groq.js.map +1 -0
- package/lib/options/openai.d.ts +40 -0
- package/lib/options/openai.d.ts.map +1 -0
- package/lib/options/openai.js +284 -0
- package/lib/options/openai.js.map +1 -0
- package/lib/{types/options → options}/shared-parsing.d.ts +1 -1
- package/lib/options/shared-parsing.d.ts.map +1 -0
- package/lib/{esm/options → options}/shared-parsing.js +14 -17
- package/lib/options/shared-parsing.js.map +1 -0
- package/lib/options/version-parsing.d.ts.map +1 -0
- package/lib/{esm/options → options}/version-parsing.js +15 -15
- package/lib/options/version-parsing.js.map +1 -0
- package/lib/{types/options → options}/vertexai.d.ts +18 -15
- package/lib/options/vertexai.d.ts.map +1 -0
- package/lib/options/vertexai.js +606 -0
- package/lib/options/vertexai.js.map +1 -0
- package/lib/{types/options.d.ts → options.d.ts} +1 -1
- package/lib/options.d.ts.map +1 -0
- package/lib/{esm/options.js → options.js} +10 -7
- package/lib/options.js.map +1 -0
- package/lib/{types/types.d.ts → types.d.ts} +161 -42
- package/lib/types.d.ts.map +1 -0
- package/lib/{esm/types.js → types.js} +28 -22
- package/lib/types.js.map +1 -0
- package/package.json +12 -34
- package/src/LlumiverseError.test.ts +18 -72
- package/src/capability/anthropic.ts +99 -0
- package/src/capability/azure_foundry.ts +303 -65
- package/src/capability/bedrock.ts +201 -56
- package/src/capability/openai.ts +135 -41
- package/src/capability/vertexai.ts +105 -35
- package/src/capability.ts +21 -16
- package/src/index.ts +13 -11
- package/src/options/anthropic.ts +59 -0
- package/src/options/azure_foundry.ts +157 -143
- package/src/options/bedrock.ts +266 -187
- package/src/options/context-windows.ts +2 -2
- package/src/options/embedding.ts +92 -0
- package/src/options/fallback.ts +50 -17
- package/src/options/groq.ts +48 -21
- package/src/options/openai.ts +231 -183
- package/src/options/shared-parsing.ts +16 -21
- package/src/options/version-parsing.ts +17 -17
- package/src/options/vertexai.ts +385 -288
- package/src/options.ts +11 -8
- package/src/types.ts +284 -160
- package/lib/cjs/capability/azure_foundry.js +0 -160
- package/lib/cjs/capability/azure_foundry.js.map +0 -1
- package/lib/cjs/capability/bedrock.js +0 -158
- package/lib/cjs/capability/bedrock.js.map +0 -1
- package/lib/cjs/capability/openai.js +0 -98
- package/lib/cjs/capability/openai.js.map +0 -1
- package/lib/cjs/capability/vertexai.js +0 -80
- package/lib/cjs/capability/vertexai.js.map +0 -1
- package/lib/cjs/capability.js +0 -109
- package/lib/cjs/capability.js.map +0 -1
- package/lib/cjs/index.js +0 -27
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/options/azure_foundry.js +0 -423
- package/lib/cjs/options/azure_foundry.js.map +0 -1
- package/lib/cjs/options/bedrock.js +0 -427
- package/lib/cjs/options/bedrock.js.map +0 -1
- package/lib/cjs/options/context-windows.js +0 -138
- package/lib/cjs/options/context-windows.js.map +0 -1
- package/lib/cjs/options/fallback.js +0 -35
- package/lib/cjs/options/fallback.js.map +0 -1
- package/lib/cjs/options/groq.js +0 -37
- package/lib/cjs/options/groq.js.map +0 -1
- package/lib/cjs/options/openai.js +0 -246
- package/lib/cjs/options/openai.js.map +0 -1
- package/lib/cjs/options/shared-parsing.js +0 -144
- package/lib/cjs/options/shared-parsing.js.map +0 -1
- package/lib/cjs/options/version-parsing.js +0 -326
- package/lib/cjs/options/version-parsing.js.map +0 -1
- package/lib/cjs/options/vertexai.js +0 -525
- package/lib/cjs/options/vertexai.js.map +0 -1
- package/lib/cjs/options.js +0 -30
- package/lib/cjs/options.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/types.js +0 -299
- package/lib/cjs/types.js.map +0 -1
- package/lib/esm/capability/azure_foundry.js +0 -157
- package/lib/esm/capability/azure_foundry.js.map +0 -1
- package/lib/esm/capability/bedrock.js +0 -155
- package/lib/esm/capability/bedrock.js.map +0 -1
- package/lib/esm/capability/openai.js +0 -95
- package/lib/esm/capability/openai.js.map +0 -1
- package/lib/esm/capability/vertexai.js +0 -77
- package/lib/esm/capability/vertexai.js.map +0 -1
- package/lib/esm/capability.js.map +0 -1
- package/lib/esm/index.js +0 -11
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/options/azure_foundry.js.map +0 -1
- package/lib/esm/options/bedrock.js +0 -423
- package/lib/esm/options/bedrock.js.map +0 -1
- package/lib/esm/options/context-windows.js.map +0 -1
- package/lib/esm/options/fallback.js +0 -32
- package/lib/esm/options/fallback.js.map +0 -1
- package/lib/esm/options/groq.js +0 -34
- package/lib/esm/options/groq.js.map +0 -1
- package/lib/esm/options/openai.js +0 -243
- package/lib/esm/options/openai.js.map +0 -1
- package/lib/esm/options/shared-parsing.js.map +0 -1
- package/lib/esm/options/version-parsing.js.map +0 -1
- package/lib/esm/options/vertexai.js +0 -519
- package/lib/esm/options/vertexai.js.map +0 -1
- package/lib/esm/options.js.map +0 -1
- package/lib/esm/types.js.map +0 -1
- package/lib/types/capability/azure_foundry.d.ts.map +0 -1
- package/lib/types/capability/bedrock.d.ts.map +0 -1
- package/lib/types/capability/openai.d.ts.map +0 -1
- package/lib/types/capability/vertexai.d.ts.map +0 -1
- package/lib/types/capability.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -11
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/options/azure_foundry.d.ts.map +0 -1
- package/lib/types/options/bedrock.d.ts +0 -54
- package/lib/types/options/bedrock.d.ts.map +0 -1
- package/lib/types/options/context-windows.d.ts.map +0 -1
- package/lib/types/options/fallback.d.ts.map +0 -1
- package/lib/types/options/groq.d.ts.map +0 -1
- package/lib/types/options/openai.d.ts +0 -37
- package/lib/types/options/openai.d.ts.map +0 -1
- package/lib/types/options/shared-parsing.d.ts.map +0 -1
- package/lib/types/options/version-parsing.d.ts.map +0 -1
- package/lib/types/options/vertexai.d.ts.map +0 -1
- package/lib/types/options.d.ts.map +0 -1
- package/lib/types/types.d.ts.map +0 -1
- /package/lib/{types/options → options}/context-windows.d.ts +0 -0
- /package/lib/{esm/options → options}/context-windows.js +0 -0
- /package/lib/{types/options → options}/version-parsing.d.ts +0 -0
|
@@ -1,96 +1,330 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ModelCapabilities, ModelModalities } from '../types.js';
|
|
2
2
|
|
|
3
3
|
// Global feature flags - temporarily disable tool support for non-OpenAI models
|
|
4
4
|
const ENABLE_TOOL_SUPPORT_NON_OPENAI = false;
|
|
5
5
|
|
|
6
|
-
// Record of Azure Foundry model capabilities keyed by model ID (lowercased)
|
|
6
|
+
// Record of Azure Foundry model capabilities keyed by model ID (lowercased)
|
|
7
7
|
// Only include models with specific exceptions that differ from their family patterns
|
|
8
8
|
const RECORD_MODEL_CAPABILITIES: Record<string, ModelCapabilities> = {
|
|
9
9
|
// OpenAI O-series exceptions - o1-mini doesn't have tool support like other o1 models
|
|
10
|
-
|
|
10
|
+
'o1-mini': {
|
|
11
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
12
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
13
|
+
tool_support: false,
|
|
14
|
+
tool_support_streaming: false,
|
|
15
|
+
},
|
|
11
16
|
// OpenAI o3 is text-only unlike other o-series models
|
|
12
|
-
|
|
17
|
+
o3: {
|
|
18
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
19
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
20
|
+
tool_support: true,
|
|
21
|
+
tool_support_streaming: false,
|
|
22
|
+
},
|
|
13
23
|
|
|
14
24
|
// Models with special properties not covered by family patterns
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
'deepseek-r1-0528': {
|
|
26
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
27
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
28
|
+
tool_support: false,
|
|
29
|
+
tool_support_streaming: false,
|
|
30
|
+
},
|
|
31
|
+
'deepseek-v3-0324': {
|
|
32
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
33
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
34
|
+
tool_support: false,
|
|
35
|
+
tool_support_streaming: false,
|
|
36
|
+
},
|
|
37
|
+
'mistral-medium-2505': {
|
|
38
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
39
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
40
|
+
tool_support: false,
|
|
41
|
+
tool_support_streaming: false,
|
|
42
|
+
},
|
|
43
|
+
'mistral-nemo': {
|
|
44
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
45
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
46
|
+
tool_support: false,
|
|
47
|
+
tool_support_streaming: false,
|
|
48
|
+
},
|
|
49
|
+
'llama-4-scout-17b-16e-instruct': {
|
|
50
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
51
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
52
|
+
tool_support: false,
|
|
53
|
+
tool_support_streaming: false,
|
|
54
|
+
},
|
|
20
55
|
};
|
|
21
56
|
|
|
22
57
|
// Populate RECORD_FAMILY_CAPABILITIES as a const record (lowest common denominator for each family)
|
|
23
58
|
const RECORD_FAMILY_CAPABILITIES: Record<string, ModelCapabilities> = {
|
|
24
59
|
// OpenAI GPT families
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
60
|
+
'gpt-3.5-turbo': {
|
|
61
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
62
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
63
|
+
tool_support: false,
|
|
64
|
+
tool_support_streaming: false,
|
|
65
|
+
},
|
|
66
|
+
'gpt-35-turbo': {
|
|
67
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
68
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
69
|
+
tool_support: false,
|
|
70
|
+
tool_support_streaming: false,
|
|
71
|
+
},
|
|
72
|
+
'gpt-35': {
|
|
73
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
74
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
75
|
+
tool_support: false,
|
|
76
|
+
tool_support_streaming: false,
|
|
77
|
+
},
|
|
78
|
+
'gpt-4': {
|
|
79
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
80
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
81
|
+
tool_support: true,
|
|
82
|
+
tool_support_streaming: true,
|
|
83
|
+
},
|
|
84
|
+
'gpt-4.1': {
|
|
85
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
86
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
87
|
+
tool_support: true,
|
|
88
|
+
tool_support_streaming: true,
|
|
89
|
+
},
|
|
90
|
+
'gpt-4.5': {
|
|
91
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
92
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
93
|
+
tool_support: true,
|
|
94
|
+
tool_support_streaming: true,
|
|
95
|
+
},
|
|
96
|
+
'gpt-4o': {
|
|
97
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
98
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
99
|
+
tool_support: true,
|
|
100
|
+
tool_support_streaming: true,
|
|
101
|
+
},
|
|
102
|
+
gpt: {
|
|
103
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
104
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
105
|
+
tool_support: true,
|
|
106
|
+
tool_support_streaming: true,
|
|
107
|
+
},
|
|
33
108
|
|
|
34
109
|
// OpenAI O-series families
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
110
|
+
o1: {
|
|
111
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
112
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
113
|
+
tool_support: true,
|
|
114
|
+
tool_support_streaming: false,
|
|
115
|
+
},
|
|
116
|
+
'o1-preview': {
|
|
117
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
118
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
119
|
+
tool_support: true,
|
|
120
|
+
tool_support_streaming: false,
|
|
121
|
+
},
|
|
122
|
+
'o1-pro': {
|
|
123
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
124
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
125
|
+
tool_support: true,
|
|
126
|
+
tool_support_streaming: false,
|
|
127
|
+
},
|
|
128
|
+
'o3-mini': {
|
|
129
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
130
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
131
|
+
tool_support: true,
|
|
132
|
+
tool_support_streaming: false,
|
|
133
|
+
},
|
|
134
|
+
'o4-mini': {
|
|
135
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
136
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
137
|
+
tool_support: true,
|
|
138
|
+
tool_support_streaming: false,
|
|
139
|
+
},
|
|
140
|
+
o4: {
|
|
141
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
142
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
143
|
+
tool_support: true,
|
|
144
|
+
tool_support_streaming: false,
|
|
145
|
+
},
|
|
146
|
+
o: {
|
|
147
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
148
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
149
|
+
tool_support: true,
|
|
150
|
+
tool_support_streaming: false,
|
|
151
|
+
},
|
|
42
152
|
|
|
43
153
|
// Llama families
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
154
|
+
'llama-3.1': {
|
|
155
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
156
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
157
|
+
tool_support: true,
|
|
158
|
+
tool_support_streaming: false,
|
|
159
|
+
},
|
|
160
|
+
'llama-3.2': {
|
|
161
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
162
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
163
|
+
tool_support: false,
|
|
164
|
+
tool_support_streaming: false,
|
|
165
|
+
},
|
|
166
|
+
'llama-3.3': {
|
|
167
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
168
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
169
|
+
tool_support: true,
|
|
170
|
+
tool_support_streaming: false,
|
|
171
|
+
},
|
|
172
|
+
'llama-3': {
|
|
173
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
174
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
175
|
+
tool_support: true,
|
|
176
|
+
tool_support_streaming: false,
|
|
177
|
+
},
|
|
178
|
+
'llama-4': {
|
|
179
|
+
input: { text: true, image: true, video: false, audio: false, embed: false },
|
|
180
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
181
|
+
tool_support: false,
|
|
182
|
+
tool_support_streaming: false,
|
|
183
|
+
},
|
|
184
|
+
llama: {
|
|
185
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
186
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
187
|
+
tool_support: false,
|
|
188
|
+
tool_support_streaming: false,
|
|
189
|
+
},
|
|
50
190
|
|
|
51
191
|
// Mistral families
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
192
|
+
'mistral-large': {
|
|
193
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
194
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
195
|
+
tool_support: true,
|
|
196
|
+
tool_support_streaming: false,
|
|
197
|
+
},
|
|
198
|
+
'mistral-small': {
|
|
199
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
200
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
201
|
+
tool_support: true,
|
|
202
|
+
tool_support_streaming: false,
|
|
203
|
+
},
|
|
204
|
+
mistral: {
|
|
205
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
206
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
207
|
+
tool_support: false,
|
|
208
|
+
tool_support_streaming: false,
|
|
209
|
+
},
|
|
55
210
|
|
|
56
211
|
// Microsoft Phi families
|
|
57
|
-
|
|
58
|
-
|
|
212
|
+
'phi-4': {
|
|
213
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
214
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
215
|
+
tool_support: false,
|
|
216
|
+
tool_support_streaming: false,
|
|
217
|
+
},
|
|
218
|
+
phi: {
|
|
219
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
220
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
221
|
+
tool_support: false,
|
|
222
|
+
tool_support_streaming: false,
|
|
223
|
+
},
|
|
59
224
|
|
|
60
225
|
// DeepSeek families
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
226
|
+
'deepseek-r1': {
|
|
227
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
228
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
229
|
+
tool_support: false,
|
|
230
|
+
tool_support_streaming: false,
|
|
231
|
+
},
|
|
232
|
+
'deepseek-v3': {
|
|
233
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
234
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
235
|
+
tool_support: true,
|
|
236
|
+
tool_support_streaming: false,
|
|
237
|
+
},
|
|
238
|
+
deepseek: {
|
|
239
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
240
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
241
|
+
tool_support: false,
|
|
242
|
+
tool_support_streaming: false,
|
|
243
|
+
},
|
|
64
244
|
|
|
65
245
|
// AI21 families
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
246
|
+
'ai21-jamba': {
|
|
247
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
248
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
249
|
+
tool_support: true,
|
|
250
|
+
tool_support_streaming: true,
|
|
251
|
+
},
|
|
252
|
+
ai21: {
|
|
253
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
254
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
255
|
+
tool_support: true,
|
|
256
|
+
tool_support_streaming: true,
|
|
257
|
+
},
|
|
258
|
+
jamba: {
|
|
259
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
260
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
261
|
+
tool_support: true,
|
|
262
|
+
tool_support_streaming: true,
|
|
263
|
+
},
|
|
69
264
|
|
|
70
265
|
// Cohere families
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
266
|
+
'cohere-command': {
|
|
267
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
268
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
269
|
+
tool_support: true,
|
|
270
|
+
tool_support_streaming: true,
|
|
271
|
+
},
|
|
272
|
+
cohere: {
|
|
273
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
274
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
275
|
+
tool_support: true,
|
|
276
|
+
tool_support_streaming: true,
|
|
277
|
+
},
|
|
278
|
+
command: {
|
|
279
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
280
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
281
|
+
tool_support: true,
|
|
282
|
+
tool_support_streaming: true,
|
|
283
|
+
},
|
|
74
284
|
|
|
75
285
|
// xAI families
|
|
76
|
-
|
|
77
|
-
|
|
286
|
+
'grok-3': {
|
|
287
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
288
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
289
|
+
tool_support: true,
|
|
290
|
+
tool_support_streaming: true,
|
|
291
|
+
},
|
|
292
|
+
grok: {
|
|
293
|
+
input: { text: true, image: false, video: false, audio: false, embed: false },
|
|
294
|
+
output: { text: true, image: false, video: false, audio: false, embed: false },
|
|
295
|
+
tool_support: true,
|
|
296
|
+
tool_support_streaming: true,
|
|
297
|
+
},
|
|
78
298
|
};
|
|
79
299
|
|
|
80
300
|
// Fallback pattern lists for inferring modalities and tool support
|
|
81
|
-
const IMAGE_INPUT_MODELS = [
|
|
82
|
-
const VIDEO_INPUT_MODELS = [
|
|
83
|
-
const AUDIO_INPUT_MODELS = [
|
|
84
|
-
const TEXT_INPUT_MODELS = [
|
|
85
|
-
const IMAGE_OUTPUT_MODELS = [
|
|
86
|
-
const VIDEO_OUTPUT_MODELS = [
|
|
87
|
-
const AUDIO_OUTPUT_MODELS = [
|
|
88
|
-
const TEXT_OUTPUT_MODELS = [
|
|
89
|
-
const EMBEDDING_OUTPUT_MODELS = [
|
|
90
|
-
const TOOL_SUPPORT_MODELS = [
|
|
301
|
+
const IMAGE_INPUT_MODELS = ['image', 'vision'];
|
|
302
|
+
const VIDEO_INPUT_MODELS = ['video'];
|
|
303
|
+
const AUDIO_INPUT_MODELS = ['audio'];
|
|
304
|
+
const TEXT_INPUT_MODELS = ['text'];
|
|
305
|
+
const IMAGE_OUTPUT_MODELS = ['image'];
|
|
306
|
+
const VIDEO_OUTPUT_MODELS = ['video'];
|
|
307
|
+
const AUDIO_OUTPUT_MODELS = ['audio'];
|
|
308
|
+
const TEXT_OUTPUT_MODELS = ['text'];
|
|
309
|
+
const EMBEDDING_OUTPUT_MODELS = ['embed'];
|
|
310
|
+
const TOOL_SUPPORT_MODELS = [
|
|
311
|
+
'tool',
|
|
312
|
+
'gpt-4',
|
|
313
|
+
'gpt-4o',
|
|
314
|
+
'o1',
|
|
315
|
+
'o3',
|
|
316
|
+
'o4',
|
|
317
|
+
'llama-3',
|
|
318
|
+
'mistral-large',
|
|
319
|
+
'mistral-small',
|
|
320
|
+
'jamba',
|
|
321
|
+
'cohere',
|
|
322
|
+
'command',
|
|
323
|
+
'grok',
|
|
324
|
+
];
|
|
91
325
|
|
|
92
326
|
function modelMatches(modelName: string, patterns: string[]): boolean {
|
|
93
|
-
return patterns.some(pattern => modelName.includes(pattern));
|
|
327
|
+
return patterns.some((pattern) => modelName.includes(pattern));
|
|
94
328
|
}
|
|
95
329
|
|
|
96
330
|
/**
|
|
@@ -109,7 +343,7 @@ export function getModelCapabilitiesAzureFoundry(model: string): ModelCapabiliti
|
|
|
109
343
|
}
|
|
110
344
|
|
|
111
345
|
// 2. Fallback: find the longest matching family prefix in RECORD_FAMILY_CAPABILITIES
|
|
112
|
-
let bestFamilyKey
|
|
346
|
+
let bestFamilyKey: string | undefined;
|
|
113
347
|
let bestFamilyLength = 0;
|
|
114
348
|
for (const key of Object.keys(RECORD_FAMILY_CAPABILITIES)) {
|
|
115
349
|
if (normalized.startsWith(key) && key.length > bestFamilyLength) {
|
|
@@ -127,14 +361,14 @@ export function getModelCapabilitiesAzureFoundry(model: string): ModelCapabiliti
|
|
|
127
361
|
image: modelMatches(normalized, IMAGE_INPUT_MODELS) || undefined,
|
|
128
362
|
video: modelMatches(normalized, VIDEO_INPUT_MODELS) || undefined,
|
|
129
363
|
audio: modelMatches(normalized, AUDIO_INPUT_MODELS) || undefined,
|
|
130
|
-
embed: false
|
|
364
|
+
embed: false,
|
|
131
365
|
};
|
|
132
366
|
const output: ModelModalities = {
|
|
133
367
|
text: modelMatches(normalized, TEXT_OUTPUT_MODELS) || true, // Default to text output
|
|
134
368
|
image: modelMatches(normalized, IMAGE_OUTPUT_MODELS) || undefined,
|
|
135
369
|
video: modelMatches(normalized, VIDEO_OUTPUT_MODELS) || undefined,
|
|
136
370
|
audio: modelMatches(normalized, AUDIO_OUTPUT_MODELS) || undefined,
|
|
137
|
-
embed: modelMatches(normalized, EMBEDDING_OUTPUT_MODELS) || undefined
|
|
371
|
+
embed: modelMatches(normalized, EMBEDDING_OUTPUT_MODELS) || undefined,
|
|
138
372
|
};
|
|
139
373
|
const tool_support = modelMatches(normalized, TOOL_SUPPORT_MODELS) || undefined;
|
|
140
374
|
const tool_support_streaming = tool_support || undefined;
|
|
@@ -149,14 +383,18 @@ export function getModelCapabilitiesAzureFoundry(model: string): ModelCapabiliti
|
|
|
149
383
|
*/
|
|
150
384
|
function applyGlobalToolSupportDisable(capabilities: ModelCapabilities, modelName: string): ModelCapabilities {
|
|
151
385
|
// Check if this is an OpenAI model
|
|
152
|
-
const isOpenAIModel =
|
|
386
|
+
const isOpenAIModel =
|
|
387
|
+
modelName.startsWith('gpt-') ||
|
|
388
|
+
modelName.startsWith('o1') ||
|
|
389
|
+
modelName.startsWith('o3') ||
|
|
390
|
+
modelName.startsWith('o4');
|
|
153
391
|
|
|
154
392
|
if (!ENABLE_TOOL_SUPPORT_NON_OPENAI && !isOpenAIModel) {
|
|
155
393
|
// Disable tool support for non-OpenAI models while preserving other capabilities
|
|
156
394
|
return {
|
|
157
395
|
...capabilities,
|
|
158
396
|
tool_support: false,
|
|
159
|
-
tool_support_streaming: false
|
|
397
|
+
tool_support_streaming: false,
|
|
160
398
|
};
|
|
161
399
|
}
|
|
162
400
|
|
|
@@ -169,13 +407,13 @@ function parseAzureFoundryModelId(compositeId: string): { deploymentName: string
|
|
|
169
407
|
if (parts.length === 2) {
|
|
170
408
|
return {
|
|
171
409
|
deploymentName: parts[0],
|
|
172
|
-
baseModel: parts[1]
|
|
410
|
+
baseModel: parts[1],
|
|
173
411
|
};
|
|
174
412
|
}
|
|
175
413
|
|
|
176
414
|
// Backwards compatibility: if no delimiter found, treat as deployment name
|
|
177
415
|
return {
|
|
178
416
|
deploymentName: compositeId,
|
|
179
|
-
baseModel: compositeId
|
|
417
|
+
baseModel: compositeId,
|
|
180
418
|
};
|
|
181
|
-
}
|
|
419
|
+
}
|