AIServiceLanguageClient

class oci.ai_language.AIServiceLanguageClient(config, **kwargs)

OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market.

Methods

__init__(config, **kwargs) Creates a new service client
batch_detect_dominant_language(…) The API returns the detected language and a related confidence score (between 0 and 1).
batch_detect_language_entities(…) The API extracts entities in text records.
batch_detect_language_key_phrases(…) The API extracts key-phrases in text records.
batch_detect_language_pii_entities(…) The API extracts pii entities in text records.
batch_detect_language_sentiments(…) The API extracts aspect-based and sentence level sentiment in text records.
batch_detect_language_text_classification(…) The API automatically classifies text into a set of pre-determined classes and sub-classes.
batch_language_translation(…) Translates a batch of text documents from source to target language.
cancel_job(job_id, **kwargs) Canceling the job cancels all the tasks under it.
change_endpoint_compartment(endpoint_id, …) Moves a Endpoint into a different compartment.
change_job_compartment(job_id, …) Moves a Job into a different compartment.
change_model_compartment(model_id, …) Moves a Model into a different compartment.
change_project_compartment(project_id, …) Moves a Project into a different compartment.
create_endpoint(create_endpoint_details, …) Creates a new endpoint and deploy the trained model
create_job(create_job_details, **kwargs) Creates a new language service async job.
create_model(create_model_details, **kwargs) Creates a new model for training and train the model with date provided.
create_project(create_project_details, **kwargs) Creates a new Project.
delete_endpoint(endpoint_id, **kwargs) Deletes a provisioned endpoint resource by identifier.
delete_job(job_id, **kwargs) Deletes the language service async Job
delete_model(model_id, **kwargs) Deletes a provisioned model resource by identifier.
delete_project(project_id, **kwargs) Deletes a Project resource by identifier.
detect_dominant_language(…) Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
detect_language_entities(…) Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
detect_language_key_phrases(…) Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
detect_language_sentiments(…) Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
detect_language_text_classification(…) Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.
get_endpoint(endpoint_id, **kwargs) Gets an endpoint by identifier
get_job(job_id, **kwargs) Gets a language service async job
get_model(model_id, **kwargs) Gets a model by identifier
get_model_type(model_type, **kwargs) Gets model capabilities
get_project(project_id, **kwargs) Gets a Project by identifier
get_work_request(work_request_id, **kwargs) Gets the status of the work request with the given ID.
list_endpoints(compartment_id, **kwargs) Returns a list of Endpoints.
list_evaluation_results(model_id, **kwargs) Get a (paginated) list of evaluation results for a given model.
list_jobs(compartment_id, **kwargs) Returns a list of language service async Jobs.
list_models(compartment_id, **kwargs) Returns a list of models.
list_projects(compartment_id, **kwargs) Returns a list of Projects.
list_work_request_errors(work_request_id, …) Return a (paginated) list of errors for a given work request.
list_work_request_logs(work_request_id, **kwargs) Return a (paginated) list of logs for a given work request.
list_work_requests(compartment_id, **kwargs) Lists the work requests in a compartment.
update_endpoint(endpoint_id, …) Update the Endpoint identified by the id
update_job(job_id, update_job_details, **kwargs) Updates the language service async Job
update_model(model_id, update_model_details, …) Updates the model
update_project(project_id, …) Updates the Project
__init__(config, **kwargs)

Creates a new service client

Parameters:
  • config (dict) – Configuration keys and values as per SDK and Tool Configuration. The from_file() method can be used to load configuration from a file. Alternatively, a dict can be passed. You can validate_config the dict using validate_config()
  • service_endpoint (str) – (optional) The endpoint of the service to call using this client. For example https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint.
  • timeout (float or tuple(float, float)) – (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) –

    (optional) The signer to use when signing requests made by the service client. The default is to use a Signer based on the values provided in the config parameter.

    One use case for this parameter is for Instance Principals authentication by passing an instance of InstancePrincipalsSecurityTokenSigner as the value for this keyword argument

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a retry_strategy keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

  • circuit_breaker_strategy (obj) – (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client uses DEFAULT_CIRCUIT_BREAKER_STRATEGY as default if no circuit breaker strategy is provided. The specifics of circuit breaker strategy are described here.
  • circuit_breaker_callback (function) – (optional) Callback function to receive any exceptions triggerred by the circuit breaker.
  • client_level_realm_specific_endpoint_template_enabled (bool) – (optional) A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None.
  • allow_control_chars – (optional) allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not allow control characters to be in the response object.
batch_detect_dominant_language(batch_detect_dominant_language_details, **kwargs)

The API returns the detected language and a related confidence score (between 0 and 1). It supports passing a batch of records.

List of supported languages.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

Parameters:
  • batch_detect_dominant_language_details (oci.ai_language.models.BatchDetectDominantLanguageDetails) – (required) The details to make a language detection detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type BatchDetectDominantLanguageResult

Return type:

Response

Example:

Click here to see an example of how to use batch_detect_dominant_language API.

batch_detect_language_entities(batch_detect_language_entities_details, **kwargs)

The API extracts entities in text records. For each entity, its type/subtype and confidence score (between 0 and 1) is returned. It supports passing a batch of records.

List of supported entities.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

Parameters:
  • batch_detect_language_entities_details (oci.ai_language.models.BatchDetectLanguageEntitiesDetails) – (required) The details to make a Entity detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type BatchDetectLanguageEntitiesResult

Return type:

Response

Example:

Click here to see an example of how to use batch_detect_language_entities API.

batch_detect_language_key_phrases(batch_detect_language_key_phrases_details, **kwargs)

The API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text. It supports passing a batch of records.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

Parameters:
  • batch_detect_language_key_phrases_details (oci.ai_language.models.BatchDetectLanguageKeyPhrasesDetails) – (required) The details to make keyPhrase detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type BatchDetectLanguageKeyPhrasesResult

Return type:

Response

Example:

Click here to see an example of how to use batch_detect_language_key_phrases API.

batch_detect_language_pii_entities(batch_detect_language_pii_entities_details, **kwargs)

The API extracts pii entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned. It supports passing a batch of records.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

Parameters:
  • batch_detect_language_pii_entities_details (oci.ai_language.models.BatchDetectLanguagePiiEntitiesDetails) – (required) The details to make a PII entity detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type BatchDetectLanguagePiiEntitiesResult

Return type:

Response

Example:

Click here to see an example of how to use batch_detect_language_pii_entities API.

batch_detect_language_sentiments(batch_detect_language_sentiments_details, **kwargs)

The API extracts aspect-based and sentence level sentiment in text records.

For aspect-based sentiment analysis, a set of aspects and their respective sentiment is returned for each record. Similarly, for sentence-level sentiment analysis, the sentiment is returned at the sentence level.

For sentiment analysis, confidence scores are provided for each of the classes (positive, negative, neutral and mixed).

Learn more about sentiment analysis here.

Limitations:
  • A batch may have up to 100 records.
  • A record may be up to 5000 characters long.
  • The total of characters to process in a request can be up to 20,000 characters.
Parameters:
  • batch_detect_language_sentiments_details (oci.ai_language.models.BatchDetectLanguageSentimentsDetails) – (required) The details to make sentiment detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • level (list[str]) –

    (optional) Set this parameter for sentence and aspect level sentiment analysis. Allowed values are:

    • ASPECT
    • SENTENCE

    Allowed values are: “ASPECT”, “SENTENCE”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type BatchDetectLanguageSentimentsResult

Return type:

Response

Example:

Click here to see an example of how to use batch_detect_language_sentiments API.

batch_detect_language_text_classification(batch_detect_language_text_classification_details, **kwargs)

The API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified.

It supports passing a batch of records.

Learn more about text classification here.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

Parameters:
  • batch_detect_language_text_classification_details (oci.ai_language.models.BatchDetectLanguageTextClassificationDetails) – (required) The details to make text classification detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type BatchDetectLanguageTextClassificationResult

Return type:

Response

Example:

Click here to see an example of how to use batch_detect_language_text_classification API.

batch_language_translation(batch_language_translation_details, **kwargs)

Translates a batch of text documents from source to target language. A batch can contain:

  • up to 100 records.
  • documents length less than 5000 characters.
  • 20,000 characters in total as a sum of all documents length.
Parameters:
  • batch_language_translation_details (oci.ai_language.models.BatchLanguageTranslationDetails) – (required) The details to make language translation call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type BatchLanguageTranslationResult

Return type:

Response

Example:

Click here to see an example of how to use batch_language_translation API.

cancel_job(job_id, **kwargs)

Canceling the job cancels all the tasks under it.

Parameters:
  • job_id (str) – (required) Unique Transcription Job identifier.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use cancel_job API.

change_endpoint_compartment(endpoint_id, change_endpoint_compartment_details, **kwargs)

Moves a Endpoint into a different compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:
  • endpoint_id (str) – (required) The OCID of the endpoint.
  • change_endpoint_compartment_details (oci.ai_language.models.ChangeEndpointCompartmentDetails) – (required)
  • opc_request_id (str) – (optional) Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use change_endpoint_compartment API.

change_job_compartment(job_id, change_job_compartment_details, **kwargs)

Moves a Job into a different compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:
  • job_id (str) – (required) unique job OCID.
  • change_job_compartment_details (oci.ai_language.models.ChangeJobCompartmentDetails) – (required)
  • opc_request_id (str) – (optional) Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use change_job_compartment API.

change_model_compartment(model_id, change_model_compartment_details, **kwargs)

Moves a Model into a different compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:
  • model_id (str) – (required) unique model OCID.
  • change_model_compartment_details (oci.ai_language.models.ChangeModelCompartmentDetails) – (required)
  • opc_request_id (str) – (optional) Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use change_model_compartment API.

change_project_compartment(project_id, change_project_compartment_details, **kwargs)

Moves a Project into a different compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:
  • project_id (str) – (required) The OCID of the project.
  • change_project_compartment_details (oci.ai_language.models.ChangeProjectCompartmentDetails) – (required)
  • opc_request_id (str) – (optional) Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use change_project_compartment API.

create_endpoint(create_endpoint_details, **kwargs)

Creates a new endpoint and deploy the trained model

Parameters:
  • create_endpoint_details (oci.ai_language.models.CreateEndpointDetails) – (required) Details for the new endpoint.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Endpoint

Return type:

Response

Example:

Click here to see an example of how to use create_endpoint API.

create_job(create_job_details, **kwargs)

Creates a new language service async job.

Parameters:
  • create_job_details (oci.ai_language.models.CreateJobDetails) – (required) Details for the new job.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Job

Return type:

Response

Example:

Click here to see an example of how to use create_job API.

create_model(create_model_details, **kwargs)

Creates a new model for training and train the model with date provided.

Parameters:
  • create_model_details (oci.ai_language.models.CreateModelDetails) – (required) Details for the new model.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Model

Return type:

Response

Example:

Click here to see an example of how to use create_model API.

create_project(create_project_details, **kwargs)

Creates a new Project.

Parameters:
  • create_project_details (oci.ai_language.models.CreateProjectDetails) – (required) Details for the new Project.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Project

Return type:

Response

Example:

Click here to see an example of how to use create_project API.

delete_endpoint(endpoint_id, **kwargs)

Deletes a provisioned endpoint resource by identifier. This operation fails with a 409 error unless all associated resources are in a DELETED state. You must delete all associated resources before deleting a model.

Parameters:
  • endpoint_id (str) – (required) The OCID of the endpoint.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use delete_endpoint API.

delete_job(job_id, **kwargs)

Deletes the language service async Job

Parameters:
  • job_id (str) – (required) Unique Transcription Job identifier.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use delete_job API.

delete_model(model_id, **kwargs)

Deletes a provisioned model resource by identifier. This operation fails with a 409 error unless all associated resources are in a DELETED state. You must delete all associated resources before deleting a model.

Parameters:
  • model_id (str) – (required) unique model OCID.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use delete_model API.

delete_project(project_id, **kwargs)

Deletes a Project resource by identifier. This operation fails with a 409 error unless all associated resources (models deployments or data assets) are in a DELETED state. You must delete all associated resources before deleting a project.

Parameters:
  • project_id (str) – (required) The OCID of the project.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use delete_project API.

detect_dominant_language(detect_dominant_language_details, **kwargs)

Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. We recommend you replace this API with the batch API, BatchDetectDominantLanguage.

The DetectDominantLanguage API returns the detected language and a related confidence score (between 0 and 1).

List of supported languages

Limitations: - A record may be up to 1000 characters long.

Parameters:
  • detect_dominant_language_details (oci.ai_language.models.DetectDominantLanguageDetails) – (required) The details to make a language detection detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type DetectDominantLanguageResult

Return type:

Response

Example:

Click here to see an example of how to use detect_dominant_language API.

detect_language_entities(detect_language_entities_details, **kwargs)

Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. We recommend you replace this API with the batch API, BatchDetectLanguageEntities.

The DetectLanguageEntities API extracts entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned.

Limitations: - A text may be up to 1000 characters long.

Parameters:
  • detect_language_entities_details (oci.ai_language.models.DetectLanguageEntitiesDetails) – (required) The details to make a Entity detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • model_version (str) –

    (optional) Named Entity Recognition model versions. By default user will get output from V2.1 implementation.

    Allowed values are: “V2_1”, “V1_1”

  • is_pii (bool) – (optional) If this parameter is set to true, you only get PII (Personally identifiable information) entities like PhoneNumber, Email, Person, and so on. Default value is false.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type DetectLanguageEntitiesResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_entities API.

detect_language_key_phrases(detect_language_key_phrases_details, **kwargs)
Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT.

We recommend you replace this API with the batch API, BatchDetectLanguageKeyPhrases.

The DetectLanguageKeyPhrases API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text.

Limitations: - A record may be up to 1000 characters long.

Parameters:
  • detect_language_key_phrases_details (oci.ai_language.models.DetectLanguageKeyPhrasesDetails) – (required) The details to make keyPhrase detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type DetectLanguageKeyPhrasesResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_key_phrases API.

detect_language_sentiments(detect_language_sentiments_details, **kwargs)

Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. We recommend you replace this API with the batch API, BatchDetectLanguageSentiments.

The DetectLanguageSentiments API extracts aspect-based in text records.

For aspect-based sentiment analysis, a set of aspects and their respective sentiment is returned.

For sentiment analysis, confidence scores are provided for each of the classes (positive, negative, neutral).

Learn more about sentiment analysis here.

Limitations:
  • A record may be up to 1000 characters long.
Parameters:
  • detect_language_sentiments_details (oci.ai_language.models.DetectLanguageSentimentsDetails) – (required) The details to make sentiment detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type DetectLanguageSentimentsResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_sentiments API.

detect_language_text_classification(detect_language_text_classification_details, **kwargs)

Deprecated: This API will be retired Tuesday, 10 Oct 2023 00:00:00 GMT. We recommend you replace this API with the batch API, BatchDetectLanguageTextClassification.

The DetectLanguageTextClassification API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified.

Learn more about text classification here.

Limitations: - A record may be up to 1000 characters long.

Parameters:
  • detect_language_text_classification_details (oci.ai_language.models.DetectLanguageTextClassificationDetails) – (required) The details to make text classification detect call.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type DetectLanguageTextClassificationResult

Return type:

Response

Example:

Click here to see an example of how to use detect_language_text_classification API.

get_endpoint(endpoint_id, **kwargs)

Gets an endpoint by identifier

Parameters:
  • endpoint_id (str) – (required) The OCID of the endpoint.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Endpoint

Return type:

Response

Example:

Click here to see an example of how to use get_endpoint API.

get_job(job_id, **kwargs)

Gets a language service async job

Parameters:
  • job_id (str) – (required) Unique Transcription Job identifier.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Job

Return type:

Response

Example:

Click here to see an example of how to use get_job API.

get_model(model_id, **kwargs)

Gets a model by identifier

Parameters:
  • model_id (str) – (required) unique model OCID.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Model

Return type:

Response

Example:

Click here to see an example of how to use get_model API.

get_model_type(model_type, **kwargs)

Gets model capabilities

Parameters:
  • model_type (str) – (required) Results like version and model supported info by specifying model type
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ModelTypeInfo

Return type:

Response

Example:

Click here to see an example of how to use get_model_type API.

get_project(project_id, **kwargs)

Gets a Project by identifier

Parameters:
  • project_id (str) – (required) The OCID of the project.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Project

Return type:

Response

Example:

Click here to see an example of how to use get_project API.

get_work_request(work_request_id, **kwargs)

Gets the status of the work request with the given ID.

Parameters:
  • work_request_id (str) – (required) The ID of the asynchronous request.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type WorkRequest

Return type:

Response

Example:

Click here to see an example of how to use get_work_request API.

list_endpoints(compartment_id, **kwargs)

Returns a list of Endpoints.

Parameters:
  • compartment_id (str) – (required) The ID of the compartment in which to list resources.
  • endpoint_id (str) – (optional) The OCID of the endpoint.
  • project_id (str) – (optional) The ID of the project for which to list the objects.
  • display_name (str) – (optional) A filter to return only resources that match the entire display name given.
  • model_id (str) – (optional) The ID of the trained model for which to list the endpoints.
  • lifecycle_state (str) –

    (optional) <b>Filter</b> results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: “DELETING”, “DELETED”, “FAILED”, “CREATING”, “ACTIVE”, “UPDATING”

  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • sort_order (str) –

    (optional) The sort order to use, either ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) Specifies the field to sort by. Accepts only one field. By default, when you sort by timeCreated, the results are shown in descending order. When you sort by displayName, the results are shown in ascending order. Sort order for the displayName field is case sensitive.

    Allowed values are: “timeCreated”, “displayName”

  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type EndpointCollection

Return type:

Response

Example:

Click here to see an example of how to use list_endpoints API.

list_evaluation_results(model_id, **kwargs)

Get a (paginated) list of evaluation results for a given model.

Parameters:
  • model_id (str) – (required) unique model OCID.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type EvaluationResultCollection

Return type:

Response

Example:

Click here to see an example of how to use list_evaluation_results API.

list_jobs(compartment_id, **kwargs)

Returns a list of language service async Jobs.

Parameters:
  • compartment_id (str) – (required) The ID of the compartment in which to list resources.
  • lifecycle_state (str) –

    (optional) A filter to return only resources whose lifecycleState matches the given lifecycleState.

    Allowed values are: “ACCEPTED”, “IN_PROGRESS”, “SUCCEEDED”, “FAILED”, “CANCELING”, “CANCELED”, “DELETING”, “DELETED”

  • display_name (str) – (optional) A filter to return only resources that match the entire display name given.
  • id (str) – (optional) Unique identifier(OCID).
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • sort_order (str) –

    (optional) The sort order to use, either ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending.

    Allowed values are: “timeCreated”, “displayName”

  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type JobCollection

Return type:

Response

Example:

Click here to see an example of how to use list_jobs API.

list_models(compartment_id, **kwargs)

Returns a list of models.

Parameters:
  • compartment_id (str) – (required) The ID of the compartment in which to list resources.
  • model_id (str) – (optional) unique model OCID.
  • project_id (str) – (optional) The ID of the project for which to list the objects.
  • lifecycle_state (str) –

    (optional) <b>Filter</b> results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: “DELETING”, “DELETED”, “FAILED”, “CREATING”, “ACTIVE”, “UPDATING”

  • display_name (str) – (optional) A filter to return only resources that match the entire display name given.
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • sort_order (str) –

    (optional) The sort order to use, either ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) Specifies the field to sort by. Accepts only one field. By default, when you sort by timeCreated, the results are shown in descending order. When you sort by displayName, the results are shown in ascending order. Sort order for the displayName field is case sensitive.

    Allowed values are: “timeCreated”, “displayName”

  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ModelCollection

Return type:

Response

Example:

Click here to see an example of how to use list_models API.

list_projects(compartment_id, **kwargs)

Returns a list of Projects.

Parameters:
  • compartment_id (str) – (required) The ID of the compartment in which to list resources.
  • lifecycle_state (str) –

    (optional) <b>Filter</b> results by the specified lifecycle state. Must be a valid state for the resource type.

    Allowed values are: “DELETING”, “DELETED”, “FAILED”, “CREATING”, “ACTIVE”, “UPDATING”

  • display_name (str) – (optional) A filter to return only resources that match the entire display name given.
  • limit (int) – (optional) The maximum number of items to return.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • project_id (str) – (optional) The ID of the project for which to list the objects.
  • sort_order (str) –

    (optional) The sort order to use, either ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) Specifies the field to sort by. Accepts only one field. By default, when you sort by timeCreated, the results are shown in descending order. When you sort by displayName, the results are shown in ascending order. Sort order for the displayName field is case sensitive.

    Allowed values are: “timeCreated”, “displayName”

  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ProjectCollection

Return type:

Response

Example:

Click here to see an example of how to use list_projects API.

list_work_request_errors(work_request_id, **kwargs)

Return a (paginated) list of errors for a given work request.

Parameters:
  • work_request_id (str) – (required) The ID of the asynchronous request.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximum number of items to return.
  • sort_order (str) –

    (optional) The sort order to use, either ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.

    Allowed values are: “timeCreated”, “displayName”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type WorkRequestErrorCollection

Return type:

Response

Example:

Click here to see an example of how to use list_work_request_errors API.

list_work_request_logs(work_request_id, **kwargs)

Return a (paginated) list of logs for a given work request.

Parameters:
  • work_request_id (str) – (required) The ID of the asynchronous request.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximum number of items to return.
  • sort_order (str) –

    (optional) The sort order to use, either ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.

    Allowed values are: “timeCreated”, “displayName”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type WorkRequestLogCollection

Return type:

Response

Example:

Click here to see an example of how to use list_work_request_logs API.

list_work_requests(compartment_id, **kwargs)

Lists the work requests in a compartment.

Parameters:
  • compartment_id (str) – (required) The ID of the compartment in which to list resources.
  • work_request_id (str) – (optional) The ID of the asynchronous work request.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • page (str) – (optional) The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximum number of items to return.
  • resource_id (str) – (optional) The ID of the resource for which list workrequests.
  • sort_order (str) –

    (optional) The sort order to use, either ‘asc’ or ‘desc’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.

    Allowed values are: “timeCreated”, “displayName”

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type WorkRequestSummaryCollection

Return type:

Response

Example:

Click here to see an example of how to use list_work_requests API.

update_endpoint(endpoint_id, update_endpoint_details, **kwargs)

Update the Endpoint identified by the id

Parameters:
  • endpoint_id (str) – (required) The OCID of the endpoint.
  • update_endpoint_details (oci.ai_language.models.UpdateEndpointDetails) – (required) The information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use update_endpoint API.

update_job(job_id, update_job_details, **kwargs)

Updates the language service async Job

Parameters:
  • job_id (str) – (required) Unique Transcription Job identifier.
  • update_job_details (oci.ai_language.models.UpdateJobDetails) – (required) The information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type Job

Return type:

Response

Example:

Click here to see an example of how to use update_job API.

update_model(model_id, update_model_details, **kwargs)

Updates the model

Parameters:
  • model_id (str) – (required) unique model OCID.
  • update_model_details (oci.ai_language.models.UpdateModelDetails) – (required) The information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use update_model API.

update_project(project_id, update_project_details, **kwargs)

Updates the Project

Parameters:
  • project_id (str) – (required) The OCID of the project.
  • update_project_details (oci.ai_language.models.UpdateProjectDetails) – (required) The information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use update_project API.