xref: /aosp_15_r20/external/googleapis/google/ai/generativelanguage/v1beta3/citation.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.ai.generativelanguage.v1beta3;
18
19import "google/api/field_behavior.proto";
20
21option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta3/generativelanguagepb;generativelanguagepb";
22option java_multiple_files = true;
23option java_outer_classname = "CitationProto";
24option java_package = "com.google.ai.generativelanguage.v1beta3";
25
26// A collection of source attributions for a piece of content.
27message CitationMetadata {
28  // Citations to sources for a specific response.
29  repeated CitationSource citation_sources = 1;
30}
31
32// A citation to a source for a portion of a specific response.
33message CitationSource {
34  // Optional. Start of segment of the response that is attributed to this
35  // source.
36  //
37  // Index indicates the start of the segment, measured in bytes.
38  optional int32 start_index = 1 [(google.api.field_behavior) = OPTIONAL];
39
40  // Optional. End of the attributed segment, exclusive.
41  optional int32 end_index = 2 [(google.api.field_behavior) = OPTIONAL];
42
43  // Optional. URI that is attributed as a source for a portion of the text.
44  optional string uri = 3 [(google.api.field_behavior) = OPTIONAL];
45
46  // Optional. License for the GitHub project that is attributed as a source for
47  // segment.
48  //
49  // License info is required for code citations.
50  optional string license = 4 [(google.api.field_behavior) = OPTIONAL];
51}
52