mirror of https://github.com/buster-so/buster.git
skip the think and prep step in workflow
This commit is contained in:
parent
4dbdb066e0
commit
70021ff130
|
@ -83,45 +83,45 @@ export async function runAnalystWorkflow(
|
|||
// Add all messages from create-todos step (tool call, result, and user message)
|
||||
messages.push(...todos.messages);
|
||||
|
||||
const thinkAndPrepAgentStepResults = await runThinkAndPrepAgentStep({
|
||||
options: {
|
||||
messageId: input.messageId,
|
||||
chatId: input.chatId,
|
||||
organizationId: input.organizationId,
|
||||
dataSourceId: input.dataSourceId,
|
||||
dataSourceSyntax: input.dataSourceSyntax,
|
||||
userId: input.userId,
|
||||
sql_dialect_guidance: input.dataSourceSyntax,
|
||||
datasets: input.datasets,
|
||||
workflowStartTime,
|
||||
analysisMode,
|
||||
analystInstructions,
|
||||
organizationDocs,
|
||||
userPersonalizationMessageContent,
|
||||
},
|
||||
streamOptions: {
|
||||
messages,
|
||||
},
|
||||
});
|
||||
// const thinkAndPrepAgentStepResults = await runThinkAndPrepAgentStep({
|
||||
// options: {
|
||||
// messageId: input.messageId,
|
||||
// chatId: input.chatId,
|
||||
// organizationId: input.organizationId,
|
||||
// dataSourceId: input.dataSourceId,
|
||||
// dataSourceSyntax: input.dataSourceSyntax,
|
||||
// userId: input.userId,
|
||||
// sql_dialect_guidance: input.dataSourceSyntax,
|
||||
// datasets: input.datasets,
|
||||
// workflowStartTime,
|
||||
// analysisMode,
|
||||
// analystInstructions,
|
||||
// organizationDocs,
|
||||
// userPersonalizationMessageContent,
|
||||
// },
|
||||
// streamOptions: {
|
||||
// messages,
|
||||
// },
|
||||
// });
|
||||
|
||||
console.info('[runAnalystWorkflow] DEBUG: Think-and-prep results', {
|
||||
workflowId,
|
||||
messageId: input.messageId,
|
||||
earlyTermination: thinkAndPrepAgentStepResults.earlyTermination,
|
||||
messageCount: thinkAndPrepAgentStepResults.messages.length,
|
||||
});
|
||||
// console.info('[runAnalystWorkflow] DEBUG: Think-and-prep results', {
|
||||
// workflowId,
|
||||
// messageId: input.messageId,
|
||||
// earlyTermination: thinkAndPrepAgentStepResults.earlyTermination,
|
||||
// messageCount: thinkAndPrepAgentStepResults.messages.length,
|
||||
// });
|
||||
|
||||
messages.push(...thinkAndPrepAgentStepResults.messages);
|
||||
// messages.push(...thinkAndPrepAgentStepResults.messages);
|
||||
|
||||
// Check if think-and-prep agent terminated early (clarifying question or direct response)
|
||||
// // Check if think-and-prep agent terminated early (clarifying question or direct response)
|
||||
let analystAgentStepResults = { messages: [] as ModelMessage[] };
|
||||
|
||||
if (!thinkAndPrepAgentStepResults.earlyTermination) {
|
||||
console.info('[runAnalystWorkflow] Running analyst agent step (early termination = false)', {
|
||||
workflowId,
|
||||
messageId: input.messageId,
|
||||
earlyTermination: thinkAndPrepAgentStepResults.earlyTermination,
|
||||
});
|
||||
// if (!thinkAndPrepAgentStepResults.earlyTermination) {
|
||||
// console.info('[runAnalystWorkflow] Running analyst agent step (early termination = false)', {
|
||||
// workflowId,
|
||||
// messageId: input.messageId,
|
||||
// earlyTermination: thinkAndPrepAgentStepResults.earlyTermination,
|
||||
// });
|
||||
|
||||
analystAgentStepResults = await runAnalystAgentStep({
|
||||
options: {
|
||||
|
@ -144,13 +144,13 @@ export async function runAnalystWorkflow(
|
|||
});
|
||||
|
||||
messages.push(...analystAgentStepResults.messages);
|
||||
} else {
|
||||
console.info('[runAnalystWorkflow] DEBUG: SKIPPING analyst agent due to early termination', {
|
||||
workflowId,
|
||||
messageId: input.messageId,
|
||||
earlyTermination: thinkAndPrepAgentStepResults.earlyTermination,
|
||||
});
|
||||
}
|
||||
// } else {
|
||||
// console.info('[runAnalystWorkflow] DEBUG: SKIPPING analyst agent due to early termination', {
|
||||
// workflowId,
|
||||
// messageId: input.messageId,
|
||||
// earlyTermination: thinkAndPrepAgentStepResults.earlyTermination,
|
||||
// });
|
||||
// }
|
||||
|
||||
// Extract all tool calls from messages
|
||||
const allToolCalls = extractToolCallsFromMessages(messages);
|
||||
|
|
Loading…
Reference in New Issue