mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix: wrap agent response in 'response' for consistency across all blocks
This commit is contained in:
@@ -146,7 +146,7 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
const fields = extractFieldsFromSchema(responseFormat)
|
||||
if (fields.length > 0) {
|
||||
return {
|
||||
tags: fields.map((field: Field) => `${normalizedBlockName}.${field.name}`),
|
||||
tags: fields.map((field: Field) => `${normalizedBlockName}.response.${field.name}`),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,7 +185,7 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
if (responseFormat) {
|
||||
const fields = extractFieldsFromSchema(responseFormat)
|
||||
if (fields.length > 0) {
|
||||
return fields.map((field: Field) => `${normalizedBlockName}.${field.name}`)
|
||||
return fields.map((field: Field) => `${normalizedBlockName}.response.${field.name}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,18 +322,20 @@ export class AgentBlockHandler implements BlockHandler {
|
||||
console.log(`[AgentBlockHandler Debug] Successfully parsed content:`, parsedContent)
|
||||
|
||||
const result = {
|
||||
...parsedContent,
|
||||
tokens: response.tokens || {
|
||||
prompt: 0,
|
||||
completion: 0,
|
||||
total: 0,
|
||||
response: {
|
||||
...parsedContent,
|
||||
tokens: response.tokens || {
|
||||
prompt: 0,
|
||||
completion: 0,
|
||||
total: 0,
|
||||
},
|
||||
toolCalls: response.toolCalls
|
||||
? {
|
||||
list: response.toolCalls,
|
||||
count: response.toolCalls.length,
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
toolCalls: response.toolCalls
|
||||
? {
|
||||
list: response.toolCalls,
|
||||
count: response.toolCalls.length,
|
||||
}
|
||||
: undefined,
|
||||
}
|
||||
|
||||
console.log(`[AgentBlockHandler Debug] Result:`, result)
|
||||
|
||||
Reference in New Issue
Block a user