Skip to content

Commit

Permalink
Update proto
Browse files Browse the repository at this point in the history
  • Loading branch information
gkkachi committed Mar 17, 2024
1 parent 9bdd615 commit 7668409
Show file tree
Hide file tree
Showing 48 changed files with 2,128 additions and 304 deletions.
25 changes: 14 additions & 11 deletions proto/google/ai/generativelanguage/v1beta/generative_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ service GenerativeService {
option (google.api.http) = {
post: "/v1beta/{model=models/*}:generateContent"
body: "*"
additional_bindings {
post: "/v1beta/{model=tunedModels/*}:generateContent"
body: "*"
}
};
option (google.api.method_signature) = "model,contents";
}
Expand Down Expand Up @@ -185,18 +189,16 @@ message GenerationConfig {

// Optional. The maximum number of tokens to include in a candidate.
//
// If unset, this will default to output_token_limit specified in the `Model`
// specification.
// Note: The default value varies by model, see the `Model.output_token_limit`
// attribute of the `Model` returned from the `getModel` function.
optional int32 max_output_tokens = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Controls the randomness of the output.
//
// Note: The default value varies by model, see the `Model.temperature`
// attribute of the `Model` returned the `getModel` function.
// attribute of the `Model` returned from the `getModel` function.
//
// Values can range from [0.0,1.0],
// inclusive. A value closer to 1.0 will produce responses that are more
// varied and creative, while a value closer to 0.0 will typically result in
// more straightforward responses from the model.
// Values can range from [0.0, infinity).
optional float temperature = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. The maximum cumulative probability of tokens to consider when
Expand All @@ -210,18 +212,17 @@ message GenerationConfig {
// of tokens based on the cumulative probability.
//
// Note: The default value varies by model, see the `Model.top_p`
// attribute of the `Model` returned the `getModel` function.
// attribute of the `Model` returned from the `getModel` function.
optional float top_p = 6 [(google.api.field_behavior) = OPTIONAL];

// Optional. The maximum number of tokens to consider when sampling.
//
// The model uses combined Top-k and nucleus sampling.
//
// Top-k sampling considers the set of `top_k` most probable tokens.
// Defaults to 40.
//
// Note: The default value varies by model, see the `Model.top_k`
// attribute of the `Model` returned the `getModel` function.
// attribute of the `Model` returned from the `getModel` function.
optional int32 top_k = 7 [(google.api.field_behavior) = OPTIONAL];
}

Expand Down Expand Up @@ -457,7 +458,9 @@ message GenerateAnswerRequest {
// overrides the default settings for each `SafetyCategory` specified in the
// safety_settings. If there is no `SafetySetting` for a given
// `SafetyCategory` provided in the list, the API will use the default safety
// setting for that category.
// setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH,
// HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT,
// HARM_CATEGORY_HARASSMENT are supported.
repeated SafetySetting safety_settings = 3
[(google.api.field_behavior) = OPTIONAL];

Expand Down
4 changes: 2 additions & 2 deletions proto/google/ai/generativelanguage/v1beta/safety.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ enum HarmCategory {
// Negative or harmful comments targeting identity and/or protected attribute.
HARM_CATEGORY_DEROGATORY = 1;

// Content that is rude, disrepspectful, or profane.
// Content that is rude, disrespectful, or profane.
HARM_CATEGORY_TOXICITY = 2;

// Describes scenarios depictng violence against an individual or group, or
// Describes scenarios depicting violence against an individual or group, or
// general descriptions of gore.
HARM_CATEGORY_VIOLENCE = 3;

Expand Down
33 changes: 25 additions & 8 deletions proto/google/ai/generativelanguage/v1beta/tuned_model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,38 @@ message TuningTask {
Hyperparameters hyperparameters = 5 [(google.api.field_behavior) = IMMUTABLE];
}

// Hyperparameters controlling the tuning process.
// Hyperparameters controlling the tuning process. Read more at
// https://ai.google.dev/docs/model_tuning_guidance
message Hyperparameters {
// Options for specifying learning rate during tuning.
oneof learning_rate_option {
// Optional. Immutable. The learning rate hyperparameter for tuning.
// If not set, a default of 0.001 or 0.0002 will be calculated based on the
// number of training examples.
float learning_rate = 16 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OPTIONAL
];

// Optional. Immutable. The learning rate multiplier is used to calculate a
// final learning_rate based on the default (recommended) value. Actual
// learning rate := learning_rate_multiplier * default learning rate Default
// learning rate is dependent on base model and dataset size. If not set, a
// default of 1.0 will be used.
float learning_rate_multiplier = 17 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = OPTIONAL
];
}

// Immutable. The number of training epochs. An epoch is one pass through the
// training data. If not set, a default of 10 will be used.
// training data. If not set, a default of 5 will be used.
optional int32 epoch_count = 14 [(google.api.field_behavior) = IMMUTABLE];

// Immutable. The batch size hyperparameter for tuning.
// If not set, a default of 16 or 64 will be used based on the number of
// If not set, a default of 4 or 16 will be used based on the number of
// training examples.
optional int32 batch_size = 15 [(google.api.field_behavior) = IMMUTABLE];

// Immutable. The learning rate hyperparameter for tuning.
// If not set, a default of 0.0002 or 0.002 will be calculated based on the
// number of training examples.
optional float learning_rate = 16 [(google.api.field_behavior) = IMMUTABLE];
}

// Dataset for training or validation.
Expand Down
11 changes: 4 additions & 7 deletions proto/google/api/cloudquotas/v1/cloudquotas.proto
Original file line number Diff line number Diff line change
Expand Up @@ -231,19 +231,16 @@ message ListQuotaPreferencesRequest {
// create/update time range.
//
// Example filters:
// `state=PENDING OR state=PENDING_PARTIALLY_GRANTED`
// `state=PENDING OR state=PENDING_PARTIALLY_GRANTED AND
// creation_time>2022-12-03T10:30:00`
//
// If no filter is provided, returns all pending quota preferences.
// `reconciling=true AND request_type=CLOUD_CONSOLE`,
// `reconciling=true OR creation_time>2022-12-03T10:30:00`
string filter = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. How to order of the results. By default, the results are ordered
// by create time.
//
// Example orders:
// `type`
// `state, create_time`
// `quota_id`,
// `service, create_time`
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

Expand Down
42 changes: 42 additions & 0 deletions proto/google/chat/v1/annotation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ syntax = "proto3";

package google.chat.v1;

import "google/chat/v1/attachment.proto";
import "google/chat/v1/user.proto";

option csharp_namespace = "Google.Apps.Chat.V1";
Expand Down Expand Up @@ -72,6 +73,9 @@ message Annotation {

// The metadata for a slash command.
SlashCommandMetadata slash_command = 5;

// The metadata for a rich link.
RichLinkMetadata rich_link_metadata = 6;
}
}

Expand Down Expand Up @@ -124,6 +128,41 @@ message SlashCommandMetadata {
bool triggers_dialog = 5;
}

// A rich link to a resource.
message RichLinkMetadata {
// The rich link type. More types might be added in the future.
enum RichLinkType {
// Default value for the enum. Don't use.
RICH_LINK_TYPE_UNSPECIFIED = 0;

// A Google Drive rich link type.
DRIVE_FILE = 1;
}

// The URI of this link.
string uri = 1;

// The rich link type.
RichLinkType rich_link_type = 2;

// Data for the linked resource.
oneof data {
// Data for a drive link.
DriveLinkData drive_link_data = 3;
}
}

// Data for Google Drive links.
message DriveLinkData {
// A
// [DriveDataRef](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
// which references a Google Drive file.
DriveDataRef drive_data_ref = 1;

// The mime type of the linked Google Drive resource.
string mime_type = 2;
}

// Type of the annotation.
enum AnnotationType {
// Default value for the enum. Don't use.
Expand All @@ -134,4 +173,7 @@ enum AnnotationType {

// A slash command is invoked.
SLASH_COMMAND = 2;

// A rich link annotation.
RICH_LINK = 3;
}
3 changes: 3 additions & 0 deletions proto/google/cloud/aiplatform/v1/accelerator_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ enum AcceleratorType {
// Nvidia L4 GPU.
NVIDIA_L4 = 11;

// Nvidia H100 80Gb GPU.
NVIDIA_H100_80GB = 13;

// TPU v2.
TPU_V2 = 6;

Expand Down
95 changes: 95 additions & 0 deletions proto/google/cloud/aiplatform/v1/content.proto
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,39 @@ message SafetyRating {
HIGH = 4;
}

// Harm severity levels.
enum HarmSeverity {
// Harm severity unspecified.
HARM_SEVERITY_UNSPECIFIED = 0;

// Negligible level of harm severity.
HARM_SEVERITY_NEGLIGIBLE = 1;

// Low level of harm severity.
HARM_SEVERITY_LOW = 2;

// Medium level of harm severity.
HARM_SEVERITY_MEDIUM = 3;

// High level of harm severity.
HARM_SEVERITY_HIGH = 4;
}

// Output only. Harm category.
HarmCategory category = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Harm probability levels in the content.
HarmProbability probability = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Harm probability score.
float probability_score = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Harm severity levels in the content.
HarmSeverity severity = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Harm severity score.
float severity_score = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Indicates whether the content was filtered out because of this
// rating.
bool blocked = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand Down Expand Up @@ -265,6 +292,18 @@ message Candidate {

// All other reasons that stopped the token generation
OTHER = 5;

// The token generation was stopped as the response was flagged for the
// terms which are included from the terminology blocklist.
BLOCKLIST = 6;

// The token generation was stopped as the response was flagged for
// the prohibited contents.
PROHIBITED_CONTENT = 7;

// The token generation was stopped as the response was flagged for
// Sensitive Personally Identifiable Information (SPII) contents.
SPII = 8;
}

// Output only. Index of the candidate.
Expand All @@ -291,4 +330,60 @@ message Candidate {
// Output only. Source attribution of the generated content.
CitationMetadata citation_metadata = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Metadata specifies sources used to ground generated content.
GroundingMetadata grounding_metadata = 7
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Segment of the content.
message Segment {
// Output only. The index of a Part object within its parent Content object.
int32 part_index = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Start index in the given Part, measured in bytes. Offset from
// the start of the Part, inclusive, starting at zero.
int32 start_index = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. End index in the given Part, measured in bytes. Offset from
// the start of the Part, exclusive, starting at zero.
int32 end_index = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Grounding attribution.
message GroundingAttribution {
// Attribution from the web.
message Web {
// Output only. URI reference of the attribution.
string uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Title of the attribution.
string title = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

oneof reference {
// Optional. Attribution from the web.
Web web = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Output only. Segment of the content this attribution belongs to.
Segment segment = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. Output only. Confidence score of the attribution. Ranges from 0
// to 1. 1 is the most confident.
optional float confidence_score = 2 [
(google.api.field_behavior) = OPTIONAL,
(google.api.field_behavior) = OUTPUT_ONLY
];
}

// Metadata returned to client when grounding is enabled.
message GroundingMetadata {
// Optional. Web search queries for the following-up web search.
repeated string web_search_queries = 1
[(google.api.field_behavior) = OPTIONAL];

// Optional. List of grounding attributions.
repeated GroundingAttribution grounding_attributions = 2
[(google.api.field_behavior) = OPTIONAL];
}
12 changes: 12 additions & 0 deletions proto/google/cloud/aiplatform/v1/dataset_version.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package google.cloud.aiplatform.v1;

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

option csharp_namespace = "Google.Cloud.AIPlatform.V1";
Expand Down Expand Up @@ -52,4 +53,15 @@ message DatasetVersion {

// Output only. Name of the associated BigQuery dataset.
string big_query_dataset_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// The user-defined name of the DatasetVersion.
// The name can be up to 128 characters long and can consist of any UTF-8
// characters.
string display_name = 7;

// Required. Output only. Additional information about the DatasetVersion.
google.protobuf.Value metadata = 8 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = REQUIRED
];
}
9 changes: 6 additions & 3 deletions proto/google/cloud/aiplatform/v1/endpoint_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,23 @@ message ListEndpointsRequest {
// Optional. An expression for filtering the results of the request. For field
// names both snake_case and camelCase are supported.
//
// * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
// * `endpoint` supports `=` and `!=`. `endpoint` represents the Endpoint
// ID,
// i.e. the last segment of the Endpoint's [resource
// name][google.cloud.aiplatform.v1.Endpoint.name].
// * `display_name` supports = and, !=
// * `display_name` supports `=` and `!=`.
// * `labels` supports general map functions that is:
// * `labels.key=value` - key:value equality
// * `labels.key:* or labels:key - key existence
// * `labels.key:*` or `labels:key` - key existence
// * A key including a space must be quoted. `labels."a key"`.
// * `base_model_name` only supports `=`.
//
// Some examples:
//
// * `endpoint=1`
// * `displayName="myDisplayName"`
// * `labels.myKey="myValue"`
// * `baseModelName="text-bison"`
string filter = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. The standard list page size.
Expand Down
Loading

0 comments on commit 7668409

Please sign in to comment.