Useful TypeScript functions for AI in journalism projects. Part of the journalism library.
The library is maintained by Nael Shiab, computational journalist and senior data producer for CBC News.
To learn how to use this library and more, check out Code Like a Journalist, a free and open-source data analysis and data visualization course in TypeScript. You might also find simple-data-analysis useful.
npm install @nshiab/journalism-ai
import { askGemini } from "@nshiab/journalism-ai";
// Set AI_KEY and AI_MODEL in your environment first.
const result = await askGemini("What is the capital of France?");
console.log(result.response);
To start a data project with folders, configuration and documentation for AI agents, run:
npx @nshiab/setup-data-project
See CONTRIBUTING.md for development commands.