Skip to content

Commit 7000215

Browse files
committed
refactor: convert collectParentInstructions to use object parameter
1 parent 53cfa2c commit 7000215

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

backend/src/templates/strings.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ export async function formatPrompt({
111111
}
112112
type StringField = 'systemPrompt' | 'instructionsPrompt' | 'stepPrompt'
113113

114-
export async function collectParentInstructions(
115-
agentType: string,
116-
agentTemplates: Record<string, AgentTemplate>,
117-
): Promise<string[]> {
114+
export async function collectParentInstructions(params: {
115+
agentType: string
116+
agentTemplates: Record<string, AgentTemplate>
117+
}): Promise<string[]> {
118+
const { agentType, agentTemplates } = params
118119
const instructions: string[] = []
119120

120121
for (const template of Object.values(agentTemplates)) {
@@ -196,10 +197,10 @@ export async function getAgentPrompt<T extends StringField>({
196197
agentTemplates,
197198
))
198199

199-
const parentInstructions = await collectParentInstructions(
200-
agentState.agentType,
200+
const parentInstructions = await collectParentInstructions({
201+
agentType: agentState.agentType,
201202
agentTemplates,
202-
)
203+
})
203204

204205
if (parentInstructions.length > 0) {
205206
addendum += '\n\n## Additional Instructions for Spawning Agents\n\n'

0 commit comments

Comments
 (0)