Developer sample written in Angular, demonstrating how to use system instruction and prompting in the Gemini API to collaboratively and iteratively create to create quiz questions in supported languages
This example uses Angular and Gemini API.
Your system needs to be configured to run Angular.
You need Gemini API key in order to run this demo. Here's how:
- Launch Google AI Studio
- Click "Get API Key"
Caution: Using the Google AI SDK for JavaScript directly from a client-side app is recommended for prototyping only. For non-prototyping use cases, we strongly recommend that you call the Google AI Gemini API only server-side to keep your API key safe. If you embed your API key directly in your JavaScript app or fetch it remotely at runtime, you risk potentially exposing your API key to malicious actors.
You have two options to get this code:
- Open it in IDX
- Clone this repo to your local machine.
To run this application, you can either
- hard code your API key in
server.ts
- set it as an environment variable called
API_KEY
Note: Do not use
ng serve
as this sample uses server side rendering (SSR).
- Build the example with
ng build
- Run the demo with
npm start
- Navigate to
http://localhost:4000/
That's it, have fun!
Note: Do not use
ng serve
as this sample uses server side rendering (SSR).
- Update the files.
- Stop the server
- Run
ng build
- Run
npm start