[go: nahoru, domu]

Skip to content

Commit

Permalink
addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 committed May 10, 2024
1 parent 79a88fe commit 4af78f1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion vertexai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Getting Started
2. Enable Gemini in the console.
3. Create a ReCAPTCHA Enterprise key in the same project.
4. Enable App Check in the Firebase console with the ReCAPTCHA Enterprise site key you created.
5. Copy your Firebase project config and your ReCAPTCHA Enterprise site key into the appropraite places in `config.ts` in this directory.
5. Copy your Firebase project config and your ReCAPTCHA Enterprise site key into the appropriate places in `config.ts` in this directory.
6. In this directory, run `npm install`
7. In this directory, run `npm run dev`

Expand Down
4 changes: 2 additions & 2 deletions vertexai/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<!--
Copyright (c) 2016 Google Inc.
Copyright (c) 2024 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Firebase SDK for Vertex AI Quickstart</title>
<title>Vertex AI for Firebase SDK Quickstart</title>
</head>
<body>
<div>Open browser's developer console to view console.log output.</div>
Expand Down
25 changes: 22 additions & 3 deletions vertexai/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/**
* @license
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { initializeApp } from 'firebase/app';
import { firebaseConfig, RECAPTCHA_ENTERPRISE_SITE_KEY } from './config';
import {
Expand All @@ -9,14 +26,16 @@ import { getVertexAI, getGenerativeModel } from "firebase/vertexai-preview";
async function main() {
const app = initializeApp(firebaseConfig);

// initialize app check
// Initialize App Check
// This line can be removed if you do not want to enable App Check for
// your project. App Check is recommended to limit unauthorized usage.
initializeAppCheck(app, {
provider: new ReCaptchaEnterpriseProvider(RECAPTCHA_ENTERPRISE_SITE_KEY),
});

// Get vertex instance
// Get VertexAI instance
const vertexAI = getVertexAI(app);
// Get a gemini model
// Get a Gemini model
const model = getGenerativeModel(
vertexAI,
{ model: "gemini-1.5-pro-preview-0409" }
Expand Down
6 changes: 3 additions & 3 deletions vertexai/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quickstart-js-storage",
"name": "quickstart-js-vertexai",
"version": "1.0.0",
"description": "JavaScript quickstarts for Firebase Storage.",
"description": "JavaScript quickstarts for Vertex AI for Firebase.",
"repository": {
"type": "git",
"url": "git+https://github.com/firebase/quickstart-js.git"
Expand All @@ -26,6 +26,6 @@
"format": "prettier --write ."
},
"dependencies": {
"firebase": "10.12.0"
"firebase": "^10.12.0"
}
}

0 comments on commit 4af78f1

Please sign in to comment.