Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Latest commit

 

History

History
357 lines (254 loc) · 11.5 KB

FineTuningApi.md

File metadata and controls

357 lines (254 loc) · 11.5 KB

OpenapiClient::FineTuningApi

All URIs are relative to https://api.openai.com/v1

Method HTTP request Description
cancel_fine_tuning_job POST /fine_tuning/jobs/{fine_tuning_job_id}/cancel Immediately cancel a fine-tune job.
create_fine_tuning_job POST /fine_tuning/jobs Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. Learn more about fine-tuning
list_fine_tuning_events GET /fine_tuning/jobs/{fine_tuning_job_id}/events Get status updates for a fine-tuning job.
list_paginated_fine_tuning_jobs GET /fine_tuning/jobs List your organization's fine-tuning jobs
retrieve_fine_tuning_job GET /fine_tuning/jobs/{fine_tuning_job_id} Get info about a fine-tuning job. Learn more about fine-tuning

cancel_fine_tuning_job

cancel_fine_tuning_job(fine_tuning_job_id)

Immediately cancel a fine-tune job.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::FineTuningApi.new
fine_tuning_job_id = 'ft-AF1WoRqd3aJAHsqc9NY7iL8F' # String | The ID of the fine-tuning job to cancel. 

begin
  # Immediately cancel a fine-tune job. 
  result = api_instance.cancel_fine_tuning_job(fine_tuning_job_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->cancel_fine_tuning_job: #{e}"
end

Using the cancel_fine_tuning_job_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> cancel_fine_tuning_job_with_http_info(fine_tuning_job_id)

begin
  # Immediately cancel a fine-tune job. 
  data, status_code, headers = api_instance.cancel_fine_tuning_job_with_http_info(fine_tuning_job_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FineTuningJob>
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->cancel_fine_tuning_job_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
fine_tuning_job_id String The ID of the fine-tuning job to cancel.

Return type

FineTuningJob

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

create_fine_tuning_job

create_fine_tuning_job(create_fine_tuning_job_request)

Creates a job that fine-tunes a specified model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. Learn more about fine-tuning

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::FineTuningApi.new
create_fine_tuning_job_request = OpenapiClient::CreateFineTuningJobRequest.new({model: OpenapiClient::CreateFineTuningJobRequestModel.new, training_file: 'file-abc123'}) # CreateFineTuningJobRequest | 

begin
  # Creates a job that fine-tunes a specified model from a given dataset.  Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.  [Learn more about fine-tuning](/docs/guides/fine-tuning) 
  result = api_instance.create_fine_tuning_job(create_fine_tuning_job_request)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->create_fine_tuning_job: #{e}"
end

Using the create_fine_tuning_job_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_fine_tuning_job_with_http_info(create_fine_tuning_job_request)

begin
  # Creates a job that fine-tunes a specified model from a given dataset.  Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.  [Learn more about fine-tuning](/docs/guides/fine-tuning) 
  data, status_code, headers = api_instance.create_fine_tuning_job_with_http_info(create_fine_tuning_job_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FineTuningJob>
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->create_fine_tuning_job_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_fine_tuning_job_request CreateFineTuningJobRequest

Return type

FineTuningJob

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

list_fine_tuning_events

list_fine_tuning_events(fine_tuning_job_id, opts)

Get status updates for a fine-tuning job.

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::FineTuningApi.new
fine_tuning_job_id = 'ft-AF1WoRqd3aJAHsqc9NY7iL8F' # String | The ID of the fine-tuning job to get events for. 
opts = {
  after: 'after_example', # String | Identifier for the last event from the previous pagination request.
  limit: 56 # Integer | Number of events to retrieve.
}

begin
  # Get status updates for a fine-tuning job. 
  result = api_instance.list_fine_tuning_events(fine_tuning_job_id, opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->list_fine_tuning_events: #{e}"
end

Using the list_fine_tuning_events_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_fine_tuning_events_with_http_info(fine_tuning_job_id, opts)

begin
  # Get status updates for a fine-tuning job. 
  data, status_code, headers = api_instance.list_fine_tuning_events_with_http_info(fine_tuning_job_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListFineTuningJobEventsResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->list_fine_tuning_events_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
fine_tuning_job_id String The ID of the fine-tuning job to get events for.
after String Identifier for the last event from the previous pagination request. [optional]
limit Integer Number of events to retrieve. [optional][default to 20]

Return type

ListFineTuningJobEventsResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_paginated_fine_tuning_jobs

list_paginated_fine_tuning_jobs(opts)

List your organization's fine-tuning jobs

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::FineTuningApi.new
opts = {
  after: 'after_example', # String | Identifier for the last job from the previous pagination request.
  limit: 56 # Integer | Number of fine-tuning jobs to retrieve.
}

begin
  # List your organization's fine-tuning jobs 
  result = api_instance.list_paginated_fine_tuning_jobs(opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->list_paginated_fine_tuning_jobs: #{e}"
end

Using the list_paginated_fine_tuning_jobs_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> list_paginated_fine_tuning_jobs_with_http_info(opts)

begin
  # List your organization's fine-tuning jobs 
  data, status_code, headers = api_instance.list_paginated_fine_tuning_jobs_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListPaginatedFineTuningJobsResponse>
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->list_paginated_fine_tuning_jobs_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
after String Identifier for the last job from the previous pagination request. [optional]
limit Integer Number of fine-tuning jobs to retrieve. [optional][default to 20]

Return type

ListPaginatedFineTuningJobsResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

retrieve_fine_tuning_job

retrieve_fine_tuning_job(fine_tuning_job_id)

Get info about a fine-tuning job. Learn more about fine-tuning

Examples

require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
  # Configure Bearer authorization: ApiKeyAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OpenapiClient::FineTuningApi.new
fine_tuning_job_id = 'ft-AF1WoRqd3aJAHsqc9NY7iL8F' # String | The ID of the fine-tuning job. 

begin
  # Get info about a fine-tuning job.  [Learn more about fine-tuning](/docs/guides/fine-tuning) 
  result = api_instance.retrieve_fine_tuning_job(fine_tuning_job_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->retrieve_fine_tuning_job: #{e}"
end

Using the retrieve_fine_tuning_job_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> retrieve_fine_tuning_job_with_http_info(fine_tuning_job_id)

begin
  # Get info about a fine-tuning job.  [Learn more about fine-tuning](/docs/guides/fine-tuning) 
  data, status_code, headers = api_instance.retrieve_fine_tuning_job_with_http_info(fine_tuning_job_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <FineTuningJob>
rescue OpenapiClient::ApiError => e
  puts "Error when calling FineTuningApi->retrieve_fine_tuning_job_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
fine_tuning_job_id String The ID of the fine-tuning job.

Return type

FineTuningJob

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json