Skip to content

Commit 42917ce

Browse files
authored
fix(agent): stringify input into user prompt for agent (#984)
1 parent 5f6d219 commit 42917ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/sim/executor/handlers/agent/agent-handler.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,13 @@ export class AgentBlockHandler implements BlockHandler {
317317
}
318318

319319
private addUserPrompt(messages: Message[], userPrompt: any) {
320-
let content = userPrompt
320+
let content: string
321321
if (typeof userPrompt === 'object' && userPrompt.input) {
322-
content = userPrompt.input
322+
content = String(userPrompt.input)
323323
} else if (typeof userPrompt === 'object') {
324324
content = JSON.stringify(userPrompt)
325+
} else {
326+
content = String(userPrompt)
325327
}
326328

327329
messages.push({ role: 'user', content })

0 commit comments

Comments
 (0)