Class AbstractWorkersAIModel
java.lang.Object
dev.langchain4j.model.workersai.client.AbstractWorkersAIModel
- Direct Known Subclasses:
WorkersAiChatModel,WorkersAiEmbeddingModel,WorkersAiImageModel,WorkersAiLanguageModel
Abstract class for WorkerAI models as they are all initialized the same way.
...
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringAccount identifier, provided by the WorkerAI platform.protected StringModelName, preferred as enum for extensibility.protected WorkersAiApiOkHttpClient for the WorkerAI API. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractWorkersAIModel(String accountId, String modelName, String apiToken) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprocessErrors(ApiResponse<?> res, okhttp3.ResponseBody errors) Process errors from the API.
-
Field Details
-
accountId
Account identifier, provided by the WorkerAI platform. -
modelName
ModelName, preferred as enum for extensibility. -
workerAiClient
OkHttpClient for the WorkerAI API.
-
-
Constructor Details
-
AbstractWorkersAIModel
Simple constructor.- Parameters:
accountId- account identifier.modelName- model name.apiToken- api apiToken from .
-
-
Method Details
-
processErrors
Process errors from the API.- Parameters:
res- responseerrors- errors body from retrofit- Throws:
IOException- error occurred during invocation
-