@firebase/ai 1.4.0-canary.c0617a341 → 1.4.0-canary.ec5f37403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-public.d.ts +225 -71
- package/dist/ai.d.ts +225 -71
- package/dist/esm/index.esm2017.js +5 -46
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/esm/src/api.d.ts +2 -38
- package/dist/esm/src/public-types.d.ts +0 -18
- package/dist/esm/src/types/requests.d.ts +68 -6
- package/dist/esm/src/types/responses.d.ts +148 -11
- package/dist/esm/src/types/schema.d.ts +11 -3
- package/dist/index.cjs.js +4 -48
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.node.cjs.js +4 -48
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +5 -46
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/api.d.ts +2 -38
- package/dist/src/public-types.d.ts +0 -18
- package/dist/src/types/requests.d.ts +68 -6
- package/dist/src/types/responses.d.ts +148 -11
- package/dist/src/types/schema.d.ts +11 -3
- package/package.json +8 -8
package/dist/index.node.cjs.js
CHANGED
|
@@ -9,7 +9,7 @@ var logger$1 = require('@firebase/logger');
|
|
|
9
9
|
var tslib = require('tslib');
|
|
10
10
|
|
|
11
11
|
var name = "@firebase/ai";
|
|
12
|
-
var version = "1.4.0-canary.
|
|
12
|
+
var version = "1.4.0-canary.ec5f37403";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
@@ -1000,6 +1000,7 @@ async function makeRequest(model, task, apiSettings, stream, body, requestOption
|
|
|
1000
1000
|
// ignored
|
|
1001
1001
|
}
|
|
1002
1002
|
if (response.status === 403 &&
|
|
1003
|
+
errorDetails &&
|
|
1003
1004
|
errorDetails.some((detail) => detail.reason === 'SERVICE_DISABLED') &&
|
|
1004
1005
|
errorDetails.some((detail) => {
|
|
1005
1006
|
var _a, _b;
|
|
@@ -1579,6 +1580,8 @@ function aggregateResponses(responses) {
|
|
|
1579
1580
|
candidate.finishMessage;
|
|
1580
1581
|
aggregatedResponse.candidates[i].safetyRatings =
|
|
1581
1582
|
candidate.safetyRatings;
|
|
1583
|
+
aggregatedResponse.candidates[i].groundingMetadata =
|
|
1584
|
+
candidate.groundingMetadata;
|
|
1582
1585
|
/**
|
|
1583
1586
|
* Candidates should always have content and parts, but this handles
|
|
1584
1587
|
* possible malformed responses.
|
|
@@ -2492,50 +2495,6 @@ class ImagenImageFormat {
|
|
|
2492
2495
|
* See the License for the specific language governing permissions and
|
|
2493
2496
|
* limitations under the License.
|
|
2494
2497
|
*/
|
|
2495
|
-
/**
|
|
2496
|
-
* @deprecated Use the new {@link AIModel} instead. The Vertex AI in Firebase SDK has been
|
|
2497
|
-
* replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
|
|
2498
|
-
* services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
|
|
2499
|
-
*
|
|
2500
|
-
* Base class for Firebase AI model APIs.
|
|
2501
|
-
*
|
|
2502
|
-
* @public
|
|
2503
|
-
*/
|
|
2504
|
-
const VertexAIModel = AIModel;
|
|
2505
|
-
/**
|
|
2506
|
-
* @deprecated Use the new {@link AIError} instead. The Vertex AI in Firebase SDK has been
|
|
2507
|
-
* replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
|
|
2508
|
-
* services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
|
|
2509
|
-
*
|
|
2510
|
-
* Error class for the Firebase AI SDK.
|
|
2511
|
-
*
|
|
2512
|
-
* @public
|
|
2513
|
-
*/
|
|
2514
|
-
const VertexAIError = AIError;
|
|
2515
|
-
/**
|
|
2516
|
-
* @deprecated Use the new {@link getAI | getAI()} instead. The Vertex AI in Firebase SDK has been
|
|
2517
|
-
* replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
|
|
2518
|
-
* services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
|
|
2519
|
-
*
|
|
2520
|
-
* Returns a {@link VertexAI} instance for the given app, configured to use the
|
|
2521
|
-
* Vertex AI Gemini API. This instance will be
|
|
2522
|
-
* configured to use the Vertex AI Gemini API.
|
|
2523
|
-
*
|
|
2524
|
-
* @param app - The {@link @firebase/app#FirebaseApp} to use.
|
|
2525
|
-
* @param options - Options to configure the Vertex AI instance, including the location.
|
|
2526
|
-
*
|
|
2527
|
-
* @public
|
|
2528
|
-
*/
|
|
2529
|
-
function getVertexAI(app$1 = app.getApp(), options) {
|
|
2530
|
-
app$1 = util.getModularInstance(app$1);
|
|
2531
|
-
// Dependencies
|
|
2532
|
-
const AIProvider = app._getProvider(app$1, AI_TYPE);
|
|
2533
|
-
const backend = new VertexAIBackend(options === null || options === void 0 ? void 0 : options.location);
|
|
2534
|
-
const identifier = encodeInstanceIdentifier(backend);
|
|
2535
|
-
return AIProvider.getImmediate({
|
|
2536
|
-
identifier
|
|
2537
|
-
});
|
|
2538
|
-
}
|
|
2539
2498
|
/**
|
|
2540
2499
|
* Returns the default {@link AI} instance that is associated with the provided
|
|
2541
2500
|
* {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new instance with the
|
|
@@ -2648,10 +2607,7 @@ exports.ResponseModality = ResponseModality;
|
|
|
2648
2607
|
exports.Schema = Schema;
|
|
2649
2608
|
exports.StringSchema = StringSchema;
|
|
2650
2609
|
exports.VertexAIBackend = VertexAIBackend;
|
|
2651
|
-
exports.VertexAIError = VertexAIError;
|
|
2652
|
-
exports.VertexAIModel = VertexAIModel;
|
|
2653
2610
|
exports.getAI = getAI;
|
|
2654
2611
|
exports.getGenerativeModel = getGenerativeModel;
|
|
2655
2612
|
exports.getImagenModel = getImagenModel;
|
|
2656
|
-
exports.getVertexAI = getVertexAI;
|
|
2657
2613
|
//# sourceMappingURL=index.node.cjs.js.map
|