Flask_Chat / app.py
raygiles3's picture
Update app.py
f968d79 verified
raw
history blame
801 Bytes
import base64
import json
from flask import Flask, render_template, request
from worker import speech_to_text, text_to_speech, openai_process_message
from flask_cors import CORS
import os
app = Flask(__name__)
cors = CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/', methods=['GET'])
def index():
return render_template('index.html')
@app.route('/speech-to-text', methods=['POST'])
def speech_to_text_route():
return None
@app.route('/process-message', methods=['POST'])
def process_prompt_route():
response = app.response_class(
response=json.dumps({"openaiResponseText": None, "openaiResponseSpeech": None}),
status=200,
mimetype='application/json'
)
return response
if __name__ == "__main__":
app.run(port=8000, host='0.0.0.0')