MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / parseCustomHeaders

Function parseCustomHeaders

apps/webuiapps/src/lib/llmClient.ts:174–188  ·  view source on GitHub ↗
(raw?: string)

Source from the content-addressed store, hash-verified

172}
173
174function parseCustomHeaders(raw?: string): Record<string, string> {
175 if (!raw) return {};
176 const headers: Record<string, string> = {};
177 for (const line of raw.split('\n')) {
178 const trimmed = line.trim();
179 if (!trimmed) continue;
180 const idx = trimmed.indexOf(':');
181 if (idx > 0) {
182 const key = trimmed.slice(0, idx).trim().toLowerCase();
183 const val = trimmed.slice(idx + 1).trim();
184 headers[`x-custom-${key}`] = val;
185 }
186 }
187 return headers;
188}
189
190export async function chat(
191 messages: ChatMessage[],

Callers 2

chatOpenAIFunction · 0.70
chatAnthropicFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected