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

Function extractTextFromInteractionOutputs

apps/sim/providers/gemini/core.ts:472–484  ·  view source on GitHub ↗

* Extracts text content from a completed interaction's outputs array. * The outputs array can contain text, thought, google_search_result, and other types. * We concatenate all text outputs to get the full research report.

(outputs: Interactions.Interaction['outputs'])

Source from the content-addressed store, hash-verified

470 * We concatenate all text outputs to get the full research report.
471 */
472function extractTextFromInteractionOutputs(outputs: Interactions.Interaction['outputs']): string {
473 if (!outputs || outputs.length === 0) return ''
474
475 const textParts: string[] = []
476 for (const output of outputs) {
477 if (output.type === 'text') {
478 const text = (output as Interactions.TextContent).text
479 if (text) textParts.push(text)
480 }
481 }
482
483 return textParts.join('\n\n')
484}
485
486/**
487 * Extracts token usage from an Interaction's Usage object.

Callers 1

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected