Class VertexAiGeminiChatModel

java.lang.Object
dev.langchain4j.model.vertexai.gemini.VertexAiGeminiChatModel
All Implemented Interfaces:
dev.langchain4j.model.chat.ChatModel, Closeable, AutoCloseable

public class VertexAiGeminiChatModel extends Object implements dev.langchain4j.model.chat.ChatModel, Closeable
Represents a Google Vertex AI Gemini language model with a chat completion interface, such as gemini-pro. 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 GOOGLE_APPLICATION_CREDENTIALS environment variable points to your JSON service account key.
2. Authorization
3. Prerequisites
  • Constructor Details

  • Method Details

    • chat

      public dev.langchain4j.model.chat.response.ChatResponse chat(dev.langchain4j.model.chat.request.ChatRequest chatRequest)
      Specified by:
      chat in interface dev.langchain4j.model.chat.ChatModel
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • supportedCapabilities

      public Set<dev.langchain4j.model.chat.Capability> supportedCapabilities()
      Specified by:
      supportedCapabilities in interface dev.langchain4j.model.chat.ChatModel
    • listeners

      public List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners()
      Specified by:
      listeners in interface dev.langchain4j.model.chat.ChatModel
    • provider

      public dev.langchain4j.model.ModelProvider provider()
      Specified by:
      provider in interface dev.langchain4j.model.chat.ChatModel
    • builder