Skip to content

Commit 4de548e

Browse files
Merge branch 'main' into data-connect-readme-doc
2 parents aa81c41 + f54c0fe commit 4de548e

9 files changed

Lines changed: 72 additions & 64 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
169169
with:
170170
node-version: '20'
171-
registry-url: 'https://registry.npmjs.org'
171+
registry-url: 'https://wombat-dressing-room.appspot.com/'
172172
check-latest: false
173173
- name: 'Download Artifacts'
174174
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ import { } from '@angular/fire/app-check';
183183
</td>
184184
<td>
185185

186-
#### [Vertex AI](docs/vertexai.md#vertex-ai)
186+
#### [AI Logic](docs/ai.md#ai-logic)
187187
```ts
188-
import { } from '@angular/fire/vertexai';
188+
import { } from '@angular/fire/ai';
189189
```
190190
</td>
191191
</tr>

docs/ai.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<small>
2+
<a href="https://github.com/angular/angularfire">AngularFire</a> &#10097; <a href="../README.md#developer-guide">Developer Guide</a> &#10097; AI Logic
3+
</small>
4+
5+
# AI Logic
6+
7+
Firebase AI Logic gives you access to the latest generative AI models from Google: the Gemini models and Imagen models.
8+
9+
[Learn more](https://firebase.google.com/docs/ai-logic)
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 an AI instance in the application's `app.config.ts`:
19+
20+
```ts
21+
import { provideFirebaseApp, initializeApp } from '@angular/fire/app';
22+
import { provideAI, getAI } from '@angular/fire/ai';
23+
24+
export const appConfig: ApplicationConfig = {
25+
providers: [
26+
provideFirebaseApp(() => initializeApp({ ... })),
27+
provideAI(() => getAI()),
28+
...
29+
],
30+
...,
31+
}
32+
```
33+
34+
Next inject `AI` into your component:
35+
36+
```typescript
37+
import { Component, inject } from '@angular/core';
38+
import { AI } from '@angular/fire/ai';
39+
40+
@Component({ ... })
41+
export class MyComponent {
42+
private ai = inject(AI);
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/ai'` to `import { ... } from '@angular/fire/ai'` and follow the official documentation.
52+
53+
[Getting Started](https://firebase.google.com/docs/ai-logic/get-started?platform=web) | [API Reference](https://firebase.google.com/docs/reference/js/ai)

docs/vertexai.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"name": "@angular/fire",
33
"version": "21.0.0-rc.0",
44
"description": "Angular + Firebase = ❤️",
5+
"publishConfig": {
6+
"registry": "https://wombat-dressing-room.appspot.com",
7+
"access": "public"
8+
},
59
"private": true,
610
"scripts": {
711
"test": "npm run build:jasmine && npm run test:node-esm && npm run test:chrome-headless",

src/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"name": "@angular/fire",
44
"version": "ANGULARFIRE2_VERSION",
55
"description": "Angular + Firebase = ❤️",
6+
"publishConfig": {
7+
"registry": "https://wombat-dressing-room.appspot.com",
8+
"access": "public"
9+
},
610
"schematics": "./schematics/collection.json",
711
"builders": "./schematics/builders.json",
812
"keywords": [

src/schematics/interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const enum FEATURES {
1212
Firestore,
1313
Storage,
1414
RemoteConfig,
15-
VertexAI,
15+
AI,
1616
}
1717

1818
export const featureOptions = [
@@ -27,7 +27,7 @@ export const featureOptions = [
2727
{ name: 'Performance Monitoring', value: FEATURES.Performance },
2828
{ name: 'Cloud Storage', value: FEATURES.Storage },
2929
{ name: 'Remote Config', value: FEATURES.RemoteConfig },
30-
{ name: 'Vertex AI', value: FEATURES.VertexAI },
30+
{ name: 'AI Logic', value: FEATURES.AI },
3131
];
3232

3333
export const enum PROJECT_TYPE { Static, CloudFunctions, CloudRun, WebFrameworks }

src/schematics/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,13 @@ export function featureToRules(
293293
"@angular/fire/remote-config"
294294
)}(() => getRemoteConfig())`;
295295
});
296-
case FEATURES.VertexAI:
296+
case FEATURES.AI:
297297
return addRootProvider(projectName, ({ code, external }) => {
298-
external("getVertexAI", "@angular/fire/vertexai");
298+
external("getAI", "@angular/fire/ai");
299299
return code`${external(
300-
"provideVertexAI",
301-
"@angular/fire/vertexai"
302-
)}(() => getVertexAI())`;
300+
"provideAI",
301+
"@angular/fire/ai"
302+
)}(() => getAI())`;
303303
});
304304
default:
305305
return undefined;

tools/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ fi;
1717
npm --no-git-tag-version --allow-same-version -f version $OVERRIDE_VERSION
1818

1919
npm run build &&
20-
echo "npm publish . --tag $NPM_TAG" > ./dist/packages-dist/publish.sh &&
20+
echo "npm publish . --access public --registry https://wombat-dressing-room.appspot.com --tag $NPM_TAG" > ./dist/packages-dist/publish.sh &&
2121
chmod +x ./dist/packages-dist/publish.sh

0 commit comments

Comments
 (0)