-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add tool_config feat: Add file upload service feat: Add file_data to part options docs: A comment for field `candidate_count` in message `.google.ai.generativelanguage.v1beta.GenerationConfig` is changed PiperOrigin-RevId: 620400522
- Loading branch information
1 parent
a70aa2c
commit 81cd9fe
Showing
6 changed files
with
286 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Copyright 2023 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" | ||
}; | ||
|
||
// 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]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
// Copyright 2023 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/ai/generativelanguage/v1beta/file.proto"; | ||
import "google/api/annotations.proto"; | ||
import "google/api/client.proto"; | ||
import "google/api/field_behavior.proto"; | ||
import "google/api/resource.proto"; | ||
import "google/protobuf/empty.proto"; | ||
|
||
option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "FileServiceProto"; | ||
option java_package = "com.google.ai.generativelanguage.v1beta"; | ||
|
||
// An API for uploading and managing files. | ||
service FileService { | ||
option (google.api.default_host) = "generativelanguage.googleapis.com"; | ||
|
||
// Creates a `File`. | ||
rpc CreateFile(CreateFileRequest) returns (CreateFileResponse) { | ||
option (google.api.http) = { | ||
post: "/v1beta/files" | ||
body: "*" | ||
}; | ||
} | ||
|
||
// Lists the metadata for `File`s owned by the requesting project. | ||
rpc ListFiles(ListFilesRequest) returns (ListFilesResponse) { | ||
option (google.api.http) = { | ||
get: "/v1beta/files" | ||
}; | ||
} | ||
|
||
// Gets the metadata for the given `File`. | ||
rpc GetFile(GetFileRequest) returns (File) { | ||
option (google.api.http) = { | ||
get: "/v1beta/{name=files/*}" | ||
}; | ||
option (google.api.method_signature) = "name"; | ||
} | ||
|
||
// Deletes the `File`. | ||
rpc DeleteFile(DeleteFileRequest) returns (google.protobuf.Empty) { | ||
option (google.api.http) = { | ||
delete: "/v1beta/{name=files/*}" | ||
}; | ||
option (google.api.method_signature) = "name"; | ||
} | ||
} | ||
|
||
// Request for `CreateFile`. | ||
message CreateFileRequest { | ||
// Optional. Metadata for the file to create. | ||
File file = 1 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// Response for `CreateFile`. | ||
message CreateFileResponse { | ||
// Metadata for the created file. | ||
File file = 1; | ||
} | ||
|
||
// Request for `ListFiles`. | ||
message ListFilesRequest { | ||
// Optional. Maximum number of `File`s to return per page. | ||
// If unspecified, defaults to 10. Maximum `page_size` is 100. | ||
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; | ||
|
||
// Optional. A page token from a previous `ListFiles` call. | ||
string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// Response for `ListFiles`. | ||
message ListFilesResponse { | ||
// The list of `File`s. | ||
repeated File files = 1; | ||
|
||
// A token that can be sent as a `page_token` into a subsequent `ListFiles` | ||
// call. | ||
string next_page_token = 2; | ||
} | ||
|
||
// Request for `GetFile`. | ||
message GetFileRequest { | ||
// Required. The name of the `File` to get. | ||
// Example: `files/abc-123` | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = { | ||
type: "generativelanguage.googleapis.com/File" | ||
} | ||
]; | ||
} | ||
|
||
// Request for `DeleteFile`. | ||
message DeleteFileRequest { | ||
// Required. The name of the `File` to delete. | ||
// Example: `files/abc-123` | ||
string name = 1 [ | ||
(google.api.field_behavior) = REQUIRED, | ||
(google.api.resource_reference) = { | ||
type: "generativelanguage.googleapis.com/File" | ||
} | ||
]; | ||
} |
Oops, something went wrong.