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

Function getModelForBlock

apps/sim/lib/tokenization/streaming.ts:104–124  ·  view source on GitHub ↗

* Determines the appropriate model for a block

(log: BlockLog)

Source from the content-addressed store, hash-verified

102 * Determines the appropriate model for a block
103 */
104function getModelForBlock(log: BlockLog): string {
105 // Try to get model from output first
106 if (log.output?.model?.trim()) {
107 return log.output.model
108 }
109
110 // Try to get model from input
111 const inputModel = log.input?.model
112 if (typeof inputModel === 'string' && inputModel.trim()) {
113 return inputModel
114 }
115
116 // Use block type specific defaults
117 const blockType = log.blockType
118 if (blockType === 'agent' || blockType === 'router' || blockType === 'evaluator') {
119 return TOKENIZATION_CONFIG.defaults.model
120 }
121
122 // Final fallback
123 return TOKENIZATION_CONFIG.defaults.model
124}
125
126/**
127 * Processes multiple block logs for streaming tokenization

Callers 1

processStreamingBlockLogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected