File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,11 @@ export async function collectParentInstructions(
122122 return instructions
123123}
124124
125+ const additionalPlaceholders = {
126+ systemPrompt : [ PLACEHOLDER . TOOLS_PROMPT , PLACEHOLDER . AGENTS_PROMPT ] ,
127+ instructionsPrompt : [ ] ,
128+ stepPrompt : [ ] ,
129+ } satisfies Record < StringField , string [ ] >
125130export async function getAgentPrompt < T extends StringField > (
126131 agentTemplate : AgentTemplate ,
127132 promptType : { type : T } ,
@@ -130,13 +135,9 @@ export async function getAgentPrompt<T extends StringField>(
130135 agentRegistry : AgentRegistry ,
131136) : Promise < string | undefined > {
132137 let promptValue = agentTemplate [ promptType . type ]
133- addToolsPromptToSystemPrompt: if ( promptType . type === 'systemPrompt' ) {
134- if ( promptValue === undefined ) {
135- promptValue = PLACEHOLDER . TOOLS_PROMPT
136- break addToolsPromptToSystemPrompt
137- }
138- if ( ! promptValue . includes ( PLACEHOLDER . TOOLS_PROMPT ) ) {
139- promptValue += `\n\n${ PLACEHOLDER . TOOLS_PROMPT } `
138+ for ( const placeholder of additionalPlaceholders [ promptType . type ] ) {
139+ if ( ! promptValue . includes ( placeholder ) ) {
140+ promptValue += `\n\n${ placeholder } `
140141 }
141142 }
142143
You can’t perform that action at this time.
0 commit comments