Get desktop application:
View/edit binary Protocol Buffers messages
An API for using Generative Language Models (GLMs) in dialog applications. Also known as large language models (LLMs), this API provides models that are trained for multi-turn dialog.
Generates a response from the model given an input `MessagePrompt`.
Request to generate a message response from the model.
Required. The name of the model to use. Format: `name=models/{model}`.
Required. The structured textual input given to the model as a prompt. Given a prompt, the model will return what it predicts is the next message in the discussion.
Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model.
Optional. The number of generated response messages to return. This value must be between `[1, 8]`, inclusive. If unset, this will default to `1`.
Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`.
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.
The response from the model. This includes candidate messages and conversation history in the form of chronologically-ordered messages.
Candidate response messages from the model.
The conversation history used by the model.
A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category.
Runs a model's tokenizer on a string and returns the token count.
Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.
Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`
Required. The prompt, whose token count is to be returned.
A response from `CountMessageTokens`. It returns the model's `token_count` for the `prompt`.
The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.
Provides methods for getting metadata information about Generative Models.
Gets information about a specific Model.
Request for getting information about a specific Model.
Required. The resource name of the model. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`
Lists models available through the API.
Request for listing all Models.
The maximum number of `Models` to return (per page). The service may return fewer models. If unspecified, at most 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.
A page token, received from a previous `ListModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListModels` must match the call that provided the page token.
Response from `ListModel` containing a paginated list of Models.
The returned Models.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
Gets information about a specific TunedModel.
Request for getting information about a specific Model.
Required. The resource name of the model. Format: `tunedModels/my-model-id`
Lists tuned models owned by the user.
Request for listing TunedModels.
Optional. The maximum number of `TunedModels` to return (per page). The service may return fewer tuned models. If unspecified, at most 10 tuned models will be returned. This method returns at most 1000 models per page, even if you pass a larger page_size.
Optional. A page token, received from a previous `ListTunedModels` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListTunedModels` must match the call that provided the page token.
Response from `ListTunedModels` containing a paginated list of Models.
The returned Models.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
Creates a tuned model. Intermediate tuning progress (if any) is accessed through the [google.longrunning.Operations] service. Status and results can be accessed through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222
Request to create a TunedModel.
Optional. The unique id for the tuned model if specified. This value should be up to 40 characters, the first character must be a letter, the last could be a letter or a number. The id must match the regular expression: [a-z]([a-z0-9-]{0,38}[a-z0-9])?.
Required. The tuned model to create.
Updates a tuned model.
Request to update a TunedModel.
Required. The tuned model to update.
Required. The list of fields to update.
Deletes a tuned model.
Request to delete a TunedModel.
Required. The resource name of the model. Format: `tunedModels/my-model-id`
Provides methods for managing permissions to PaLM API resources.
Create a permission to a specific resource.
Request to create a `Permission`.
Required. The parent resource of the `Permission`. Format: tunedModels/{tuned_model}
Required. The permission to create.
Gets information about a specific Permission.
Request for getting information about a specific `Permission`.
Required. The resource name of the permission. Format: `tunedModels/{tuned_model}permissions/{permission}`
Lists permissions for the specific resource.
Request for listing permissions.
Required. The parent resource of the permissions. Format: tunedModels/{tuned_model}
Optional. The maximum number of `Permission`s to return (per page). The service may return fewer permissions. If unspecified, at most 10 permissions will be returned. This method returns at most 1000 permissions per page, even if you pass larger page_size.
Optional. A page token, received from a previous `ListPermissions` call. Provide the `page_token` returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to `ListPermissions` must match the call that provided the page token.
Response from `ListPermissions` containing a paginated list of permissions.
Returned permissions.
A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages.
Updates the permission.
Request to update the `Permission`.
Required. The permission to update. The permission's `name` field is used to identify the permission to update.
Required. The list of fields to update. Accepted ones: - role (`Permission.role` field)
Deletes the permission.
Request to delete the `Permission`.
Required. The resource name of the permission. Format: `tunedModels/{tuned_model}/permissions/{permission}`
Transfers ownership of the tuned model. This is the only way to change ownership of the tuned model. The current owner will be downgraded to writer role.
Request to transfer the ownership of the tuned model.
Required. The resource name of the tuned model to transfer ownership . Format: `tunedModels/my-model-id`
Required. The email address of the user to whom the tuned model is being transferred to.
Response from `TransferOwnership`.
(message has no fields)
API for using Generative Language Models (GLMs) trained to generate text. Also known as Large Language Models (LLM)s, these generate text given an input prompt from the user.
Generates a response from the model given an input message.
Request to generate a text completion response from the model.
Required. The name of the `Model` or `TunedModel` to use for generating the completion. Examples: models/text-bison-001 tunedModels/sentence-translator-u3b7m
Required. The free-form input text given to the model as a prompt. Given a prompt, the model will generate a TextCompletion response it predicts as the completion of the input text.
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. 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.
Optional. Number of generated responses to return. This value must be between [1, 8], inclusive. If unset, this will default to 1.
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.
Optional. The maximum cumulative probability of tokens to consider when sampling. The model uses combined Top-k and nucleus sampling. Tokens are sorted based on their assigned probabilities so that only the most likely tokens are considered. Top-k sampling directly limits the maximum number of tokens to consider, while Nucleus sampling limits number 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.
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.
A list of unique `SafetySetting` instances for blocking unsafe content. that will be enforced on the `GenerateTextRequest.prompt` and `GenerateTextResponse.candidates`. There should not be more than one setting for each `SafetyCategory` type. The API will block any prompts and responses that fail to meet the thresholds set by these settings. This list 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.
The set of character sequences (up to 5) that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response.
The response from the model, including candidate completions.
Candidate responses from the model.
A set of content filtering metadata for the prompt and response text. This indicates which `SafetyCategory`(s) blocked a candidate from this response, the lowest `HarmProbability` that triggered a block, and the HarmThreshold setting for that category. This indicates the smallest change to the `SafetySettings` that would be necessary to unblock at least 1 response. The blocking is configured by the `SafetySettings` in the request (or the default `SafetySettings` of the API).
Returns any safety feedback related to content filtering.
Generates an embedding from the model given an input message.
Request to get a text embedding from the model.
Required. The model name to use with the format model=models/{model}.
Required. The free-form input text that the model will turn into an embedding.
The response to a EmbedTextRequest.
Output only. The embedding generated from the input text.
Generates multiple embeddings from the model given input text in a synchronous call.
Batch request to get a text embedding from the model.
Required. The name of the `Model` to use for generating the embedding. Examples: models/embedding-gecko-001
Required. The free-form input texts that the model will turn into an embedding. The current limit is 100 texts, over which an error will be thrown.
The response to a EmbedTextRequest.
Output only. The embeddings generated from the input text.
Runs a model's tokenizer on a text and returns the token count.
Counts the number of tokens in the `prompt` sent to a model. Models may tokenize text differently, so each model may return a different `token_count`.
Required. The model's resource name. This serves as an ID for the Model to use. This name should match a model name returned by the `ListModels` method. Format: `models/{model}`
Required. The free-form input text given to the model as a prompt.
A response from `CountTextTokens`. It returns the model's `token_count` for the `prompt`.
The number of tokens that the `model` tokenizes the `prompt` into. Always non-negative.
A collection of source attributions for a piece of content.
Used in:
,Citations to sources for a specific response.
A citation to a source for a portion of a specific response.
Used in:
Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes.
Optional. End of the attributed segment, exclusive.
Optional. URI that is attributed as a source for a portion of the text.
Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations.
Content filtering metadata associated with processing a single request. ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.
Used in:
,The reason content was blocked during request processing.
A string that describes the filtering behavior in more detail.
A list of reasons why content may have been blocked.
Used in:
A blocked reason was not specified.
Content was blocked by safety settings.
Content was blocked, but the reason is uncategorized.
Metadata about the state and progress of creating a tuned model returned from the long-running operation
Name of the tuned model associated with the tuning operation.
The total number of tuning steps.
The number of steps completed.
The completed percentage for the tuning operation.
Metrics collected during tuning.
Dataset for training or validation.
Used in:
Inline data or a reference to the data.
Optional. Inline examples.
A list of floats representing the embedding.
Used in:
,The embedding values.
An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response.
Used in:
Required. An example of an input `Message` from the user.
Required. An example of what the model should output given the input.
The category of a rating. These categories cover various kinds of harms that developers may wish to adjust.
Used in:
,Category is unspecified.
Negative or harmful comments targeting identity and/or protected attribute.
Content that is rude, disrepspectful, or profane.
Describes scenarios depictng violence against an individual or group, or general descriptions of gore.
Contains references to sexual acts or other lewd content.
Promotes unchecked medical advice.
Dangerous content that promotes, facilitates, or encourages harmful acts.
Hyperparameters controlling the tuning process.
Used in:
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.
Immutable. The batch size hyperparameter for tuning. If not set, a default of 16 or 64 will be used based on the number of training examples.
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.
The base unit of structured text. A `Message` includes an `author` and the `content` of the `Message`. The `author` is used to tag messages when they are fed to the model as text.
Used in:
, ,Optional. The author of this Message. This serves as a key for tagging the content of this Message when it is fed to the model as text. The author can be any alphanumeric string.
Required. The text content of the structured `Message`.
Output only. Citation information for model-generated `content` in this `Message`. If this `Message` was generated as output from the model, this field may be populated with attribution information for any text included in the `content`. This field is used only on output.
All of the structured input text passed to the model as a prompt. A `MessagePrompt` contains a structured set of fields that provide context for the conversation, examples of user input/model output message pairs that prime the model to respond in different ways, and the conversation history or list of messages representing the alternating turns of the conversation between the user and the model.
Used in:
,Optional. Text that should be provided to the model first to ground the response. If not empty, this `context` will be given to the model first before the `examples` and `messages`. When using a `context` be sure to provide it with every request to maintain continuity. This field can be a description of your prompt to the model to help provide context and guide the responses. Examples: "Translate the phrase from English to French." or "Given a statement, classify the sentiment as happy, sad or neutral." Anything included in this field will take precedence over message history if the total input size exceeds the model's `input_token_limit` and the input request is truncated.
Optional. Examples of what the model should generate. This includes both user input and the response that the model should emulate. These `examples` are treated identically to conversation messages except that they take precedence over the history in `messages`: If the total input size exceeds the model's `input_token_limit` the input will be truncated. Items will be dropped from `messages` before `examples`.
Required. A snapshot of the recent conversation history sorted chronologically. Turns alternate between two authors. If the total input size exceeds the model's `input_token_limit` the input will be truncated: The oldest items will be dropped from `messages`.
Information about a Generative Language Model.
Used as response type in: ModelService.GetModel
Used as field type in:
Required. The resource name of the `Model`. Format: `models/{model}` with a `{model}` naming convention of: * "{base_model_id}-{version}" Examples: * `models/chat-bison-001`
Required. The name of the base model, pass this to the generation request. Examples: * `chat-bison`
Required. The version number of the model. This represents the major version
The human-readable name of the model. E.g. "Chat Bison". The name can be up to 128 characters long and can consist of any UTF-8 characters.
A short description of the model.
Maximum number of input tokens allowed for this model.
Maximum number of output tokens available for this model.
The model's supported generation methods. The method names are defined as Pascal case strings, such as `generateMessage` which correspond to API methods.
Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.
For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be used by the backend while making the call to the model.
For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model.
Permission resource grants user, group or the rest of the world access to the PaLM API resource (e.g. a tuned model, file). A role is a collection of permitted operations that allows users to perform specific actions on PaLM API resources. To make them available to users, groups, or service accounts, you assign roles. When you assign a role, you grant permissions that the role contains. There are three concentric roles. Each role is a superset of the previous role's permitted operations: - reader can use the resource (e.g. tuned model) for inference - writer has reader's permissions and additionally can edit and share - owner has writer's permissions and additionally can delete
Used as response type in: PermissionService.CreatePermission, PermissionService.GetPermission, PermissionService.UpdatePermission
Used as field type in:
, ,Output only. The permission name. A unique name will be generated on create. Example: tunedModels/{tuned_model}permssions/{permission} Output only.
Required. Immutable. The type of the grantee.
Optional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.
Required. The role granted by this permission.
Defines types of the grantee of this permission.
Used in:
The default value. This value is unused.
Represents a user. When set, you must provide email_address for the user.
Represents a group. When set, you must provide email_address for the group.
Represents access to everyone. No extra information is required.
Defines the role granted by this permission.
Used in:
The default value. This value is unused.
Owner can use, update, share and delete the resource.
Writer can use, update and share the resource.
Reader can use the resource.
Safety feedback for an entire request. This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.
Used in:
Safety rating evaluated from content.
Safety settings applied to the request.
Safety rating for a piece of content. The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.
Used in:
,Required. The category for this rating.
Required. The probability of harm for this content.
The probability that a piece of content is harmful. The classification system gives the probability of the content being unsafe. This does not indicate the severity of harm for a piece of content.
Used in:
Probability is unspecified.
Content has a negligible chance of being unsafe.
Content has a low chance of being unsafe.
Content has a medium chance of being unsafe.
Content has a high chance of being unsafe.
Safety setting, affecting the safety-blocking behavior. Passing a safety setting for a category changes the allowed proability that content is blocked.
Used in:
,Required. The category for this setting.
Required. Controls the probability threshold at which harm is blocked.
Block at and beyond a specified harm probability.
Used in:
Threshold is unspecified.
Content with NEGLIGIBLE will be allowed.
Content with NEGLIGIBLE and LOW will be allowed.
Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed.
All content will be allowed.
Output text returned from a model.
Used in:
Output only. The generated text returned from the model.
Ratings for the safety of a response. There is at most one rating per category.
Output only. Citation information for model-generated `output` in this `TextCompletion`. This field may be populated with attribution information for any text included in the `output`.
Text given to the model as a prompt. The Model will use this TextPrompt to Generate a text completion.
Used in:
,Required. The prompt text.
A fine-tuned model created using ModelService.CreateTunedModel.
Used as response type in: ModelService.GetTunedModel, ModelService.UpdateTunedModel
Used as field type in:
, ,The model used as the starting point for tuning.
Optional. TunedModel to use as the starting point for training the new model.
Immutable. The name of the `Model` to tune. Example: `models/text-bison-001`
Output only. The tuned model name. A unique name will be generated on create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on create, the id portion of the name will be set by concatenating the words of the display_name with hyphens and adding a random portion for uniqueness. Example: display_name = "Sentence Translator" name = "tunedModels/sentence-translator-u3b7m"
Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces.
Optional. A short description of this model.
Optional. Controls the randomness of the output. Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will produce responses that are more varied, while a value closer to `0.0` will typically result in less surprising responses from the model. This value specifies default to be the one used by the base model while creating the model.
Optional. For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least `top_p`. This value specifies default to be the one used by the base model while creating the model.
Optional. For Top-k sampling. Top-k sampling considers the set of `top_k` most probable tokens. This value specifies default to be used by the backend while making the call to the model. This value specifies default to be the one used by the base model while creating the model.
Output only. The state of the tuned model.
Output only. The timestamp when this model was created.
Output only. The timestamp when this model was updated.
Required. The tuning task that creates the tuned model.
The state of the tuned model.
Used in:
The default value. This value is unused.
The model is being created.
The model is ready to be used.
The model failed to be created.
Tuned model as a source for training a new model.
Used in:
Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model`
Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/text-bison-001`
A single example for tuning.
Used in:
The input to the model for this example.
Optional. Text model input.
Required. The expected model output.
A set of tuning examples. Can be training or validatation data.
Used in:
Required. The examples. Example input can be for text or discuss, but all examples in a set must be of the same type.
Record for a single tuning step.
Used in:
,Output only. The tuning step.
Output only. The epoch this step was part of.
Output only. The mean loss of the training examples for this step.
Output only. The timestamp when this metric was computed.
Tuning tasks that create tuned models.
Used in:
Output only. The timestamp when tuning this model started.
Output only. The timestamp when tuning this model completed.
Output only. Metrics collected during tuning.
Required. Input only. Immutable. The model training data.
Immutable. Hyperparameters controlling the tuning process. If not provided, default values will be used.