public ChatSession withGenerationConfig(GenerationConfig generationConfig) {
    return new ChatSession(
        model.withGenerationConfig(generationConfig),
        history,
        previousHistorySize,
        Optional.of(rootChatSession.orElse(this)),
        automaticFunctionCallingResponder);
  }
Creates a copy of the current ChatSession with updated GenerationConfig.

@param generationConfig a {@link com.google.cloud.vertexai.api.GenerationConfig} that will be
    used in the new ChatSession.
@return a new {@link ChatSession} instance with the specified GenerationConfig.
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai/ChatSession.java