@kwirthmagnify/kwirth-common-ai 0.5.47 → 0.5.48
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/front.js +7 -13
- package/package.json +1 -1
package/dist/front.js
CHANGED
|
@@ -32,17 +32,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.ToolSelector = exports.AiConfigProvider = exports.AiConfigLlm = exports.LlmSelector = void 0;
|
|
40
37
|
const react_1 = __importStar(require("react"));
|
|
41
38
|
const material_1 = require("@mui/material");
|
|
42
|
-
const
|
|
43
|
-
const FileUpload_1 = __importDefault(require("@mui/icons-material/FileUpload"));
|
|
44
|
-
const Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
|
|
45
|
-
const VisibilityOff_1 = __importDefault(require("@mui/icons-material/VisibilityOff"));
|
|
39
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
46
40
|
const downloadJson = async (data, filename) => {
|
|
47
41
|
var _a;
|
|
48
42
|
const json = JSON.stringify(data, null, 2);
|
|
@@ -167,7 +161,7 @@ const AiConfigLlm = (props) => {
|
|
|
167
161
|
react_1.default.createElement(material_1.Checkbox, { checked: useProviderKey, onChange: e => setUseProviderKey(e.target.checked) })),
|
|
168
162
|
react_1.default.createElement(material_1.TextField, { value: key, onChange: e => setKey(e.target.value), disabled: useProviderKey, label: 'API Key', placeholder: 'Enter API Key', variant: 'standard', fullWidth: true, type: showPassword ? 'text' : 'password', InputProps: {
|
|
169
163
|
endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: 'end' },
|
|
170
|
-
react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(
|
|
164
|
+
react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(icons_material_1.VisibilityOff, null) : react_1.default.createElement(icons_material_1.Visibility, null))))
|
|
171
165
|
} })),
|
|
172
166
|
react_1.default.createElement(material_1.Stack, { direction: 'row', spacing: 1 },
|
|
173
167
|
react_1.default.createElement(material_1.Button, { variant: 'outlined', size: 'small', onClick: onNew }, "New"),
|
|
@@ -188,8 +182,8 @@ const AiConfigLlm = (props) => {
|
|
|
188
182
|
reader.readAsText(f);
|
|
189
183
|
e.target.value = '';
|
|
190
184
|
} }),
|
|
191
|
-
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(
|
|
192
|
-
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(
|
|
185
|
+
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileUpload, { fontSize: 'small' }), onClick: () => { var _a; return (_a = importLlmRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }, "Import"),
|
|
186
|
+
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileDownload, { fontSize: 'small' }), onClick: () => downloadJson(llms, 'kwirth-llms.json') }, "Export"),
|
|
193
187
|
react_1.default.createElement(material_1.Box, { flex: 1 }),
|
|
194
188
|
react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(llms), variant: 'contained' }, "OK"),
|
|
195
189
|
react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(undefined), color: 'inherit' }, "Cancel"))));
|
|
@@ -293,7 +287,7 @@ const AiConfigProvider = (props) => {
|
|
|
293
287
|
setProviderName(e.target.value); }, variant: 'standard', fullWidth: true }, props.providersAvailable.map(t => (react_1.default.createElement(material_1.MenuItem, { key: t, value: t }, t))))),
|
|
294
288
|
react_1.default.createElement(material_1.TextField, { label: 'API Key / Token', type: showPassword ? 'text' : 'password', variant: 'standard', fullWidth: true, value: providerKey, onChange: e => setProviderKey(e.target.value), helperText: 'This key can be afterwards linked to specific uses.', InputProps: {
|
|
295
289
|
endAdornment: (react_1.default.createElement(material_1.InputAdornment, { position: 'end' },
|
|
296
|
-
react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(
|
|
290
|
+
react_1.default.createElement(material_1.IconButton, { onClick: () => setShowPassword(!showPassword), edge: 'end' }, showPassword ? react_1.default.createElement(icons_material_1.VisibilityOff, null) : react_1.default.createElement(icons_material_1.Visibility, null))))
|
|
297
291
|
} }),
|
|
298
292
|
providerType === 'openai-compat' && (react_1.default.createElement(material_1.TextField, { label: 'Base URL', variant: 'standard', fullWidth: true, placeholder: 'https://your-maas-host/v1', value: providerEndpoint, onChange: e => setProviderEndpoint(e.target.value), helperText: 'OpenAI-compatible API base URL (e.g. Huawei MaaS, vLLM, LM Studio\u2026)' })),
|
|
299
293
|
react_1.default.createElement(material_1.Box, { sx: { flexGrow: 1 } }),
|
|
@@ -317,8 +311,8 @@ const AiConfigProvider = (props) => {
|
|
|
317
311
|
reader.readAsText(f);
|
|
318
312
|
e.target.value = '';
|
|
319
313
|
} }),
|
|
320
|
-
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(
|
|
321
|
-
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(
|
|
314
|
+
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileUpload, { fontSize: 'small' }), onClick: () => { var _a; return (_a = importProvRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }, "Import"),
|
|
315
|
+
react_1.default.createElement(material_1.Button, { startIcon: react_1.default.createElement(icons_material_1.FileDownload, { fontSize: 'small' }), onClick: () => downloadJson(providers.map(p => { var _a; return (Object.assign({ name: p.name, type: (_a = p.type) !== null && _a !== void 0 ? _a : p.name, key: p.key }, (p.endpoint ? { endpoint: p.endpoint } : {}))); }), 'kwirth-providers.json') }, "Export"),
|
|
322
316
|
react_1.default.createElement(material_1.Box, { flex: 1 }),
|
|
323
317
|
react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(providers), color: 'primary', variant: 'contained' }, "Save"),
|
|
324
318
|
react_1.default.createElement(material_1.Button, { onClick: () => props.onClose(undefined), color: 'inherit' }, "Cancel"))));
|