MCPcopy Index your code
hub / github.com/Xyntopia/taskyon / processFunctionTask

Function processFunctionTask

src/modules/taskWorker.ts:156–174  ·  view source on GitHub ↗
(task: LLMTask)

Source from the content-addressed store, hash-verified

154}
155
156export async function processFunctionTask(task: LLMTask) {
157 if (task.context?.function) {
158 const func = task.context.function;
159 console.log(`Calling function ${func.name}`);
160 if (tools[func.name]) {
161 const result = await handleFunctionExecution(func, tools);
162 task.result = result;
163 } else {
164 const toolnames = JSON.stringify(task.allowedTools);
165 task.result = {
166 type: 'ToolError',
167 toolResult: {
168 error: `The function ${func.name} is not available in tools. Please select a valid function from this list: ${toolnames}`,
169 },
170 };
171 }
172 }
173 return task;
174}
175
176function createNewAssistantResponseTask(
177 parentTask: LLMTask

Callers 1

taskWorkerFunction · 0.85

Calls 1

handleFunctionExecutionFunction · 0.90

Tested by

no test coverage detected