setEnvs
setEnvs(
envs
):void
Defined in: .build/typescript/packages/env/src/utils/index.ts:28
Set environment variables before using llamaindex, because some LLM need to access API key before running.
You have to set the environment variables in Cloudflare Worker environment, because it doesn’t have any global environment variables.
Parameters
Section titled “Parameters”object
Environment variables
Returns
Section titled “Returns”void
Example
Section titled “Example”export default \{ async fetch( request: Request, env: Env, ctx: ExecutionContext, ): Promise<Response> { const { setEnvs \} = await import("@llamaindex/env"); setEnvs(env); // ... return new Response("Hello, World!"); },};