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

Function createNewAssistantResponseTask

src/modules/taskWorker.ts:176–195  ·  view source on GitHub ↗
(
  parentTask: LLMTask
)

Source from the content-addressed store, hash-verified

174}
175
176function createNewAssistantResponseTask(
177 parentTask: LLMTask
178): partialTaskDraft[] {
179 // Process the response and create new tasks if necessary
180 console.log('create new response task');
181 const taskListFromResponse: partialTaskDraft[] = [];
182 const messages = parentTask.result?.assistantResponse || [];
183 console.log('create a new assistant response tasks...', messages);
184 for (const tm of messages) {
185 const allText = tm.content.filter(
186 (m): m is OpenAI.Beta.Threads.MessageContentText => m.type === 'text'
187 );
188 taskListFromResponse.push({
189 role: tm.role,
190 content: allText.map((textContent) => textContent.text.value).join('\n'),
191 debugging: { threadMessage: tm },
192 });
193 }
194 return taskListFromResponse;
195}
196
197async function parseChatResponse(
198 message: string,

Callers 1

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected