๐Ÿ“ฆ google-gemini / angular-language-learning-sample

โ˜… 35 stars โ‘‚ 12 forks ๐Ÿ‘ 35 watching โš–๏ธ Apache License 2.0
๐Ÿ“ฅ Clone https://github.com/google-gemini/angular-language-learning-sample.git
HTTPS git clone https://github.com/google-gemini/angular-language-learning-sample.git
SSH git clone git@github.com:google-gemini/angular-language-learning-sample.git
CLI gh repo clone google-gemini/angular-language-learning-sample
Mark Thompson Mark Thompson Merge pull request #12 from google-gemini/dependabot/npm_and_yarn/multi-cf87d80143 f698e58 1 years ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .idx
๐Ÿ“ docs
๐Ÿ“ src
๐Ÿ“„ .editorconfig
๐Ÿ“„ .gitignore
๐Ÿ“„ angular.json
๐Ÿ“„ CONTRIBUTING.md
๐Ÿ“„ LICENSE
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ server.ts
๐Ÿ“„ tsconfig.app.json
๐Ÿ“„ tsconfig.json
๐Ÿ“„ tsconfig.spec.json
๐Ÿ“„ README.md

Angular language learning sample

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

Open in IDX

Setup & Getting Started

This example uses Angular and Gemini API.

Before you start

Your system needs to be configured to run Angular.

You need Gemini API key in order to run this demo. Here's how:

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.

Getting the code

You have two options to get this code:

Configure your environment

To run this application, you can either
  • hard code your API key in server.ts
  • set it as an environment variable called API_KEY

Starting the application

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!

Making local changes

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