mirror of https://github.com/buster-so/buster.git
route to different think and prep based on the context from the router
This commit is contained in:
parent
5219cc0004
commit
bb07af8cbd
|
@ -8,6 +8,7 @@ import { z } from 'zod';
|
|||
import { getSqlDialectGuidance } from '../agents/shared/sql-dialect-guidance';
|
||||
import { thinkAndPrepAgent } from '../agents/think-and-prep-agent/think-and-prep-agent';
|
||||
import { createThinkAndPrepInstructionsWithoutDatasets } from '../agents/think-and-prep-agent/think-and-prep-instructions';
|
||||
import { createThinkAndPrepInstructionsWithoutDatasets as createInvestigationInstructionsWithoutDatasets } from '../agents/think-and-prep-agent/investigation-instructions';
|
||||
import type { thinkAndPrepWorkflowInputSchema } from '../schemas/workflow-schemas';
|
||||
import { ChunkProcessor } from '../utils/database/chunk-processor';
|
||||
import {
|
||||
|
@ -267,11 +268,24 @@ ${databaseContext}
|
|||
|
||||
const wrappedStream = wrapTraced(
|
||||
async () => {
|
||||
// Get the analysis type from the router step
|
||||
const analysisType = inputData['analysis-type-router'].analysisType.choice;
|
||||
|
||||
console.info('Think and Prep: Using analysis type', {
|
||||
analysisType,
|
||||
reasoning: inputData['analysis-type-router'].analysisType.reasoning,
|
||||
});
|
||||
|
||||
// Select the appropriate instructions based on analysis type
|
||||
const instructions = analysisType === 'investigation'
|
||||
? createInvestigationInstructionsWithoutDatasets(sqlDialectGuidance)
|
||||
: createThinkAndPrepInstructionsWithoutDatasets(sqlDialectGuidance);
|
||||
|
||||
// Create system messages with dataset context and instructions
|
||||
const systemMessages: CoreMessage[] = [
|
||||
{
|
||||
role: 'system',
|
||||
content: createThinkAndPrepInstructionsWithoutDatasets(sqlDialectGuidance),
|
||||
content: instructions,
|
||||
providerOptions: DEFAULT_CACHE_OPTIONS,
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue