File tree 2 files changed +63
-0
lines changed
2 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -190,4 +190,14 @@ import { } from '@angular/fire/app-check';
190
190
```
191
191
</td >
192
192
</tr >
193
+ <tr >
194
+ <td>
195
+
196
+ #### [ Vertex AI] ( docs/vertexai.md#vertex-ai-preview )
197
+ ``` ts
198
+ import { } from ' @angular/fire/vertexai-preview' ;
199
+ ```
200
+ </td >
201
+
202
+ </tr >
193
203
</table >
Original file line number Diff line number Diff line change
1
+ <small >
2
+ <a href =" https://github.com/angular/angularfire " >AngularFire</a > ❱ ; <a href =" ../README.md#developer-guide " >Developer Guide</a > ❱ ; Vertex AI
3
+ </small >
4
+
5
+ # Vertex AI (preview)
6
+
7
+ The Vertex AI Gemini API gives you access to the latest generative AI models from Google: the Gemini models.
8
+
9
+ [ Learn more] ( https://firebase.google.com/docs/vertex-ai )
10
+
11
+ ## Dependency Injection
12
+
13
+ As a prerequisite, ensure that ` AngularFire ` has been added to your project via
14
+ ``` bash
15
+ ng add @angular/fire
16
+ ```
17
+
18
+ Provide a Vertex AI instance in the application's ` app.config.ts ` :
19
+
20
+ ``` ts
21
+ import { provideFirebaseApp , initializeApp } from ' @angular/fire/app' ;
22
+ import { provideVertexAI , getVertexAI } from ' @angular/fire/vertexai-preview' ;
23
+
24
+ export const appConfig: ApplicationConfig = {
25
+ providers: [
26
+ provideFirebaseApp (() => initializeApp ({ ... })),
27
+ provideVertexAI (() => getVertexAI ()),
28
+ ...
29
+ ],
30
+ ... ,
31
+ }
32
+ ```
33
+
34
+ Next inject ` VertexAI ` into your component:
35
+
36
+ ``` typescript
37
+ import { Component , inject } from ' @angular/core' ;
38
+ import { VertexAI } from ' @angular/fire/vertexai-preview' ;
39
+
40
+ @Component ({ ... })
41
+ export class MyComponent {
42
+ private vertexAI = inject (VertexAI );
43
+ ...
44
+ }
45
+ ```
46
+
47
+ ## Firebase API
48
+
49
+ AngularFire wraps the Firebase JS SDK to ensure proper functionality in Angular, while providing the same API.
50
+
51
+ Update the imports from ` import { ... } from 'firebase/vertexai-preview' ` to ` import { ... } from '@angular/fire/vertexai-preview' ` and follow the official documentation.
52
+
53
+ [ Getting Started] ( https://firebase.google.com/docs/vertex-ai/get-started?platform=web ) | [ API Reference] ( https://firebase.google.com/docs/reference/js/vertexai-preview )
You can’t perform that action at this time.
0 commit comments