Class GoogleAiGeminiStreamingChatModel

java.lang.Object
dev.langchain4j.model.googleai.GoogleAiGeminiStreamingChatModel
All Implemented Interfaces:
dev.langchain4j.model.chat.StreamingChatLanguageModel

public class GoogleAiGeminiStreamingChatModel extends Object implements dev.langchain4j.model.chat.StreamingChatLanguageModel
  • Field Details

    • geminiService

      protected final dev.langchain4j.model.googleai.GeminiService geminiService
    • apiKey

      protected final String apiKey
    • modelName

      protected final String modelName
    • temperature

      protected final Double temperature
    • topK

      protected final Integer topK
    • topP

      protected final Double topP
    • maxOutputTokens

      protected final Integer maxOutputTokens
    • stopSequences

      protected final List<String> stopSequences
    • responseFormat

      protected final dev.langchain4j.model.chat.request.ResponseFormat responseFormat
    • toolConfig

      protected final GeminiFunctionCallingConfig toolConfig
    • allowCodeExecution

      protected final boolean allowCodeExecution
    • includeCodeExecutionOutput

      protected final boolean includeCodeExecutionOutput
    • safetySettings

      protected final List<GeminiSafetySetting> safetySettings
    • listeners

      protected final List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners
    • maxRetries

      protected final Integer maxRetries
  • Constructor Details

  • Method Details

    • generate

      public void generate(List<dev.langchain4j.data.message.ChatMessage> messages, dev.langchain4j.model.StreamingResponseHandler<dev.langchain4j.data.message.AiMessage> handler)
      Specified by:
      generate in interface dev.langchain4j.model.chat.StreamingChatLanguageModel
    • generate

      public void generate(List<dev.langchain4j.data.message.ChatMessage> messages, dev.langchain4j.agent.tool.ToolSpecification toolSpecification, dev.langchain4j.model.StreamingResponseHandler<dev.langchain4j.data.message.AiMessage> handler)
      Specified by:
      generate in interface dev.langchain4j.model.chat.StreamingChatLanguageModel
    • generate

      public void generate(List<dev.langchain4j.data.message.ChatMessage> messages, List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications, dev.langchain4j.model.StreamingResponseHandler<dev.langchain4j.data.message.AiMessage> handler)
      Specified by:
      generate in interface dev.langchain4j.model.chat.StreamingChatLanguageModel
    • createGenerateContentRequest

      protected dev.langchain4j.model.googleai.GeminiGenerateContentRequest createGenerateContentRequest(List<dev.langchain4j.data.message.ChatMessage> messages, List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications, dev.langchain4j.model.chat.request.ResponseFormat responseFormat)
    • createChatModelRequest

      protected dev.langchain4j.model.chat.listener.ChatModelRequest createChatModelRequest(List<dev.langchain4j.data.message.ChatMessage> messages, List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications)
    • computeMimeType

      protected static String computeMimeType(dev.langchain4j.model.chat.request.ResponseFormat responseFormat)
    • notifyListenersOnRequest

      protected void notifyListenersOnRequest(dev.langchain4j.model.chat.listener.ChatModelRequestContext context)
    • notifyListenersOnResponse

      protected void notifyListenersOnResponse(dev.langchain4j.model.output.Response<dev.langchain4j.data.message.AiMessage> response, dev.langchain4j.model.chat.listener.ChatModelRequest request, ConcurrentHashMap<Object,Object> attributes)
    • notifyListenersOnError

      protected void notifyListenersOnError(Exception exception, dev.langchain4j.model.chat.listener.ChatModelRequest request, ConcurrentHashMap<Object,Object> attributes)