@uipath/apollo-react 6.16.4 → 6.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/StageNode/tasks/AdhocTask.cjs +1 -1
- package/dist/canvas/components/StageNode/tasks/AdhocTask.js +1 -1
- package/dist/canvas/components/StageNode/tasks/DraggableTask.cjs +1 -1
- package/dist/canvas/components/StageNode/tasks/DraggableTask.js +1 -1
- package/dist/canvas/components/StageNode/tasks/EventDrivenTask.cjs +1 -1
- package/dist/canvas/components/StageNode/tasks/EventDrivenTask.js +1 -1
- package/dist/material/components/ap-model-picker/ModelPicker.cjs +45 -12
- package/dist/material/components/ap-model-picker/ModelPicker.d.ts +1 -0
- package/dist/material/components/ap-model-picker/ModelPicker.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/ModelPicker.js +46 -13
- package/dist/material/components/ap-model-picker/index.cjs +27 -11
- package/dist/material/components/ap-model-picker/index.d.ts +4 -3
- package/dist/material/components/ap-model-picker/index.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/index.js +4 -3
- package/dist/material/components/ap-model-picker/loadMessages.cjs +79 -0
- package/dist/material/components/ap-model-picker/loadMessages.d.ts +23 -0
- package/dist/material/components/ap-model-picker/loadMessages.d.ts.map +1 -0
- package/dist/material/components/ap-model-picker/loadMessages.js +39 -0
- package/dist/material/components/ap-model-picker/types.d.ts +2 -0
- package/dist/material/components/ap-model-picker/types.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/useModelPickerState.cjs +6 -3
- package/dist/material/components/ap-model-picker/useModelPickerState.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/useModelPickerState.js +6 -3
- package/dist/material/components/ap-model-picker/usePlatformAccess.cjs +48 -11
- package/dist/material/components/ap-model-picker/usePlatformAccess.d.ts +6 -2
- package/dist/material/components/ap-model-picker/usePlatformAccess.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/usePlatformAccess.js +46 -12
- package/dist/material/components/ap-model-picker/utils.cjs +58 -9
- package/dist/material/components/ap-model-picker/utils.d.ts +2 -0
- package/dist/material/components/ap-model-picker/utils.d.ts.map +1 -1
- package/dist/material/components/ap-model-picker/utils.js +51 -8
- package/dist/material/theme/overrides/MuiIconButton.cjs +12 -2
- package/dist/material/theme/overrides/MuiIconButton.d.ts.map +1 -1
- package/dist/material/theme/overrides/MuiIconButton.js +12 -2
- package/dist/material/theme/overrides/MuiSwitch.cjs +13 -44
- package/dist/material/theme/overrides/MuiSwitch.d.ts.map +1 -1
- package/dist/material/theme/overrides/MuiSwitch.js +13 -34
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type ModelVendor = 'OpenAi' | 'AzureOpenAi' | 'AnthropicClaude' | 'AwsBedrock' | 'VertexAi' | 'Custom' | string;
|
|
2
2
|
export type ModelSubscriptionType = 'UiPathOwned' | 'BYOMReplacedLikeForLike' | 'BYOMReplacedAlternative' | 'BYOMAdded' | string;
|
|
3
3
|
export type ModelGeography = 'EU' | 'CA' | 'US' | 'SI' | 'JA' | 'AU' | 'IN' | 'UK' | 'CH' | 'UAE' | 'SK' | 'GLOBAL' | string;
|
|
4
|
+
export type ModelType = 'RequestResponse' | 'Realtime' | string;
|
|
4
5
|
export interface DeprecationDetails {
|
|
5
6
|
usageEndDate?: string;
|
|
6
7
|
replacedBy?: string;
|
|
@@ -53,6 +54,7 @@ export interface DiscoveryModel {
|
|
|
53
54
|
isRecommended?: boolean;
|
|
54
55
|
isBlockedByPolicy?: boolean;
|
|
55
56
|
isPreview?: boolean;
|
|
57
|
+
modelType?: ModelType;
|
|
56
58
|
deprecationDetails?: DeprecationDetails | null;
|
|
57
59
|
byomDetails?: ByomDetails | null;
|
|
58
60
|
modelDetails?: ModelDetails;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,W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CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IASlB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAS9C,aAAa,CAAC,EAAE,OAAO,CAAC;IAMxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,aAAa,GACb,iBAAiB,GACjB,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,MAAM,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,yBAAyB,GACzB,yBAAyB,GACzB,WAAW,GACX,MAAM,CAAC;AAEX,MAAM,MAAM,cAAc,GACtB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ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O,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAOD,MAAM,WAAW,uBAAuB;IAEtC,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,aAAa,CAAC,EAAE,MAAM,CAAC;IAKvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
|
|
@@ -72,10 +72,13 @@ function useModelPickerState(opts) {
|
|
|
72
72
|
}, [
|
|
73
73
|
annotated
|
|
74
74
|
]);
|
|
75
|
-
const
|
|
75
|
+
const matchesValue = (0, external_react_namespaceObject.useCallback)((m)=>m.modelId === value || m.modelName === value, [
|
|
76
|
+
value
|
|
77
|
+
]);
|
|
78
|
+
const selected = (0, external_react_namespaceObject.useMemo)(()=>annotated.find(matchesValue) ?? models.find(matchesValue) ?? null, [
|
|
76
79
|
annotated,
|
|
77
80
|
models,
|
|
78
|
-
|
|
81
|
+
matchesValue
|
|
79
82
|
]);
|
|
80
83
|
const unknownValue = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
81
84
|
if (!value) return null;
|
|
@@ -101,7 +104,7 @@ function useModelPickerState(opts) {
|
|
|
101
104
|
}, []);
|
|
102
105
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
103
106
|
if (open) {
|
|
104
|
-
const sel = filtered.findIndex(
|
|
107
|
+
const sel = filtered.findIndex(matchesValue);
|
|
105
108
|
setActiveIndex(sel >= 0 ? sel : 0);
|
|
106
109
|
requestAnimationFrame(()=>searchRef.current?.focus());
|
|
107
110
|
} else setQuery('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelPickerState.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/useModelPickerState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAgB,KAAK,aAAa,EAAe,MAAM,SAAS,CAAC;AAExE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAMtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAM3C,OAAO,CAAC,EAAE,aAAa,CAAC;IAMxB,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAMpC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC;IAO5C,wBAAwB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAM7C,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAM1C,aAAa,EAAE,cAAc,EAAE,CAAC;IAEhC,SAAS,EAAE,cAAc,EAAE,CAAC;IAE5B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAE3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAMpC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAErC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAUhC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpC,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAElD,MAAM,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAEpC,EAAE,EAAE,MAAM,CAAC;IAEX,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAEtD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CACrD;AAeD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,yBAAyB,
|
|
1
|
+
{"version":3,"file":"useModelPickerState.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/useModelPickerState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAgB,KAAK,aAAa,EAAe,MAAM,SAAS,CAAC;AAExE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,cAAc,EAAE,CAAC;IACz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AK,IAAI,CAAC;IAElD,MAAM,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAEpC,EAAE,EAAE,MAAM,CAAC;IAEX,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAEtD,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CACrD;AAeD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,yBAAyB,CAoL/F"}
|
|
@@ -44,10 +44,13 @@ function useModelPickerState(opts) {
|
|
|
44
44
|
}, [
|
|
45
45
|
annotated
|
|
46
46
|
]);
|
|
47
|
-
const
|
|
47
|
+
const matchesValue = useCallback((m)=>m.modelId === value || m.modelName === value, [
|
|
48
|
+
value
|
|
49
|
+
]);
|
|
50
|
+
const selected = useMemo(()=>annotated.find(matchesValue) ?? models.find(matchesValue) ?? null, [
|
|
48
51
|
annotated,
|
|
49
52
|
models,
|
|
50
|
-
|
|
53
|
+
matchesValue
|
|
51
54
|
]);
|
|
52
55
|
const unknownValue = useMemo(()=>{
|
|
53
56
|
if (!value) return null;
|
|
@@ -73,7 +76,7 @@ function useModelPickerState(opts) {
|
|
|
73
76
|
}, []);
|
|
74
77
|
useEffect(()=>{
|
|
75
78
|
if (open) {
|
|
76
|
-
const sel = filtered.findIndex(
|
|
79
|
+
const sel = filtered.findIndex(matchesValue);
|
|
77
80
|
setActiveIndex(sel >= 0 ? sel : 0);
|
|
78
81
|
requestAnimationFrame(()=>searchRef.current?.focus());
|
|
79
82
|
} else setQuery('');
|
|
@@ -26,6 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
buildLlmConfigurationsUrl: ()=>buildLlmConfigurationsUrl,
|
|
28
28
|
useUserFolders: ()=>useUserFolders,
|
|
29
|
+
useDeleteByoConfiguration: ()=>useDeleteByoConfiguration,
|
|
29
30
|
platformNavigation: ()=>platformNavigation,
|
|
30
31
|
usePlatformDiscoveryModels: ()=>usePlatformDiscoveryModels,
|
|
31
32
|
useByoConnectionNames: ()=>useByoConnectionNames,
|
|
@@ -34,6 +35,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34
35
|
const external_react_namespaceObject = require("react");
|
|
35
36
|
const external_useDiscoveryModels_cjs_namespaceObject = require("./useDiscoveryModels.cjs");
|
|
36
37
|
const resolveToken = async (token)=>'function' == typeof token ? token() : token;
|
|
38
|
+
const buildGatewayUrl = (ctx, path)=>{
|
|
39
|
+
const base = (ctx.baseUrl ?? '').replace(/\/$/, '');
|
|
40
|
+
if (ctx.organizationId && ctx.tenantId) {
|
|
41
|
+
let origin = '';
|
|
42
|
+
try {
|
|
43
|
+
origin = base ? new URL(base).origin : '';
|
|
44
|
+
} catch {
|
|
45
|
+
origin = '';
|
|
46
|
+
}
|
|
47
|
+
return `${origin}/${ctx.organizationId}/${ctx.tenantId}/llmgateway_/${path}`;
|
|
48
|
+
}
|
|
49
|
+
return `${base}/${ctx.tenantName}/llmgateway_/${path}`;
|
|
50
|
+
};
|
|
37
51
|
const FOLDERS_PAGE_SIZE = 100;
|
|
38
52
|
function useUserFolders(ctx) {
|
|
39
53
|
const [folders, setFolders] = (0, external_react_namespaceObject.useState)([]);
|
|
@@ -108,17 +122,7 @@ function usePlatformDiscoveryModels(ctx, folderKey) {
|
|
|
108
122
|
abortRef.current = ctrl;
|
|
109
123
|
setLoading(true);
|
|
110
124
|
setError(null);
|
|
111
|
-
const
|
|
112
|
-
let url;
|
|
113
|
-
if (ctx.organizationId && ctx.tenantId) {
|
|
114
|
-
let origin = '';
|
|
115
|
-
try {
|
|
116
|
-
origin = base ? new URL(base).origin : '';
|
|
117
|
-
} catch {
|
|
118
|
-
origin = '';
|
|
119
|
-
}
|
|
120
|
-
url = `${origin}/${ctx.organizationId}/${ctx.tenantId}/llmgateway_/api/discovery`;
|
|
121
|
-
} else url = `${base}/${ctx.tenantName}/llmgateway_/api/discovery`;
|
|
125
|
+
const url = buildGatewayUrl(ctx, 'api/discovery');
|
|
122
126
|
try {
|
|
123
127
|
const bearer = await resolveToken(ctx.token);
|
|
124
128
|
const headers = {
|
|
@@ -169,6 +173,37 @@ function usePlatformDiscoveryModels(ctx, folderKey) {
|
|
|
169
173
|
refetch: fetchModels
|
|
170
174
|
};
|
|
171
175
|
}
|
|
176
|
+
function useDeleteByoConfiguration(ctx) {
|
|
177
|
+
const deleteConfiguration = (0, external_react_namespaceObject.useCallback)(async (configurationId)=>{
|
|
178
|
+
if (!ctx) throw new Error('Cannot delete a BYO configuration without a request context.');
|
|
179
|
+
const bearer = await resolveToken(ctx.token);
|
|
180
|
+
const res = await fetch(buildGatewayUrl(ctx, `api/byo/product/llm-configurations/${encodeURIComponent(configurationId)}`), {
|
|
181
|
+
method: 'DELETE',
|
|
182
|
+
headers: {
|
|
183
|
+
Authorization: `Bearer ${bearer}`,
|
|
184
|
+
Accept: 'application/json'
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
if (!res.ok) {
|
|
188
|
+
let message = '';
|
|
189
|
+
try {
|
|
190
|
+
const body = await res.json();
|
|
191
|
+
if (body && 'object' == typeof body && 'Message' in body) {
|
|
192
|
+
const raw = body.Message;
|
|
193
|
+
if ('string' == typeof raw) message = raw;
|
|
194
|
+
}
|
|
195
|
+
} catch {
|
|
196
|
+
message = '';
|
|
197
|
+
}
|
|
198
|
+
throw new Error(message || `Failed to delete the custom model (HTTP ${res.status}).`);
|
|
199
|
+
}
|
|
200
|
+
}, [
|
|
201
|
+
ctx
|
|
202
|
+
]);
|
|
203
|
+
return {
|
|
204
|
+
deleteConfiguration
|
|
205
|
+
};
|
|
206
|
+
}
|
|
172
207
|
const EMPTY_GUID = '00000000-0000-0000-0000-000000000000';
|
|
173
208
|
function useByoConnectionNames(models, ctx) {
|
|
174
209
|
const [names, setNames] = (0, external_react_namespaceObject.useState)(new Map());
|
|
@@ -304,6 +339,7 @@ exports.buildLlmConfigurationsUrl = __webpack_exports__.buildLlmConfigurationsUr
|
|
|
304
339
|
exports.platformNavigation = __webpack_exports__.platformNavigation;
|
|
305
340
|
exports.useByoConnectionNames = __webpack_exports__.useByoConnectionNames;
|
|
306
341
|
exports.useCanManageByo = __webpack_exports__.useCanManageByo;
|
|
342
|
+
exports.useDeleteByoConfiguration = __webpack_exports__.useDeleteByoConfiguration;
|
|
307
343
|
exports.usePlatformDiscoveryModels = __webpack_exports__.usePlatformDiscoveryModels;
|
|
308
344
|
exports.useUserFolders = __webpack_exports__.useUserFolders;
|
|
309
345
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
@@ -311,6 +347,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
311
347
|
"platformNavigation",
|
|
312
348
|
"useByoConnectionNames",
|
|
313
349
|
"useCanManageByo",
|
|
350
|
+
"useDeleteByoConfiguration",
|
|
314
351
|
"usePlatformDiscoveryModels",
|
|
315
352
|
"useUserFolders"
|
|
316
353
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -16,16 +16,20 @@ export interface UseUserFoldersResult {
|
|
|
16
16
|
folders: FolderSwitcherFolder[];
|
|
17
17
|
loading: boolean;
|
|
18
18
|
error: Error | null;
|
|
19
|
-
refetch: () => void
|
|
19
|
+
refetch: () => Promise<void>;
|
|
20
20
|
}
|
|
21
21
|
export declare function useUserFolders(ctx: PlatformRequestContext | null): UseUserFoldersResult;
|
|
22
22
|
export interface UsePlatformDiscoveryModelsResult {
|
|
23
23
|
models: DiscoveryModel[] | undefined;
|
|
24
24
|
loading: boolean;
|
|
25
25
|
error: Error | null;
|
|
26
|
-
refetch: () => void
|
|
26
|
+
refetch: () => Promise<void>;
|
|
27
27
|
}
|
|
28
28
|
export declare function usePlatformDiscoveryModels(ctx: PlatformRequestContext | null, folderKey: string | null): UsePlatformDiscoveryModelsResult;
|
|
29
|
+
export interface UseDeleteByoConfigurationResult {
|
|
30
|
+
deleteConfiguration: (configurationId: string) => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare function useDeleteByoConfiguration(ctx: PlatformRequestContext | null): UseDeleteByoConfigurationResult;
|
|
29
33
|
export declare function useByoConnectionNames(models: readonly {
|
|
30
34
|
byoConnectionLabel?: string;
|
|
31
35
|
byomDetails?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePlatformAccess.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/usePlatformAccess.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAgB9C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"usePlatformAccess.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/usePlatformAccess.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAgB9C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AA6BtE,MAAM,WAAW,sBAAsB;IAErC,KAAK,EAAE,aAAa,CAAC;IAWrB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,MAAM,CAAC;IAOnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAQxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,aAAa,CAAC,EAAE,MAAM,CAAC;IAOvB,MAAM,C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AAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAiBD,wBAAgB,eAAe,CAAC,GAAG,EAAE,sBAAsB,GAAG,IAAI,GAAG,qBAAqB,CAoEzF;AAMD,MAAM,WAAW,4BAA4B;IAE3C,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IAEvB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAcD,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,4BAA4B,GACpC,MAAM,CAuBR;AAaD,eAAO,MAAM,kBAAkB;sBACX,MAAM,GAAG,IAAI;CAGhC,CAAC"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
2
|
import { normalizeDiscoveryModels } from "./useDiscoveryModels.js";
|
|
3
3
|
const resolveToken = async (token)=>'function' == typeof token ? token() : token;
|
|
4
|
+
const buildGatewayUrl = (ctx, path)=>{
|
|
5
|
+
const base = (ctx.baseUrl ?? '').replace(/\/$/, '');
|
|
6
|
+
if (ctx.organizationId && ctx.tenantId) {
|
|
7
|
+
let origin = '';
|
|
8
|
+
try {
|
|
9
|
+
origin = base ? new URL(base).origin : '';
|
|
10
|
+
} catch {
|
|
11
|
+
origin = '';
|
|
12
|
+
}
|
|
13
|
+
return `${origin}/${ctx.organizationId}/${ctx.tenantId}/llmgateway_/${path}`;
|
|
14
|
+
}
|
|
15
|
+
return `${base}/${ctx.tenantName}/llmgateway_/${path}`;
|
|
16
|
+
};
|
|
4
17
|
const FOLDERS_PAGE_SIZE = 100;
|
|
5
18
|
function useUserFolders(ctx) {
|
|
6
19
|
const [folders, setFolders] = useState([]);
|
|
@@ -75,17 +88,7 @@ function usePlatformDiscoveryModels(ctx, folderKey) {
|
|
|
75
88
|
abortRef.current = ctrl;
|
|
76
89
|
setLoading(true);
|
|
77
90
|
setError(null);
|
|
78
|
-
const
|
|
79
|
-
let url;
|
|
80
|
-
if (ctx.organizationId && ctx.tenantId) {
|
|
81
|
-
let origin = '';
|
|
82
|
-
try {
|
|
83
|
-
origin = base ? new URL(base).origin : '';
|
|
84
|
-
} catch {
|
|
85
|
-
origin = '';
|
|
86
|
-
}
|
|
87
|
-
url = `${origin}/${ctx.organizationId}/${ctx.tenantId}/llmgateway_/api/discovery`;
|
|
88
|
-
} else url = `${base}/${ctx.tenantName}/llmgateway_/api/discovery`;
|
|
91
|
+
const url = buildGatewayUrl(ctx, 'api/discovery');
|
|
89
92
|
try {
|
|
90
93
|
const bearer = await resolveToken(ctx.token);
|
|
91
94
|
const headers = {
|
|
@@ -136,6 +139,37 @@ function usePlatformDiscoveryModels(ctx, folderKey) {
|
|
|
136
139
|
refetch: fetchModels
|
|
137
140
|
};
|
|
138
141
|
}
|
|
142
|
+
function useDeleteByoConfiguration(ctx) {
|
|
143
|
+
const deleteConfiguration = useCallback(async (configurationId)=>{
|
|
144
|
+
if (!ctx) throw new Error('Cannot delete a BYO configuration without a request context.');
|
|
145
|
+
const bearer = await resolveToken(ctx.token);
|
|
146
|
+
const res = await fetch(buildGatewayUrl(ctx, `api/byo/product/llm-configurations/${encodeURIComponent(configurationId)}`), {
|
|
147
|
+
method: 'DELETE',
|
|
148
|
+
headers: {
|
|
149
|
+
Authorization: `Bearer ${bearer}`,
|
|
150
|
+
Accept: 'application/json'
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
if (!res.ok) {
|
|
154
|
+
let message = '';
|
|
155
|
+
try {
|
|
156
|
+
const body = await res.json();
|
|
157
|
+
if (body && 'object' == typeof body && 'Message' in body) {
|
|
158
|
+
const raw = body.Message;
|
|
159
|
+
if ('string' == typeof raw) message = raw;
|
|
160
|
+
}
|
|
161
|
+
} catch {
|
|
162
|
+
message = '';
|
|
163
|
+
}
|
|
164
|
+
throw new Error(message || `Failed to delete the custom model (HTTP ${res.status}).`);
|
|
165
|
+
}
|
|
166
|
+
}, [
|
|
167
|
+
ctx
|
|
168
|
+
]);
|
|
169
|
+
return {
|
|
170
|
+
deleteConfiguration
|
|
171
|
+
};
|
|
172
|
+
}
|
|
139
173
|
const EMPTY_GUID = '00000000-0000-0000-0000-000000000000';
|
|
140
174
|
function useByoConnectionNames(models, ctx) {
|
|
141
175
|
const [names, setNames] = useState(new Map());
|
|
@@ -267,4 +301,4 @@ const platformNavigation = {
|
|
|
267
301
|
globalThis.open?.(url, '_blank', 'noopener,noreferrer');
|
|
268
302
|
}
|
|
269
303
|
};
|
|
270
|
-
export { buildLlmConfigurationsUrl, platformNavigation, useByoConnectionNames, useCanManageByo, usePlatformDiscoveryModels, useUserFolders };
|
|
304
|
+
export { buildLlmConfigurationsUrl, platformNavigation, useByoConnectionNames, useCanManageByo, useDeleteByoConfiguration, usePlatformDiscoveryModels, useUserFolders };
|
|
@@ -25,15 +25,59 @@ var __webpack_exports__ = {};
|
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
groupModels: ()=>groupModels,
|
|
28
|
+
isTextGenerationModel: ()=>isTextGenerationModel,
|
|
28
29
|
getSubstitutionTarget: ()=>getSubstitutionTarget,
|
|
29
30
|
filterModels: ()=>filterModels,
|
|
30
31
|
deriveModelTags: ()=>deriveModelTags,
|
|
31
|
-
defaultCostTier: ()=>defaultCostTier
|
|
32
|
+
defaultCostTier: ()=>defaultCostTier,
|
|
33
|
+
resolveHomeGeography: ()=>resolveHomeGeography
|
|
32
34
|
});
|
|
33
35
|
const external_badges_cjs_namespaceObject = require("./badges.cjs");
|
|
34
36
|
const external_i18n_cjs_namespaceObject = require("./i18n.cjs");
|
|
35
37
|
const RECOMMENDED_SUBSCRIPTION = 'UiPathOwned';
|
|
36
38
|
const isByoModel = (m)=>'BYOMAdded' === m.modelSubscriptionType || 'BYOMReplacedAlternative' === m.modelSubscriptionType || 'BYOMReplacedLikeForLike' === m.modelSubscriptionType || !!m.byomDetails || !!m.byoConnectionLabel;
|
|
39
|
+
function isTextGenerationModel(m) {
|
|
40
|
+
if ('Realtime' === m.modelType) return false;
|
|
41
|
+
return !(m.apiFlavor ?? '').includes('Embeddings');
|
|
42
|
+
}
|
|
43
|
+
const OMS_REGION_TO_GEOGRAPHY = {
|
|
44
|
+
europe: 'EU',
|
|
45
|
+
unitedstates: 'US',
|
|
46
|
+
japan: 'JA',
|
|
47
|
+
canada: 'CA',
|
|
48
|
+
australia: 'AU',
|
|
49
|
+
india: 'IN',
|
|
50
|
+
unitedkingdom: 'UK',
|
|
51
|
+
singapore: 'SI',
|
|
52
|
+
switzerland: 'CH',
|
|
53
|
+
unitedarabemirates: 'UAE',
|
|
54
|
+
southkorea: 'SK'
|
|
55
|
+
};
|
|
56
|
+
const GEOGRAPHY_CODES = new Set([
|
|
57
|
+
'EU',
|
|
58
|
+
'CA',
|
|
59
|
+
'US',
|
|
60
|
+
'SI',
|
|
61
|
+
'JA',
|
|
62
|
+
'AU',
|
|
63
|
+
'IN',
|
|
64
|
+
'UK',
|
|
65
|
+
'CH',
|
|
66
|
+
'UAE',
|
|
67
|
+
'SK',
|
|
68
|
+
'GLOBAL'
|
|
69
|
+
]);
|
|
70
|
+
function resolveHomeGeography(homeRegion) {
|
|
71
|
+
const raw = homeRegion?.trim();
|
|
72
|
+
if (!raw) return;
|
|
73
|
+
const upper = raw.toUpperCase();
|
|
74
|
+
if ('GLOBAL' === upper) return;
|
|
75
|
+
if (GEOGRAPHY_CODES.has(upper)) return upper;
|
|
76
|
+
return OMS_REGION_TO_GEOGRAPHY[raw.toLowerCase().replace(/[\s_-]/g, '')];
|
|
77
|
+
}
|
|
78
|
+
function listMatchesModel(ids, model) {
|
|
79
|
+
return ids.includes(model.modelId) || ids.includes(model.modelName);
|
|
80
|
+
}
|
|
37
81
|
function deriveModelTags(model, context = {}) {
|
|
38
82
|
const tags = [];
|
|
39
83
|
const localize = (desc)=>{
|
|
@@ -41,13 +85,13 @@ function deriveModelTags(model, context = {}) {
|
|
|
41
85
|
return desc.message ?? desc.id;
|
|
42
86
|
};
|
|
43
87
|
const isByo = isByoModel(model);
|
|
44
|
-
const isRecommended = void 0 !== context.recommendedModelIds ? context.recommendedModelIds
|
|
88
|
+
const isRecommended = void 0 !== context.recommendedModelIds ? listMatchesModel(context.recommendedModelIds, model) : model.isRecommended ?? (model.modelSubscriptionType === RECOMMENDED_SUBSCRIPTION && !model.isPreview && !model.deprecationDetails?.usageEndDate);
|
|
45
89
|
if (isRecommended) tags.push({
|
|
46
90
|
kind: 'recommended',
|
|
47
91
|
label: localize(external_i18n_cjs_namespaceObject.TAG_LABELS.recommended),
|
|
48
92
|
tooltip: localize(external_i18n_cjs_namespaceObject.TAG_LABELS.recommendedTooltip)
|
|
49
93
|
});
|
|
50
|
-
const isPreview = void 0 !== context.previewModelIds ? context.previewModelIds
|
|
94
|
+
const isPreview = void 0 !== context.previewModelIds ? listMatchesModel(context.previewModelIds, model) : !!model.isPreview;
|
|
51
95
|
if (!isByo && isPreview) tags.push({
|
|
52
96
|
kind: 'preview',
|
|
53
97
|
label: localize(external_i18n_cjs_namespaceObject.TAG_LABELS.preview)
|
|
@@ -96,7 +140,8 @@ function deriveModelTags(model, context = {}) {
|
|
|
96
140
|
});
|
|
97
141
|
if (!isByo) {
|
|
98
142
|
const geo = model.routingDetails?.geography;
|
|
99
|
-
|
|
143
|
+
const home = 'GLOBAL' === context.homeRegion ? void 0 : context.homeRegion;
|
|
144
|
+
if (geo && home && 'GLOBAL' !== geo && geo !== home) tags.push({
|
|
100
145
|
kind: 'out-of-region',
|
|
101
146
|
label: context.i18n ? context.i18n._({
|
|
102
147
|
id: 'modelPicker.tag.outOfRegion.label',
|
|
@@ -109,9 +154,9 @@ function deriveModelTags(model, context = {}) {
|
|
|
109
154
|
id: 'modelPicker.tag.outOfRegion.tooltip',
|
|
110
155
|
message: 'Routes traffic outside {homeRegion}',
|
|
111
156
|
values: {
|
|
112
|
-
homeRegion:
|
|
157
|
+
homeRegion: home
|
|
113
158
|
}
|
|
114
|
-
}) : `Routes traffic outside ${
|
|
159
|
+
}) : `Routes traffic outside ${home}`
|
|
115
160
|
});
|
|
116
161
|
}
|
|
117
162
|
const poolBadges = context.badgesFor?.(model) ?? (()=>{
|
|
@@ -171,8 +216,8 @@ function formatDate(iso) {
|
|
|
171
216
|
});
|
|
172
217
|
}
|
|
173
218
|
function buildSubscriptionMatchers(ctx) {
|
|
174
|
-
const isRecommended = (m)=>void 0 !== ctx.recommendedModelIds ? ctx.recommendedModelIds
|
|
175
|
-
const isPreview = (m)=>void 0 !== ctx.previewModelIds ? ctx.previewModelIds
|
|
219
|
+
const isRecommended = (m)=>void 0 !== ctx.recommendedModelIds ? listMatchesModel(ctx.recommendedModelIds, m) : m.isRecommended ?? (m.modelSubscriptionType === RECOMMENDED_SUBSCRIPTION && !m.isPreview && !m.deprecationDetails?.usageEndDate);
|
|
220
|
+
const isPreview = (m)=>void 0 !== ctx.previewModelIds ? listMatchesModel(ctx.previewModelIds, m) : !!m.isPreview;
|
|
176
221
|
const localize = (desc)=>{
|
|
177
222
|
if (ctx.i18n) return (0, external_i18n_cjs_namespaceObject.tr)(ctx.i18n, desc);
|
|
178
223
|
return desc.message ?? desc.id;
|
|
@@ -304,12 +349,16 @@ exports.deriveModelTags = __webpack_exports__.deriveModelTags;
|
|
|
304
349
|
exports.filterModels = __webpack_exports__.filterModels;
|
|
305
350
|
exports.getSubstitutionTarget = __webpack_exports__.getSubstitutionTarget;
|
|
306
351
|
exports.groupModels = __webpack_exports__.groupModels;
|
|
352
|
+
exports.isTextGenerationModel = __webpack_exports__.isTextGenerationModel;
|
|
353
|
+
exports.resolveHomeGeography = __webpack_exports__.resolveHomeGeography;
|
|
307
354
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
308
355
|
"defaultCostTier",
|
|
309
356
|
"deriveModelTags",
|
|
310
357
|
"filterModels",
|
|
311
358
|
"getSubstitutionTarget",
|
|
312
|
-
"groupModels"
|
|
359
|
+
"groupModels",
|
|
360
|
+
"isTextGenerationModel",
|
|
361
|
+
"resolveHomeGeography"
|
|
313
362
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
314
363
|
Object.defineProperty(exports, '__esModule', {
|
|
315
364
|
value: true
|
|
@@ -9,6 +9,8 @@ export interface DeriveModelTagsContext {
|
|
|
9
9
|
badgesFor?: (model: DiscoveryModel) => readonly ModelBadgeKind[];
|
|
10
10
|
customTagsFor?: (model: DiscoveryModel) => readonly ModelTag[];
|
|
11
11
|
}
|
|
12
|
+
export declare function isTextGenerationModel(m: DiscoveryModel): boolean;
|
|
13
|
+
export declare function resolveHomeGeography(homeRegion: string | undefined): string | undefined;
|
|
12
14
|
export declare function deriveModelTags(model: DiscoveryModel, context?: DeriveModelTagsContext): ModelTag[];
|
|
13
15
|
export declare function defaultCostTier(model: DiscoveryModel): CostTier | null;
|
|
14
16
|
export declare function getSubstitutionTarget(model: DiscoveryModel): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG/C,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAS9E,MAAM,WAAW,sBAAsB;IAOrC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/material/components/ap-model-picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;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,UAAU,EAAE,CA6Ed;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAkBtF"}
|
|
@@ -2,6 +2,48 @@ import { MODEL_BADGES } from "./badges.js";
|
|
|
2
2
|
import { GROUP_LABELS, TAG_LABELS, tr } from "./i18n.js";
|
|
3
3
|
const RECOMMENDED_SUBSCRIPTION = 'UiPathOwned';
|
|
4
4
|
const isByoModel = (m)=>'BYOMAdded' === m.modelSubscriptionType || 'BYOMReplacedAlternative' === m.modelSubscriptionType || 'BYOMReplacedLikeForLike' === m.modelSubscriptionType || !!m.byomDetails || !!m.byoConnectionLabel;
|
|
5
|
+
function isTextGenerationModel(m) {
|
|
6
|
+
if ('Realtime' === m.modelType) return false;
|
|
7
|
+
return !(m.apiFlavor ?? '').includes('Embeddings');
|
|
8
|
+
}
|
|
9
|
+
const OMS_REGION_TO_GEOGRAPHY = {
|
|
10
|
+
europe: 'EU',
|
|
11
|
+
unitedstates: 'US',
|
|
12
|
+
japan: 'JA',
|
|
13
|
+
canada: 'CA',
|
|
14
|
+
australia: 'AU',
|
|
15
|
+
india: 'IN',
|
|
16
|
+
unitedkingdom: 'UK',
|
|
17
|
+
singapore: 'SI',
|
|
18
|
+
switzerland: 'CH',
|
|
19
|
+
unitedarabemirates: 'UAE',
|
|
20
|
+
southkorea: 'SK'
|
|
21
|
+
};
|
|
22
|
+
const GEOGRAPHY_CODES = new Set([
|
|
23
|
+
'EU',
|
|
24
|
+
'CA',
|
|
25
|
+
'US',
|
|
26
|
+
'SI',
|
|
27
|
+
'JA',
|
|
28
|
+
'AU',
|
|
29
|
+
'IN',
|
|
30
|
+
'UK',
|
|
31
|
+
'CH',
|
|
32
|
+
'UAE',
|
|
33
|
+
'SK',
|
|
34
|
+
'GLOBAL'
|
|
35
|
+
]);
|
|
36
|
+
function resolveHomeGeography(homeRegion) {
|
|
37
|
+
const raw = homeRegion?.trim();
|
|
38
|
+
if (!raw) return;
|
|
39
|
+
const upper = raw.toUpperCase();
|
|
40
|
+
if ('GLOBAL' === upper) return;
|
|
41
|
+
if (GEOGRAPHY_CODES.has(upper)) return upper;
|
|
42
|
+
return OMS_REGION_TO_GEOGRAPHY[raw.toLowerCase().replace(/[\s_-]/g, '')];
|
|
43
|
+
}
|
|
44
|
+
function listMatchesModel(ids, model) {
|
|
45
|
+
return ids.includes(model.modelId) || ids.includes(model.modelName);
|
|
46
|
+
}
|
|
5
47
|
function deriveModelTags(model, context = {}) {
|
|
6
48
|
const tags = [];
|
|
7
49
|
const localize = (desc)=>{
|
|
@@ -9,13 +51,13 @@ function deriveModelTags(model, context = {}) {
|
|
|
9
51
|
return desc.message ?? desc.id;
|
|
10
52
|
};
|
|
11
53
|
const isByo = isByoModel(model);
|
|
12
|
-
const isRecommended = void 0 !== context.recommendedModelIds ? context.recommendedModelIds
|
|
54
|
+
const isRecommended = void 0 !== context.recommendedModelIds ? listMatchesModel(context.recommendedModelIds, model) : model.isRecommended ?? (model.modelSubscriptionType === RECOMMENDED_SUBSCRIPTION && !model.isPreview && !model.deprecationDetails?.usageEndDate);
|
|
13
55
|
if (isRecommended) tags.push({
|
|
14
56
|
kind: 'recommended',
|
|
15
57
|
label: localize(TAG_LABELS.recommended),
|
|
16
58
|
tooltip: localize(TAG_LABELS.recommendedTooltip)
|
|
17
59
|
});
|
|
18
|
-
const isPreview = void 0 !== context.previewModelIds ? context.previewModelIds
|
|
60
|
+
const isPreview = void 0 !== context.previewModelIds ? listMatchesModel(context.previewModelIds, model) : !!model.isPreview;
|
|
19
61
|
if (!isByo && isPreview) tags.push({
|
|
20
62
|
kind: 'preview',
|
|
21
63
|
label: localize(TAG_LABELS.preview)
|
|
@@ -64,7 +106,8 @@ function deriveModelTags(model, context = {}) {
|
|
|
64
106
|
});
|
|
65
107
|
if (!isByo) {
|
|
66
108
|
const geo = model.routingDetails?.geography;
|
|
67
|
-
|
|
109
|
+
const home = 'GLOBAL' === context.homeRegion ? void 0 : context.homeRegion;
|
|
110
|
+
if (geo && home && 'GLOBAL' !== geo && geo !== home) tags.push({
|
|
68
111
|
kind: 'out-of-region',
|
|
69
112
|
label: context.i18n ? context.i18n._({
|
|
70
113
|
id: 'modelPicker.tag.outOfRegion.label',
|
|
@@ -77,9 +120,9 @@ function deriveModelTags(model, context = {}) {
|
|
|
77
120
|
id: 'modelPicker.tag.outOfRegion.tooltip',
|
|
78
121
|
message: 'Routes traffic outside {homeRegion}',
|
|
79
122
|
values: {
|
|
80
|
-
homeRegion:
|
|
123
|
+
homeRegion: home
|
|
81
124
|
}
|
|
82
|
-
}) : `Routes traffic outside ${
|
|
125
|
+
}) : `Routes traffic outside ${home}`
|
|
83
126
|
});
|
|
84
127
|
}
|
|
85
128
|
const poolBadges = context.badgesFor?.(model) ?? (()=>{
|
|
@@ -139,8 +182,8 @@ function formatDate(iso) {
|
|
|
139
182
|
});
|
|
140
183
|
}
|
|
141
184
|
function buildSubscriptionMatchers(ctx) {
|
|
142
|
-
const isRecommended = (m)=>void 0 !== ctx.recommendedModelIds ? ctx.recommendedModelIds
|
|
143
|
-
const isPreview = (m)=>void 0 !== ctx.previewModelIds ? ctx.previewModelIds
|
|
185
|
+
const isRecommended = (m)=>void 0 !== ctx.recommendedModelIds ? listMatchesModel(ctx.recommendedModelIds, m) : m.isRecommended ?? (m.modelSubscriptionType === RECOMMENDED_SUBSCRIPTION && !m.isPreview && !m.deprecationDetails?.usageEndDate);
|
|
186
|
+
const isPreview = (m)=>void 0 !== ctx.previewModelIds ? listMatchesModel(ctx.previewModelIds, m) : !!m.isPreview;
|
|
144
187
|
const localize = (desc)=>{
|
|
145
188
|
if (ctx.i18n) return tr(ctx.i18n, desc);
|
|
146
189
|
return desc.message ?? desc.id;
|
|
@@ -267,4 +310,4 @@ function filterModels(models, query) {
|
|
|
267
310
|
return haystack.includes(q);
|
|
268
311
|
});
|
|
269
312
|
}
|
|
270
|
-
export { defaultCostTier, deriveModelTags, filterModels, getSubstitutionTarget, groupModels };
|
|
313
|
+
export { defaultCostTier, deriveModelTags, filterModels, getSubstitutionTarget, groupModels, isTextGenerationModel, resolveHomeGeography };
|
|
@@ -47,7 +47,17 @@ const MuiIconButton = (palette)=>({
|
|
|
47
47
|
boxShadow: `inset 0 0 0 1px ${palette.semantic.colorBackground}`
|
|
48
48
|
},
|
|
49
49
|
'&.MuiIconButton-colorPrimary:not(.Mui-disabled)': {
|
|
50
|
-
color: palette.semantic.colorPrimary
|
|
50
|
+
color: palette.semantic.colorPrimary,
|
|
51
|
+
'&&:hover': {
|
|
52
|
+
backgroundColor: palette.semantic.colorIconButtonHover
|
|
53
|
+
},
|
|
54
|
+
'&&:focus-visible': {
|
|
55
|
+
backgroundColor: palette.semantic.colorIconButtonHover,
|
|
56
|
+
outline: `2px solid ${palette.semantic.colorFocusIndicator} !important`
|
|
57
|
+
},
|
|
58
|
+
'&&:active': {
|
|
59
|
+
backgroundColor: palette.semantic.colorIconButtonPressed
|
|
60
|
+
}
|
|
51
61
|
},
|
|
52
62
|
'&.MuiIconButton-colorSecondary:not(.Mui-disabled)': {
|
|
53
63
|
color: palette.semantic.colorIconDefault,
|
|
@@ -56,7 +66,7 @@ const MuiIconButton = (palette)=>({
|
|
|
56
66
|
},
|
|
57
67
|
'&&:focus-visible': {
|
|
58
68
|
backgroundColor: palette.semantic.colorIconButtonHover,
|
|
59
|
-
outline:
|
|
69
|
+
outline: `2px solid ${palette.semantic.colorFocusIndicator} !important`
|
|
60
70
|
},
|
|
61
71
|
'&&:active': {
|
|
62
72
|
backgroundColor: palette.semantic.colorIconButtonPressed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MuiIconButton.d.ts","sourceRoot":"","sources":["../../../../src/material/theme/overrides/MuiIconButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEtE,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,mBAAmB,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"MuiIconButton.d.ts","sourceRoot":"","sources":["../../../../src/material/theme/overrides/MuiIconButton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEtE,eAAO,MAAM,aAAa,GAAI,SAAS,OAAO,KAAG,mBAAmB,CAAC,eAAe,CAqClF,CAAC"}
|
|
@@ -9,7 +9,17 @@ const MuiIconButton = (palette)=>({
|
|
|
9
9
|
boxShadow: `inset 0 0 0 1px ${palette.semantic.colorBackground}`
|
|
10
10
|
},
|
|
11
11
|
'&.MuiIconButton-colorPrimary:not(.Mui-disabled)': {
|
|
12
|
-
color: palette.semantic.colorPrimary
|
|
12
|
+
color: palette.semantic.colorPrimary,
|
|
13
|
+
'&&:hover': {
|
|
14
|
+
backgroundColor: palette.semantic.colorIconButtonHover
|
|
15
|
+
},
|
|
16
|
+
'&&:focus-visible': {
|
|
17
|
+
backgroundColor: palette.semantic.colorIconButtonHover,
|
|
18
|
+
outline: `2px solid ${palette.semantic.colorFocusIndicator} !important`
|
|
19
|
+
},
|
|
20
|
+
'&&:active': {
|
|
21
|
+
backgroundColor: palette.semantic.colorIconButtonPressed
|
|
22
|
+
}
|
|
13
23
|
},
|
|
14
24
|
'&.MuiIconButton-colorSecondary:not(.Mui-disabled)': {
|
|
15
25
|
color: palette.semantic.colorIconDefault,
|
|
@@ -18,7 +28,7 @@ const MuiIconButton = (palette)=>({
|
|
|
18
28
|
},
|
|
19
29
|
'&&:focus-visible': {
|
|
20
30
|
backgroundColor: palette.semantic.colorIconButtonHover,
|
|
21
|
-
outline:
|
|
31
|
+
outline: `2px solid ${palette.semantic.colorFocusIndicator} !important`
|
|
22
32
|
},
|
|
23
33
|
'&&:active': {
|
|
24
34
|
backgroundColor: palette.semantic.colorIconButtonPressed
|