Class AbstractWorkersAIModel

java.lang.Object
dev.langchain4j.model.workersai.client.AbstractWorkersAIModel
Direct Known Subclasses:
WorkersAiChatModel, WorkersAiEmbeddingModel, WorkersAiImageModel, WorkersAiLanguageModel

public abstract class AbstractWorkersAIModel extends Object
Abstract class for WorkerAI models as they are all initialized the same way. ...
  • Field Details

    • accountId

      protected String accountId
      Account identifier, provided by the WorkerAI platform.
    • modelName

      protected String modelName
      ModelName, preferred as enum for extensibility.
    • workerAiClient

      protected WorkersAiApi workerAiClient
      OkHttpClient for the WorkerAI API.
  • Constructor Details

    • AbstractWorkersAIModel

      public AbstractWorkersAIModel(String accountId, String modelName, String apiToken)
      Simple constructor.
      Parameters:
      accountId - account identifier.
      modelName - model name.
      apiToken - api apiToken from .
  • Method Details

    • processErrors

      protected void processErrors(ApiResponse<?> res, okhttp3.ResponseBody errors) throws IOException
      Process errors from the API.
      Parameters:
      res - response
      errors - errors body from retrofit
      Throws:
      IOException - error occurred during invocation