public ChatSession withTools(List<Tool> tools) {
    return new ChatSession(
        model.withTools(tools),
        history,
        previousHistorySize,
        Optional.of(rootChatSession.orElse(this)),
        automaticFunctionCallingResponder);
  }
Creates a copy of the current ChatSession with updated Tools.

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