MCPcopy Create free account
hub / github.com/OpenAnonymity/oa-chat / buildChatRequestBody

Function buildChatRequestBody

local_inference/backends/httpOpenAIBackend.js:85–107  ·  view source on GitHub ↗
(request, messages)

Source from the content-addressed store, hash-verified

83}
84
85function buildChatRequestBody(request, messages) {
86 const body = {
87 model: request.model,
88 messages,
89 temperature: request.temperature,
90 top_p: request.top_p,
91 stream: false
92 };
93
94 if (request.max_output_tokens) {
95 body.max_tokens = request.max_output_tokens;
96 }
97
98 if (Number.isInteger(request.seed)) {
99 body.seed = request.seed;
100 }
101
102 if (request.user) {
103 body.user = request.user;
104 }
105
106 return body;
107}
108
109export function createOpenAICompatibleBackend({
110 id,

Callers 2

createResponseFunction · 0.85
streamResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected