UNPKG

@react-native-firebase/vertexai

Version:

React Native Firebase - Vertex AI is a fully-managed, unified AI development platform for building and using generative AI

135 lines (130 loc) 4.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _exportNames = { getVertexAI: true, VertexAIModel: true, VertexAIError: true, VertexAIBackend: true, AIModel: true, AIError: true, VertexAIErrorCode: true }; Object.defineProperty(exports, "AIError", { enumerable: true, get: function () { return _ai.AIError; } }); Object.defineProperty(exports, "AIModel", { enumerable: true, get: function () { return _ai.AIModel; } }); Object.defineProperty(exports, "VertexAIBackend", { enumerable: true, get: function () { return _ai.VertexAIBackend; } }); exports.VertexAIError = void 0; Object.defineProperty(exports, "VertexAIErrorCode", { enumerable: true, get: function () { return _ai.AIErrorCode; } }); exports.VertexAIModel = void 0; exports.getVertexAI = getVertexAI; var _app = require("@react-native-firebase/app"); var _ai = require("@react-native-firebase/ai"); Object.keys(_ai).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _ai[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _ai[key]; } }); }); var _publicTypes = require("./public-types.js"); Object.keys(_publicTypes).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _publicTypes[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _publicTypes[key]; } }); }); /** * @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. */ const DEFAULT_LOCATION = 'us-central1'; /** * @deprecated Use the new {@link getAI | getAI()} instead. The Vertex AI in Firebase SDK has been * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. * * Returns a {@link VertexAI} instance for the given app, configured to use the * Vertex AI Gemini API. This instance will be * configured to use the Vertex AI Gemini API. * * Returns a <code>{@link VertexAI}</code> instance for the given app. * * @public * * @param app - The {@link @FirebaseApp} to use. * @param options - The {@link VertexAIOptions} to use. * @param appCheck - The {@link @AppCheck} to use. * @param auth - The {@link @Auth} to use. */ function getVertexAI(app = (0, _app.getApp)(), options) { return { app, location: options?.location || DEFAULT_LOCATION, appCheck: options?.appCheck || null, auth: options?.auth || null, backend: new _ai.VertexAIBackend(options?.location || DEFAULT_LOCATION) }; } /** * @deprecated Use the new {@link AIModel} instead. The Vertex AI in Firebase SDK has been * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. * * Base class for Firebase AI model APIs. * * @public */ const VertexAIModel = exports.VertexAIModel = _ai.AIModel; /** * @deprecated Use the new {@link AIError} instead. The Vertex AI in Firebase SDK has been * replaced with the Firebase AI SDK to accommodate the evolving set of supported features and * services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}. * * Error class for the Firebase AI SDK. * * @public */ const VertexAIError = exports.VertexAIError = _ai.AIError; //# sourceMappingURL=index.js.map