62
62
<div class =" row" >
63
63
<info-dialog
64
64
v-if ="
65
- currentModel && state .modelLookUp[currentModel]?.description
65
+ currentModel && tystate .modelLookUp[currentModel]?.description
66
66
"
67
67
size =" xs"
68
- :info-text =" state .modelLookUp[currentModel]?.description"
68
+ :info-text =" tystate .modelLookUp[currentModel]?.description || '' "
69
69
/>
70
70
<q-btn flat dense size =" sm" no-caps >
71
71
<div class =" ellipsis" >
111
111
<q-space ></q-space >
112
112
<div v-if =" currentModel" class =" gt-xs" >
113
113
{{
114
- `t/c: ${estimatedTokens}/${state .modelLookUp[currentModel]?.context_length}`
114
+ `t/c: ${estimatedTokens}/${tystate .modelLookUp[currentModel]?.context_length}`
115
115
}}
116
116
<q-tooltip :delay =" 1000" class =" q-gutter-sm" >
117
117
<div >
@@ -367,6 +367,7 @@ import { getApiConfig } from 'src/modules/taskyon/taskWorker';
367
367
import { addPrompts } from ' src/modules/taskyon/promptCreation' ;
368
368
import type { ChatCompletionMessageParam } from ' openai/resources/index.mjs' ;
369
369
import { useNlpWorker } from ' src/modules/taskyon/webWorkerApi' ;
370
+ import { useAppStateStore } from ' src/stores/appState' ;
370
371
371
372
const CodeEditor = defineAsyncComponent (
372
373
() =>
@@ -392,7 +393,8 @@ function updateContent(value: string | null | undefined) {
392
393
};
393
394
}
394
395
395
- const state = useTaskyonStore ();
396
+ const state = useAppStateStore ();
397
+ const tystate = useTaskyonStore ();
396
398
const { expandedTaskCreation } = toRefs (state );
397
399
const { expertMode } = toRefs (state .appConfiguration );
398
400
const { selectedApi } = toRefs (state .llmSettings );
@@ -404,7 +406,7 @@ const fileAttachments = ref<File[]>([]); // holds all attached files as a "taskl
404
406
405
407
async function getAllTools() {
406
408
const foundTools = await (
407
- await state .getTaskManager ()
409
+ await tystate .getTaskManager ()
408
410
).updateToolDefinitions (true );
409
411
return foundTools ;
410
412
}
@@ -455,7 +457,7 @@ const handleBotNameUpdate = ({
455
457
if (api ) {
456
458
api .selectedModel = newName ;
457
459
}
458
- state .addModelToHistory (newName );
460
+ tystate .addModelToHistory (newName );
459
461
};
460
462
461
463
const selectedTaskType = computed (() => {
@@ -554,7 +556,7 @@ watchDebounced(
554
556
let accumulatedEstimated = 0 ;
555
557
let messages: ChatCompletionMessageParam [] = [];
556
558
if (state .llmSettings .selectedTaskId ) {
557
- const tm = await state .getTaskManager ();
559
+ const tm = await tystate .getTaskManager ();
558
560
// we only need the last 2 or 3 tasks in order to check for
559
561
const chain = await tm .getTaskIdChain (
560
562
state .llmSettings .selectedTaskId ,
@@ -610,7 +612,7 @@ async function addFiles2Taskyon(newFiles: File[]) {
610
612
611
613
// Collect UUIDs from added files
612
614
const uuids = [];
613
- const tm = await state .getTaskManager ();
615
+ const tm = await tystate .getTaskManager ();
614
616
for (const [fileIdx, file] of newFiles .entries ()) {
615
617
const uuid = await tm .addFile ({
616
618
opfs: opfsMapping [fileIdx ],
@@ -630,7 +632,7 @@ async function createFileTask(files: File[]) {
630
632
const fileUuids = await addFiles2Taskyon (files );
631
633
632
634
if (fileUuids .length ) {
633
- const task: Parameters <typeof state .addTask2Tree >[0 ] = {
635
+ const task: Parameters <typeof tystate .addTask2Tree >[0 ] = {
634
636
role: ' system' ,
635
637
configuration: currentModel .value
636
638
? {
@@ -650,12 +652,12 @@ async function createFileTask(files: File[]) {
650
652
async function addNewTask(execute = true ) {
651
653
// make sure we reset our execution context interrupt We do this right before adding another
652
654
// task, because we want to make sure that
653
- state .taskWorkerController .reset ();
655
+ tystate .taskWorkerController .reset ();
654
656
const fileTaskObj = await createFileTask (fileAttachments .value );
655
657
let fileTaskId = undefined ;
656
658
if (fileTaskObj ) {
657
659
console .log (' add files to chat:' , fileTaskObj );
658
- fileTaskId = await state .addTask2Tree (
660
+ fileTaskId = await tystate .addTask2Tree (
659
661
fileTaskObj ,
660
662
state .llmSettings .selectedTaskId , // parent
661
663
false , // we do not want to execute the file object, we want to use the users prompt...
@@ -668,7 +670,7 @@ async function addNewTask(execute = true) {
668
670
// otherwise, it won't get executed but simply saved into the tree
669
671
console .log (' adding new task, execute?' , execute );
670
672
const newTask = { ... currentnewTask .value };
671
- const newTaskId = await state .addTask2Tree (
673
+ const newTaskId = await tystate .addTask2Tree (
672
674
newTask ,
673
675
fileTaskId || state .llmSettings .selectedTaskId , // parent
674
676
execute , // execute right away...
0 commit comments