@firebase/ai 1.4.0-canary.d590889d6 → 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.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { Logger } from '@firebase/logger';
|
|
|
5
5
|
import { __asyncGenerator, __await } from 'tslib';
|
|
6
6
|
|
|
7
7
|
var name = "@firebase/ai";
|
|
8
|
-
var version = "1.4.0-canary.
|
|
8
|
+
var version = "1.4.0-canary.ec5f37403";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @license
|
|
@@ -996,6 +996,7 @@ async function makeRequest(model, task, apiSettings, stream, body, requestOption
|
|
|
996
996
|
// ignored
|
|
997
997
|
}
|
|
998
998
|
if (response.status === 403 &&
|
|
999
|
+
errorDetails &&
|
|
999
1000
|
errorDetails.some((detail) => detail.reason === 'SERVICE_DISABLED') &&
|
|
1000
1001
|
errorDetails.some((detail) => {
|
|
1001
1002
|
var _a, _b;
|
|
@@ -1575,6 +1576,8 @@ function aggregateResponses(responses) {
|
|
|
1575
1576
|
candidate.finishMessage;
|
|
1576
1577
|
aggregatedResponse.candidates[i].safetyRatings =
|
|
1577
1578
|
candidate.safetyRatings;
|
|
1579
|
+
aggregatedResponse.candidates[i].groundingMetadata =
|
|
1580
|
+
candidate.groundingMetadata;
|
|
1578
1581
|
/**
|
|
1579
1582
|
* Candidates should always have content and parts, but this handles
|
|
1580
1583
|
* possible malformed responses.
|
|
@@ -2488,50 +2491,6 @@ class ImagenImageFormat {
|
|
|
2488
2491
|
* See the License for the specific language governing permissions and
|
|
2489
2492
|
* limitations under the License.
|
|
2490
2493
|
*/
|
|
2491
|
-
/**
|
|
2492
|
-
* @deprecated Use the new {@link AIModel} instead. The Vertex AI in Firebase SDK has been
|
|
2493
|
-
* replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
|
|
2494
|
-
* services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
|
|
2495
|
-
*
|
|
2496
|
-
* Base class for Firebase AI model APIs.
|
|
2497
|
-
*
|
|
2498
|
-
* @public
|
|
2499
|
-
*/
|
|
2500
|
-
const VertexAIModel = AIModel;
|
|
2501
|
-
/**
|
|
2502
|
-
* @deprecated Use the new {@link AIError} instead. The Vertex AI in Firebase SDK has been
|
|
2503
|
-
* replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
|
|
2504
|
-
* services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
|
|
2505
|
-
*
|
|
2506
|
-
* Error class for the Firebase AI SDK.
|
|
2507
|
-
*
|
|
2508
|
-
* @public
|
|
2509
|
-
*/
|
|
2510
|
-
const VertexAIError = AIError;
|
|
2511
|
-
/**
|
|
2512
|
-
* @deprecated Use the new {@link getAI | getAI()} instead. The Vertex AI in Firebase SDK has been
|
|
2513
|
-
* replaced with the Firebase AI SDK to accommodate the evolving set of supported features and
|
|
2514
|
-
* services. For migration details, see the {@link https://firebase.google.com/docs/vertex-ai/migrate-to-latest-sdk | migration guide}.
|
|
2515
|
-
*
|
|
2516
|
-
* Returns a {@link VertexAI} instance for the given app, configured to use the
|
|
2517
|
-
* Vertex AI Gemini API. This instance will be
|
|
2518
|
-
* configured to use the Vertex AI Gemini API.
|
|
2519
|
-
*
|
|
2520
|
-
* @param app - The {@link @firebase/app#FirebaseApp} to use.
|
|
2521
|
-
* @param options - Options to configure the Vertex AI instance, including the location.
|
|
2522
|
-
*
|
|
2523
|
-
* @public
|
|
2524
|
-
*/
|
|
2525
|
-
function getVertexAI(app = getApp(), options) {
|
|
2526
|
-
app = getModularInstance(app);
|
|
2527
|
-
// Dependencies
|
|
2528
|
-
const AIProvider = _getProvider(app, AI_TYPE);
|
|
2529
|
-
const backend = new VertexAIBackend(options === null || options === void 0 ? void 0 : options.location);
|
|
2530
|
-
const identifier = encodeInstanceIdentifier(backend);
|
|
2531
|
-
return AIProvider.getImmediate({
|
|
2532
|
-
identifier
|
|
2533
|
-
});
|
|
2534
|
-
}
|
|
2535
2494
|
/**
|
|
2536
2495
|
* Returns the default {@link AI} instance that is associated with the provided
|
|
2537
2496
|
* {@link @firebase/app#FirebaseApp}. If no instance exists, initializes a new instance with the
|
|
@@ -2625,5 +2584,5 @@ function registerAI() {
|
|
|
2625
2584
|
}
|
|
2626
2585
|
registerAI();
|
|
2627
2586
|
|
|
2628
|
-
export { AIError, AIModel, ArraySchema, Backend, BackendType, BlockReason, BooleanSchema, ChatSession, FinishReason, FunctionCallingMode, GenerativeModel, GoogleAIBackend, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, ImagenAspectRatio, ImagenImageFormat, ImagenModel, ImagenPersonFilterLevel, ImagenSafetyFilterLevel, IntegerSchema, Modality, NumberSchema, ObjectSchema, POSSIBLE_ROLES, ResponseModality, Schema, SchemaType, StringSchema, VertexAIBackend,
|
|
2587
|
+
export { AIError, AIModel, ArraySchema, Backend, BackendType, BlockReason, BooleanSchema, ChatSession, FinishReason, FunctionCallingMode, GenerativeModel, GoogleAIBackend, HarmBlockMethod, HarmBlockThreshold, HarmCategory, HarmProbability, HarmSeverity, ImagenAspectRatio, ImagenImageFormat, ImagenModel, ImagenPersonFilterLevel, ImagenSafetyFilterLevel, IntegerSchema, Modality, NumberSchema, ObjectSchema, POSSIBLE_ROLES, ResponseModality, Schema, SchemaType, StringSchema, VertexAIBackend, getAI, getGenerativeModel, getImagenModel };
|
|
2629
2588
|
//# sourceMappingURL=index.node.mjs.map
|