MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / chatBody

Function chatBody

graph-ui/src/chat/chat-client.ts:157–175  ·  view source on GitHub ↗
(request: ChatRequest)

Source from the content-addressed store, hash-verified

155
156/** The body, built in one place so the eval and the chat send the same bytes. */
157export function chatBody(request: ChatRequest): Record<string, unknown> {
158 return {
159 messages: [
160 { role: 'system', content: request.system },
161 { role: 'user', content: request.user },
162 ],
163 temperature: CHAT_TEMPERATURE,
164 seed: CHAT_SEED,
165 repeat_penalty: CHAT_REPEAT_PENALTY,
166 max_tokens: request.maxTokens ?? CHAT_MAX_TOKENS,
167 stream: false,
168 ...(request.chatTemplateKwargs === undefined
169 ? {}
170 : { chat_template_kwargs: request.chatTemplateKwargs }),
171 ...(request.model === undefined || request.model.length === 0
172 ? {}
173 : { model: request.model }),
174 };
175}
176
177/** Ask the sidecar once. Rejects with a {@link ChatError} and never with a string. */
178export async function askModel(request: ChatRequest): Promise<ChatReply> {

Callers 2

askModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected