@@ -1786,6 +1786,73 @@ message DataSchemaDetails {
17861786
17871787 // The search strategy for annotations value of the `key`.
17881788 message SearchStrategy {
1789+ // Filter on the confidence score. Only adds to index if the confidence
1790+ // score is higher than the threshold.
1791+ // Example data schema:
1792+ // key: "name-confidence-pair"
1793+ // type: CUSTOMIZED_STRUCT
1794+ // granularity: GRANULARITY_PARTITION_LEVEL
1795+ // customized_struct_config {
1796+ // field_schemas {
1797+ // key: "name"
1798+ // type: STRING
1799+ // granularity: GRANULARITY_PARTITION_LEVEL
1800+ // search_strategy {
1801+ // search_strategy_type: SMART_SEARCH
1802+ // confidence_score_index_config {
1803+ // field_path: "name-confidence-pair.score"
1804+ // threshold: 0.6
1805+ // }
1806+ // }
1807+ // }
1808+ // field_schemas {
1809+ // key: "score"
1810+ // type: FLOAT
1811+ // granularity: GRANULARITY_PARTITION_LEVEL
1812+ // }
1813+ // }
1814+ // This means only "name" with score > 0.6 will be indexed.
1815+ message ConfidenceScoreIndexConfig {
1816+ // Required. The path to the confidence score field. It is a string that
1817+ // concatenates all the data schema keys along the path. See the example
1818+ // above. If the data schema contains LIST, use '_ENTRIES' to concatenate.
1819+ // Example data schema contains a list:
1820+ // "key": "list-name-score",
1821+ // "schemaDetails": {
1822+ // "type": "LIST",
1823+ // "granularity": "GRANULARITY_PARTITION_LEVEL",
1824+ // "listConfig": {
1825+ // "valueSchema": {
1826+ // "type": "CUSTOMIZED_STRUCT",
1827+ // "granularity": "GRANULARITY_PARTITION_LEVEL",
1828+ // "customizedStructConfig": {
1829+ // "fieldSchemas": {
1830+ // "name": {
1831+ // "type": "STRING",
1832+ // "granularity": "GRANULARITY_PARTITION_LEVEL",
1833+ // "searchStrategy": {
1834+ // "searchStrategyType": "SMART_SEARCH"
1835+ // "confidence_score_index_config": {
1836+ // "field_path": "list-name-score._ENTRIES.score",
1837+ // "threshold": "0.9",
1838+ // }
1839+ // }
1840+ // },
1841+ // "score": {
1842+ // "type": "FLOAT",
1843+ // "granularity": "GRANULARITY_PARTITION_LEVEL",
1844+ // }
1845+ // }
1846+ // }
1847+ // }
1848+ // }
1849+ // }
1850+ string field_path = 1 [(google.api.field_behavior ) = REQUIRED ];
1851+
1852+ // Required. The threshold.
1853+ float threshold = 2 [(google.api.field_behavior ) = REQUIRED ];
1854+ }
1855+
17891856 // The types of search strategies to be applied on the annotation key.
17901857 enum SearchStrategyType {
17911858 // Annotatation values of the `key` above will not be searchable.
@@ -1805,7 +1872,14 @@ message DataSchemaDetails {
18051872 // which is documented in the DataSchemaDetails.DataType. Specifying
18061873 // unsupported `search_strategy_type` for data types will result in
18071874 // INVALID_ARGUMENT error.
1808- SearchStrategyType search_strategy_type = 1 ;
1875+ optional SearchStrategyType search_strategy_type = 1 ;
1876+
1877+ // Optional. Configs the path to the confidence score, and the threshold.
1878+ // Only if the score is greater than the threshold, current field will be
1879+ // built into the index. Only applies to leaf nodes using EXACT_SEARCH or
1880+ // SMART_SEARCH.
1881+ ConfidenceScoreIndexConfig confidence_score_index_config = 2
1882+ [(google.api.field_behavior ) = OPTIONAL ];
18091883 }
18101884
18111885 // Data type of the annotation.
@@ -1916,7 +1990,7 @@ message DataSchemaDetails {
19161990 }
19171991
19181992 // Type of the annotation.
1919- DataType type = 1 ;
1993+ optional DataType type = 1 ;
19201994
19211995 // Config for protobuf any type.
19221996 ProtoAnyConfig proto_any_config = 6 ;
@@ -1928,7 +2002,7 @@ message DataSchemaDetails {
19282002 CustomizedStructConfig customized_struct_config = 9 ;
19292003
19302004 // The granularity associated with this DataSchema.
1931- Granularity granularity = 5 ;
2005+ optional Granularity granularity = 5 ;
19322006
19332007 // The search strategy to be applied on the `key` above.
19342008 SearchStrategy search_strategy = 7 ;
@@ -2140,8 +2214,12 @@ message ListAnnotationsRequest {
21402214
21412215 // The filter applied to the returned list.
21422216 // We only support filtering for the following fields:
2217+ // For corpus of STREAM_VIDEO type:
21432218 // `partition.temporal_partition.start_time`,
21442219 // `partition.temporal_partition.end_time`, and `key`.
2220+ // For corpus of VIDEO_ON_DEMAND type,
2221+ // `partition.relative_temporal_partition.start_offset`,
2222+ // `partition.relative_temporal_partition.end_offset`, and `key`.
21452223 // For corpus of IMAGE type, only `key` is supported.
21462224 // Timestamps are specified in the RFC-3339 format, and only one restriction
21472225 // may be applied per field, joined by conjunctions.
@@ -2726,11 +2804,11 @@ message SearchHypernym {
27262804 // `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}`
27272805 string name = 1 ;
27282806
2729- // The hypernym.
2730- string hypernym = 2 ;
2807+ // Optional. The hypernym.
2808+ string hypernym = 2 [ (google.api .field_behavior ) = OPTIONAL ] ;
27312809
2732- // Hyponyms that the hypernym is mapped to.
2733- repeated string hyponyms = 3 ;
2810+ // Optional. Hyponyms that the hypernym is mapped to.
2811+ repeated string hyponyms = 3 [ (google.api .field_behavior ) = OPTIONAL ] ;
27342812}
27352813
27362814// Request message for creating SearchHypernym.
0 commit comments