Interface GenerativeAiAsync

  • All Superinterfaces:
    AutoCloseable
    All Known Implementing Classes:
    GenerativeAiAsyncClient

    @Generated(value="OracleSDKGenerator",
               comments="API Version: 20231130")
    public interface GenerativeAiAsync
    extends AutoCloseable
    OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings.

    Use the Generative AI service management API to create and manage DedicatedAiCluster, Endpoint, Model, and WorkRequest in the Generative AI service. For example, create a custom model by fine-tuning an out-of-the-box model using your own data, on a fine-tuning dedicated AI cluster. Then, create a hosting dedicated AI cluster with an endpoint to host your custom model.

    To access your custom model endpoints, or to try the out-of-the-box models to generate text, summarize, and create text embeddings see the [Generative AI Inference API](https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/latest/).

    To learn more about the service, see the [Generative AI documentation](https://docs.oracle.com/iaas/Content/generative-ai/home.htm).

    • Method Detail

      • refreshClient

        void refreshClient()
        Rebuilds the client from scratch.

        Useful to refresh certificates.

      • setEndpoint

        void setEndpoint​(String endpoint)
        Sets the endpoint to call (ex, https://www.example.com).
        Parameters:
        endpoint - The endpoint of the serice.
      • getEndpoint

        String getEndpoint()
        Gets the set endpoint for REST call (ex, https://www.example.com)
      • setRegion

        void setRegion​(Region region)
        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.

        Parameters:
        region - The region of the service.
      • setRegion

        void setRegion​(String regionId)
        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 call setEndpoint.

        Parameters:
        regionId - The public region ID.
      • useRealmSpecificEndpointTemplate

        void useRealmSpecificEndpointTemplate​(boolean realmSpecificEndpointTemplateEnabled)
        Determines whether realm specific endpoint should be used or not.

        Set realmSpecificEndpointTemplateEnabled to “true” if the user wants to enable use of realm specific endpoint template, otherwise set it to “false”

        Parameters:
        realmSpecificEndpointTemplateEnabled - flag to enable the use of realm specific endpoint template
      • createEndpoint

        Future<CreateEndpointResponse> createEndpoint​(CreateEndpointRequest request,
                                                      AsyncHandler<CreateEndpointRequest,​CreateEndpointResponse> handler)
        Creates an endpoint.

        The header contains an opc-work-request-id, which is the id for the WorkRequest that tracks the endpoint creation progress.

        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<CreateModelResponse> createModel​(CreateModelRequest request,
                                                AsyncHandler<CreateModelRequest,​CreateModelResponse> handler)
        Creates a custom model by fine-tuning a base model with your own dataset.

        You can create a new custom models or create a new version of existing custom model..

        The header contains an opc-work-request-id, which is the id for the WorkRequest that tracks the model creation progress.

        Parameters:
        request - The request object containing the details to send
        handler - 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.
      • deleteDedicatedAiCluster

        Future<DeleteDedicatedAiClusterResponse> deleteDedicatedAiCluster​(DeleteDedicatedAiClusterRequest request,
                                                                          AsyncHandler<DeleteDedicatedAiClusterRequest,​DeleteDedicatedAiClusterResponse> handler)
        Deletes a dedicated AI cluster.

        You can only delete clusters without attached resources. Before you delete a hosting dedicated AI cluster, you must delete the endpoints associated to that cluster. Before you delete a fine-tuning dedicated AI cluster, you must delete the custom model on that cluster. The delete action permanently deletes the cluster. This action can't be undone.

        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<DeleteEndpointResponse> deleteEndpoint​(DeleteEndpointRequest request,
                                                      AsyncHandler<DeleteEndpointRequest,​DeleteEndpointResponse> handler)
        Deletes an endpoint.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<DeleteModelResponse> deleteModel​(DeleteModelRequest request,
                                                AsyncHandler<DeleteModelRequest,​DeleteModelResponse> handler)
        Deletes a custom model.

        A model shouldn’t be deleted if there’s one or more active endpoints associated with that model.

        Parameters:
        request - The request object containing the details to send
        handler - 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.
      • getDedicatedAiCluster

        Future<GetDedicatedAiClusterResponse> getDedicatedAiCluster​(GetDedicatedAiClusterRequest request,
                                                                    AsyncHandler<GetDedicatedAiClusterRequest,​GetDedicatedAiClusterResponse> handler)
        Gets information about a dedicated AI cluster.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<GetEndpointResponse> getEndpoint​(GetEndpointRequest request,
                                                AsyncHandler<GetEndpointRequest,​GetEndpointResponse> handler)
        Gets information about an endpoint.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<GetModelResponse> getModel​(GetModelRequest request,
                                          AsyncHandler<GetModelRequest,​GetModelResponse> handler)
        Gets information about a custom model.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<GetWorkRequestResponse> getWorkRequest​(GetWorkRequestRequest request,
                                                      AsyncHandler<GetWorkRequestRequest,​GetWorkRequestResponse> handler)
        Gets the details of a work request.
        Parameters:
        request - The request object containing the details to send
        handler - 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.
      • listDedicatedAiClusters

        Future<ListDedicatedAiClustersResponse> listDedicatedAiClusters​(ListDedicatedAiClustersRequest request,
                                                                        AsyncHandler<ListDedicatedAiClustersRequest,​ListDedicatedAiClustersResponse> handler)
        Lists the dedicated AI clusters in a specific compartment.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<ListEndpointsResponse> listEndpoints​(ListEndpointsRequest request,
                                                    AsyncHandler<ListEndpointsRequest,​ListEndpointsResponse> handler)
        Lists the endpoints of a specific compartment.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<ListModelsResponse> listModels​(ListModelsRequest request,
                                              AsyncHandler<ListModelsRequest,​ListModelsResponse> handler)
        Lists the models in a specific compartment.

        Includes pretrained base models and fine-tuned custom models.

        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<ListWorkRequestErrorsResponse> listWorkRequestErrors​(ListWorkRequestErrorsRequest request,
                                                                    AsyncHandler<ListWorkRequestErrorsRequest,​ListWorkRequestErrorsResponse> handler)
        Lists the errors for a work request.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<ListWorkRequestLogsResponse> listWorkRequestLogs​(ListWorkRequestLogsRequest request,
                                                                AsyncHandler<ListWorkRequestLogsRequest,​ListWorkRequestLogsResponse> handler)
        Lists the logs for a work request.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<ListWorkRequestsResponse> listWorkRequests​(ListWorkRequestsRequest request,
                                                          AsyncHandler<ListWorkRequestsRequest,​ListWorkRequestsResponse> handler)
        Lists the work requests in a compartment.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<UpdateEndpointResponse> updateEndpoint​(UpdateEndpointRequest request,
                                                      AsyncHandler<UpdateEndpointRequest,​UpdateEndpointResponse> handler)
        Updates the properties of an endpoint.
        Parameters:
        request - The request object containing the details to send
        handler - 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

        Future<UpdateModelResponse> updateModel​(UpdateModelRequest request,
                                                AsyncHandler<UpdateModelRequest,​UpdateModelResponse> handler)
        Updates the properties of a custom model such as name, description, version, freeform tags, and defined tags.
        Parameters:
        request - The request object containing the details to send
        handler - 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.