GenerativeAiClient

class oci.generative_ai.GenerativeAiClient(config, **kwargs)

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 [dedicated AI clusters](#/en/generative-ai/latest/DedicatedAiCluster/), [endpoints](#/en/generative-ai/latest/Endpoint/), [custom models](#/en/generative-ai/latest/Model/), and [work requests](#/en/generative-ai/latest/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](/iaas/api/#/en/generative-ai-inference/latest/).

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

Methods

__init__(config, **kwargs) Creates a new service client
change_dedicated_ai_cluster_compartment(…) Moves a dedicated AI cluster into a different compartment within the same tenancy.
change_endpoint_compartment(endpoint_id, …) Moves an endpoint into a different compartment within the same tenancy.
change_model_compartment(model_id, …) Moves a custom model into a different compartment.
create_dedicated_ai_cluster(…) Creates a dedicated AI cluster.
create_endpoint(create_endpoint_details, …) Creates an endpoint.
create_model(create_model_details, **kwargs) Creates a custom model by fine-tuning a base model with your own dataset.
delete_dedicated_ai_cluster(…) Deletes a dedicated AI cluster.
delete_endpoint(endpoint_id, **kwargs) Deletes an endpoint.
delete_model(model_id, **kwargs) Deletes a custom model.
get_dedicated_ai_cluster(…) Gets information about a dedicated AI cluster.
get_endpoint(endpoint_id, **kwargs) Gets information about an endpoint.
get_model(model_id, **kwargs) Gets information about a custom model.
get_work_request(work_request_id, **kwargs) Gets the details of a work request.
list_dedicated_ai_clusters(compartment_id, …) Lists the dedicated AI clusters in a specific compartment.
list_endpoints(compartment_id, **kwargs) Lists the endpoints of a specific compartment.
list_models(compartment_id, **kwargs) Lists the models in a specific compartment.
list_work_request_errors(work_request_id, …) Lists the errors for a work request.
list_work_request_logs(work_request_id, **kwargs) Lists the logs for a work request.
list_work_requests(compartment_id, **kwargs) Lists the work requests in a compartment.
update_dedicated_ai_cluster(…) Updates a dedicated AI cluster.
update_endpoint(endpoint_id, …) Updates the properties of an endpoint.
update_model(model_id, update_model_details, …) Updates the properties of a custom model such as name, description, version, freeform tags, and defined tags.
__init__(config, **kwargs)

Creates a new service client

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

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

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

  • retry_strategy (obj) –

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

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

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

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:
  • dedicated_ai_cluster_id (str) –

    (required) The OCID of the dedicated AI cluster.

  • change_dedicated_ai_cluster_compartment_details (oci.generative_ai.models.ChangeDedicatedAiClusterCompartmentDetails) – (required) The information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type None

Return type:

Response

Example:

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

change_endpoint_compartment(endpoint_id, change_endpoint_compartment_details, **kwargs)

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:
  • endpoint_id (str) –

    (required) The OCID of the endpoint.

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

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

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

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

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

A Response object with data of type None

Return type:

Response

Example:

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

change_model_compartment(model_id, change_model_compartment_details, **kwargs)

Moves a custom model into a different compartment. For information about moving resources between compartments, see Moving Resources to a Different Compartment.

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

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

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

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

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

A Response object with data of type None

Return type:

Response

Example:

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

create_dedicated_ai_cluster(create_dedicated_ai_cluster_details, **kwargs)

Creates a dedicated AI cluster.

Parameters:
  • create_dedicated_ai_cluster_details (oci.generative_ai.models.CreateDedicatedAiClusterDetails) – (required) Details for the new dedicated AI cluster.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type DedicatedAiCluster

Return type:

Response

Example:

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

create_endpoint(create_endpoint_details, **kwargs)

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:
  • create_endpoint_details (oci.generative_ai.models.CreateEndpointDetails) – (required) Details for the new endpoint.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type Endpoint

Return type:

Response

Example:

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

create_model(create_model_details, **kwargs)

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:
  • create_model_details (oci.generative_ai.models.CreateModelDetails) – (required) Details for the new model.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of running that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and removed from the system, then a retry of the original creation request might be rejected.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type Model

Return type:

Response

Example:

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

delete_dedicated_ai_cluster(dedicated_ai_cluster_id, **kwargs)

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:
  • dedicated_ai_cluster_id (str) –

    (required) The OCID of the dedicated AI cluster.

  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type None

Return type:

Response

Example:

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

delete_endpoint(endpoint_id, **kwargs)

Deletes an endpoint.

Parameters:
  • endpoint_id (str) –

    (required) The OCID of the endpoint.

  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type None

Return type:

Response

Example:

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

delete_model(model_id, **kwargs)

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

Parameters:
  • model_id (str) – (required) The model OCID
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type None

Return type:

Response

Example:

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

get_dedicated_ai_cluster(dedicated_ai_cluster_id, **kwargs)

Gets information about a dedicated AI cluster.

Parameters:
  • dedicated_ai_cluster_id (str) –

    (required) The OCID of the dedicated AI cluster.

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type DedicatedAiCluster

Return type:

Response

Example:

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

get_endpoint(endpoint_id, **kwargs)

Gets information about an endpoint.

Parameters:
  • endpoint_id (str) –

    (required) The OCID of the endpoint.

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type Endpoint

Return type:

Response

Example:

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

get_model(model_id, **kwargs)

Gets information about a custom model.

Parameters:
  • model_id (str) – (required) The model OCID
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type Model

Return type:

Response

Example:

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

get_work_request(work_request_id, **kwargs)

Gets the details of a work request.

Parameters:
  • work_request_id (str) –

    (required) The OCID of the asynchronous work request.

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type WorkRequest

Return type:

Response

Example:

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

list_dedicated_ai_clusters(compartment_id, **kwargs)

Lists the dedicated AI clusters in a specific compartment.

Parameters:
  • compartment_id (str) –

    (required) The OCID of the compartment in which to list resources.

  • lifecycle_state (str) –

    (optional) A filter to return only the dedicated AI clusters that their lifecycle state matches the given lifecycle state.

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

  • display_name (str) – (optional) A filter to return only resources that match the given display name exactly.
  • id (str) –

    (optional) The OCID of the dedicated AI cluster.

  • limit (int) –

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated “List” call. For important details about how pagination works, see List Pagination.

  • page (str) –

    (optional) For list pagination. The value of the opc-next-page response header from the previous “List” call. For important details about how pagination works, see List Pagination.

  • sort_order (str) –

    (optional) The sort order to use, either ‘ASC’ or ‘DESC’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide only one sort order. Default order for timeCreated is descending. Default order for displayName is ascending.

    Allowed values are: “timeCreated”, “displayName”, “lifecycleState”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type DedicatedAiClusterCollection

Return type:

Response

Example:

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

list_endpoints(compartment_id, **kwargs)

Lists the endpoints of a specific compartment.

Parameters:
  • compartment_id (str) –

    (required) The OCID of the compartment in which to list resources.

  • lifecycle_state (str) –

    (optional) A filter to return only resources that their lifecycle state matches the given lifecycle state.

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

  • display_name (str) – (optional) A filter to return only resources that match the given display name exactly.
  • id (str) –

    (optional) The OCID of the endpoint.

  • limit (int) –

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated “List” call. For important details about how pagination works, see List Pagination.

  • page (str) –

    (optional) For list pagination. The value of the opc-next-page response header from the previous “List” call. For important details about how pagination works, see List Pagination.

  • sort_order (str) –

    (optional) The sort order to use, either ‘ASC’ or ‘DESC’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide only one sort order. Default order for timeCreated is descending. Default order for displayName is ascending.

    Allowed values are: “displayName”, “timeCreated”

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type EndpointCollection

Return type:

Response

Example:

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

list_models(compartment_id, **kwargs)

Lists the models in a specific compartment. Includes pretrained base models and fine-tuned custom models.

Parameters:
  • compartment_id (str) –

    (required) The OCID of the compartment in which to list resources.

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • vendor (str) – (optional) A filter to return only resources that match the entire vendor given.
  • capability (list[str]) –

    (optional) A filter to return only resources their capability matches the given capability.

    Allowed values are: “TEXT_GENERATION”, “TEXT_SUMMARIZATION”, “TEXT_EMBEDDINGS”, “FINE_TUNE”, “CHAT”

  • lifecycle_state (str) –

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

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

  • display_name (str) – (optional) A filter to return only resources that match the given display name exactly.
  • id (str) – (optional) The ID of the model.
  • limit (int) –

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated “List” call. For important details about how pagination works, see List Pagination.

  • page (str) –

    (optional) For list pagination. The value of the opc-next-page response header from the previous “List” call. For important details about how pagination works, see List Pagination.

  • sort_order (str) –

    (optional) The sort order to use, either ‘ASC’ or ‘DESC’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

    (optional) The field to sort by. You can provide only one sort order. Default order for timeCreated is descending.

    Allowed values are: “displayName”, “lifecycleState”, “timeCreated”

  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type ModelCollection

Return type:

Response

Example:

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

list_work_request_errors(work_request_id, **kwargs)

Lists the errors for a work request.

Parameters:
  • work_request_id (str) –

    (required) The OCID of the asynchronous work request.

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • page (str) –

    (optional) For list pagination. The value of the opc-next-page response header from the previous “List” call. For important details about how pagination works, see List Pagination.

  • limit (int) –

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated “List” call. For important details about how pagination works, see List Pagination.

  • sort_by (str) –

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

    Allowed values are: “timestamp”

  • sort_order (str) –

    (optional) The sort order to use, either ‘ASC’ or ‘DESC’.

    Allowed values are: “ASC”, “DESC”

  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type WorkRequestErrorCollection

Return type:

Response

Example:

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

list_work_request_logs(work_request_id, **kwargs)

Lists the logs for a work request.

Parameters:
  • work_request_id (str) –

    (required) The OCID of the asynchronous work request.

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • page (str) –

    (optional) For list pagination. The value of the opc-next-page response header from the previous “List” call. For important details about how pagination works, see List Pagination.

  • limit (int) –

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated “List” call. For important details about how pagination works, see List Pagination.

  • sort_by (str) –

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

    Allowed values are: “timestamp”

  • sort_order (str) –

    (optional) The sort order to use, either ‘ASC’ or ‘DESC’.

    Allowed values are: “ASC”, “DESC”

  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type WorkRequestLogEntryCollection

Return type:

Response

Example:

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

list_work_requests(compartment_id, **kwargs)

Lists the work requests in a compartment.

Parameters:
  • compartment_id (str) –

    (required) The OCID of the compartment in which to list resources.

  • work_request_id (str) –

    (optional) The OCID of the asynchronous work request.

  • status (str) –

    (optional) A filter to return only the resources that match the given lifecycle state.

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

  • resource_id (str) –

    (optional) The OCID of the resource affected by the work request.

  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • page (str) –

    (optional) For list pagination. The value of the opc-next-page response header from the previous “List” call. For important details about how pagination works, see List Pagination.

  • limit (int) –

    (optional) For list pagination. The maximum number of results per page, or items to return in a paginated “List” call. For important details about how pagination works, see List Pagination.

  • sort_order (str) –

    (optional) The sort order to use, either ‘ASC’ or ‘DESC’.

    Allowed values are: “ASC”, “DESC”

  • sort_by (str) –

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

    Allowed values are: “timeAccepted”

  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type WorkRequestSummaryCollection

Return type:

Response

Example:

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

update_dedicated_ai_cluster(dedicated_ai_cluster_id, update_dedicated_ai_cluster_details, **kwargs)

Updates a dedicated AI cluster.

Parameters:
  • dedicated_ai_cluster_id (str) –

    (required) The OCID of the dedicated AI cluster.

  • update_dedicated_ai_cluster_details (oci.generative_ai.models.UpdateDedicatedAiClusterDetails) – (required) The information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type DedicatedAiCluster

Return type:

Response

Example:

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

update_endpoint(endpoint_id, update_endpoint_details, **kwargs)

Updates the properties of an endpoint.

Parameters:
  • endpoint_id (str) –

    (required) The OCID of the endpoint.

  • update_endpoint_details (oci.generative_ai.models.UpdateEndpointDetails) – (required) The information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type Endpoint

Return type:

Response

Example:

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

update_model(model_id, update_model_details, **kwargs)

Updates the properties of a custom model such as name, description, version, freeform tags, and defined tags.

Parameters:
  • model_id (str) – (required) The model OCID
  • update_model_details (oci.generative_ai.models.UpdateModelDetails) – (required) The model information to be updated.
  • if_match (str) – (optional) For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.
  • opc_request_id (str) – (optional) Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. The only valid characters for request IDs are letters, numbers, underscore, and dash.
  • retry_strategy (obj) –

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

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

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

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

A Response object with data of type Model

Return type:

Response

Example:

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