MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / flattenSystemPrompt

Function flattenSystemPrompt

src/services/api/openaiCompatibleClient.ts:196–208  ·  view source on GitHub ↗
(system: unknown)

Source from the content-addressed store, hash-verified

194}
195
196function flattenSystemPrompt(system: unknown): string | undefined {
197 if (!Array.isArray(system)) {
198 return typeof system === 'string' && system.length > 0 ? system : undefined
199 }
200 const text = system
201 .map(block => {
202 if (!block || typeof block !== 'object') return ''
203 return 'text' in block && typeof block.text === 'string' ? block.text : ''
204 })
205 .filter(Boolean)
206 .join('\n\n')
207 return text.length > 0 ? text : undefined
208}
209
210function anthropicMessagesToOpenAI(
211 system: unknown,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected