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
Modifier and TypeFieldDescriptionprotected String
Account identifier, provided by the WorkerAI platform.protected String
ModelName, preferred as enum for extensibility.protected WorkersAiApi
OkHttpClient for the WorkerAI API. -
Constructor Summary
ConstructorDescriptionAbstractWorkersAIModel
(String accountId, String modelName, String apiToken) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
processErrors
(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
-