docstr: Creates a fine-tuning job which begins the process of creating a new 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](https://platform.openai.com/docs/guides/fine-tuning)
  
  Args:
    model: The name of the model to fine-tune. You can select one of the
        [supported models](https://platform.openai.com/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
  
    training_file: The ID of an uploaded file that contains training data.
  
        See [upload file](https://platform.openai.com/docs/api-reference/files/upload)
        for how to upload a file.
  
        Your dataset must be formatted as a JSONL file. Additionally, you must upload
        your file with the purpose `fine-tune`.
  
        See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
        for more details.
  
    hyperparameters: The hyperparameters used for the fine-tuning job.
  
    suffix: A string of up to 18 characters that will be added to your fine-tuned model
        name.
  
        For example, a `suffix` of "custom-model-name" would produce a model name like
        `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`.
  
    validation_file: The ID of an uploaded file that contains validation data.
  
        If you provide this file, the data is used to generate validation metrics
        periodically during fine-tuning. These metrics can be viewed in the fine-tuning
        results file. The same data should not be present in both train and validation
        files.
  
        Your dataset must be formatted as a JSONL file. You must upload your file with
        the purpose `fine-tune`.
  
        See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
        for more details.
  
    extra_headers: Send extra headers
  
    extra_query: Add additional query parameters to the request
  
    extra_body: Add additional JSON properties to the request
  
    timeout: Override the client-level default timeout for this request, in seconds
docstr_tok: ["Creates","a","fine-tuning","job","which","begins","the","process","of","creating","a","new","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","]","(","https",":","\/\/platform.openai.com\/docs\/guides\/fine-tuning",")","Args",":","model",":","The","name","of","the","model","to","fine-tune",".","You","can","select","one","of","the","[","supported","models","]","(","https",":","\/\/platform.openai.com\/docs\/guides\/fine-tuning\/what-models-can-be-fine-tuned",")",".","training_file",":","The","ID","of","an","uploaded","file","that","contains","training","data",".","See","[","upload","file","]","(","https",":","\/\/platform.openai.com\/docs\/api-reference\/files\/upload",")","for","how","to","upload","a","file",".","Your","dataset","must","be","formatted","as","a","JSONL","file",".","Additionally",",","you","must","upload","your","file","with","the","purpose","`","fine-tune","`",".","See","the","[","fine-tuning","guide","]","(","https",":","\/\/platform.openai.com\/docs\/guides\/fine-tuning",")","for","more","details",".","hyperparameters",":","The","hyperparameters","used","for","the","fine-tuning","job",".","suffix",":","A","string","of","up","to","18","characters","that","will","be","added","to","your","fine-tuned","model","name",".","For","example",",","a","`","suffix","`","of","``","custom-model-name","''","would","produce","a","model","name","like","`","ft",":","gpt-3.5-turbo",":","openai",":","custom-model-name:7p4lURel","`",".","validation_file",":","The","ID","of","an","uploaded","file","that","contains","validation","data",".","If","you","provide","this","file",",","the","data","is","used","to","generate","validation","metrics","periodically","during","fine-tuning",".","These","metrics","can","be","viewed","in","the","fine-tuning","results","file",".","The","same","data","should","not","be","present","in","both","train","and","validation","files",".","Your","dataset","must","be","formatted","as","a","JSONL","file",".","You","must","upload","your","file","with","the","purpose","`","fine-tune","`",".","See","the","[","fine-tuning","guide","]","(","https",":","\/\/platform.openai.com\/docs\/guides\/fine-tuning",")","for","more","details",".","extra_headers",":","Send","extra","headers","extra_query",":","Add","additional","query","parameters","to","the","request","extra_body",":","Add","additional","JSON","properties","to","the","request","timeout",":","Override","the","client-level","default","timeout","for","this","request",",","in","seconds"]
code: def create(
      self,
      *,
      model: Union[
          str, Literal["babbage-002", "davinci-002", "gpt-3.5-turbo"]
      ],
      training_file: str,
      hyperparameters: job_create_params.Hyperparameters
      | NotGiven = NOT_GIVEN,
      suffix: Optional[str] | NotGiven = NOT_GIVEN,
      validation_file: Optional[str] | NotGiven = NOT_GIVEN,
      # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
      # The extra values given here take precedence over values defined on the client or passed to this method.
      extra_headers: Headers | None = None,
      extra_query: Query | None = None,
      extra_body: Body | None = None,
      timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
  ) -> FineTuningJob:
      """
      Creates a fine-tuning job which begins the process of creating a new 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](https://platform.openai.com/docs/guides/fine-tuning)
  
      Args:
        model: The name of the model to fine-tune. You can select one of the
            [supported models](https://platform.openai.com/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
  
        training_file: The ID of an uploaded file that contains training data.
  
            See [upload file](https://platform.openai.com/docs/api-reference/files/upload)
            for how to upload a file.
  
            Your dataset must be formatted as a JSONL file. Additionally, you must upload
            your file with the purpose `fine-tune`.
  
            See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
            for more details.
  
        hyperparameters: The hyperparameters used for the fine-tuning job.
  
        suffix: A string of up to 18 characters that will be added to your fine-tuned model
            name.
  
            For example, a `suffix` of "custom-model-name" would produce a model name like
            `ft:gpt-3.5-turbo:openai:custom-model-name:7p4lURel`.
  
        validation_file: The ID of an uploaded file that contains validation data.
  
            If you provide this file, the data is used to generate validation metrics
            periodically during fine-tuning. These metrics can be viewed in the fine-tuning
            results file. The same data should not be present in both train and validation
            files.
  
            Your dataset must be formatted as a JSONL file. You must upload your file with
            the purpose `fine-tune`.
  
            See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning)
            for more details.
  
        extra_headers: Send extra headers
  
        extra_query: Add additional query parameters to the request
  
        extra_body: Add additional JSON properties to the request
  
        timeout: Override the client-level default timeout for this request, in seconds
      """
      return self._post(
          "/fine_tuning/jobs",
          body=maybe_transform(
              {
                  "model": model,
                  "training_file": training_file,
                  "hyperparameters": hyperparameters,
                  "suffix": suffix,
                  "validation_file": validation_file,
              },
              job_create_params.JobCreateParams,
          ),
          options=make_request_options(
              extra_headers=extra_headers,
              extra_query=extra_query,
              extra_body=extra_body,
              timeout=timeout,
          ),
          cast_to=FineTuningJob,
      )
  
imports: from __future__ import annotations
  from typing import Union, Optional
  from typing_extensions import Literal
  import httpx
  from ...None import _legacy_response
  from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
  from ..._utils import maybe_transform
  from ..._compat import cached_property
  from ..._resource import SyncAPIResource, AsyncAPIResource
  from ..._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
  from ...pagination import SyncCursorPage, AsyncCursorPage
  from ..._base_client import AsyncPaginator, make_request_options
  from ...types.fine_tuning import FineTuningJob, FineTuningJobEvent, job_list_params, job_create_params, job_list_events_params
label_desc: Use image node_id 3 for calling the Jobs obj's underlying member method code with example usage: obj.create() and returns: self