# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

require 'oci'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
ai_language_client =
  OCI::AiLanguage::AIServiceLanguageClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
create_model_response =
  ai_language_client.create_model(
    OCI::AiLanguage::Models::CreateModelDetails.new(
      compartment_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value',
      project_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-projectId-Value',
      model_details:
        OCI::AiLanguage::Models::TextClassificationModelDetails.new(
          model_type: 'TEXT_CLASSIFICATION',
          language_code: 'EXAMPLE-languageCode-Value',
          classification_mode:
            OCI::AiLanguage::Models::ClassificationMultiClassModeDetails.new(
              classification_mode: 'MULTI_CLASS',
              version: 'EXAMPLE-version-Value'
            )
        ),
      display_name: 'EXAMPLE-displayName-Value',
      description: 'EXAMPLE-description-Value',
      training_dataset:
        OCI::AiLanguage::Models::DataScienceLabelingDataset.new(
          dataset_type: 'DATA_SCIENCE_LABELING',
          dataset_id: 'ocid1.test.oc1..<unique_ID>EXAMPLE-datasetId-Value'
        ),
      test_strategy:
        OCI::AiLanguage::Models::TestAndValidationDatasetStrategy.new(
          strategy_type: 'TEST_AND_VALIDATION_DATASET',
          testing_dataset:
            OCI::AiLanguage::Models::ObjectStorageDataset.new(
              dataset_type: 'OBJECT_STORAGE',
              location_details:
                OCI::AiLanguage::Models::ObjectListDataset.new(
                  location_type: 'OBJECT_LIST',
                  namespace_name: 'EXAMPLE-namespaceName-Value',
                  bucket_name: 'EXAMPLE-bucketName-Value',
                  object_names: %w[EXAMPLE--Value]
                )
            )
        ),
      freeform_tags: {
        'EXAMPLE_KEY_Nhwjw' => 'EXAMPLE_VALUE_uN4eW8It2EftWwGa5rIK'
      },
      defined_tags: {
        'EXAMPLE_KEY_0FoC6' => { 'EXAMPLE_KEY_cdXMb' => 'EXAMPLE--Value' }
      }
    )
  )

# Get the data from response
puts "#{create_model_response.data}"