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

Function getResponseFormatOutputs

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

Source from the content-addressed store, hash-verified

320}
321
322export 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
346export function getEvaluatorMetricOutputs(
347 subBlocks?: Record<string, SubBlockWithValue>

Callers 1

getEffectiveBlockOutputsFunction · 0.85

Calls 2

extractFieldsFromSchemaFunction · 0.90

Tested by

no test coverage detected