@firebase/ai 2.3.0-canary.0ffcb26af → 2.3.0-canary.1bcf83d7f
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 +1 -119
- package/dist/ai.d.ts +1 -120
- package/dist/esm/index.esm.js +3 -54
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/src/types/googleai.d.ts +1 -2
- package/dist/esm/src/types/requests.d.ts +1 -21
- package/dist/esm/src/types/responses.d.ts +0 -92
- package/dist/index.cjs.js +2 -54
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.node.cjs.js +2 -54
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +3 -54
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/types/googleai.d.ts +1 -2
- package/dist/src/types/requests.d.ts +1 -21
- package/dist/src/types/responses.d.ts +0 -92
- package/package.json +8 -8
package/dist/index.node.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ var util = require('@firebase/util');
|
|
|
8
8
|
var logger$1 = require('@firebase/logger');
|
|
9
9
|
|
|
10
10
|
var name = "@firebase/ai";
|
|
11
|
-
var version = "2.3.0-canary.
|
|
11
|
+
var version = "2.3.0-canary.1bcf83d7f";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
@@ -364,45 +364,6 @@ const Language = {
|
|
|
364
364
|
* See the License for the specific language governing permissions and
|
|
365
365
|
* limitations under the License.
|
|
366
366
|
*/
|
|
367
|
-
/**
|
|
368
|
-
* The status of a URL retrieval.
|
|
369
|
-
*
|
|
370
|
-
* @remarks
|
|
371
|
-
* <b>URL_RETRIEVAL_STATUS_UNSPECIFIED:</b> Unspecified retrieval status.
|
|
372
|
-
* <br/>
|
|
373
|
-
* <b>URL_RETRIEVAL_STATUS_SUCCESS:</b> The URL retrieval was successful.
|
|
374
|
-
* <br/>
|
|
375
|
-
* <b>URL_RETRIEVAL_STATUS_ERROR:</b> The URL retrieval failed.
|
|
376
|
-
* <br/>
|
|
377
|
-
* <b>URL_RETRIEVAL_STATUS_PAYWALL:</b> The URL retrieval failed because the content is behind a paywall.
|
|
378
|
-
* <br/>
|
|
379
|
-
* <b>URL_RETRIEVAL_STATUS_UNSAFE:</b> The URL retrieval failed because the content is unsafe.
|
|
380
|
-
* <br/>
|
|
381
|
-
*
|
|
382
|
-
* @beta
|
|
383
|
-
*/
|
|
384
|
-
const URLRetrievalStatus = {
|
|
385
|
-
/**
|
|
386
|
-
* Unspecified retrieval status.
|
|
387
|
-
*/
|
|
388
|
-
URL_RETRIEVAL_STATUS_UNSPECIFIED: 'URL_RETRIEVAL_STATUS_UNSPECIFIED',
|
|
389
|
-
/**
|
|
390
|
-
* The URL retrieval was successful.
|
|
391
|
-
*/
|
|
392
|
-
URL_RETRIEVAL_STATUS_SUCCESS: 'URL_RETRIEVAL_STATUS_SUCCESS',
|
|
393
|
-
/**
|
|
394
|
-
* The URL retrieval failed.
|
|
395
|
-
*/
|
|
396
|
-
URL_RETRIEVAL_STATUS_ERROR: 'URL_RETRIEVAL_STATUS_ERROR',
|
|
397
|
-
/**
|
|
398
|
-
* The URL retrieval failed because the content is behind a paywall.
|
|
399
|
-
*/
|
|
400
|
-
URL_RETRIEVAL_STATUS_PAYWALL: 'URL_RETRIEVAL_STATUS_PAYWALL',
|
|
401
|
-
/**
|
|
402
|
-
* The URL retrieval failed because the content is unsafe.
|
|
403
|
-
*/
|
|
404
|
-
URL_RETRIEVAL_STATUS_UNSAFE: 'URL_RETRIEVAL_STATUS_UNSAFE'
|
|
405
|
-
};
|
|
406
367
|
/**
|
|
407
368
|
* The types of responses that can be returned by {@link LiveSession.receive}.
|
|
408
369
|
*
|
|
@@ -1606,8 +1567,7 @@ function mapGenerateContentCandidates(candidates) {
|
|
|
1606
1567
|
finishMessage: candidate.finishMessage,
|
|
1607
1568
|
safetyRatings: mappedSafetyRatings,
|
|
1608
1569
|
citationMetadata,
|
|
1609
|
-
groundingMetadata: candidate.groundingMetadata
|
|
1610
|
-
urlContextMetadata: candidate.urlContextMetadata
|
|
1570
|
+
groundingMetadata: candidate.groundingMetadata
|
|
1611
1571
|
};
|
|
1612
1572
|
mappedCandidates.push(mappedCandidate);
|
|
1613
1573
|
});
|
|
@@ -1777,17 +1737,6 @@ function aggregateResponses(responses) {
|
|
|
1777
1737
|
candidate.safetyRatings;
|
|
1778
1738
|
aggregatedResponse.candidates[i].groundingMetadata =
|
|
1779
1739
|
candidate.groundingMetadata;
|
|
1780
|
-
// The urlContextMetadata object is defined in the first chunk of the response stream.
|
|
1781
|
-
// In all subsequent chunks, the urlContextMetadata object will be undefined. We need to
|
|
1782
|
-
// make sure that we don't overwrite the first value urlContextMetadata object with undefined.
|
|
1783
|
-
// FIXME: What happens if we receive a second, valid urlContextMetadata object?
|
|
1784
|
-
const urlContextMetadata = candidate.urlContextMetadata;
|
|
1785
|
-
if (typeof urlContextMetadata === 'object' &&
|
|
1786
|
-
urlContextMetadata !== null &&
|
|
1787
|
-
Object.keys(urlContextMetadata).length > 0) {
|
|
1788
|
-
aggregatedResponse.candidates[i].urlContextMetadata =
|
|
1789
|
-
urlContextMetadata;
|
|
1790
|
-
}
|
|
1791
1740
|
/**
|
|
1792
1741
|
* Candidates should always have content and parts, but this handles
|
|
1793
1742
|
* possible malformed responses.
|
|
@@ -3816,7 +3765,6 @@ exports.ResponseModality = ResponseModality;
|
|
|
3816
3765
|
exports.Schema = Schema;
|
|
3817
3766
|
exports.SchemaType = SchemaType;
|
|
3818
3767
|
exports.StringSchema = StringSchema;
|
|
3819
|
-
exports.URLRetrievalStatus = URLRetrievalStatus;
|
|
3820
3768
|
exports.VertexAIBackend = VertexAIBackend;
|
|
3821
3769
|
exports.getAI = getAI;
|
|
3822
3770
|
exports.getGenerativeModel = getGenerativeModel;
|