# Override generativelanguage_v1::GenerativeServiceClient Authentication Defaults

      [](std::string const& keyfile) {
        auto is = std::ifstream(keyfile);
        is.exceptions(std::ios::badbit);  // Minimal error handling in examples
        auto contents = std::string(std::istreambuf_iterator<char>(is.rdbuf()), {});
        auto options =
            google::cloud::Options{}.set<google::cloud::UnifiedCredentialsOption>(
                google::cloud::MakeServiceAccountCredentials(contents));
        return google::cloud::generativelanguage_v1::GenerativeServiceClient(
            google::cloud::generativelanguage_v1::MakeGenerativeServiceConnection(
                options));
      }