Skip to content

Commit

Permalink
sample: migrated js-angular samples to use Google AI instead of Verte…
Browse files Browse the repository at this point in the history
…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
chrisraygill and “chrisraygill” authored Feb 28, 2025
1 parent 86eef57 commit 25c1efe
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 1,037 deletions.
38 changes: 31 additions & 7 deletions samples/js-angular/README.md
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
Loading

0 comments on commit 25c1efe

Please sign in to comment.