com.oracle.bmc.generativeai.GenerativeAiAsync Maven / Gradle / Ivy
Show all versions of oci-java-sdk-generativeai Show documentation
/**
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/
package com.oracle.bmc.generativeai;
import com.oracle.bmc.generativeai.requests.*;
import com.oracle.bmc.generativeai.responses.*;
/**
* 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 {@link DedicatedAiCluster},
* {@link Endpoint}, {@link Model}, and {@link 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.cloud.oracle.com/#/en/generative-ai-inference/latest/).
*
*
To learn more about the service, see the [Generative AI
* documentation](https://docs.cloud.oracle.com/iaas/Content/generative-ai/home.htm).
*/
@jakarta.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20231130")
public interface GenerativeAiAsync extends AutoCloseable {
/** Rebuilds the client from scratch. Useful to refresh certificates. */
void refreshClient();
/**
* Sets the endpoint to call (ex, https://www.example.com).
*
* @param endpoint The endpoint of the serice.
*/
void setEndpoint(String endpoint);
/** Gets the set endpoint for REST call (ex, https://www.example.com) */
String getEndpoint();
/**
* Sets the region to call (ex, Region.US_PHOENIX_1).
*
*
Note, this will call {@link #setEndpoint(String) setEndpoint} after resolving the
* endpoint. If the service is not available in this region, however, an
* IllegalArgumentException will be raised.
*
* @param region The region of the service.
*/
void setRegion(com.oracle.bmc.Region region);
/**
* 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 {@link
* #setRegion(Region) setRegion}.
*
*
If no known Region could be determined, it will create an endpoint based on the default
* endpoint format ({@link com.oracle.bmc.Region#formatDefaultRegionEndpoint(Service, String)}
* and then call {@link #setEndpoint(String) setEndpoint}.
*
* @param regionId The public region ID.
*/
void setRegion(String regionId);
/**
* 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"
*
* @param realmSpecificEndpointTemplateEnabled flag to enable the use of realm specific endpoint
* template
*/
void useRealmSpecificEndpointTemplate(boolean realmSpecificEndpointTemplateEnabled);
/**
* 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](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future
changeDedicatedAiClusterCompartment(
ChangeDedicatedAiClusterCompartmentRequest request,
com.oracle.bmc.responses.AsyncHandler<
ChangeDedicatedAiClusterCompartmentRequest,
ChangeDedicatedAiClusterCompartmentResponse>
handler);
/**
* 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](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future changeEndpointCompartment(
ChangeEndpointCompartmentRequest request,
com.oracle.bmc.responses.AsyncHandler<
ChangeEndpointCompartmentRequest, ChangeEndpointCompartmentResponse>
handler);
/**
* Moves a custom model into a different compartment. For information about moving resources
* between compartments, see [Moving Resources to a Different
* Compartment](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future changeModelCompartment(
ChangeModelCompartmentRequest request,
com.oracle.bmc.responses.AsyncHandler<
ChangeModelCompartmentRequest, ChangeModelCompartmentResponse>
handler);
/**
* Creates a dedicated AI cluster.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future createDedicatedAiCluster(
CreateDedicatedAiClusterRequest request,
com.oracle.bmc.responses.AsyncHandler<
CreateDedicatedAiClusterRequest, CreateDedicatedAiClusterResponse>
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.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future createEndpoint(
CreateEndpointRequest request,
com.oracle.bmc.responses.AsyncHandler
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.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future createModel(
CreateModelRequest request,
com.oracle.bmc.responses.AsyncHandler 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.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future deleteDedicatedAiCluster(
DeleteDedicatedAiClusterRequest request,
com.oracle.bmc.responses.AsyncHandler<
DeleteDedicatedAiClusterRequest, DeleteDedicatedAiClusterResponse>
handler);
/**
* Deletes an endpoint.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future deleteEndpoint(
DeleteEndpointRequest request,
com.oracle.bmc.responses.AsyncHandler
handler);
/**
* Deletes a custom model. A model shouldn't be deleted if there's one or more active endpoints
* associated with that model.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future deleteModel(
DeleteModelRequest request,
com.oracle.bmc.responses.AsyncHandler handler);
/**
* Gets information about a dedicated AI cluster.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future getDedicatedAiCluster(
GetDedicatedAiClusterRequest request,
com.oracle.bmc.responses.AsyncHandler<
GetDedicatedAiClusterRequest, GetDedicatedAiClusterResponse>
handler);
/**
* Gets information about an endpoint.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future getEndpoint(
GetEndpointRequest request,
com.oracle.bmc.responses.AsyncHandler handler);
/**
* Gets information about a custom model.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future getModel(
GetModelRequest request,
com.oracle.bmc.responses.AsyncHandler handler);
/**
* Gets the details of a work request.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future getWorkRequest(
GetWorkRequestRequest request,
com.oracle.bmc.responses.AsyncHandler
handler);
/**
* Lists the dedicated AI clusters in a specific compartment.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future listDedicatedAiClusters(
ListDedicatedAiClustersRequest request,
com.oracle.bmc.responses.AsyncHandler<
ListDedicatedAiClustersRequest, ListDedicatedAiClustersResponse>
handler);
/**
* Lists the endpoints of a specific compartment.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future listEndpoints(
ListEndpointsRequest request,
com.oracle.bmc.responses.AsyncHandler
handler);
/**
* Lists the models in a specific compartment. Includes pretrained base models and fine-tuned
* custom models.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future listModels(
ListModelsRequest request,
com.oracle.bmc.responses.AsyncHandler handler);
/**
* Lists the errors for a work request.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future listWorkRequestErrors(
ListWorkRequestErrorsRequest request,
com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestErrorsRequest, ListWorkRequestErrorsResponse>
handler);
/**
* Lists the logs for a work request.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future listWorkRequestLogs(
ListWorkRequestLogsRequest request,
com.oracle.bmc.responses.AsyncHandler<
ListWorkRequestLogsRequest, ListWorkRequestLogsResponse>
handler);
/**
* Lists the work requests in a compartment.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future listWorkRequests(
ListWorkRequestsRequest request,
com.oracle.bmc.responses.AsyncHandler
handler);
/**
* Updates a dedicated AI cluster.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future updateDedicatedAiCluster(
UpdateDedicatedAiClusterRequest request,
com.oracle.bmc.responses.AsyncHandler<
UpdateDedicatedAiClusterRequest, UpdateDedicatedAiClusterResponse>
handler);
/**
* Updates the properties of an endpoint.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future updateEndpoint(
UpdateEndpointRequest request,
com.oracle.bmc.responses.AsyncHandler
handler);
/**
* Updates the properties of a custom model such as name, description, version, freeform tags,
* and defined tags.
*
* @param request The request object containing the details to send
* @param handler The request handler to invoke upon completion, may be null.
* @return 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.
*/
java.util.concurrent.Future updateModel(
UpdateModelRequest request,
com.oracle.bmc.responses.AsyncHandler handler);
}