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

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