Skip to content

Update to use new vertex api #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .postcssrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": {
"@tailwindcss/postcss": {}
}
}
55 changes: 28 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,39 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^18.1.0",
"@angular/cdk": "^18.1.4",
"@angular/common": "^18.1.0",
"@angular/compiler": "^18.1.0",
"@angular/core": "^18.1.0",
"@angular/fire": "^18.0.1",
"@angular/forms": "^18.1.0",
"@angular/material": "^18.1.4",
"@angular/platform-browser": "^18.1.0",
"@angular/platform-browser-dynamic": "^18.1.0",
"@google/generative-ai": "^0.19.0",
"firebase": "^10.13.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"uuid": "^10.0.0",
"zone.js": "~0.14.3"
"@angular/animations": "^19.2.8",
"@angular/cdk": "^19.2.11",
"@angular/common": "^19.2.8",
"@angular/compiler": "^19.2.8",
"@angular/core": "^19.2.8",
"@angular/fire": "^19.1.0",
"@angular/forms": "^19.2.8",
"@angular/material": "^19.2.11",
"@angular/platform-browser": "^19.2.8",
"@angular/platform-browser-dynamic": "^19.2.8",
"@google/generative-ai": "^0.24.0",
"@tailwindcss/postcss": "^4.1.4",
"firebase": "^11.6.1",
"rxjs": "~7.8.2",
"tslib": "^2.8.1",
"uuid": "^11.1.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.1.4",
"@angular/cli": "^18.1.4",
"@angular/compiler-cli": "^18.1.0",
"@types/jasmine": "~5.1.0",
"@angular-devkit/build-angular": "^19.2.9",
"@angular/cli": "^19.2.9",
"@angular/compiler-cli": "^19.2.8",
"@types/jasmine": "~5.1.7",
"@types/uuid": "^10.0.0",
"autoprefixer": "^10.4.20",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"autoprefixer": "^10.4.21",
"jasmine-core": "~5.6.0",
"karma": "~6.4.4",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.9",
"typescript": "~5.5.2"
"postcss": "^8.5.3",
"tailwindcss": "^4.1.4",
"typescript": "~5.8.3"
}
}
6,878 changes: 3,342 additions & 3,536 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

49 changes: 24 additions & 25 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,30 @@ const HELP_ME_CLEAN = 'You are an organization expert transforming this place to
const HELP_ME_PLAN = 'You are a travel expert planning a trip here for 5 people including one toddler and my mom who is turning 50.';

@Component({
selector: 'app-root',
standalone: true,
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
MatSnackBarModule, // Do not remove: used by service.
MatButtonModule,
MatMenuModule,
MatChipsModule,
MatFormFieldModule,
MatSlideToggleModule,
MatProgressSpinnerModule,
MatIconModule,
MatInputModule,
MatNativeDateModule,
MatSelectModule,
MatCheckboxModule,
AsyncPipe,
TaskComponent,
CheckboximageComponent,
],
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-root',
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
MatSnackBarModule, // Do not remove: used by service.
MatButtonModule,
MatMenuModule,
MatChipsModule,
MatFormFieldModule,
MatSlideToggleModule,
MatProgressSpinnerModule,
MatIconModule,
MatInputModule,
MatNativeDateModule,
MatSelectModule,
MatCheckboxModule,
AsyncPipe,
TaskComponent,
CheckboximageComponent,
],
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent {
readonly formControls = {
Expand Down
11 changes: 5 additions & 6 deletions src/app/checkboximage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import { MatCheckbox } from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon';

@Component({
selector: 'app-checkboximage',
standalone: true,
imports: [MatCheckbox, MatIconModule, MatCardModule],
templateUrl: './checkboximage.component.html',
styleUrl: './checkboximage.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-checkboximage',
imports: [MatCheckbox, MatIconModule, MatCardModule],
templateUrl: './checkboximage.component.html',
styleUrl: './checkboximage.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CheckboximageComponent {
checked = input(false);
Expand Down
11 changes: 5 additions & 6 deletions src/app/roundbutton.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button';

@Component({
selector: 'app-roundbutton',
standalone: true,
imports: [MatButtonModule, MatIconModule],
templateUrl: './roundbutton.component.html',
styleUrl: './roundbutton.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-roundbutton',
imports: [MatButtonModule, MatIconModule],
templateUrl: './roundbutton.component.html',
styleUrl: './roundbutton.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RoundbuttonComponent {
checked = input(false);
Expand Down
5 changes: 2 additions & 3 deletions src/app/services/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { GoogleGenerativeAIFetchError } from '@google/generative-ai';
import { v4 as uuidv4 } from 'uuid';
import { GoogleGenerativeAI } from '@google/generative-ai';
import { environment } from '../../environments/environments';
import { getVertexAI, getGenerativeModel } from 'firebase/vertexai-preview';
import { getVertexAI, getGenerativeModel } from 'firebase/vertexai';

type Priority = 'none' | 'low' | 'medium' | 'high';

Expand Down Expand Up @@ -93,8 +93,7 @@ export class TaskService {
// first call to GenerateContent(). You may see a PERMISSION_DENIED error before then.
private prodModel = getGenerativeModel(this.vertexAI, MODEL_CONFIG);

private genAI = new GoogleGenerativeAI(environment.gemini_api_key);
private experimentModel = this.genAI.getGenerativeModel(MODEL_CONFIG);
private experimentModel = getGenerativeModel(this.vertexAI, MODEL_CONFIG);

user$ = authState(this.auth);
public tasksSubject = new Subject<Task[]>();
Expand Down
33 changes: 16 additions & 17 deletions src/app/task.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,22 @@ import { RoundbuttonComponent } from './roundbutton.component';
import { MatDividerModule } from '@angular/material/divider';

@Component({
selector: 'app-task',
standalone: true,
imports: [
MatCard,
MatCardHeader,
MatCardTitle,
MatCardContent,
MatCheckbox,
MatButtonToggleModule,
MatIconModule,
MatButtonModule,
RoundbuttonComponent,
MatDividerModule,
],
templateUrl: './task.component.html',
styleUrl: './task.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'app-task',
imports: [
MatCard,
MatCardHeader,
MatCardTitle,
MatCardContent,
MatCheckbox,
MatButtonToggleModule,
MatIconModule,
MatButtonModule,
RoundbuttonComponent,
MatDividerModule,
],
templateUrl: './task.component.html',
styleUrl: './task.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TaskComponent {
task = input(undefined as TaskWithSubtasks | undefined);
Expand Down
4 changes: 1 addition & 3 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ $firebase-ai-angular-theme: mat.define-theme((
// Comment out the line below if you want to use the deprecated `color` inputs.
// @include mat.color-variants-backwards-compatibility($firebase-ai-angular-theme);
/* You can add global styles to this file, and also import other style files */
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

html, body { height: 100%; }
body {
Expand Down
Loading