UNPKG

node-llama-cpp

Version:

Run AI models locally on your machine with node.js bindings for llama.cpp. Enforce a JSON schema on the model output on the generation level

21 lines 561 B
import { GbnfTerminal } from "../GbnfTerminal.js"; export class GbnfVerbatimText extends GbnfTerminal { value; constructor(value) { super(); this.value = value; } getGrammar() { return [ '"', this.value .replaceAll("\\", "\\\\") .replaceAll('"', '\\"') .replaceAll("\t", "\\t") .replaceAll("\r", "\\r") .replaceAll("\n", "\\n"), '"' ].join(""); } } //# sourceMappingURL=GbnfVerbatimText.js.map