from flask import jsonify # from gameload import upload_game_docs # import chat # import os # import dotenv # import os import gradio # app = Flask(__name__) # dotenv.load_dotenv('.env') # host = os.getenv('HOST') # port = os.getenv('PORT') # @app.route('/initialize_game', methods=['GET']) # def initialize_game(): # inputs = request.args.to_dict() # user_id = inputs['user_id'] # game_id = inputs['game_id'] # result = chat.initialize_game(user_id, game_id) # response = {'role': 'assistant', 'content': result} # return jsonify(response) # @app.route('/start_game', methods=['GET']) # def start_game(): # inputs = request.args.to_dict() # user_id = inputs['user_id'] # game_id = inputs['game_id'] # user_input = inputs['user_input'] # gpt_output = chat.start_game(game_id, user_id, user_input) # response = {'role': 'assistant', 'content': gpt_output} # return jsonify(response) # @app.route('/health_check', methods=['GET']) def health_check(name): response = {'message': 'Site is healthy ' + name} return jsonify(response) # @app.route('/load_game', methods=['GET']) # def load_game(): # upload_game_docs() # response = {'message': 'Game loaded'} # return jsonify(response) gradio_interface = gradio.Interface( fn=health_check, inputs="text", outputs="text" ) gradio_interface.launch()