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

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

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:



96
97
98
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 96

def initialize(client:)
  @client = client
end

Instance Method Details

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

Cancel a fine tuning job.

Parameters:

Returns:

See Also:



84
85
86
87
88
89
90
91
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 84

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

Create a new fine tuning job.

Parameters:

Returns:

See Also:



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

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:



65
66
67
68
69
70
71
72
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 65

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

Retrieve a fine tuning job by ‘job_id`.

Parameters:

Returns:

See Also:



47
48
49
50
51
52
53
54
# File 'lib/telnyx/resources/ai/fine_tuning/jobs.rb', line 47

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