@@ -487,11 +487,14 @@ export declare interface GenerateContentResponse {
487
487
/**
488
488
* A response candidate generated from the model.
489
489
* @property {Content } - content. {@link Content}
490
- * @property {number } - [index]. The index of the candidate in the {@link GenerateContentResponse}
490
+ * @property {number } - [index]. The index of the candidate in the {@link
491
+ * GenerateContentResponse}
491
492
* @property {FinishReason } - [finishReason]. {@link FinishReason}
492
493
* @property {string } - [finishMessage].
493
494
* @property {SafetyRating[] } - [safetyRatings]. Array of {@link SafetyRating}
494
495
* @property {CitationMetadata } - [citationMetadata]. {@link CitationMetadata}
496
+ * @property {GroundingMetadata } - [groundingMetadata]. {@link
497
+ * GroundingMetadata}
495
498
*/
496
499
export declare interface GenerateContentCandidate {
497
500
content : Content ;
@@ -500,6 +503,7 @@ export declare interface GenerateContentCandidate {
500
503
finishMessage ?: string ;
501
504
safetyRatings ?: SafetyRating [ ] ;
502
505
citationMetadata ?: CitationMetadata ;
506
+ groundingMetadata ?: GroundingMetadata ;
503
507
functionCall ?: FunctionCall ;
504
508
}
505
509
@@ -525,6 +529,57 @@ export declare interface CitationSource {
525
529
license ?: string ;
526
530
}
527
531
532
+ /**
533
+ * A collection of grounding attributions for a piece of content.
534
+ * @property {string[] } - [webSearchQueries]. Web search queries for the
535
+ * following-up web search.
536
+ * @property {GroundingAttribution[] } - [groundingAttributions]. Array of {@link
537
+ * GroundingAttribution}
538
+ */
539
+ export declare interface GroundingMetadata {
540
+ webSearchQueries ?: string [ ] ;
541
+ groundingAttributions ?: GroundingAttribution [ ] ;
542
+ }
543
+
544
+ /**
545
+ * Grounding attribution.
546
+ * @property {GroundingAttributionWeb } - [web] Attribution from the web.
547
+ * @property {GroundingAttributionSegment } - [segment] Segment of the content
548
+ * this attribution belongs to.
549
+ * @property {number } - [confidenceScore] Confidence score of the attribution.
550
+ * Ranges from 0 to 1. 1 is the most confident.
551
+ */
552
+ export declare interface GroundingAttribution {
553
+ web ?: GroundingAttributionWeb ;
554
+ segment ?: GroundingAttributionSegment ;
555
+ confidenceScore ?: number ;
556
+ }
557
+
558
+ /**
559
+ * Segment of the content this attribution belongs to.
560
+ * @property {number } - [part_index] The index of a Part object within its
561
+ * parent Content object.
562
+ * @property {number } - [startIndex] Start index in the given Part, measured in
563
+ * bytes. Offset from the start of the Part, inclusive, starting at zero.
564
+ * @property {number } - [endIndex] End index in the given Part, measured in
565
+ * bytes. Offset from the start of the Part, exclusive, starting at zero.
566
+ */
567
+ export declare interface GroundingAttributionSegment {
568
+ partIndex ?: number ;
569
+ startIndex ?: number ;
570
+ endIndex ?: number ;
571
+ }
572
+
573
+ /**
574
+ * Attribution from the web.
575
+ * @property {string } - [uri] URI reference of the attribution.
576
+ * @property {string } - [title] Title of the attribution.
577
+ */
578
+ export declare interface GroundingAttributionWeb {
579
+ uri ?: string ;
580
+ title ?: string ;
581
+ }
582
+
528
583
/**
529
584
* A predicted FunctionCall returned from the model that contains a string
530
585
* representating the FunctionDeclaration.name with the parameters and their
@@ -586,9 +641,9 @@ export declare interface FunctionDeclaration {
586
641
}
587
642
588
643
/**
589
- * A Tool is a piece of code that enables the system to interact with
590
- * external systems to perform an action, or set of actions, outside of
591
- * knowledge and scope of the model.
644
+ * A FunctionDeclarationsTool is a piece of code that enables the system to
645
+ * interact with external systems to perform an action, or set of actions,
646
+ * outside of knowledge and scope of the model.
592
647
* @property {object } - function_declarations One or more function declarations
593
648
* to be passed to the model along with the current user query. Model may decide
594
649
* to call a subset of these functions by populating
@@ -598,8 +653,54 @@ export declare interface FunctionDeclaration {
598
653
* generate the final response back to the user. Maximum 64 function
599
654
* declarations can be provided.
600
655
*/
601
- export declare interface Tool {
602
- function_declarations : FunctionDeclaration [ ] ;
656
+ export declare interface FunctionDeclarationsTool {
657
+ function_declarations ?: FunctionDeclaration [ ] ;
658
+ }
659
+
660
+ export declare interface RetrievalTool {
661
+ retrieval ?: Retrieval ;
662
+ }
663
+
664
+ export declare interface GoogleSearchRetrievalTool {
665
+ googleSearchRetrieval ?: GoogleSearchRetrieval ;
666
+ }
667
+
668
+ export declare type Tool =
669
+ | FunctionDeclarationsTool
670
+ | RetrievalTool
671
+ | GoogleSearchRetrievalTool ;
672
+
673
+ /**
674
+ * Defines a retrieval tool that model can call to access external knowledge.
675
+ * @property {VertexAISearch } - [vertexAiSearch] Set to use data source powered
676
+ by Vertex AI Search.
677
+ * @property {boolean } - [disableAttribution] Disable using the result from
678
+ this tool in detecting grounding attribution. This does not affect how the
679
+ result is given to the model for generation.
680
+ */
681
+ export declare interface Retrieval {
682
+ vertexAiSearch ?: VertexAISearch ;
683
+ disableAttribution ?: boolean ;
684
+ }
685
+
686
+ /**
687
+ * Tool to retrieve public web data for grounding, powered by Google.
688
+ * @property {boolean } - [disableAttribution] Disable using the result from this
689
+ * tool in detecting grounding attribution. This does not affect how the result
690
+ * is given to the model for generation.
691
+ */
692
+ export declare interface GoogleSearchRetrieval {
693
+ disableAttribution ?: boolean ;
694
+ }
695
+
696
+ /**
697
+ * Retrieve from Vertex AI Search datastore for grounding. See
698
+ https://cloud.google.com/vertex-ai-search-and-conversation
699
+ * @property {string } - [datastore] Fully-qualified Vertex AI Search's datastore
700
+ resource ID. projects/<>/locations/<>/collections/<>/dataStores/<>
701
+ */
702
+ export declare interface VertexAISearch {
703
+ datastore : string ;
603
704
}
604
705
605
706
/**
0 commit comments