baml.env.get

Returns the value of the environment variable `key`, or `null` if not set.

Reference version

Signature

function baml.env.get(key: string) -> string | null throws baml.errors.Io | baml.errors.ParseError

Returns the value of the environment variable key, or null if not set.

Throws

  • baml.errors.Io if environment variable access is not available.
  • baml.errors.ParseError if the variable is set but its value is not valid UTF-8.

Source:<builtin>/baml/ns_env/env.bamlbytes 260–369