mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(agent): stringify input into user prompt for agent (#984)
This commit is contained in:
@@ -317,11 +317,13 @@ export class AgentBlockHandler implements BlockHandler {
|
||||
}
|
||||
|
||||
private addUserPrompt(messages: Message[], userPrompt: any) {
|
||||
let content = userPrompt
|
||||
let content: string
|
||||
if (typeof userPrompt === 'object' && userPrompt.input) {
|
||||
content = userPrompt.input
|
||||
content = String(userPrompt.input)
|
||||
} else if (typeof userPrompt === 'object') {
|
||||
content = JSON.stringify(userPrompt)
|
||||
} else {
|
||||
content = String(userPrompt)
|
||||
}
|
||||
|
||||
messages.push({ role: 'user', content })
|
||||
|
||||
Reference in New Issue
Block a user