else:
                    result[genre] = 1
                if result[genre] > most_popular_genre_count:
                    most_popular_genre_count = result[genre]
                    most_popular_genre = genre
        data_request = dict()
        data_request["request"] = "genre"
        data_request["genre"] = most_popular_genre
        data = steamspypi.download(data_request)
        sorted_data = sorted(
            data.values(), key=lambda x: x.get("average_forever", 0), reverse=True
        )
        owned_games = [game["appid"] for game in users_games["games"]]  # type: ignore
        remaining_games = [
            game for game in sorted_data if game["appid"] not in owned_games
        ]
        top_5_popular_not_owned = [game["name"] for game in remaining_games[:5]]
        return str(top_5_popular_not_owned)
[docs]    def run(self, mode: str, game: str) -> str:
        if mode == "get_games_details":
            return self.details_of_games(game)
        elif mode == "get_recommended_games":
            return self.recommended_games(game)
        else:
            raise ValueError(f"Invalid mode {mode} for Steam API.")