Class AIServiceLanguageAsyncClient
- java.lang.Object
-
- com.oracle.bmc.http.internal.BaseAsyncClient
-
- com.oracle.bmc.ailanguage.AIServiceLanguageAsyncClient
-
- All Implemented Interfaces:
AIServiceLanguageAsync
,AutoCloseable
@Generated(value="OracleSDKGenerator", comments="API Version: 20221001") public class AIServiceLanguageAsyncClient extends BaseAsyncClient implements AIServiceLanguageAsync
Async client implementation for AIServiceLanguage service.
There are two ways to use async client: 1. Use AsyncHandler: using AsyncHandler, if the response to the call is anInputStream
, like getObject Api in object storage service, developers need to process the stream in AsyncHandler, and not anywhere else, because the stream will be closed right after the AsyncHandler is invoked.
2. Use Java Future: using Java Future, developers need to close the stream after they are done with the Java Future.
Accessing the result should be done in a mutually exclusive manner, either through the Future or the AsyncHandler, but not both. If the Future is used, the caller should pass in null as the AsyncHandler. If the AsyncHandler is used, it is still safe to use the Future to determine whether or not the request was completed via Future.isDone/isCancelled.
Please refer to https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/ResteasyClientWithObjectStorageExample.java
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AIServiceLanguageAsyncClient.Builder
Builder class for this client.
-
Field Summary
Fields Modifier and Type Field Description String
clientCommonLibraryVersion
Compatible SDK version, provided by the codegen.Optional<String>
minimumClientCommonLibraryVersionFromClient
Minimum compatible SDK version, maybe provided by the codegen.static Service
SERVICE
Service instance for AIServiceLanguage.
-
Constructor Summary
Constructors Constructor Description AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory)
Deprecated.Use thebuilder
instead.AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators)
Deprecated.Use thebuilder
instead.AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.AIServiceLanguageAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)
Deprecated.Use thebuilder
instead.AIServiceLanguageAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration)
Deprecated.Use thebuilder
instead.AIServiceLanguageAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator)
Deprecated.Use thebuilder
instead.
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.oracle.bmc.ailanguage.AIServiceLanguageAsync
getEndpoint, refreshClient, setEndpoint, useRealmSpecificEndpointTemplate
-
Methods inherited from interface java.lang.AutoCloseable
close
-
-
-
-
Constructor Detail
-
AIServiceLanguageAsyncClient
@Deprecated public AIServiceLanguageAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeAIServiceLanguageAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)
-
AIServiceLanguageAsyncClient
@Deprecated public AIServiceLanguageAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeAIServiceLanguageAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
-
AIServiceLanguageAsyncClient
@Deprecated public AIServiceLanguageAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeAIServiceLanguageAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
-
AIServiceLanguageAsyncClient
@Deprecated public AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeAIServiceLanguageAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
-
AIServiceLanguageAsyncClient
@Deprecated public AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeAIServiceLanguageAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
-ClientBuilderBase.additionalClientConfigurators
-
AIServiceLanguageAsyncClient
@Deprecated public AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeAIServiceLanguageAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
-ClientBuilderBase.additionalClientConfigurators
endpoint
-ClientBuilderBase.endpoint(java.lang.String)
-
AIServiceLanguageAsyncClient
@Deprecated public AIServiceLanguageAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
Deprecated.Use thebuilder
instead.Create a new client instance.- Parameters:
authenticationDetailsProvider
- The authentication details (seeAIServiceLanguageAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
-ClientBuilderBase.configuration
clientConfigurator
-ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
-ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
-ClientBuilderBase.additionalClientConfigurators
endpoint
-ClientBuilderBase.endpoint(java.lang.String)
signingStrategyRequestSignerFactories
-ClientBuilderBase.signingStrategyRequestSignerFactories
-
-
Method Detail
-
builder
public static AIServiceLanguageAsyncClient.Builder builder()
Create a builder for this client.- Returns:
- builder
-
setRegion
public void setRegion(Region region)
Description copied from interface:AIServiceLanguageAsync
Sets the region to call (ex, Region.US_PHOENIX_1).Note, this will call
setEndpoint
after resolving the endpoint. If the service is not available in this region, however, an IllegalArgumentException will be raised.- Specified by:
setRegion
in interfaceAIServiceLanguageAsync
- Parameters:
region
- The region of the service.
-
setRegion
public void setRegion(String regionId)
Description copied from interface:AIServiceLanguageAsync
Sets the region to call (ex, ‘us-phoenix-1’).Note, this will first try to map the region ID to a known Region and call
setRegion
.If no known Region could be determined, it will create an endpoint based on the default endpoint format (
Region.formatDefaultRegionEndpoint(Service, String)
and then callsetEndpoint
.- Specified by:
setRegion
in interfaceAIServiceLanguageAsync
- Parameters:
regionId
- The public region ID.
-
batchDetectDominantLanguage
public Future<BatchDetectDominantLanguageResponse> batchDetectDominantLanguage(BatchDetectDominantLanguageRequest request, AsyncHandler<BatchDetectDominantLanguageRequest,BatchDetectDominantLanguageResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.](https://docs.oracle.com/iaas/language/using/pretrain-models.htm#lang-detect)
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.
- Specified by:
batchDetectDominantLanguage
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
batchDetectHealthEntity
public Future<BatchDetectHealthEntityResponse> batchDetectHealthEntity(BatchDetectHealthEntityRequest request, AsyncHandler<BatchDetectHealthEntityRequest,BatchDetectHealthEntityResponse> handler)
Description copied from interface:AIServiceLanguageAsync
The API extracts health 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.
- Specified by:
batchDetectHealthEntity
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
batchDetectLanguageEntities
public Future<BatchDetectLanguageEntitiesResponse> batchDetectLanguageEntities(BatchDetectLanguageEntitiesRequest request, AsyncHandler<BatchDetectLanguageEntitiesRequest,BatchDetectLanguageEntitiesResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.](https://docs.oracle.com/iaas/language/using/pretrain-models.htm#ner__sup-ner-entity)
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.
- Specified by:
batchDetectLanguageEntities
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
batchDetectLanguageKeyPhrases
public Future<BatchDetectLanguageKeyPhrasesResponse> batchDetectLanguageKeyPhrases(BatchDetectLanguageKeyPhrasesRequest request, AsyncHandler<BatchDetectLanguageKeyPhrasesRequest,BatchDetectLanguageKeyPhrasesResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
batchDetectLanguageKeyPhrases
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
batchDetectLanguagePiiEntities
public Future<BatchDetectLanguagePiiEntitiesResponse> batchDetectLanguagePiiEntities(BatchDetectLanguagePiiEntitiesRequest request, AsyncHandler<BatchDetectLanguagePiiEntitiesRequest,BatchDetectLanguagePiiEntitiesResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
batchDetectLanguagePiiEntities
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
batchDetectLanguageSentiments
public Future<BatchDetectLanguageSentimentsResponse> batchDetectLanguageSentiments(BatchDetectLanguageSentimentsRequest request, AsyncHandler<BatchDetectLanguageSentimentsRequest,BatchDetectLanguageSentimentsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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](https://docs.oracle.com/iaas/language/using/pretrain-models.htm#sentiment).
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.
- Specified by:
batchDetectLanguageSentiments
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
batchDetectLanguageTextClassification
public Future<BatchDetectLanguageTextClassificationResponse> batchDetectLanguageTextClassification(BatchDetectLanguageTextClassificationRequest request, AsyncHandler<BatchDetectLanguageTextClassificationRequest,BatchDetectLanguageTextClassificationResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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](https://docs.oracle.com/iaas/language/using/pretrain-models.htm#text-class).
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.
- Specified by:
batchDetectLanguageTextClassification
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
batchLanguageTranslation
public Future<BatchLanguageTranslationResponse> batchLanguageTranslation(BatchLanguageTranslationRequest request, AsyncHandler<BatchLanguageTranslationRequest,BatchLanguageTranslationResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
batchLanguageTranslation
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
cancelJob
public Future<CancelJobResponse> cancelJob(CancelJobRequest request, AsyncHandler<CancelJobRequest,CancelJobResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Canceling the job cancels all the tasks under it.- Specified by:
cancelJob
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
changeEndpointCompartment
public Future<ChangeEndpointCompartmentResponse> changeEndpointCompartment(ChangeEndpointCompartmentRequest request, AsyncHandler<ChangeEndpointCompartmentRequest,ChangeEndpointCompartmentResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Moves a Endpoint into a different compartment.When provided, If-Match is checked against ETag values of the resource.
- Specified by:
changeEndpointCompartment
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
changeJobCompartment
public Future<ChangeJobCompartmentResponse> changeJobCompartment(ChangeJobCompartmentRequest request, AsyncHandler<ChangeJobCompartmentRequest,ChangeJobCompartmentResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Moves a Job into a different compartment.When provided, If-Match is checked against ETag values of the resource.
- Specified by:
changeJobCompartment
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
changeModelCompartment
public Future<ChangeModelCompartmentResponse> changeModelCompartment(ChangeModelCompartmentRequest request, AsyncHandler<ChangeModelCompartmentRequest,ChangeModelCompartmentResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Moves a Model into a different compartment.When provided, If-Match is checked against ETag values of the resource.
- Specified by:
changeModelCompartment
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
changeProjectCompartment
public Future<ChangeProjectCompartmentResponse> changeProjectCompartment(ChangeProjectCompartmentRequest request, AsyncHandler<ChangeProjectCompartmentRequest,ChangeProjectCompartmentResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Moves a Project into a different compartment.When provided, If-Match is checked against ETag values of the resource.
- Specified by:
changeProjectCompartment
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createEndpoint
public Future<CreateEndpointResponse> createEndpoint(CreateEndpointRequest request, AsyncHandler<CreateEndpointRequest,CreateEndpointResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Creates a new endpoint and deploy the trained model- Specified by:
createEndpoint
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createJob
public Future<CreateJobResponse> createJob(CreateJobRequest request, AsyncHandler<CreateJobRequest,CreateJobResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Creates a new language service async job.- Specified by:
createJob
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createModel
public Future<CreateModelResponse> createModel(CreateModelRequest request, AsyncHandler<CreateModelRequest,CreateModelResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Creates a new model for training and train the model with date provided.- Specified by:
createModel
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
createProject
public Future<CreateProjectResponse> createProject(CreateProjectRequest request, AsyncHandler<CreateProjectRequest,CreateProjectResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Creates a new Project.- Specified by:
createProject
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
deleteEndpoint
public Future<DeleteEndpointResponse> deleteEndpoint(DeleteEndpointRequest request, AsyncHandler<DeleteEndpointRequest,DeleteEndpointResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
deleteEndpoint
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
deleteJob
public Future<DeleteJobResponse> deleteJob(DeleteJobRequest request, AsyncHandler<DeleteJobRequest,DeleteJobResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Deletes the language service async Job- Specified by:
deleteJob
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
deleteModel
public Future<DeleteModelResponse> deleteModel(DeleteModelRequest request, AsyncHandler<DeleteModelRequest,DeleteModelResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
deleteModel
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
deleteProject
public Future<DeleteProjectResponse> deleteProject(DeleteProjectRequest request, AsyncHandler<DeleteProjectRequest,DeleteProjectResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
deleteProject
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
detectDominantLanguage
public Future<DetectDominantLanguageResponse> detectDominantLanguage(DetectDominantLanguageRequest request, AsyncHandler<DetectDominantLanguageRequest,DetectDominantLanguageResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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](https://docs.oracle.com/iaas/language/using/pretrain-models.htm#lang-detect)
Limitations: - A record may be up to 1000 characters long.
- Specified by:
detectDominantLanguage
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
detectLanguageEntities
public Future<DetectLanguageEntitiesResponse> detectLanguageEntities(DetectLanguageEntitiesRequest request, AsyncHandler<DetectLanguageEntitiesRequest,DetectLanguageEntitiesResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
detectLanguageEntities
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
detectLanguageKeyPhrases
public Future<DetectLanguageKeyPhrasesResponse> detectLanguageKeyPhrases(DetectLanguageKeyPhrasesRequest request, AsyncHandler<DetectLanguageKeyPhrasesRequest,DetectLanguageKeyPhrasesResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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.
- Specified by:
detectLanguageKeyPhrases
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
detectLanguageSentiments
public Future<DetectLanguageSentimentsResponse> detectLanguageSentiments(DetectLanguageSentimentsRequest request, AsyncHandler<DetectLanguageSentimentsRequest,DetectLanguageSentimentsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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](https://docs.oracle.com/iaas/language/using/pretrain-models.htm#sentiment).
Limitations: - A record may be up to 1000 characters long.
- Specified by:
detectLanguageSentiments
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
detectLanguageTextClassification
public Future<DetectLanguageTextClassificationResponse> detectLanguageTextClassification(DetectLanguageTextClassificationRequest request, AsyncHandler<DetectLanguageTextClassificationRequest,DetectLanguageTextClassificationResponse> handler)
Description copied from interface:AIServiceLanguageAsync
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](https://docs.oracle.com/iaas/language/using/pretrain-models.htm#text-class).
Limitations: - A record may be up to 1000 characters long.
- Specified by:
detectLanguageTextClassification
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getEndpoint
public Future<GetEndpointResponse> getEndpoint(GetEndpointRequest request, AsyncHandler<GetEndpointRequest,GetEndpointResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Gets an endpoint by identifier- Specified by:
getEndpoint
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getJob
public Future<GetJobResponse> getJob(GetJobRequest request, AsyncHandler<GetJobRequest,GetJobResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Gets a language service async job- Specified by:
getJob
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getModel
public Future<GetModelResponse> getModel(GetModelRequest request, AsyncHandler<GetModelRequest,GetModelResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Gets a model by identifier- Specified by:
getModel
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getModelType
public Future<GetModelTypeResponse> getModelType(GetModelTypeRequest request, AsyncHandler<GetModelTypeRequest,GetModelTypeResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Gets model capabilities- Specified by:
getModelType
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getProject
public Future<GetProjectResponse> getProject(GetProjectRequest request, AsyncHandler<GetProjectRequest,GetProjectResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Gets a Project by identifier- Specified by:
getProject
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getWorkRequest
public Future<GetWorkRequestResponse> getWorkRequest(GetWorkRequestRequest request, AsyncHandler<GetWorkRequestRequest,GetWorkRequestResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Gets the status of the work request with the given ID.- Specified by:
getWorkRequest
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listEndpoints
public Future<ListEndpointsResponse> listEndpoints(ListEndpointsRequest request, AsyncHandler<ListEndpointsRequest,ListEndpointsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Returns a list of Endpoints.- Specified by:
listEndpoints
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listEvaluationResults
public Future<ListEvaluationResultsResponse> listEvaluationResults(ListEvaluationResultsRequest request, AsyncHandler<ListEvaluationResultsRequest,ListEvaluationResultsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Get a (paginated) list of evaluation results for a given model.- Specified by:
listEvaluationResults
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listJobs
public Future<ListJobsResponse> listJobs(ListJobsRequest request, AsyncHandler<ListJobsRequest,ListJobsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Returns a list of language service async Jobs.- Specified by:
listJobs
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listModels
public Future<ListModelsResponse> listModels(ListModelsRequest request, AsyncHandler<ListModelsRequest,ListModelsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Returns a list of models.- Specified by:
listModels
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listProjects
public Future<ListProjectsResponse> listProjects(ListProjectsRequest request, AsyncHandler<ListProjectsRequest,ListProjectsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Returns a list of Projects.- Specified by:
listProjects
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listWorkRequestErrors
public Future<ListWorkRequestErrorsResponse> listWorkRequestErrors(ListWorkRequestErrorsRequest request, AsyncHandler<ListWorkRequestErrorsRequest,ListWorkRequestErrorsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Return a (paginated) list of errors for a given work request.- Specified by:
listWorkRequestErrors
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listWorkRequestLogs
public Future<ListWorkRequestLogsResponse> listWorkRequestLogs(ListWorkRequestLogsRequest request, AsyncHandler<ListWorkRequestLogsRequest,ListWorkRequestLogsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Return a (paginated) list of logs for a given work request.- Specified by:
listWorkRequestLogs
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
listWorkRequests
public Future<ListWorkRequestsResponse> listWorkRequests(ListWorkRequestsRequest request, AsyncHandler<ListWorkRequestsRequest,ListWorkRequestsResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Lists the work requests in a compartment.- Specified by:
listWorkRequests
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
updateEndpoint
public Future<UpdateEndpointResponse> updateEndpoint(UpdateEndpointRequest request, AsyncHandler<UpdateEndpointRequest,UpdateEndpointResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Update the Endpoint identified by the id- Specified by:
updateEndpoint
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
updateJob
public Future<UpdateJobResponse> updateJob(UpdateJobRequest request, AsyncHandler<UpdateJobRequest,UpdateJobResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Updates the language service async Job- Specified by:
updateJob
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
updateModel
public Future<UpdateModelResponse> updateModel(UpdateModelRequest request, AsyncHandler<UpdateModelRequest,UpdateModelResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Updates the model- Specified by:
updateModel
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
updateProject
public Future<UpdateProjectResponse> updateProject(UpdateProjectRequest request, AsyncHandler<UpdateProjectRequest,UpdateProjectResponse> handler)
Description copied from interface:AIServiceLanguageAsync
Updates the Project- Specified by:
updateProject
in interfaceAIServiceLanguageAsync
- Parameters:
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.- Returns:
- A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
-
getDefaultConfigurator
protected ClientConfigurator getDefaultConfigurator()
-
useRealmSpecificEndpointTemplate
public void useRealmSpecificEndpointTemplate(boolean useOfRealmSpecificEndpointTemplateEnabled)
This method should be used to enable or disable the use of realm-specific endpoint template.The default value is null. To enable the use of endpoint template defined for the realm in use, set the flag to true To disable the use of endpoint template defined for the realm in use, set the flag to false
- Parameters:
useOfRealmSpecificEndpointTemplateEnabled
- This flag can be set to true or false to enable or disable the use of realm-specific endpoint template respectively
-
populateServiceParametersInEndpoint
public final void populateServiceParametersInEndpoint(String endpoint, Map<String,Object> requiredParametersMap)
Populate the parameters in the endpoint with its corresponding value and update the base endpoint.The value will be populated iff the parameter in endpoint is a required request path parameter or a required request query parameter. If not, the parameter in the endpoint will be ignored and left blank.
- Parameters:
endpoint
- The endpoint template in userequiredParametersMap
- Map of parameter name as key and value set in request path or query parameter as value
-
updateBaseEndpoint
public final void updateBaseEndpoint(String endpoint)
This method should be used for parameterized endpoint templates only.This does not include {region} and {secondLevelDomain} parameters.
- Parameters:
endpoint
- The updated endpoint to use
-
setEndpoint
public final void setEndpoint(String endpoint)
-
getEndpoint
public final String getEndpoint()
-
refreshClient
public final void refreshClient()
Rebuild the backingHttpClient
.This will call
ClientConfigurator
s again, and can be used to e.g. refresh the SSL certificate.
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
getClientCommonLibraryVersion
public String getClientCommonLibraryVersion()
-
getMinimumClientCommonLibraryVersionFromClient
public Optional<String> getMinimumClientCommonLibraryVersionFromClient()
-
clientCall
protected <REQ extends BmcRequest<?>,RESP extends BmcResponse,RESP_BUILDER extends BmcResponse.Builder<RESP>> ClientCall<REQ,RESP,RESP_BUILDER> clientCall(REQ request, Supplier<RESP_BUILDER> responseBuilder)
-
-