@christianriedl/utils 1.0.144 → 1.0.146
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/package.json
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
const htmlText = ref('');
|
|
32
32
|
const tools = ref(props.tools);
|
|
33
33
|
const filter = ref<IOpenAIFilter | undefined>(undefined);
|
|
34
|
+
const tooltips = computed(() => tools.value ? 'Tools: ' + tools.value.join(',') : 'No Tools');
|
|
34
35
|
|
|
35
36
|
onUnmounted(() => {
|
|
36
37
|
openAI.clearContext();
|
|
@@ -168,7 +169,9 @@
|
|
|
168
169
|
<v-container v-else fluid class="bg-office">
|
|
169
170
|
<v-row dense align="center" class="font-weight-bold">
|
|
170
171
|
<v-col :cols="qcols">
|
|
171
|
-
<v-text-field name="subject" type="text" v-model="question" density="compact"
|
|
172
|
+
<v-text-field name="subject" type="text" v-model="question" density="compact" v-tooltip:top="tooltips"
|
|
173
|
+
hide-details append-inner-icon="$search" @click:appendInner="showFilter=true">
|
|
174
|
+
</v-text-field>
|
|
172
175
|
</v-col>
|
|
173
176
|
<v-col :cols="12 - qcols">
|
|
174
177
|
<v-btn class="aibutton" @click="onComplete">AI</v-btn>
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
const metadata = ref<IDataItem[]>([]);
|
|
37
37
|
const toolName = ref('');
|
|
38
38
|
const toolFunctions = reactive<IFunction[]>([]);
|
|
39
|
+
const canClear = !props.ismobile;
|
|
39
40
|
let fileHandle: FileSystemFileHandle | null = null;
|
|
40
41
|
let vsSelected = false;
|
|
41
42
|
|
|
@@ -80,6 +81,15 @@
|
|
|
80
81
|
function onUseChange() {
|
|
81
82
|
useChanged.value = true;
|
|
82
83
|
}
|
|
84
|
+
function onDelete(key: string | number) {
|
|
85
|
+
delete tools[key];
|
|
86
|
+
if (use[key])
|
|
87
|
+
useChanged.value = true;
|
|
88
|
+
delete use[key];
|
|
89
|
+
if (fileSearch[key])
|
|
90
|
+
delete fileSearch[key];
|
|
91
|
+
toolsChanged.value = true;
|
|
92
|
+
}
|
|
83
93
|
async function showTools(serverLabel: string) {
|
|
84
94
|
toolName.value = serverLabel;
|
|
85
95
|
const res = await openAI.getToolFunctions(serverLabel);
|
|
@@ -133,7 +143,7 @@
|
|
|
133
143
|
alert('Tool with this name already exists, please choose another name !');
|
|
134
144
|
return;
|
|
135
145
|
}
|
|
136
|
-
const mcpTool: IMcpTool = { type: 'mcp', server_label: name,
|
|
146
|
+
const mcpTool: IMcpTool = { type: 'mcp', server_label: name, require_approval: 'never' };
|
|
137
147
|
tools[name] = mcpTool;
|
|
138
148
|
}
|
|
139
149
|
}
|
|
@@ -355,13 +365,13 @@
|
|
|
355
365
|
</v-select>
|
|
356
366
|
</v-col>
|
|
357
367
|
<v-col cols="2">
|
|
358
|
-
<v-number-input v-model="options.max_output_tokens" control-variant="hidden" hide-details clearable label="Max Token" density="compact" @change="onOptionChange"></v-number-input>
|
|
368
|
+
<v-number-input v-model="options.max_output_tokens" control-variant="hidden" hide-details :clearable="canClear" label="Max Token" density="compact" @change="onOptionChange"></v-number-input>
|
|
359
369
|
</v-col>
|
|
360
370
|
<v-col cols="1">
|
|
361
|
-
<v-number-input v-model="options.temperature" control-variant="hidden" :precision="2" hide-details clearable label="Temperature" density="compact" @change="onOptionChange"></v-number-input>
|
|
371
|
+
<v-number-input v-model="options.temperature" control-variant="hidden" :precision="2" hide-details :clearable="canClear" label="Temperature" density="compact" @change="onOptionChange"></v-number-input>
|
|
362
372
|
</v-col>
|
|
363
373
|
<v-col cols="1">
|
|
364
|
-
<v-number-input v-model="options.top_p" control-variant="hidden" :precision="2" hide-details clearable label="Top P" density="compact" @change="onOptionChange"></v-number-input>
|
|
374
|
+
<v-number-input v-model="options.top_p" control-variant="hidden" :precision="2" hide-details :clearable="canClear" label="Top P" density="compact" @change="onOptionChange"></v-number-input>
|
|
365
375
|
</v-col>
|
|
366
376
|
<v-col cols="1">
|
|
367
377
|
<v-checkbox v-model="options.store" label="Store" hide-details density="compact" @change="onOptionChange"></v-checkbox>
|
|
@@ -369,37 +379,40 @@
|
|
|
369
379
|
</v-row>
|
|
370
380
|
<v-row dense align="center">
|
|
371
381
|
<v-col cols="12">
|
|
372
|
-
<v-text-field v-model="options.instructions" type="string" hide-details clearable label="System Message" density="compact" @change="onOptionChange"></v-text-field>
|
|
382
|
+
<v-text-field v-model="options.instructions" type="string" hide-details :clearable="canClear" label="System Message" density="compact" @change="onOptionChange"></v-text-field>
|
|
373
383
|
</v-col>
|
|
374
384
|
</v-row>
|
|
375
385
|
<template v-for="(tool, key) in tools">
|
|
376
386
|
<v-row v-if="tool.type == 'mcp'" dense align="center">
|
|
377
|
-
<v-col cols="
|
|
387
|
+
<v-col cols="1">
|
|
378
388
|
<v-text-field v-model="tool.server_label" type="string " hide-details disabled label="mcp" density="compact" @change="onToolChange"></v-text-field>
|
|
379
389
|
</v-col>
|
|
380
390
|
<v-col cols="3">
|
|
381
|
-
<v-text-field v-model="tool.server_url" type="string" hide-details clearable label="Url" density="compact" @change="onToolChange"></v-text-field>
|
|
391
|
+
<v-text-field v-model="tool.server_url" type="string" hide-details :clearable="canClear" label="Url" density="compact" @change="onToolChange"></v-text-field>
|
|
382
392
|
</v-col>
|
|
383
393
|
<v-col cols="2">
|
|
384
|
-
<v-text-field v-model="tool.connector_id" type="string" hide-details clearable label="Connector Id" density="compact" @change="onToolChange"></v-text-field>
|
|
394
|
+
<v-text-field v-model="tool.connector_id" type="string" hide-details :clearable="canClear" label="Connector Id" density="compact" @change="onToolChange"></v-text-field>
|
|
385
395
|
</v-col>
|
|
386
396
|
<v-col cols="2">
|
|
387
|
-
<v-text-field v-model="tool.server_description" type="string" hide-details clearable label="Description" density="compact" @change="onToolChange"></v-text-field>
|
|
397
|
+
<v-text-field v-model="tool.server_description" type="string" hide-details :clearable="canClear" label="Description" density="compact" @change="onToolChange"></v-text-field>
|
|
388
398
|
</v-col>
|
|
389
399
|
<v-col cols="props.isMobile ? 2 : 1">
|
|
390
400
|
<v-select v-model="tool.require_approval" :items="mcpApprovals" hide-details
|
|
391
|
-
|
|
401
|
+
density="compact" label="Approval" @update:modelValue="onToolChange">
|
|
392
402
|
</v-select>
|
|
393
403
|
</v-col>
|
|
394
404
|
<v-col v-if="!props.ismobile" cols="1">
|
|
395
405
|
<v-btn variant="text" prepend-icon="$search" @click="showTools(tool.server_label)">TOOLS</v-btn>
|
|
396
406
|
</v-col>
|
|
407
|
+
<v-col cols="1">
|
|
408
|
+
<v-btn icon="$delete" variant="tonal" @click.stop.prevent="onDelete(key)"></v-btn>
|
|
409
|
+
</v-col>
|
|
397
410
|
<v-col cols="1">
|
|
398
411
|
<v-checkbox v-model="use[key]" label="Use" hide-details density="compact" @update:modelValue="onUseChange"></v-checkbox>
|
|
399
412
|
</v-col>
|
|
400
413
|
</v-row>
|
|
401
414
|
<v-row v-if="tool.type == 'file_search'" dense align="center">
|
|
402
|
-
<v-col cols="
|
|
415
|
+
<v-col cols="1">
|
|
403
416
|
<v-text-field :model-value="key" type="string" hide-details disabled label="file_search" density="compact" @change="onToolChange"></v-text-field>
|
|
404
417
|
</v-col>
|
|
405
418
|
<v-col cols="7">
|
|
@@ -407,24 +420,30 @@
|
|
|
407
420
|
</v-select>
|
|
408
421
|
</v-col>
|
|
409
422
|
<v-col cols="2">
|
|
410
|
-
<v-number-input v-model="tool.max_num_results" control-variant="hidden" hide-details clearable label="Max Results" density="compact" @change="onToolChange"></v-number-input>
|
|
423
|
+
<v-number-input v-model="tool.max_num_results" control-variant="hidden" hide-details :clearable="canClear" label="Max Results" density="compact" @change="onToolChange"></v-number-input>
|
|
424
|
+
</v-col>
|
|
425
|
+
<v-col cols="1">
|
|
426
|
+
<v-btn icon="$delete" variant="tonal" @click.stop.prevent="onDelete(key)"></v-btn>
|
|
411
427
|
</v-col>
|
|
412
428
|
<v-col cols="1">
|
|
413
429
|
<v-checkbox v-model="use[key]" label="Use" hide-details density="compact" @update:modelValue="onUseChange"></v-checkbox>
|
|
414
430
|
</v-col>
|
|
415
431
|
</v-row>
|
|
416
432
|
<v-row v-if="tool.type.startsWith('web_search')" dense align="center">
|
|
417
|
-
<v-col cols="
|
|
433
|
+
<v-col cols="1">
|
|
418
434
|
<v-text-field :model-value="key" type="string" hide-details disabled label="file_search" density="compact" @change="onToolChange"></v-text-field>
|
|
419
435
|
</v-col>
|
|
420
436
|
<v-col cols="2">
|
|
421
|
-
<v-text-field v-model="tool.user_location.country" type="string" hide-details clearable label="Country" density="compact" @change="onToolChange"></v-text-field>
|
|
437
|
+
<v-text-field v-model="tool.user_location.country" type="string" hide-details :clearable="canClear" label="Country" density="compact" @change="onToolChange"></v-text-field>
|
|
422
438
|
</v-col>
|
|
423
439
|
<v-col cols="3">
|
|
424
|
-
<v-text-field v-model="tool.user_location.city" type="string" hide-details clearable label="City" density="compact" @change="onToolChange"></v-text-field>
|
|
440
|
+
<v-text-field v-model="tool.user_location.city" type="string" hide-details :clearable="canClear" label="City" density="compact" @change="onToolChange"></v-text-field>
|
|
425
441
|
</v-col>
|
|
426
442
|
<v-col cols="4">
|
|
427
|
-
<v-text-field v-model="tool.user_location.region" type="string" hide-details clearable label="Region" density="compact" @change="onToolChange"></v-text-field>
|
|
443
|
+
<v-text-field v-model="tool.user_location.region" type="string" hide-details :clearable="canClear" label="Region" density="compact" @change="onToolChange"></v-text-field>
|
|
444
|
+
</v-col>
|
|
445
|
+
<v-col cols="1">
|
|
446
|
+
<v-btn icon="$delete" variant="tonal" @click.stop.prevent="onDelete(key)"></v-btn>
|
|
428
447
|
</v-col>
|
|
429
448
|
<v-col cols="1">
|
|
430
449
|
<v-checkbox v-model="use[key]" label="Use" hide-details density="compact" @update:modelValue="onUseChange"></v-checkbox>
|