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

Function normalizeMoonshotMessages

web/src/llm-api/moonshot.ts:166–182  ·  view source on GitHub ↗
(
  messages: ChatCompletionRequestBody['messages'],
)

Source from the content-addressed store, hash-verified

164}
165
166function normalizeMoonshotMessages(
167 messages: ChatCompletionRequestBody['messages'],
168): MoonshotChatMessage[] {
169 return messages.map((message) => {
170 const {
171 cache_control: _cacheControl,
172 content,
173 ...rest
174 } = message as MoonshotChatMessage
175 return {
176 ...rest,
177 ...(content !== undefined && {
178 content: normalizeMoonshotContent(content),
179 }),
180 }
181 })
182}
183
184function normalizeMoonshotContent(
185 content: ChatCompletionRequestBody['messages'][number]['content'],

Callers 1

buildMoonshotRequestBodyFunction · 0.85

Calls 1

normalizeMoonshotContentFunction · 0.85

Tested by

no test coverage detected