-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sample: migrated js-angular samples to use Google AI instead of Verte…
…x AI for easier set up (#2206) * Migrated sample to Google AI * Updated code * Udpated README * fixed formatting --------- Co-authored-by: “chrisraygill” <“chgill@google.com”>
- Loading branch information
1 parent
86eef57
commit 25c1efe
Showing
6 changed files
with
179 additions
and
1,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,48 @@ | ||
# Angular and Genkit streaming sample | ||
# Firebase Genkit Angular Streaming Sample | ||
|
||
This is a simple UI for streaming RPG character generator. | ||
An Angular application for generating RPG characters and interactive chatbot experiences using Google's Gemini API. | ||
|
||
To build: | ||
## Overview | ||
|
||
This sample application demonstrates how to implement streaming AI responses in an Angular application using Firebase Genkit and Google's Gemini API. It features two main components: | ||
- An RPG character generator that creates and streams character profiles | ||
- An interactive chatbot application for AI conversations | ||
|
||
## Prerequisites | ||
|
||
- Node.js v20+ and npm installed | ||
- A Google Developer Gemini API key | ||
|
||
## Setup Instructions | ||
|
||
1. Clone the repository and install dependencies: | ||
|
||
```bash | ||
npm i | ||
npm run setup | ||
``` | ||
|
||
The sample is using Vertex AI, so you'll need to auth: | ||
2. Get a Google Gemini API key: | ||
- Visit [Google AI Studio](https://makersuite.google.com/app/apikey) to create your API key | ||
- Set the environment variable: | ||
|
||
```bash | ||
gcloud auth application-default login | ||
export GOOGLE_GENAI_API_KEY=your_api_key_here | ||
``` | ||
|
||
To run the sample: | ||
## Running the Application | ||
|
||
Start the development server: | ||
|
||
```bash | ||
npm run genkit:dev | ||
``` | ||
|
||
Point your browser to http://localhost:4200/ | ||
Then access the application at [http://localhost:4200/](http://localhost:4200/) | ||
|
||
## Project Structure | ||
|
||
The application is built with: | ||
- Angular for the frontend framework | ||
- Firebase Genkit for AI integration | ||
- Gemini 2.0 Flash for the AI model |
Oops, something went wrong.