Package dev.langchain4j.model.vertexai
Class VertexAiChatModel
java.lang.Object
dev.langchain4j.model.vertexai.VertexAiChatModel
- All Implemented Interfaces:
ChatLanguageModel
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic VertexAiChatModel.Builder
builder()
generate
(List<ChatMessage> messages) Generates a response from the model based on a sequence of messages.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.chat.ChatLanguageModel
chat, generate, generate, generate, generate, supportedCapabilities
-
Constructor Details
-
VertexAiChatModel
-
-
Method Details
-
generate
Description copied from interface:ChatLanguageModel
Generates a response from the model based on a sequence of messages. Typically, the sequence contains messages in the following order: System (optional) - User - AI - User - AI - User ...- Specified by:
generate
in interfaceChatLanguageModel
- Parameters:
messages
- A list of messages.- Returns:
- The response generated by the model.
-
builder
-