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 classMotorModelsRequest.BuilderBuilder class for creatingMotorModelsRequestinstances. -
Method Summary
Modifier and Type Method Description static MotorModelsRequest.Builderbuilder()Static method to obtain a new Builder instance.ChatMotorchatMotor()Retrieves the chat motor configuration.MotorModelResponsedeleteModel(String modelId)Deletes a specific model identified by the model ID from OpenAI's services.MotorModelResponsegetModel(String modelId)Executes a query to retrieve an unique model using a blocking call.MotorModelResponsegetModels()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 theMotorModelExecutorwith the necessary parameters and performs the query synchronously.- Returns:
- A
MotorModelResponsecontaining either the list of models retrieved or an error if the execution fails. The response indicates success or failure through itsresponseOkproperty.
-
getModel
Executes a query to retrieve an unique model using a blocking call. This method initializes theMotorModelExecutorwith the necessary parameters and performs the query synchronously.- Parameters:
modelId- the id of the model to retrieve- Returns:
- A
MotorModelResponsecontaining either the model retrieved or an error if the execution fails. The response indicates success or failure through itsresponseOkproperty.
-
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.
-