MCPcopy Index your code
hub / github.com/simstudioai/sim / getEvaluatorMetricOutputs

Function getEvaluatorMetricOutputs

apps/sim/lib/workflows/blocks/block-outputs.ts:346–364  ·  view source on GitHub ↗
(
  subBlocks?: Record<string, SubBlockWithValue>
)

Source from the content-addressed store, hash-verified

344}
345
346export function getEvaluatorMetricOutputs(
347 subBlocks?: Record<string, SubBlockWithValue>
348): OutputDefinition | undefined {
349 const metricsValue = subBlocks?.metrics?.value
350 if (!metricsValue || !Array.isArray(metricsValue) || metricsValue.length === 0) return undefined
351
352 const validMetrics = metricsValue.filter((metric: { name?: string }) => metric?.name)
353 if (validMetrics.length === 0) return undefined
354
355 const outputs: OutputDefinition = {}
356 for (const metric of validMetrics as Array<{ name: string }>) {
357 outputs[metric.name.toLowerCase()] = {
358 type: 'number',
359 description: `Metric score: ${metric.name}`,
360 }
361 }
362
363 return outputs
364}
365
366export function getEffectiveBlockOutputs(
367 blockType: string,

Callers 1

getEffectiveBlockOutputsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected