Interface GenerativeAi

  • All Superinterfaces:
    AutoCloseable
    All Known Implementing Classes:
    GenerativeAiClient

    @Generated(value="OracleSDKGenerator",
               comments="API Version: 20231130")
    public interface GenerativeAi
    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).

    This service client uses CircuitBreakerUtils.DEFAULT_CIRCUIT_BREAKER for all the operations by default if no circuit breaker configuration is defined by the user.

    • 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 service.
      • 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
      • changeDedicatedAiClusterCompartment

        ChangeDedicatedAiClusterCompartmentResponse changeDedicatedAiClusterCompartment​(ChangeDedicatedAiClusterCompartmentRequest request)
        Moves a dedicated AI cluster into a different compartment within the same tenancy.

        For information about moving resources between compartments, see Moving Resources to a Different Compartment.

        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ChangeDedicatedAiClusterCompartmentExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ChangeDedicatedAiClusterCompartment API.

      • changeEndpointCompartment

        ChangeEndpointCompartmentResponse changeEndpointCompartment​(ChangeEndpointCompartmentRequest request)
        Moves an endpoint into a different compartment within the same tenancy.

        For information about moving resources between compartments, see Moving Resources to a Different Compartment.

        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ChangeEndpointCompartmentExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ChangeEndpointCompartment API.

      • changeModelCompartment

        ChangeModelCompartmentResponse changeModelCompartment​(ChangeModelCompartmentRequest request)
        Moves a custom model into a different compartment.

        For information about moving resources between compartments, see Moving Resources to a Different Compartment.

        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ChangeModelCompartmentExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ChangeModelCompartment API.

      • createDedicatedAiCluster

        CreateDedicatedAiClusterResponse createDedicatedAiCluster​(CreateDedicatedAiClusterRequest request)
        Creates a dedicated AI cluster.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/CreateDedicatedAiClusterExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use CreateDedicatedAiCluster API.

      • createEndpoint

        CreateEndpointResponse createEndpoint​(CreateEndpointRequest request)
        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
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/CreateEndpointExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use CreateEndpoint API.

      • createModel

        CreateModelResponse createModel​(CreateModelRequest request)
        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
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/CreateModelExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use CreateModel API.

      • deleteDedicatedAiCluster

        DeleteDedicatedAiClusterResponse deleteDedicatedAiCluster​(DeleteDedicatedAiClusterRequest request)
        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
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/DeleteDedicatedAiClusterExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use DeleteDedicatedAiCluster API.

      • deleteEndpoint

        DeleteEndpointResponse deleteEndpoint​(DeleteEndpointRequest request)
        Deletes an endpoint.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/DeleteEndpointExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use DeleteEndpoint API.

      • deleteModel

        DeleteModelResponse deleteModel​(DeleteModelRequest request)
        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
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/DeleteModelExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use DeleteModel API.

      • getDedicatedAiCluster

        GetDedicatedAiClusterResponse getDedicatedAiCluster​(GetDedicatedAiClusterRequest request)
        Gets information about a dedicated AI cluster.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/GetDedicatedAiClusterExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use GetDedicatedAiCluster API.

      • getEndpoint

        GetEndpointResponse getEndpoint​(GetEndpointRequest request)
        Gets information about an endpoint.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/GetEndpointExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use GetEndpoint API.

      • getModel

        GetModelResponse getModel​(GetModelRequest request)
        Gets information about a custom model.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/GetModelExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use GetModel API.

      • getWorkRequest

        GetWorkRequestResponse getWorkRequest​(GetWorkRequestRequest request)
        Gets the details of a work request.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/GetWorkRequestExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use GetWorkRequest API.

      • listDedicatedAiClusters

        ListDedicatedAiClustersResponse listDedicatedAiClusters​(ListDedicatedAiClustersRequest request)
        Lists the dedicated AI clusters in a specific compartment.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ListDedicatedAiClustersExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ListDedicatedAiClusters API.

      • listEndpoints

        ListEndpointsResponse listEndpoints​(ListEndpointsRequest request)
        Lists the endpoints of a specific compartment.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ListEndpointsExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ListEndpoints API.

      • listModels

        ListModelsResponse listModels​(ListModelsRequest request)
        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
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ListModelsExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ListModels API.

      • listWorkRequestErrors

        ListWorkRequestErrorsResponse listWorkRequestErrors​(ListWorkRequestErrorsRequest request)
        Lists the errors for a work request.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ListWorkRequestErrorsExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ListWorkRequestErrors API.

      • listWorkRequestLogs

        ListWorkRequestLogsResponse listWorkRequestLogs​(ListWorkRequestLogsRequest request)
        Lists the logs for a work request.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ListWorkRequestLogsExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ListWorkRequestLogs API.

      • listWorkRequests

        ListWorkRequestsResponse listWorkRequests​(ListWorkRequestsRequest request)
        Lists the work requests in a compartment.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/ListWorkRequestsExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use ListWorkRequests API.

      • updateDedicatedAiCluster

        UpdateDedicatedAiClusterResponse updateDedicatedAiCluster​(UpdateDedicatedAiClusterRequest request)
        Updates a dedicated AI cluster.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/UpdateDedicatedAiClusterExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use UpdateDedicatedAiCluster API.

      • updateEndpoint

        UpdateEndpointResponse updateEndpoint​(UpdateEndpointRequest request)
        Updates the properties of an endpoint.
        Parameters:
        request - The request object containing the details to send
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/UpdateEndpointExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use UpdateEndpoint API.

      • updateModel

        UpdateModelResponse updateModel​(UpdateModelRequest request)
        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
        Returns:
        A response object containing details about the completed operation
        Throws:
        BmcException - when an error occurs. This operation uses RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION as default if no retry strategy is provided. The specifics of the default retry strategy are described here https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/javasdkconcepts.htm#javasdkconcepts_topic_Retries

        Example: Click <a href=“https://docs.oracle.com/en-us/iaas/tools/java-sdk-examples/3.63.0/generativeai/UpdateModelExample.java.html"target=”_blank"rel=“noopener noreferrer”>here to see how to use UpdateModel API.

      • getWaiters

        GenerativeAiWaiters getWaiters()
        Gets the pre-configured waiters available for resources for this service.
        Returns:
        The service waiters.
      • getPaginators

        GenerativeAiPaginators getPaginators()
        Gets the pre-configured paginators available for list operations in this service which may return multiple pages of data.

        These paginators provide an Iterable interface so that service responses, or resources/records, can be iterated through without having to manually deal with pagination and page tokens.

        Returns:
        The service paginators.