MCPcopy Create free account
hub / github.com/pollinations/pollinations / handleSimpleTextLocal

Function handleSimpleTextLocal

gen.pollinations.ai/src/text/handler.ts:386–404  ·  view source on GitHub ↗
(
    c: TextContext,
    prompt: string,
    model: string,
    body: Record<string, unknown> = {},
)

Source from the content-addressed store, hash-verified

384}
385
386export async function handleSimpleTextLocal(
387 c: TextContext,
388 prompt: string,
389 model: string,
390 body: Record<string, unknown> = {},
391): Promise<Response> {
392 const req = createExpressLikeRequest(c, body, c.req.path, {
393 ...c.req.param(),
394 0: prompt,
395 });
396 const requestData = prepareRequestParameters(
397 {
398 ...getRequestData(req),
399 model,
400 },
401 c.var.model.definition,
402 );
403 return generateTextResponse(c, requestData, true);
404}

Callers 1

proxy.tsFile · 0.90

Calls 4

createExpressLikeRequestFunction · 0.85
prepareRequestParametersFunction · 0.85
getRequestDataFunction · 0.85
generateTextResponseFunction · 0.85

Tested by

no test coverage detected