MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / normalizeOpenCodeZenContent

Function normalizeOpenCodeZenContent

web/src/llm-api/opencode-zen.ts:164–181  ·  view source on GitHub ↗
(
  content: ChatCompletionRequestBody['messages'][number]['content'],
)

Source from the content-addressed store, hash-verified

162}
163
164function normalizeOpenCodeZenContent(
165 content: ChatCompletionRequestBody['messages'][number]['content'],
166): ChatCompletionRequestBody['messages'][number]['content'] {
167 if (!Array.isArray(content)) {
168 return content
169 }
170
171 return content.map((part) => {
172 if (!part || typeof part !== 'object') {
173 return part
174 }
175 const { cache_control: _cacheControl, ...rest } =
176 part as ChatCompletionContentPart & {
177 cache_control?: unknown
178 }
179 return rest
180 })
181}
182
183function normalizeOpenCodeZenTool(
184 tool: ChatCompletionTool,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected