createJev
createJev(
options?):Provider
Defined in: src/jev.ts:59
A provider for TypeSafe Jev, called directly. The key comes from apiKey, else from
TYPESAFE_API_KEY the first time the provider is called; nothing is read at import.
Use the ready-made jev when the defaults are right.
Parameters
Section titled “Parameters”options?
Section titled “options?”JevOptions = {}
Returns
Section titled “Returns”Throws
Section titled “Throws”ConfigError from the returned provider’s first call, when no key is found.
Example
Section titled “Example”import { readFileSync } from "node:fs";import { huncho, noul } from "huncho";import { createJev } from "huncho/jev";
const jev = createJev({ apiKey: readFileSync("/run/secrets/jev", "utf8").trim() });const route = huncho("support.route", { model: jev() }) .ask({ urgent: noul("Does this need a human within the hour?") }) .else("wait");