@@ -321,6 +321,20 @@ message SearchRequest {
321321 // A specification for configuring a summary returned in a search
322322 // response.
323323 message SummarySpec {
324+ // Specification of the prompt to use with the model.
325+ message ModelPromptSpec {
326+ // Text at the beginning of the prompt that instructs the assistant.
327+ // Examples are available in the user guide.
328+ string preamble = 1 ;
329+ }
330+
331+ // Specification of the model.
332+ message ModelSpec {
333+ // The string format of the model version.
334+ // e.g. stable, preview, etc.
335+ string version = 1 ;
336+ }
337+
324338 // The number of top results to generate the summary from. If the number
325339 // of results returned is less than `summaryResultCount`, the summary is
326340 // generated from all of the results.
@@ -372,10 +386,18 @@ message SearchRequest {
372386 // fallback messages instead.
373387 bool ignore_non_summary_seeking_query = 4 ;
374388
389+ // If specified, the spec will be used to modify the prompt provided to
390+ // the LLM.
391+ ModelPromptSpec model_prompt_spec = 5 ;
392+
375393 // Language code for Summary. Use language tags defined by
376394 // [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
377395 // Note: This is an experimental feature.
378396 string language_code = 6 ;
397+
398+ // If specified, the spec will be used to modify the model specification
399+ // provided to the LLM.
400+ ModelSpec model_spec = 7 ;
379401 }
380402
381403 // A specification for configuring the extractive content in a search
@@ -535,6 +557,20 @@ message SearchRequest {
535557 // [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
536558 string filter = 7 ;
537559
560+ // The default filter that is applied when a user performs a search without
561+ // checking any filters on the search page.
562+ //
563+ // The filter applied to every search request when quality improvement such as
564+ // query expansion is needed. In the case a query does not have a sufficient
565+ // amount of results this filter will be used to determine whether or not to
566+ // enable the query expansion flow. The original filter will still be used for
567+ // the query expanded search.
568+ // This field is strongly recommended to achieve high search quality.
569+ //
570+ // For more information about filter syntax, see
571+ // [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter].
572+ string canonical_filter = 29 ;
573+
538574 // The order in which documents are returned. Documents can be ordered by
539575 // a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
540576 // object. Leave it unset if ordered by relevance. `order_by` expression is
@@ -743,6 +779,65 @@ message SearchResponse {
743779 repeated float scores = 2 ;
744780 }
745781
782+ // Citation metadata.
783+ message CitationMetadata {
784+ // Citations for segments.
785+ repeated Citation citations = 1 ;
786+ }
787+
788+ // Citation info for a segment.
789+ message Citation {
790+ // Index indicates the start of the segment, measured in bytes/unicode.
791+ int64 start_index = 1 ;
792+
793+ // End of the attributed segment, exclusive.
794+ int64 end_index = 2 ;
795+
796+ // Citation sources for the attributed segment.
797+ repeated CitationSource sources = 3 ;
798+ }
799+
800+ // Citation source.
801+ message CitationSource {
802+ // Document reference index from SummaryWithMetadata.references.
803+ // It is 0-indexed and the value will be zero if the reference_index is
804+ // not set explicitly.
805+ int64 reference_index = 4 ;
806+ }
807+
808+ // Document reference.
809+ message Reference {
810+ // Title of the document.
811+ string title = 1 ;
812+
813+ // Required.
814+ // [Document.name][google.cloud.discoveryengine.v1alpha.Document.name] of
815+ // the document. Full resource name of the referenced document, in the
816+ // format
817+ // `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
818+ string document = 2 [
819+ (google.api.field_behavior ) = REQUIRED ,
820+ (google.api.resource_reference ) = {
821+ type : "discoveryengine.googleapis.com/Document"
822+ }
823+ ];
824+
825+ // GCS or HTTP uri for the document.
826+ string uri = 3 ;
827+ }
828+
829+ // Summary with metadata information.
830+ message SummaryWithMetadata {
831+ // Summary text with no citation information.
832+ string summary = 1 ;
833+
834+ // Citation metadata for given summary.
835+ CitationMetadata citation_metadata = 2 ;
836+
837+ // Document References.
838+ repeated Reference references = 3 ;
839+ }
840+
746841 // An Enum for summary-skipped reasons.
747842 enum SummarySkippedReason {
748843 // Default value. The summary skipped reason is not specified.
@@ -791,6 +886,8 @@ message SearchResponse {
791886 // A collection of Safety Attribute categories and their associated
792887 // confidence scores.
793888 SafetyAttributes safety_attributes = 3 ;
889+
890+ SummaryWithMetadata summary_with_metadata = 4 ;
794891 }
795892
796893 // Debug information specifically related to forward geocoding issues arising
0 commit comments