public ChatSession withSafetySettings(List<SafetySetting> safetySettings) {
    return new ChatSession(
        model.withSafetySettings(safetySettings),
        history,
        previousHistorySize,
        Optional.of(rootChatSession.orElse(this)),
        automaticFunctionCallingResponder);
  }
Creates a copy of the current ChatSession with updated SafetySettings.

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