Class: Telnyx::Resources::AI::FineTuning::Jobs

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/ai/fine_tuning/jobs.rb,
sig/telnyx/resources/ai/fine_tuning/jobs.rbs

Overview

Customize LLMs for your unique needs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Jobs

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Jobs.

Parameters:



100
101
102
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 100

def initialize(client:)
  @client = client
end

Instance Method Details

#cancel(job_id, request_options: {}) ⇒ Telnyx::Models::AI::FineTuning::FineTuningJob

Cancels the specified in-progress fine-tuning job and returns the updated job.

Parameters:

  • job_id (String)

    Unique identifier of the job.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



88
89
90
91
92
93
94
95
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 88

def cancel(job_id, params = {})
  @client.request(
    method: :post,
    path: ["ai/fine_tuning/jobs/%1$s/cancel", job_id],
    model: Telnyx::AI::FineTuning::FineTuningJob,
    options: params[:request_options]
  )
end

#create(model:, training_file:, hyperparameters: nil, suffix: nil, request_options: {}) ⇒ Telnyx::Models::AI::FineTuning::FineTuningJob

Creates a new fine-tuning job that trains a model on the provided dataset, and returns the created job.

Parameters:

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 27

def create(params)
  parsed, options = Telnyx::AI::FineTuning::JobCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "ai/fine_tuning/jobs",
    body: parsed,
    model: Telnyx::AI::FineTuning::FineTuningJob,
    options: options
  )
end

#list(request_options: {}) ⇒ Telnyx::Models::AI::FineTuning::JobListResponse

Retrieve a list of all fine tuning jobs created by the user.

Parameters:

Returns:

See Also:



68
69
70
71
72
73
74
75
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 68

def list(params = {})
  @client.request(
    method: :get,
    path: "ai/fine_tuning/jobs",
    model: Telnyx::Models::AI::FineTuning::JobListResponse,
    options: params[:request_options]
  )
end

#retrieve(job_id, request_options: {}) ⇒ Telnyx::Models::AI::FineTuning::FineTuningJob

Returns the details of a single fine-tuning job by its job_id, including its current status.

Parameters:

  • job_id (String)

    Unique identifier of the job.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



50
51
52
53
54
55
56
57
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 50

def retrieve(job_id, params = {})
  @client.request(
    method: :get,
    path: ["ai/fine_tuning/jobs/%1$s", job_id],
    model: Telnyx::AI::FineTuning::FineTuningJob,
    options: params[:request_options]
  )
end