mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-09 22:25:33 -05:00
address bugbot comments
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { useMemo } from 'react'
|
||||
import {
|
||||
getEffectiveBlockOutputs,
|
||||
getEvaluatorMetricOutputs,
|
||||
} from '@/lib/workflows/blocks/block-outputs'
|
||||
import { getEffectiveBlockOutputs } from '@/lib/workflows/blocks/block-outputs'
|
||||
import type { SchemaField } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/connection-blocks/components/field-item/field-item'
|
||||
import { getBlock } from '@/blocks'
|
||||
import { useSubBlockStore } from '@/stores/workflows/subblock/store'
|
||||
@@ -123,31 +120,6 @@ export function useBlockOutputFields({
|
||||
return []
|
||||
}
|
||||
|
||||
// Handle evaluator blocks - use metrics if available
|
||||
if (blockType === 'evaluator') {
|
||||
const metricOutputs = getEvaluatorMetricOutputs(mergedSubBlocks)
|
||||
if (metricOutputs) {
|
||||
return Object.entries(metricOutputs).map(([name, output]) => ({
|
||||
name,
|
||||
type:
|
||||
output &&
|
||||
typeof output === 'object' &&
|
||||
'type' in output &&
|
||||
typeof output.type === 'string'
|
||||
? output.type
|
||||
: 'number',
|
||||
description:
|
||||
output &&
|
||||
typeof output === 'object' &&
|
||||
'description' in output &&
|
||||
typeof output.description === 'string'
|
||||
? output.description
|
||||
: undefined,
|
||||
}))
|
||||
}
|
||||
// Fall through to use blockConfig.outputs
|
||||
}
|
||||
|
||||
// Handle variables blocks - use variable assignments if available
|
||||
if (blockType === 'variables') {
|
||||
const variablesValue =
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import {
|
||||
getEffectiveBlockOutputPaths,
|
||||
getEvaluatorMetricOutputs,
|
||||
} from '@/lib/workflows/blocks/block-outputs'
|
||||
import { getEffectiveBlockOutputPaths } from '@/lib/workflows/blocks/block-outputs'
|
||||
import { normalizeName } from '@/executor/constants'
|
||||
import { useVariablesStore } from '@/stores/panel/variables/store'
|
||||
import type { Variable } from '@/stores/panel/variables/types'
|
||||
@@ -97,17 +94,6 @@ export function computeBlockOutputPaths(block: BlockState, ctx: WorkflowContext)
|
||||
return ['results', ...insidePaths]
|
||||
}
|
||||
|
||||
if (block.type === 'evaluator') {
|
||||
const metricOutputs = getEvaluatorMetricOutputs(mergedSubBlocks)
|
||||
if (metricOutputs) {
|
||||
return Object.keys(metricOutputs)
|
||||
}
|
||||
return getEffectiveBlockOutputPaths(block.type, mergedSubBlocks, {
|
||||
triggerMode: Boolean(block.triggerMode),
|
||||
preferToolOutputs: !block.triggerMode,
|
||||
})
|
||||
}
|
||||
|
||||
if (block.type === 'variables') {
|
||||
const variablesValue = getSubBlockValue(blocks, subBlockValues, block.id, 'variables')
|
||||
if (variablesValue && Array.isArray(variablesValue) && variablesValue.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user