Package com.chatmotorapi.api.models
Class MotorModelsRequest
java.lang.Object
com.chatmotorapi.api.models.MotorModelsRequest
public class MotorModelsRequest extends Object
Represents the models associated with the Chat Motor AI. This class utilizes
the Builder pattern to provide a flexible and clear method of constructing
instances.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MotorModelsRequest.Builder
Builder class for creatingMotorModelsRequest
instances. -
Method Summary
Modifier and Type Method Description static MotorModelsRequest.Builder
builder()
Static method to obtain a new Builder instance.ChatMotor
chatMotor()
Retrieves the chat motor configuration.MotorModelResponse
deleteModel(String modelId)
Deletes a specific model identified by the model ID from OpenAI's services.MotorModelResponse
getModel(String modelId)
Executes a query to retrieve an unique model using a blocking call.MotorModelResponse
getModels()
Executes a query to retrieve models using a blocking call.
-
Method Details
-
chatMotor
Retrieves the chat motor configuration.- Returns:
- the configuration of the chat
-
builder
Static method to obtain a new Builder instance.- Returns:
- a new instance of Builder for creating a MotorAiModels object
-
getModels
Executes a query to retrieve models using a blocking call. This method initializes theMotorModelExecutor
with the necessary parameters and performs the query synchronously.- Returns:
- A
MotorModelResponse
containing either the list of models retrieved or an error if the execution fails. The response indicates success or failure through itsresponseOk
property.
-
getModel
Executes a query to retrieve an unique model using a blocking call. This method initializes theMotorModelExecutor
with the necessary parameters and performs the query synchronously.- Parameters:
modelId
- the id of the model to retrieve- Returns:
- A
MotorModelResponse
containing either the model retrieved or an error if the execution fails. The response indicates success or failure through itsresponseOk
property.
-
deleteModel
Deletes a specific model identified by the model ID from OpenAI's services. This method creates an instance of MotorModelExecutor to perform the deletion and returns the response encapsulated in a MotorModelResponse object.- Parameters:
modelId
- The unique identifier of the model to be deleted.- Returns:
- MotorModelResponse containing details about the execution of the delete operation, including success or failure status and any relevant messages.
-