Table of Contents

Class Tunings

Namespace
Google.GenAI
Assembly
Google.GenAI.dll
public sealed class Tunings
Inheritance
Tunings
Inherited Members

Constructors

Tunings(ApiClient)

public Tunings(ApiClient apiClient)

Parameters

apiClient ApiClient

Methods

CancelAsync(string, CancelTuningJobConfig?, CancellationToken)

Cancels a tuning job resource.

public Task<CancelTuningJobResponse> CancelAsync(string name, CancelTuningJobConfig? config = null, CancellationToken cancellationToken = default)

Parameters

name string

The resource name of the tuning job. For Gemini Enterprise Agent Platform , this is the full resource name or tuningJobs/{id}.

config CancelTuningJobConfig

A CancelTuningJobConfig for configuring the cancel request.

cancellationToken CancellationToken

A CancellationToken to cancel the operation.

Returns

Task<CancelTuningJobResponse>

GetAsync(string, GetTuningJobConfig?, CancellationToken)

Makes an API request to get a tuning job.

public Task<TuningJob> GetAsync(string name, GetTuningJobConfig? config = null, CancellationToken cancellationToken = default)

Parameters

name string

The resource name of the tuning job.

config GetTuningJobConfig

A GetTuningJobConfig for configuring the get request.

cancellationToken CancellationToken

The cancellation token for the request.

Returns

Task<TuningJob>

A TuningJob object.

ListAsync(ListTuningJobsConfig?, CancellationToken)

Lists tuning jobs.

public Task<Pager<TuningJob, ListTuningJobsConfig, ListTuningJobsResponse>> ListAsync(ListTuningJobsConfig? config = null, CancellationToken cancellationToken = default)

Parameters

config ListTuningJobsConfig

A ListTuningJobsConfig instance that specifies the optional configuration for the list request.

cancellationToken CancellationToken

A CancellationToken to cancel the operation.

Returns

Task<Pager<TuningJob, ListTuningJobsConfig, ListTuningJobsResponse>>

A Pager object that contains one page of tuning jobs. When iterating over the pager, it automatically fetches the next page if there are more.

TuneAsync(string, TuningDataset, CreateTuningJobConfig?, CancellationToken)

Makes an API request to create a supervised fine-tuning job.

public Task<TuningJob> TuneAsync(string baseModel, TuningDataset trainingDataset, CreateTuningJobConfig? config = null, CancellationToken cancellationToken = default)

Parameters

baseModel string

The base model to tune.

trainingDataset TuningDataset

The training dataset to use for tuning.

config CreateTuningJobConfig

A CreateTuningJobConfig for configuring the create request.

cancellationToken CancellationToken

The cancellation token for the request.

Returns

Task<TuningJob>

A TuningJob object.

ValidateRewardAsync(string, Content, ReinforcementTuningExample, SingleReinforcementTuningRewardConfig?, CompositeReinforcementTuningRewardConfig?, ValidateRewardConfig?, CancellationToken)

public Task<ValidateRewardResponse> ValidateRewardAsync(string parent, Content sampleResponse, ReinforcementTuningExample example, SingleReinforcementTuningRewardConfig? singleRewardConfig = null, CompositeReinforcementTuningRewardConfig? compositeRewardConfig = null, ValidateRewardConfig? config = null, CancellationToken cancellationToken = default)

Parameters

parent string
sampleResponse Content
example ReinforcementTuningExample
singleRewardConfig SingleReinforcementTuningRewardConfig
compositeRewardConfig CompositeReinforcementTuningRewardConfig
config ValidateRewardConfig
cancellationToken CancellationToken

Returns

Task<ValidateRewardResponse>