Interface WorkersAiApi


public interface WorkersAiApi
Public interface to interact with the WorkerAI API.
  • Method Details

    • generateChat

      @POST("client/v4/accounts/{accountIdentifier}/ai/run/{modelName}") retrofit2.Call<WorkersAiChatCompletionResponse> generateChat(@Body WorkersAiChatCompletionRequest apiRequest, @Path("accountIdentifier") String accountIdentifier, @Path(value="modelName",encoded=true) String modelId)
      Generate chat.
      Parameters:
      apiRequest - request.
      accountIdentifier - account identifier.
      modelId - model id.
      Returns:
      response.
    • generateText

      @POST("client/v4/accounts/{accountIdentifier}/ai/run/{modelName}") retrofit2.Call<WorkersAiTextCompletionResponse> generateText(@Body WorkersAiTextCompletionRequest apiRequest, @Path("accountIdentifier") String accountIdentifier, @Path(value="modelName",encoded=true) String modelName)
      Generate text.
      Parameters:
      apiRequest - request.
      accountIdentifier - account identifier.
      modelName - model name.
      Returns:
      response.
    • generateImage

      @POST("client/v4/accounts/{accountIdentifier}/ai/run/{modelName}") retrofit2.Call<okhttp3.ResponseBody> generateImage(@Body WorkersAiImageGenerationRequest apiRequest, @Path("accountIdentifier") String accountIdentifier, @Path(value="modelName",encoded=true) String modelName)
      Generate image.
      Parameters:
      apiRequest - request.
      accountIdentifier - account identifier.
      modelName - model name.
      Returns:
      response.
    • embed

      @POST("client/v4/accounts/{accountIdentifier}/ai/run/{modelName}") retrofit2.Call<WorkersAiEmbeddingResponse> embed(@Body WorkersAiEmbeddingRequest apiRequest, @Path("accountIdentifier") String accountIdentifier, @Path(value="modelName",encoded=true) String modelName)
      Generate embeddings.
      Parameters:
      apiRequest - request.
      accountIdentifier - account identifier.
      modelName - model name.
      Returns:
      response.