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

Function createMoonshotThinking

web/src/llm-api/moonshot.ts:140–164  ·  view source on GitHub ↗
(
  moonshotBody: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

138}
139
140function createMoonshotThinking(
141 moonshotBody: Record<string, unknown>,
142): Record<string, unknown> {
143 const reasoning =
144 moonshotBody.reasoning && typeof moonshotBody.reasoning === 'object'
145 ? (moonshotBody.reasoning as { enabled?: boolean })
146 : undefined
147 if (reasoning?.enabled === false) {
148 return { type: 'disabled' }
149 }
150
151 const existingThinking =
152 moonshotBody.thinking && typeof moonshotBody.thinking === 'object'
153 ? (moonshotBody.thinking as Record<string, unknown>)
154 : {}
155 if (existingThinking.type === 'disabled') {
156 return { type: 'disabled' }
157 }
158
159 return {
160 ...existingThinking,
161 type: 'enabled',
162 keep: 'all',
163 }
164}
165
166function normalizeMoonshotMessages(
167 messages: ChatCompletionRequestBody['messages'],

Callers 1

buildMoonshotRequestBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected