@@ -7,6 +7,7 @@ import { projectService } from '../../project/project-service';
77import { getChatTools } from '../chat/ai-chat.service' ;
88import { buildUIContextSection } from '../chat/prompts.service' ;
99import { getAdditionalQueryClassificationDescriptions } from './extensions' ;
10+ import { getAdditionalToolDescriptions } from './external-tool-descriptions' ;
1011import { sanitizeMessages } from './tool-utils' ;
1112import { QueryClassification } from './types' ;
1213
@@ -202,6 +203,16 @@ const getSystemPrompt = async (
202203 const toolsMessage = toolList
203204 . map ( ( t ) => `- ${ t . name } : ${ t . description } ` )
204205 . join ( '\n' ) ;
206+ const additionalToolNotes = getAdditionalToolDescriptions (
207+ toolList . map ( ( t ) => t . name ) ,
208+ ) ;
209+
210+ const additionalToolNotesSection =
211+ additionalToolNotes . length > 0
212+ ? `\n\n### IMPORTANT TOOL USAGE NOTES:\n\n${ additionalToolNotes . join (
213+ '\n\n' ,
214+ ) } \n`
215+ : '' ;
205216 return (
206217 "Given the following conversation history and the list of available tools, select the tools that are most relevant to answer the user's request. " +
207218 `IMPORTANT: Tables tools should always be included in the output if the user asks a question involving those table names: ${ openopsTablesNames . join (
@@ -211,7 +222,7 @@ const getSystemPrompt = async (
211222 'Include ALL relevant categories that apply. ' +
212223 `${
213224 uiContext ? `${ await buildUIContextSection ( uiContext ) } \n` : ''
214- } Tools: ${ toolsMessage } `
225+ } Tools: ${ toolsMessage } ${ additionalToolNotesSection } `
215226 ) ;
216227} ;
217228
0 commit comments