( subBlocks?: Record<string, SubBlockWithValue> )
| 344 | } |
| 345 | |
| 346 | export 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 | |
| 366 | export function getEffectiveBlockOutputs( |
| 367 | blockType: string, |
no outgoing calls
no test coverage detected