genkit-sample
is your starting point for learning about Firebase Genkit, an open-source framework that helps developers create AI-powered applications.
Before you start, make sure you have these installed:
- Node.js version 22 or later
- npm
- Genkit
For Genkit installation, see the official guide.
Check your installations by running:
$ node --version # the below version is on my environment
v22.4.1
$ npm --version # the below version is on my environment
10.7.0
$ genkit --version # the below version is on my environment
0.5.4
Install Project Dependencies: Open your terminal, navigate to this project's folder, and run:
$ npm install
- Set the
OPENAI_API_KEY
Environment Variable
Before running the project, you need to provide your OpenAI API key. This key allows your application to communicate with OpenAI's services. Replace your_api_key
with the actual API key you obtained from OpenAI.
$ export OPENAI_API_KEY=your_api_key
- Run the Genkit server locally
This command starts the project and automatically opens your default web browser to http://localhost:4000.
$ npm run genkit
Now you can play with it!
After making changes, you might need to build the project to see your changes in action:
$ npm run build
To ensure your code follows the project's coding standards, run the formatting and linting tools:
$ npm run typecheck # type check without modifying files
$ npm run check # scan without modifying files
$ npm run fix # modify files
Big thanks to:
MIT