4 ms·
const schema = fs.readFileSync(path.join(__dirname, "sentimentSchema.ts"), "utf8"); const translator = typechat.createJsonTranslator<SentimentResponse>(mode
by tlrobinson 3y ago
const schema = fs.readFileSync(path.join(__dirname, "sentimentSchema.ts"), "utf8");
const translator = typechat.createJsonTranslator<SentimentResponse>(model, schema, "SentimentResponse");
It would have been much nicer if they took this an an opportunity to build generic runtime type introspection into TypeScript.