aboutsummaryrefslogtreecommitdiff
path: root/google/ai/generativelanguage/v1beta/file.proto
blob: d8cfc69d23ee4d02809aca4886676916836c19cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.ai.generativelanguage.v1beta;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb";
option java_multiple_files = true;
option java_outer_classname = "FileProto";
option java_package = "com.google.ai.generativelanguage.v1beta";

// A file uploaded to the API.
message File {
  option (google.api.resource) = {
    type: "generativelanguage.googleapis.com/File"
    pattern: "files/{file}"
    plural: "files"
    singular: "file"
  };

  // States for the lifecycle of a File.
  enum State {
    // The default value. This value is used if the state is omitted.
    STATE_UNSPECIFIED = 0;

    // File is being processed and cannot be used for inference yet.
    PROCESSING = 1;

    // File is processed and available for inference.
    ACTIVE = 2;

    // File failed processing.
    FAILED = 10;
  }

  // Immutable. Identifier. The `File` resource name. The ID (name excluding the
  // "files/" prefix) can contain up to 40 characters that are lowercase
  // alphanumeric or dashes (-). The ID cannot start or end with a dash. If the
  // name is empty on create, a unique name will be generated. Example:
  // `files/123-456`
  string name = 1 [
    (google.api.field_behavior) = IDENTIFIER,
    (google.api.field_behavior) = IMMUTABLE
  ];

  // Optional. The human-readable display name for the `File`. The display name
  // must be no more than 512 characters in length, including spaces. Example:
  // "Welcome Image"
  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];

  // Output only. MIME type of the file.
  string mime_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Size of the file in bytes.
  int64 size_bytes = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The timestamp of when the `File` was created.
  google.protobuf.Timestamp create_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The timestamp of when the `File` was last updated.
  google.protobuf.Timestamp update_time = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The timestamp of when the `File` will be deleted. Only set if
  // the `File` is scheduled to expire.
  google.protobuf.Timestamp expiration_time = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. SHA-256 hash of the uploaded bytes.
  bytes sha256_hash = 8 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The uri of the `File`.
  string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Processing state of the File.
  State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
}