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

Function syncTextEnvironment

gen.pollinations.ai/src/text/handler.ts:39–49  ·  view source on GitHub ↗
(env: CloudflareBindings)

Source from the content-addressed store, hash-verified

37] as const satisfies readonly (keyof CloudflareBindings)[];
38
39function syncTextEnvironment(env: CloudflareBindings): void {
40 // Text provider config still reads process.env. In Workers all bindings are
41 // stable per deployment, so copying known string bindings before generation
42 // is deterministic across concurrent requests in the same isolate.
43 for (const key of TEXT_ENV_KEYS) {
44 const value = env[key];
45 if (typeof value === "string") {
46 process.env[key] = value;
47 }
48 }
49}
50
51function generatePollinationsId(): string {
52 return `pllns_${crypto.randomUUID().replaceAll("-", "")}`;

Callers 1

generateTextResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected