UNPKG

gpt-token-utils

Version:

Isomorphic utilities for GPT-3 tokenization and prompt building.

15 lines (14 loc) 522 B
/** * @copyright Sister Software. All rights reserved. * @author Teffen Ellis, et al. * @license * See LICENSE file in the project root for full license information. */ import { readFileSync } from 'node:fs'; import * as path from 'node:path'; import { fileURLToPath } from 'url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const fixturesPath = path.join(__dirname, 'fixtures'); export function readFixture(fileName) { return readFileSync(path.join(fixturesPath, fileName), 'utf8').trim(); }