### Schema: TuningExample Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 A single example for tuning. ```markdown ## Schema: TuningExample A single example for tuning. **Type:** object - **textInput** (string): Optional. Text model input. - **output** (string) (required): Required. The expected model output. ``` -------------------------------- ### Schema: Example Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response. ```markdown ## Schema: Example An input/output example used to instruct the Model. It demonstrates how the model should respond or format its response. **Type:** object - **input** (object) (required): 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. - **citationMetadata** (object): A collection of source attributions for a piece of content. - **citationSources** (array (CitationSource)): Citations to sources for a specific response. Array items: - **startIndex** (integer (int32)): Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes. - **license** (string): Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations. - **endIndex** (integer (int32)): Optional. End of the attributed segment, exclusive. - **uri** (string): Optional. URI that is attributed as a source for a portion of the text. - **author** (string): 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. - **content** (string) (required): Required. The text content of the structured `Message`. - **output** (object) (required): 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. ``` -------------------------------- ### GET /v1beta3/corpora/{corpus}/permissions/{permission} Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Gets information about a specific Permission. ```markdown ### Parameters - **corpus** (string, path, required): Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - **permission** (string, path, required): Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. ### Responses #### default - Successful operation **Permission** - **emailAddress** (string): 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. - **name** (string): Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only. - **role** (string (ROLE_UNSPECIFIED|OWNER|WRITER|READER)) (required): Required. The role granted by this permission. ("ROLE_UNSPECIFIED"|"OWNER"|"WRITER"|"READER") - **granteeType** (string (GRANTEE_TYPE_UNSPECIFIED|USER|GROUP|EVERYONE)): Optional. Immutable. The type of the grantee. ("GRANTEE_TYPE_UNSPECIFIED"|"USER"|"GROUP"|"EVERYONE") ### Example Usage ```bash curl -X GET "https://generativelanguage.googleapis.com/v1beta3/corpora/{corpus}/permissions/{permission}" ``` ``` -------------------------------- ### Schema: TuningExamples Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 A set of tuning examples. Can be training or validation data. ```markdown ## Schema: TuningExamples A set of tuning examples. Can be training or validation data. **Type:** object - **examples** (array (TuningExample)): The examples. Example input can be for text or discuss, but all examples in a set must be of the same type. Array items: - **textInput** (string): Optional. Text model input. - **output** (string) (required): Required. The expected model output. ``` -------------------------------- ### GET /v1beta3/models/{model} Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information. ```markdown ### Parameters - **model** (string, path, required): Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. ### Responses #### default - Successful operation **Model** - **temperature** (number (float)): Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value 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. - **topK** (integer (int32)): 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. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter. - **name** (string) (required): Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * "{base_model_id}-{version}" Examples: * `models/gemini-1.5-flash-001` - **thinking** (boolean): Whether the model supports thinking. - **outputTokenLimit** (integer (int32)): Maximum number of output tokens available for this model. - **inputTokenLimit** (integer (int32)): Maximum number of input tokens allowed for this model. - **maxTemperature** (number (float)): The maximum temperature this model can use. - **topP** (number (float)): For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). 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. - **displayName** (string): The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters. - **baseModelId** (string) (required): Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash` - **description** (string): A short description of the model. - **version** (string) (required): Required. The version number of the model. This represents the major version (`1.0` or `1.5`) - **supportedGenerationMethods** (array (string)): The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`. ### Example Usage ```bash curl -X GET "https://generativelanguage.googleapis.com/v1beta3/models/{model}" ``` ``` -------------------------------- ### GET /v1beta3/tunedModels Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Lists created tuned models. ```markdown ### Parameters - **pageSize** (integer (int32), query, optional): 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. - **pageToken** (string, query, optional): 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. - **filter** (string, query, optional): Optional. A filter is a full text search over the tuned model's description and display name. By default, results will not include tuned models shared with everyone. Additional operators: - owner:me - writers:me - readers:me - readers:everyone Examples: "owner:me" returns all tuned models to which caller has owner role "readers:me" returns all tuned models to which caller has reader role "readers:everyone" returns all tuned models that are shared with everyone ### Responses #### default - Successful operation **ListTunedModelsResponse** - **tunedModels** (array (TunedModel)): The returned Models. Array items: - **description** (string): Optional. A short description of this model. - **displayName** (string): Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - **baseModel** (string): Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` - **topP** (number (float)): 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. - **temperature** (number (float)): 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. - **topK** (integer (int32)): 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. - **createTime** (string (date-time)): Output only. The timestamp when this model was created. - **tuningTask** (object) (required): Tuning tasks that create tuned models. - **snapshots** (array (TuningSnapshot)): Output only. Metrics collected during tuning. Array items: - **step** (integer (int32)): Output only. The tuning step. - **meanLoss** (number (float)): Output only. The mean loss of the training examples for this step. - **computeTime** (string (date-time)): Output only. The timestamp when this metric was computed. - **epoch** (integer (int32)): Output only. The epoch this step was part of. - **hyperparameters** (object): Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance - **epochCount** (integer (int32)): Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. - **learningRateMultiplier** (number (float)): 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. - **learningRate** (number (float)): 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. - **batchSize** (integer (int32)): Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. - **startTime** (string (date-time)): Output only. The timestamp when tuning this model started. - **completeTime** (string (date-time)): Output only. The timestamp when tuning this model completed. - **trainingData** (object) (required): Dataset for training or validation. - **examples** (object): A set of tuning examples. Can be training or validation data. - **tunedModelSource** (object): Tuned model as a source for training a new model. - **tunedModel** (string): Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model` - **baseModel** (string): Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001` - **name** (string): 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` - **state** (string (STATE_UNSPECIFIED|CREATING|ACTIVE|FAILED)): Output only. The state of the tuned model. ("STATE_UNSPECIFIED"|"CREATING"|"ACTIVE"|"FAILED") - **updateTime** (string (date-time)): Output only. The timestamp when this model was updated. - **readerProjectNumbers** (array (string (int64))): Optional. List of project numbers that have read access to the tuned model. - **nextPageToken** (string): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages. ### Example Usage ```bash curl -X GET "https://generativelanguage.googleapis.com/v1beta3/tunedModels?pageSize=0&pageToken=string&filter=string" ``` ``` -------------------------------- ### GET /v1beta3/corpora/{corpus}/permissions Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Lists permissions for the specific resource. ```markdown ### Parameters - **corpus** (string, path, required): Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - **pageSize** (integer (int32), query, optional): 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. - **pageToken** (string, query, optional): 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. ### Responses #### default - Successful operation **ListPermissionsResponse** - **permissions** (array (Permission)): Returned permissions. Array items: - **emailAddress** (string): 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. - **name** (string): Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only. - **role** (string (ROLE_UNSPECIFIED|OWNER|WRITER|READER)) (required): Required. The role granted by this permission. ("ROLE_UNSPECIFIED"|"OWNER"|"WRITER"|"READER") - **granteeType** (string (GRANTEE_TYPE_UNSPECIFIED|USER|GROUP|EVERYONE)): Optional. Immutable. The type of the grantee. ("GRANTEE_TYPE_UNSPECIFIED"|"USER"|"GROUP"|"EVERYONE") - **nextPageToken** (string): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages. ### Example Usage ```bash curl -X GET "https://generativelanguage.googleapis.com/v1beta3/corpora/{corpus}/permissions?pageSize=0&pageToken=string" ``` ``` -------------------------------- ### GET /v1beta3/tunedModels/{tunedModel}/permissions/{permission} Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Gets information about a specific Permission. ```markdown ### Parameters - **tunedModel** (string, path, required): Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - **permission** (string, path, required): Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. ### Responses #### default - Successful operation **Permission** - **emailAddress** (string): 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. - **name** (string): Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only. - **role** (string (ROLE_UNSPECIFIED|OWNER|WRITER|READER)) (required): Required. The role granted by this permission. ("ROLE_UNSPECIFIED"|"OWNER"|"WRITER"|"READER") - **granteeType** (string (GRANTEE_TYPE_UNSPECIFIED|USER|GROUP|EVERYONE)): Optional. Immutable. The type of the grantee. ("GRANTEE_TYPE_UNSPECIFIED"|"USER"|"GROUP"|"EVERYONE") ### Example Usage ```bash curl -X GET "https://generativelanguage.googleapis.com/v1beta3/tunedModels/{tunedModel}/permissions/{permission}" ``` ``` -------------------------------- ### Schema: MessagePrompt Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 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. ```markdown ## Schema: MessagePrompt 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. **Type:** object - **examples** (array (Example)): 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`. Array items: - **input** (object) (required): 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. - **citationMetadata** (object): A collection of source attributions for a piece of content. - **citationSources** (array (CitationSource)): Citations to sources for a specific response. Array items: - **startIndex** (integer (int32)): Optional. Start of segment of the response that is attributed to this source. Index indicates the start of the segment, measured in bytes. - **license** (string): Optional. License for the GitHub project that is attributed as a source for segment. License info is required for code citations. - **endIndex** (integer (int32)): Optional. End of the attributed segment, exclusive. - **uri** (string): Optional. URI that is attributed as a source for a portion of the text. - **author** (string): 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. - **content** (string) (required): Required. The text content of the structured `Message`. - **output** (object) (required): 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. - **messages** (array (Message)) (required): 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`. Array items: - **context** (string): 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. ``` -------------------------------- ### GET /v1beta3/models Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API. ```markdown ### Parameters - **pageSize** (integer (int32), query, optional): The maximum number of `Models` to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size. - **pageToken** (string, query, optional): 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. ### Responses #### default - Successful operation **ListModelsResponse** - **models** (array (Model)): The returned Models. Array items: - **temperature** (number (float)): Controls the randomness of the output. Values can range over `[0.0,max_temperature]`, inclusive. A higher value 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. - **topK** (integer (int32)): 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. If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't allowed as a generation parameter. - **name** (string) (required): Required. The resource name of the `Model`. Refer to [Model variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) for all allowed values. Format: `models/{model}` with a `{model}` naming convention of: * "{base_model_id}-{version}" Examples: * `models/gemini-1.5-flash-001` - **thinking** (boolean): Whether the model supports thinking. - **outputTokenLimit** (integer (int32)): Maximum number of output tokens available for this model. - **inputTokenLimit** (integer (int32)): Maximum number of input tokens allowed for this model. - **maxTemperature** (number (float)): The maximum temperature this model can use. - **topP** (number (float)): For [Nucleus sampling](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). 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. - **displayName** (string): The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters. - **baseModelId** (string) (required): Required. The name of the base model, pass this to the generation request. Examples: * `gemini-1.5-flash` - **description** (string): A short description of the model. - **version** (string) (required): Required. The version number of the model. This represents the major version (`1.0` or `1.5`) - **supportedGenerationMethods** (array (string)): The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as `generateMessage` and `generateContent`. - **nextPageToken** (string): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages. ### Example Usage ```bash curl -X GET "https://generativelanguage.googleapis.com/v1beta3/models?pageSize=0&pageToken=string" ``` ``` -------------------------------- ### GET /v1beta3/tunedModels/{tunedModel}/permissions Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Lists permissions for the specific resource. ```markdown ### Parameters - **tunedModel** (string, path, required): Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. - **pageSize** (integer (int32), query, optional): 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. - **pageToken** (string, query, optional): 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. ### Responses #### default - Successful operation **ListPermissionsResponse** - **permissions** (array (Permission)): Returned permissions. Array items: - **emailAddress** (string): 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. - **name** (string): Output only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only. - **role** (string (ROLE_UNSPECIFIED|OWNER|WRITER|READER)) (required): Required. The role granted by this permission. ("ROLE_UNSPECIFIED"|"OWNER"|"WRITER"|"READER") - **granteeType** (string (GRANTEE_TYPE_UNSPECIFIED|USER|GROUP|EVERYONE)): Optional. Immutable. The type of the grantee. ("GRANTEE_TYPE_UNSPECIFIED"|"USER"|"GROUP"|"EVERYONE") - **nextPageToken** (string): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no more pages. ### Example Usage ```bash curl -X GET "https://generativelanguage.googleapis.com/v1beta3/tunedModels/{tunedModel}/permissions?pageSize=0&pageToken=string" ``` ``` -------------------------------- ### POST /v1beta3/tunedModels Source: https://generativelanguage.googleapis.com/$discovery/OPENAPI3_0 Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 ```markdown ### Parameters - **tunedModelId** (string, query, optional): 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])?`. ### Request Body **Content-Type:** application/json - **description** (string): Optional. A short description of this model. - **displayName** (string): Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - **baseModel** (string): Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` - **topP** (number (float)): 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. - **temperature** (number (float)): 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. - **topK** (integer (int32)): 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. - **createTime** (string (date-time)): Output only. The timestamp when this model was created. - **tuningTask** (object) (required): Tuning tasks that create tuned models. - **snapshots** (array (TuningSnapshot)): Output only. Metrics collected during tuning. Array items: - **step** (integer (int32)): Output only. The tuning step. - **meanLoss** (number (float)): Output only. The mean loss of the training examples for this step. - **computeTime** (string (date-time)): Output only. The timestamp when this metric was computed. - **epoch** (integer (int32)): Output only. The epoch this step was part of. - **hyperparameters** (object): Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance - **epochCount** (integer (int32)): Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. - **learningRateMultiplier** (number (float)): 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. - **learningRate** (number (float)): 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. - **batchSize** (integer (int32)): Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. - **startTime** (string (date-time)): Output only. The timestamp when tuning this model started. - **completeTime** (string (date-time)): Output only. The timestamp when tuning this model completed. - **trainingData** (object) (required): Dataset for training or validation. - **examples** (object): A set of tuning examples. Can be training or validation data. - **tunedModelSource** (object): Tuned model as a source for training a new model. - **tunedModel** (string): Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model` - **baseModel** (string): Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001` - **name** (string): 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` - **state** (string (STATE_UNSPECIFIED|CREATING|ACTIVE|FAILED)): Output only. The state of the tuned model. ("STATE_UNSPECIFIED"|"CREATING"|"ACTIVE"|"FAILED") - **updateTime** (string (date-time)): Output only. The timestamp when this model was updated. - **readerProjectNumbers** (array (string (int64))): Optional. List of project numbers that have read access to the tuned model. ### Responses #### default - Successful operation **CreateTunedModelOperation** - **done** (boolean): If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. - **error** (object): The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). - **code** (integer (int32)): The status code, which should be an enum value of google.rpc.Code. - **message** (string): A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. - **details** (array (object)): A list of messages that carry the error details. There is a common set of message types for APIs to use. - **name** (string): The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. - **metadata** (object): Metadata about the state and progress of creating a tuned model returned from the long-running operation - **completedPercent** (number (float)): The completed percentage for the tuning operation. - **totalSteps** (integer (int32)): The total number of tuning steps. - **tunedModel** (string): Name of the tuned model associated with the tuning operation. - **snapshots** (array (TuningSnapshot)): Metrics collected during tuning. Array items: - **step** (integer (int32)): Output only. The tuning step. - **meanLoss** (number (float)): Output only. The mean loss of the training examples for this step. - **computeTime** (string (date-time)): Output only. The timestamp when this metric was computed. - **epoch** (integer (int32)): Output only. The epoch this step was part of. - **completedSteps** (integer (int32)): The number of steps completed. - **response** (object): A fine-tuned model created using ModelService.CreateTunedModel. - **description** (string): Optional. A short description of this model. - **displayName** (string): Optional. The name to display for this model in user interfaces. The display name must be up to 40 characters including spaces. - **baseModel** (string): Immutable. The name of the `Model` to tune. Example: `models/gemini-1.5-flash-001` - **topP** (number (float)): 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. - **temperature** (number (float)): 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. - **topK** (integer (int32)): 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. - **createTime** (string (date-time)): Output only. The timestamp when this model was created. - **tuningTask** (object) (required): Tuning tasks that create tuned models. - **snapshots** (array (TuningSnapshot)): Output only. Metrics collected during tuning. Array items: - **hyperparameters** (object): Hyperparameters controlling the tuning process. Read more at https://ai.google.dev/docs/model_tuning_guidance - **epochCount** (integer (int32)): Immutable. The number of training epochs. An epoch is one pass through the training data. If not set, a default of 5 will be used. - **learningRateMultiplier** (number (float)): 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. - **learningRate** (number (float)): 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. - **batchSize** (integer (int32)): Immutable. The batch size hyperparameter for tuning. If not set, a default of 4 or 16 will be used based on the number of training examples. - **startTime** (string (date-time)): Output only. The timestamp when tuning this model started. - **completeTime** (string (date-time)): Output only. The timestamp when tuning this model completed. - **trainingData** (object) (required): Dataset for training or validation. - **examples** (object): A set of tuning examples. Can be training or validation data. - **tunedModelSource** (object): Tuned model as a source for training a new model. - **tunedModel** (string): Immutable. The name of the `TunedModel` to use as the starting point for training the new model. Example: `tunedModels/my-tuned-model` - **baseModel** (string): Output only. The name of the base `Model` this `TunedModel` was tuned from. Example: `models/gemini-1.5-flash-001` - **name** (string): 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` - **state** (string (STATE_UNSPECIFIED|CREATING|ACTIVE|FAILED)): Output only. The state of the tuned model. ("STATE_UNSPECIFIED"|"CREATING"|"ACTIVE"|"FAILED") - **updateTime** (string (date-time)): Output only. The timestamp when this model was updated. - **readerProjectNumbers** (array (string (int64))): Optional. List of project numbers that have read access to the tuned model. ### Example Usage ```bash curl -X POST "https://generativelanguage.googleapis.com/v1beta3/tunedModels?tunedModelId=string" \ -H "Content-Type: application/json" \ -d '{ "description": "string", "displayName": "string", "baseModel": "string", "topP": "0", "temperature": "0", "topK": "0", "createTime": "2023-01-01T00:00:00Z", "tuningTask": "value", "tunedModelSource": "value", "name": "string", "state": "STATE_UNSPECIFIED", "updateTime": "2023-01-01T00:00:00Z", "readerProjectNumbers": [ "string" ] }' ``` ```