Vertex AI API . projects . locations . tuningJobs

Instance Methods

operations()

Returns the operations Resource.

cancel(name, body=None, x__xgafv=None)

Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use GenAiTuningService.GetTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a TuningJob.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`, and TuningJob.state is set to `CANCELLED`.

close()

Close httplib2 connections.

create(parent, body=None, x__xgafv=None)

Creates a TuningJob. A created TuningJob right away will be attempted to be run.

get(name, x__xgafv=None)

Gets a TuningJob.

list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)

Lists TuningJobs in a Location.

list_next()

Retrieves the next page of results.

rebaseTunedModel(parent, body=None, x__xgafv=None)

Rebase a TunedModel.

Method Details

cancel(name, body=None, x__xgafv=None)
Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use GenAiTuningService.GetTuningJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the TuningJob is not deleted; instead it becomes a job with a TuningJob.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`, and TuningJob.state is set to `CANCELLED`.

Args:
  name: string, Required. The name of the TuningJob to cancel. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for GenAiTuningService.CancelTuningJob.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}
close()
Close httplib2 connections.
create(parent, body=None, x__xgafv=None)
Creates a TuningJob. A created TuningJob right away will be attempted to be run.

Args:
  parent: string, Required. The resource name of the Location to create the TuningJob in. Format: `projects/{project}/locations/{location}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents a TuningJob that runs with Google owned models.
  "baseModel": "A String", # The base model that is being tuned, e.g., "gemini-1.0-pro-002". .
  "createTime": "A String", # Output only. Time when the TuningJob was created.
  "description": "A String", # Optional. The description of the TuningJob.
  "encryptionSpec": { # Represents a customer-managed encryption key spec that can be applied to a top-level resource. # Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
    "kmsKeyName": "A String", # Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.
  },
  "endTime": "A String", # Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.
  "error": { # 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). # Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
    "code": 42, # The status code, which should be an enum value of google.rpc.Code.
    "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
    "message": "A 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.
  },
  "experiment": "A String", # Output only. The Experiment associated with this TuningJob.
  "labels": { # Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
    "a_key": "A String",
  },
  "name": "A String", # Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
  "startTime": "A String", # Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.
  "state": "A String", # Output only. The detailed state of the job.
  "supervisedTuningSpec": { # Tuning Spec for Supervised Tuning for first party models. # Tuning Spec for Supervised Fine Tuning.
    "hyperParameters": { # Hyperparameters for SFT. # Optional. Hyperparameters for SFT.
      "adapterSize": "A String", # Optional. Adapter size for tuning.
      "epochCount": "A String", # Optional. Number of complete passes the model makes over the entire training dataset during training.
      "learningRateMultiplier": 3.14, # Optional. Multiplier for adjusting the default learning rate.
    },
    "trainingDatasetUri": "A String", # Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.
    "validationDatasetUri": "A String", # Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.
  },
  "tunedModel": { # The Model Registry Model and Online Prediction Endpoint assiociated with this TuningJob. # Output only. The tuned model resources assiociated with this TuningJob.
    "endpoint": "A String", # Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
    "model": "A String", # Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.
  },
  "tunedModelDisplayName": "A String", # Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  "tuningDataStats": { # The tuning data statistic values for TuningJob. # Output only. The tuning data statistics associated with this TuningJob.
    "supervisedTuningDataStats": { # Tuning data statistics for Supervised Tuning. # The SFT Tuning data stats.
      "totalBillableCharacterCount": "A String", # Output only. Number of billable characters in the tuning dataset.
      "totalBillableTokenCount": "A String", # Output only. Number of billable tokens in the tuning dataset.
      "totalTruncatedExampleCount": "A String", # The number of examples in the dataset that have been truncated by any amount.
      "totalTuningCharacterCount": "A String", # Output only. Number of tuning characters in the tuning dataset.
      "truncatedExampleIndices": [ # A partial sample of the indices (starting from 1) of the truncated examples.
        "A String",
      ],
      "tuningDatasetExampleCount": "A String", # Output only. Number of examples in the tuning dataset.
      "tuningStepCount": "A String", # Output only. Number of tuning steps for this Tuning Job.
      "userDatasetExamples": [ # Output only. Sample user messages in the training dataset uri.
        { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
          "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
              "fileData": { # URI based data. # Optional. URI based data.
                "fileUri": "A String", # Required. URI.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                "args": { # Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                  "a_key": "", # Properties of the object.
                },
                "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
              },
              "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
                "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
                  "a_key": "", # Properties of the object.
                },
              },
              "inlineData": { # Content blob. It's preferred to send as text directly rather than raw bytes. # Optional. Inlined bytes data.
                "data": "A String", # Required. Raw bytes.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "text": "A String", # Optional. Text part (can be code).
              "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                "endOffset": "A String", # Optional. The end offset of the video.
                "startOffset": "A String", # Optional. The start offset of the video.
              },
            },
          ],
          "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
        },
      ],
      "userInputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user input tokens.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
      "userMessagePerExampleDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the messages per example.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
      "userOutputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user output tokens.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
    },
  },
  "updateTime": "A String", # Output only. Time when the TuningJob was most recently updated.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a TuningJob that runs with Google owned models.
  "baseModel": "A String", # The base model that is being tuned, e.g., "gemini-1.0-pro-002". .
  "createTime": "A String", # Output only. Time when the TuningJob was created.
  "description": "A String", # Optional. The description of the TuningJob.
  "encryptionSpec": { # Represents a customer-managed encryption key spec that can be applied to a top-level resource. # Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
    "kmsKeyName": "A String", # Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.
  },
  "endTime": "A String", # Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.
  "error": { # 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). # Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
    "code": 42, # The status code, which should be an enum value of google.rpc.Code.
    "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
    "message": "A 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.
  },
  "experiment": "A String", # Output only. The Experiment associated with this TuningJob.
  "labels": { # Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
    "a_key": "A String",
  },
  "name": "A String", # Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
  "startTime": "A String", # Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.
  "state": "A String", # Output only. The detailed state of the job.
  "supervisedTuningSpec": { # Tuning Spec for Supervised Tuning for first party models. # Tuning Spec for Supervised Fine Tuning.
    "hyperParameters": { # Hyperparameters for SFT. # Optional. Hyperparameters for SFT.
      "adapterSize": "A String", # Optional. Adapter size for tuning.
      "epochCount": "A String", # Optional. Number of complete passes the model makes over the entire training dataset during training.
      "learningRateMultiplier": 3.14, # Optional. Multiplier for adjusting the default learning rate.
    },
    "trainingDatasetUri": "A String", # Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.
    "validationDatasetUri": "A String", # Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.
  },
  "tunedModel": { # The Model Registry Model and Online Prediction Endpoint assiociated with this TuningJob. # Output only. The tuned model resources assiociated with this TuningJob.
    "endpoint": "A String", # Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
    "model": "A String", # Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.
  },
  "tunedModelDisplayName": "A String", # Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  "tuningDataStats": { # The tuning data statistic values for TuningJob. # Output only. The tuning data statistics associated with this TuningJob.
    "supervisedTuningDataStats": { # Tuning data statistics for Supervised Tuning. # The SFT Tuning data stats.
      "totalBillableCharacterCount": "A String", # Output only. Number of billable characters in the tuning dataset.
      "totalBillableTokenCount": "A String", # Output only. Number of billable tokens in the tuning dataset.
      "totalTruncatedExampleCount": "A String", # The number of examples in the dataset that have been truncated by any amount.
      "totalTuningCharacterCount": "A String", # Output only. Number of tuning characters in the tuning dataset.
      "truncatedExampleIndices": [ # A partial sample of the indices (starting from 1) of the truncated examples.
        "A String",
      ],
      "tuningDatasetExampleCount": "A String", # Output only. Number of examples in the tuning dataset.
      "tuningStepCount": "A String", # Output only. Number of tuning steps for this Tuning Job.
      "userDatasetExamples": [ # Output only. Sample user messages in the training dataset uri.
        { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
          "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
              "fileData": { # URI based data. # Optional. URI based data.
                "fileUri": "A String", # Required. URI.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                "args": { # Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                  "a_key": "", # Properties of the object.
                },
                "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
              },
              "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
                "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
                  "a_key": "", # Properties of the object.
                },
              },
              "inlineData": { # Content blob. It's preferred to send as text directly rather than raw bytes. # Optional. Inlined bytes data.
                "data": "A String", # Required. Raw bytes.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "text": "A String", # Optional. Text part (can be code).
              "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                "endOffset": "A String", # Optional. The end offset of the video.
                "startOffset": "A String", # Optional. The start offset of the video.
              },
            },
          ],
          "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
        },
      ],
      "userInputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user input tokens.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
      "userMessagePerExampleDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the messages per example.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
      "userOutputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user output tokens.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
    },
  },
  "updateTime": "A String", # Output only. Time when the TuningJob was most recently updated.
}
get(name, x__xgafv=None)
Gets a TuningJob.

Args:
  name: string, Required. The name of the TuningJob resource. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}` (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a TuningJob that runs with Google owned models.
  "baseModel": "A String", # The base model that is being tuned, e.g., "gemini-1.0-pro-002". .
  "createTime": "A String", # Output only. Time when the TuningJob was created.
  "description": "A String", # Optional. The description of the TuningJob.
  "encryptionSpec": { # Represents a customer-managed encryption key spec that can be applied to a top-level resource. # Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
    "kmsKeyName": "A String", # Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.
  },
  "endTime": "A String", # Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.
  "error": { # 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). # Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
    "code": 42, # The status code, which should be an enum value of google.rpc.Code.
    "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
    "message": "A 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.
  },
  "experiment": "A String", # Output only. The Experiment associated with this TuningJob.
  "labels": { # Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
    "a_key": "A String",
  },
  "name": "A String", # Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
  "startTime": "A String", # Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.
  "state": "A String", # Output only. The detailed state of the job.
  "supervisedTuningSpec": { # Tuning Spec for Supervised Tuning for first party models. # Tuning Spec for Supervised Fine Tuning.
    "hyperParameters": { # Hyperparameters for SFT. # Optional. Hyperparameters for SFT.
      "adapterSize": "A String", # Optional. Adapter size for tuning.
      "epochCount": "A String", # Optional. Number of complete passes the model makes over the entire training dataset during training.
      "learningRateMultiplier": 3.14, # Optional. Multiplier for adjusting the default learning rate.
    },
    "trainingDatasetUri": "A String", # Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.
    "validationDatasetUri": "A String", # Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.
  },
  "tunedModel": { # The Model Registry Model and Online Prediction Endpoint assiociated with this TuningJob. # Output only. The tuned model resources assiociated with this TuningJob.
    "endpoint": "A String", # Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
    "model": "A String", # Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.
  },
  "tunedModelDisplayName": "A String", # Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  "tuningDataStats": { # The tuning data statistic values for TuningJob. # Output only. The tuning data statistics associated with this TuningJob.
    "supervisedTuningDataStats": { # Tuning data statistics for Supervised Tuning. # The SFT Tuning data stats.
      "totalBillableCharacterCount": "A String", # Output only. Number of billable characters in the tuning dataset.
      "totalBillableTokenCount": "A String", # Output only. Number of billable tokens in the tuning dataset.
      "totalTruncatedExampleCount": "A String", # The number of examples in the dataset that have been truncated by any amount.
      "totalTuningCharacterCount": "A String", # Output only. Number of tuning characters in the tuning dataset.
      "truncatedExampleIndices": [ # A partial sample of the indices (starting from 1) of the truncated examples.
        "A String",
      ],
      "tuningDatasetExampleCount": "A String", # Output only. Number of examples in the tuning dataset.
      "tuningStepCount": "A String", # Output only. Number of tuning steps for this Tuning Job.
      "userDatasetExamples": [ # Output only. Sample user messages in the training dataset uri.
        { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
          "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
              "fileData": { # URI based data. # Optional. URI based data.
                "fileUri": "A String", # Required. URI.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                "args": { # Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                  "a_key": "", # Properties of the object.
                },
                "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
              },
              "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
                "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
                  "a_key": "", # Properties of the object.
                },
              },
              "inlineData": { # Content blob. It's preferred to send as text directly rather than raw bytes. # Optional. Inlined bytes data.
                "data": "A String", # Required. Raw bytes.
                "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
              },
              "text": "A String", # Optional. Text part (can be code).
              "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                "endOffset": "A String", # Optional. The end offset of the video.
                "startOffset": "A String", # Optional. The start offset of the video.
              },
            },
          ],
          "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
        },
      ],
      "userInputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user input tokens.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
      "userMessagePerExampleDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the messages per example.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
      "userOutputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user output tokens.
        "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
        "buckets": [ # Output only. Defines the histogram bucket.
          { # Dataset bucket used to create a histogram for the distribution given a population of values.
            "count": 3.14, # Output only. Number of values in the bucket.
            "left": 3.14, # Output only. Left bound of the bucket.
            "right": 3.14, # Output only. Right bound of the bucket.
          },
        ],
        "max": 3.14, # Output only. The maximum of the population values.
        "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
        "median": 3.14, # Output only. The median of the values in the population.
        "min": 3.14, # Output only. The minimum of the population values.
        "p5": 3.14, # Output only. The 5th percentile of the values in the population.
        "p95": 3.14, # Output only. The 95th percentile of the values in the population.
        "sum": "A String", # Output only. Sum of a given population of values.
      },
    },
  },
  "updateTime": "A String", # Output only. Time when the TuningJob was most recently updated.
}
list(parent, filter=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists TuningJobs in a Location.

Args:
  parent: string, Required. The resource name of the Location to list the TuningJobs from. Format: `projects/{project}/locations/{location}` (required)
  filter: string, Optional. The standard list filter.
  pageSize: integer, Optional. The standard list page size.
  pageToken: string, Optional. The standard list page token. Typically obtained via ListTuningJobsResponse.next_page_token of the previous GenAiTuningService.ListTuningJob][] call.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for GenAiTuningService.ListTuningJobs
  "nextPageToken": "A String", # A token to retrieve the next page of results. Pass to ListTuningJobsRequest.page_token to obtain that page.
  "tuningJobs": [ # List of TuningJobs in the requested page.
    { # Represents a TuningJob that runs with Google owned models.
      "baseModel": "A String", # The base model that is being tuned, e.g., "gemini-1.0-pro-002". .
      "createTime": "A String", # Output only. Time when the TuningJob was created.
      "description": "A String", # Optional. The description of the TuningJob.
      "encryptionSpec": { # Represents a customer-managed encryption key spec that can be applied to a top-level resource. # Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
        "kmsKeyName": "A String", # Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.
      },
      "endTime": "A String", # Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.
      "error": { # 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). # Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
        "code": 42, # The status code, which should be an enum value of google.rpc.Code.
        "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
          {
            "a_key": "", # Properties of the object. Contains field @type with type URL.
          },
        ],
        "message": "A 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.
      },
      "experiment": "A String", # Output only. The Experiment associated with this TuningJob.
      "labels": { # Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
        "a_key": "A String",
      },
      "name": "A String", # Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
      "startTime": "A String", # Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.
      "state": "A String", # Output only. The detailed state of the job.
      "supervisedTuningSpec": { # Tuning Spec for Supervised Tuning for first party models. # Tuning Spec for Supervised Fine Tuning.
        "hyperParameters": { # Hyperparameters for SFT. # Optional. Hyperparameters for SFT.
          "adapterSize": "A String", # Optional. Adapter size for tuning.
          "epochCount": "A String", # Optional. Number of complete passes the model makes over the entire training dataset during training.
          "learningRateMultiplier": 3.14, # Optional. Multiplier for adjusting the default learning rate.
        },
        "trainingDatasetUri": "A String", # Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.
        "validationDatasetUri": "A String", # Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.
      },
      "tunedModel": { # The Model Registry Model and Online Prediction Endpoint assiociated with this TuningJob. # Output only. The tuned model resources assiociated with this TuningJob.
        "endpoint": "A String", # Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
        "model": "A String", # Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.
      },
      "tunedModelDisplayName": "A String", # Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.
      "tuningDataStats": { # The tuning data statistic values for TuningJob. # Output only. The tuning data statistics associated with this TuningJob.
        "supervisedTuningDataStats": { # Tuning data statistics for Supervised Tuning. # The SFT Tuning data stats.
          "totalBillableCharacterCount": "A String", # Output only. Number of billable characters in the tuning dataset.
          "totalBillableTokenCount": "A String", # Output only. Number of billable tokens in the tuning dataset.
          "totalTruncatedExampleCount": "A String", # The number of examples in the dataset that have been truncated by any amount.
          "totalTuningCharacterCount": "A String", # Output only. Number of tuning characters in the tuning dataset.
          "truncatedExampleIndices": [ # A partial sample of the indices (starting from 1) of the truncated examples.
            "A String",
          ],
          "tuningDatasetExampleCount": "A String", # Output only. Number of examples in the tuning dataset.
          "tuningStepCount": "A String", # Output only. Number of tuning steps for this Tuning Job.
          "userDatasetExamples": [ # Output only. Sample user messages in the training dataset uri.
            { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
              "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
                { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                  "fileData": { # URI based data. # Optional. URI based data.
                    "fileUri": "A String", # Required. URI.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                  "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                    "args": { # Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                      "a_key": "", # Properties of the object.
                    },
                    "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                  },
                  "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                    "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
                    "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
                      "a_key": "", # Properties of the object.
                    },
                  },
                  "inlineData": { # Content blob. It's preferred to send as text directly rather than raw bytes. # Optional. Inlined bytes data.
                    "data": "A String", # Required. Raw bytes.
                    "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                  },
                  "text": "A String", # Optional. Text part (can be code).
                  "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                    "endOffset": "A String", # Optional. The end offset of the video.
                    "startOffset": "A String", # Optional. The start offset of the video.
                  },
                },
              ],
              "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
            },
          ],
          "userInputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user input tokens.
            "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
            "buckets": [ # Output only. Defines the histogram bucket.
              { # Dataset bucket used to create a histogram for the distribution given a population of values.
                "count": 3.14, # Output only. Number of values in the bucket.
                "left": 3.14, # Output only. Left bound of the bucket.
                "right": 3.14, # Output only. Right bound of the bucket.
              },
            ],
            "max": 3.14, # Output only. The maximum of the population values.
            "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
            "median": 3.14, # Output only. The median of the values in the population.
            "min": 3.14, # Output only. The minimum of the population values.
            "p5": 3.14, # Output only. The 5th percentile of the values in the population.
            "p95": 3.14, # Output only. The 95th percentile of the values in the population.
            "sum": "A String", # Output only. Sum of a given population of values.
          },
          "userMessagePerExampleDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the messages per example.
            "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
            "buckets": [ # Output only. Defines the histogram bucket.
              { # Dataset bucket used to create a histogram for the distribution given a population of values.
                "count": 3.14, # Output only. Number of values in the bucket.
                "left": 3.14, # Output only. Left bound of the bucket.
                "right": 3.14, # Output only. Right bound of the bucket.
              },
            ],
            "max": 3.14, # Output only. The maximum of the population values.
            "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
            "median": 3.14, # Output only. The median of the values in the population.
            "min": 3.14, # Output only. The minimum of the population values.
            "p5": 3.14, # Output only. The 5th percentile of the values in the population.
            "p95": 3.14, # Output only. The 95th percentile of the values in the population.
            "sum": "A String", # Output only. Sum of a given population of values.
          },
          "userOutputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user output tokens.
            "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
            "buckets": [ # Output only. Defines the histogram bucket.
              { # Dataset bucket used to create a histogram for the distribution given a population of values.
                "count": 3.14, # Output only. Number of values in the bucket.
                "left": 3.14, # Output only. Left bound of the bucket.
                "right": 3.14, # Output only. Right bound of the bucket.
              },
            ],
            "max": 3.14, # Output only. The maximum of the population values.
            "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
            "median": 3.14, # Output only. The median of the values in the population.
            "min": 3.14, # Output only. The minimum of the population values.
            "p5": 3.14, # Output only. The 5th percentile of the values in the population.
            "p95": 3.14, # Output only. The 95th percentile of the values in the population.
            "sum": "A String", # Output only. Sum of a given population of values.
          },
        },
      },
      "updateTime": "A String", # Output only. Time when the TuningJob was most recently updated.
    },
  ],
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.
        
rebaseTunedModel(parent, body=None, x__xgafv=None)
Rebase a TunedModel.

Args:
  parent: string, Required. The resource name of the Location into which to rebase the Model. Format: `projects/{project}/locations/{location}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for GenAiTuningService.RebaseTunedModel.
  "artifactDestination": { # The Google Cloud Storage location where the output is to be written to. # Optional. The Google Cloud Storage location to write the artifacts.
    "outputUriPrefix": "A String", # Required. Google Cloud Storage URI to output directory. If the uri doesn't end with '/', a '/' will be automatically appended. The directory is created if it doesn't exist.
  },
  "deployToSameEndpoint": True or False, # Optional. By default, bison to gemini migration will always create new model/endpoint, but for gemini-1.0 to gemini-1.5 migration, we default deploy to the same endpoint. See details in this Section.
  "tunedModelRef": { # TunedModel Reference for legacy model migration. # Required. TunedModel reference to retrieve the legacy model information.
    "pipelineJob": "A String", # Support migration from tuning job list page, from bison model to gemini model.
    "tunedModel": "A String", # Support migration from model registry.
    "tuningJob": "A String", # Support migration from tuning job list page, from gemini-1.0-pro-002 to 1.5 and above.
  },
  "tuningJob": { # Represents a TuningJob that runs with Google owned models. # Optional. The TuningJob to be updated. Users can use this TuningJob field to overwrite tuning configs.
    "baseModel": "A String", # The base model that is being tuned, e.g., "gemini-1.0-pro-002". .
    "createTime": "A String", # Output only. Time when the TuningJob was created.
    "description": "A String", # Optional. The description of the TuningJob.
    "encryptionSpec": { # Represents a customer-managed encryption key spec that can be applied to a top-level resource. # Customer-managed encryption key options for a TuningJob. If this is set, then all resources created by the TuningJob will be encrypted with the provided encryption key.
      "kmsKeyName": "A String", # Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created.
    },
    "endTime": "A String", # Output only. Time when the TuningJob entered any of the following JobStates: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`, `JOB_STATE_EXPIRED`.
    "error": { # 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). # Output only. Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
      "code": 42, # The status code, which should be an enum value of google.rpc.Code.
      "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
        {
          "a_key": "", # Properties of the object. Contains field @type with type URL.
        },
      ],
      "message": "A 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.
    },
    "experiment": "A String", # Output only. The Experiment associated with this TuningJob.
    "labels": { # Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
      "a_key": "A String",
    },
    "name": "A String", # Output only. Identifier. Resource name of a TuningJob. Format: `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
    "startTime": "A String", # Output only. Time when the TuningJob for the first time entered the `JOB_STATE_RUNNING` state.
    "state": "A String", # Output only. The detailed state of the job.
    "supervisedTuningSpec": { # Tuning Spec for Supervised Tuning for first party models. # Tuning Spec for Supervised Fine Tuning.
      "hyperParameters": { # Hyperparameters for SFT. # Optional. Hyperparameters for SFT.
        "adapterSize": "A String", # Optional. Adapter size for tuning.
        "epochCount": "A String", # Optional. Number of complete passes the model makes over the entire training dataset during training.
        "learningRateMultiplier": 3.14, # Optional. Multiplier for adjusting the default learning rate.
      },
      "trainingDatasetUri": "A String", # Required. Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.
      "validationDatasetUri": "A String", # Optional. Cloud Storage path to file containing validation dataset for tuning. The dataset must be formatted as a JSONL file.
    },
    "tunedModel": { # The Model Registry Model and Online Prediction Endpoint assiociated with this TuningJob. # Output only. The tuned model resources assiociated with this TuningJob.
      "endpoint": "A String", # Output only. A resource name of an Endpoint. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
      "model": "A String", # Output only. The resource name of the TunedModel. Format: `projects/{project}/locations/{location}/models/{model}`.
    },
    "tunedModelDisplayName": "A String", # Optional. The display name of the TunedModel. The name can be up to 128 characters long and can consist of any UTF-8 characters.
    "tuningDataStats": { # The tuning data statistic values for TuningJob. # Output only. The tuning data statistics associated with this TuningJob.
      "supervisedTuningDataStats": { # Tuning data statistics for Supervised Tuning. # The SFT Tuning data stats.
        "totalBillableCharacterCount": "A String", # Output only. Number of billable characters in the tuning dataset.
        "totalBillableTokenCount": "A String", # Output only. Number of billable tokens in the tuning dataset.
        "totalTruncatedExampleCount": "A String", # The number of examples in the dataset that have been truncated by any amount.
        "totalTuningCharacterCount": "A String", # Output only. Number of tuning characters in the tuning dataset.
        "truncatedExampleIndices": [ # A partial sample of the indices (starting from 1) of the truncated examples.
          "A String",
        ],
        "tuningDatasetExampleCount": "A String", # Output only. Number of examples in the tuning dataset.
        "tuningStepCount": "A String", # Output only. Number of tuning steps for this Tuning Job.
        "userDatasetExamples": [ # Output only. Sample user messages in the training dataset uri.
          { # The base structured datatype containing multi-part content of a message. A `Content` includes a `role` field designating the producer of the `Content` and a `parts` field containing multi-part data that contains the content of the message turn.
            "parts": [ # Required. Ordered `Parts` that constitute a single message. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a multi-part `Content` message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. A `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
                "fileData": { # URI based data. # Optional. URI based data.
                  "fileUri": "A String", # Required. URI.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
                "functionCall": { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] with the parameters and their values.
                  "args": { # Optional. Required. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                    "a_key": "", # Properties of the object.
                  },
                  "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name].
                },
                "functionResponse": { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.
                  "name": "A String", # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
                  "response": { # Required. The function response in JSON object format. Use "output" key to specify function output and "error" key to specify error details (if any). If "output" and "error" keys are not specified, then whole "response" is treated as function output.
                    "a_key": "", # Properties of the object.
                  },
                },
                "inlineData": { # Content blob. It's preferred to send as text directly rather than raw bytes. # Optional. Inlined bytes data.
                  "data": "A String", # Required. Raw bytes.
                  "mimeType": "A String", # Required. The IANA standard MIME type of the source data.
                },
                "text": "A String", # Optional. Text part (can be code).
                "videoMetadata": { # Metadata describes the input video content. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
                  "endOffset": "A String", # Optional. The end offset of the video.
                  "startOffset": "A String", # Optional. The start offset of the video.
                },
              },
            ],
            "role": "A String", # Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.
          },
        ],
        "userInputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user input tokens.
          "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
          "buckets": [ # Output only. Defines the histogram bucket.
            { # Dataset bucket used to create a histogram for the distribution given a population of values.
              "count": 3.14, # Output only. Number of values in the bucket.
              "left": 3.14, # Output only. Left bound of the bucket.
              "right": 3.14, # Output only. Right bound of the bucket.
            },
          ],
          "max": 3.14, # Output only. The maximum of the population values.
          "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
          "median": 3.14, # Output only. The median of the values in the population.
          "min": 3.14, # Output only. The minimum of the population values.
          "p5": 3.14, # Output only. The 5th percentile of the values in the population.
          "p95": 3.14, # Output only. The 95th percentile of the values in the population.
          "sum": "A String", # Output only. Sum of a given population of values.
        },
        "userMessagePerExampleDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the messages per example.
          "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
          "buckets": [ # Output only. Defines the histogram bucket.
            { # Dataset bucket used to create a histogram for the distribution given a population of values.
              "count": 3.14, # Output only. Number of values in the bucket.
              "left": 3.14, # Output only. Left bound of the bucket.
              "right": 3.14, # Output only. Right bound of the bucket.
            },
          ],
          "max": 3.14, # Output only. The maximum of the population values.
          "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
          "median": 3.14, # Output only. The median of the values in the population.
          "min": 3.14, # Output only. The minimum of the population values.
          "p5": 3.14, # Output only. The 5th percentile of the values in the population.
          "p95": 3.14, # Output only. The 95th percentile of the values in the population.
          "sum": "A String", # Output only. Sum of a given population of values.
        },
        "userOutputTokenDistribution": { # Dataset distribution for Supervised Tuning. # Output only. Dataset distributions for the user output tokens.
          "billableSum": "A String", # Output only. Sum of a given population of values that are billable.
          "buckets": [ # Output only. Defines the histogram bucket.
            { # Dataset bucket used to create a histogram for the distribution given a population of values.
              "count": 3.14, # Output only. Number of values in the bucket.
              "left": 3.14, # Output only. Left bound of the bucket.
              "right": 3.14, # Output only. Right bound of the bucket.
            },
          ],
          "max": 3.14, # Output only. The maximum of the population values.
          "mean": 3.14, # Output only. The arithmetic mean of the values in the population.
          "median": 3.14, # Output only. The median of the values in the population.
          "min": 3.14, # Output only. The minimum of the population values.
          "p5": 3.14, # Output only. The 5th percentile of the values in the population.
          "p95": 3.14, # Output only. The 95th percentile of the values in the population.
          "sum": "A String", # Output only. Sum of a given population of values.
        },
      },
    },
    "updateTime": "A String", # Output only. Time when the TuningJob was most recently updated.
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # This resource represents a long-running operation that is the result of a network API call.
  "done": True or False, # 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": { # 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). # The error result of the operation in case of failure or cancellation.
    "code": 42, # The status code, which should be an enum value of google.rpc.Code.
    "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
    "message": "A 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.
  },
  "metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
    "a_key": "", # Properties of the object. Contains field @type with type URL.
  },
  "name": "A 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}`.
  "response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
    "a_key": "", # Properties of the object. Contains field @type with type URL.
  },
}