Class VertexAiChatModel
java.lang.Object
dev.langchain4j.model.vertexai.VertexAiChatModel
- All Implemented Interfaces:
ChatModel
Represents a Google Vertex AI language model with a chat completion interface, such as chat-bison.
See details here.
Please follow these steps before using this model:
1. Authentication
When developing locally, you can use one of:
a) Google Cloud SDK
b) Service account When using service account, ensure that
2. Authorization
3. Prerequisites
Please follow these steps before using this model:
1. Authentication
When developing locally, you can use one of:
a) Google Cloud SDK
b) Service account When using service account, ensure that
GOOGLE_APPLICATION_CREDENTIALS environment variable points to your JSON service account key.
2. Authorization
3. Prerequisites
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionVertexAiChatModel(String endpoint, String project, String location, String publisher, String modelName, Double temperature, Integer maxOutputTokens, Integer topK, Double topP, Integer maxRetries) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic VertexAiChatModel.Builderbuilder()chat(ChatRequest chatRequest) This is the main API to interact with the chat model.
-
Constructor Details
-
VertexAiChatModel
-
VertexAiChatModel
@Deprecated(forRemoval=true, since="1.2.0") public VertexAiChatModel(String endpoint, String project, String location, String publisher, String modelName, Double temperature, Integer maxOutputTokens, Integer topK, Double topP, Integer maxRetries) Deprecated, for removal: This API element is subject to removal in a future version.Please useVertexAiChatModel(Builder)instead
-
-
Method Details
-
chat
Description copied from interface:ChatModelThis is the main API to interact with the chat model.- Specified by:
chatin interfaceChatModel- Parameters:
chatRequest- aChatRequest, containing all the inputs to the LLM- Returns:
- a
ChatResponse, containing all the outputs from the LLM
-
builder
-
VertexAiChatModel(Builder)instead