mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 08:09:23 +00:00
feat(agent): add download_asset tool and prompt instructions
This commit is contained in:
@@ -161,4 +161,12 @@ describe('AgentChatPromptBuilder', () => {
|
||||
|
||||
expect(result).toContain('User Info:\nName: Alice\nRole: owner')
|
||||
})
|
||||
|
||||
it('should build prompt with download_asset tool instruction', () => {
|
||||
const builder = new AgentChatPromptBuilder('a1')
|
||||
const result = builder.build()
|
||||
|
||||
expect(result).toContain("call the 'download_asset' tool with assetId")
|
||||
expect(result).toContain('remember to delete the temporary downloaded file.')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -174,6 +174,8 @@ export class AgentChatPromptBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
instruction += `\n\nIf you need a local file on disk to run bash commands or scripts (e.g. processing or combining assets), call the 'download_asset' tool with assetId. After finishing the job, remember to delete the temporary downloaded file.`
|
||||
|
||||
if (this.userInfo) {
|
||||
instruction += `\n\nUser Info:\nName: ${this.userInfo.name}\nRole: ${this.userInfo.role}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user