MCPcopy Create free account
hub / github.com/Hello-Application-XH/HelloGML / glmPostStream

Function glmPostStream

src/chat.ts:333–346  ·  view source on GitHub ↗
(url: string, body: any, headers: Record<string, string>, timeout = 120000)

Source from the content-addressed store, hash-verified

331}
332
333async function glmPostStream(url: string, body: any, headers: Record<string, string>, timeout = 120000): Promise<Response> {
334 const controller = new AbortController();
335 const timeoutId = setTimeout(() => controller.abort(), timeout);
336 try {
337 return await fetch(url, {
338 method: "POST",
339 headers,
340 body: JSON.stringify(body),
341 signal: controller.signal,
342 });
343 } finally {
344 clearTimeout(timeoutId);
345 }
346}
347
348export async function createCompletion(messages: any[], refreshToken: string, model = MODEL_NAME, refConvId = "", retryCount = 0, tools?: any[]): Promise<any> {
349 return (async () => {

Callers 3

createCompletionFunction · 0.85
createCompletionStreamFunction · 0.85
generateImagesFunction · 0.85

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected