( subBlocks?: Record<string, SubBlockWithValue>, blockId = 'block' )
| 320 | } |
| 321 | |
| 322 | export function getResponseFormatOutputs( |
| 323 | subBlocks?: Record<string, SubBlockWithValue>, |
| 324 | blockId = 'block' |
| 325 | ): OutputDefinition | undefined { |
| 326 | const responseFormatValue = subBlocks?.responseFormat?.value |
| 327 | if (!responseFormatValue) return undefined |
| 328 | |
| 329 | const parsed = parseResponseFormatSafely(responseFormatValue, blockId) |
| 330 | if (!parsed) return undefined |
| 331 | |
| 332 | const fields = extractFieldsFromSchema(parsed) |
| 333 | if (fields.length === 0) return undefined |
| 334 | |
| 335 | const outputs: OutputDefinition = {} |
| 336 | for (const field of fields) { |
| 337 | outputs[field.name] = { |
| 338 | type: (field.type || 'any') as any, |
| 339 | description: field.description || `Field from Agent: ${field.name}`, |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | return outputs |
| 344 | } |
| 345 | |
| 346 | export function getEvaluatorMetricOutputs( |
| 347 | subBlocks?: Record<string, SubBlockWithValue> |
no test coverage detected