MCPcopy Create free account
hub / github.com/Noumena-Network/code / flushUserContent

Function flushUserContent

src/services/api/openAICompatInferenceClient.ts:464–481  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

462 let multimodalParts: Array<Record<string, unknown>> = []
463
464 const flushUserContent = () => {
465 if (multimodalParts.length > 0) {
466 if (textParts.length > 0) {
467 multimodalParts.unshift({
468 type: 'text',
469 text: textParts.join(''),
470 })
471 }
472 messages.push({ role: 'user', content: multimodalParts })
473 textParts = []
474 multimodalParts = []
475 return
476 }
477 if (textParts.length > 0) {
478 messages.push({ role: 'user', content: textParts.join('') })
479 textParts = []
480 }
481 }
482
483 for (const block of content) {
484 if (!block || typeof block !== 'object' || !('type' in block)) {

Callers 1

convertUserContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected