mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
Standardized output format for blocks/tools. Updated executor so we can now resolve sub-json values for tagged inputs. Updated serializer to match new block output format.
This commit is contained in:
@@ -52,7 +52,7 @@ export function ConnectionBlocks({
|
||||
{connection.name.replace(/\s+/g, '').toLowerCase()}
|
||||
</span>
|
||||
<span className="text-muted-foreground">
|
||||
.{connection.outputType === 'any' ? 'res' : connection.outputType}
|
||||
.{connection.outputType}
|
||||
</span>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
@@ -24,7 +24,7 @@ export function useBlockConnections(blockId: string) {
|
||||
return {
|
||||
id: sourceBlock.id,
|
||||
type: sourceBlock.type,
|
||||
outputType: sourceBlock.outputs?.['response'],
|
||||
outputType: 'response',
|
||||
name: sourceBlock.name,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -18,8 +18,9 @@ export function useWorkflowExecution() {
|
||||
try {
|
||||
// Extract existing block states
|
||||
const currentBlockStates = Object.entries(blocks).reduce((acc, [id, block]) => {
|
||||
if (block.subBlocks?.response?.value !== undefined) {
|
||||
acc[id] = { response: block.subBlocks.response.value }
|
||||
const responseValue = block.subBlocks?.response?.value
|
||||
if (responseValue !== undefined) {
|
||||
acc[id] = { response: responseValue }
|
||||
}
|
||||
return acc
|
||||
}, {} as Record<string, any>)
|
||||
@@ -46,7 +47,7 @@ export function useWorkflowExecution() {
|
||||
if (result.success) {
|
||||
console.group('Workflow Execution Result')
|
||||
console.log('Status: ✅ Success')
|
||||
console.log('Data:', result.data)
|
||||
console.log('Output:', result.output)
|
||||
if (result.metadata) {
|
||||
console.log('Duration:', result.metadata.duration + 'ms')
|
||||
console.log('Start Time:', new Date(result.metadata.startTime).toLocaleTimeString())
|
||||
@@ -58,7 +59,7 @@ export function useWorkflowExecution() {
|
||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error'
|
||||
setExecutionResult({
|
||||
success: false,
|
||||
data: {},
|
||||
output: { response: {} },
|
||||
error: errorMessage
|
||||
})
|
||||
addNotification('error', `Failed to execute workflow: ${errorMessage}`, activeWorkflowId)
|
||||
|
||||
Reference in New Issue
Block a user