Skip to content

Commit

Permalink
fix: enable cors
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarajpandith committed Dec 9, 2023
1 parent 8f0fbac commit f774366
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import os
from dotenv import load_dotenv
load_dotenv()
from flask_cors import CORS

app = Flask(__name__)
CORS(app)

API_KEY = os.environ.get('API_KEY')

Expand Down Expand Up @@ -45,7 +47,7 @@ def chat_completion():

model = "gpt-3.5-turbo"

return Response(generate_response(model, llm, content), content_type='text/plain', mimetype='text/event-stream')
return Response(generate_response(model, llm, content), content_type='text/event-stream', mimetype='text/event-stream')

@app.route('/working_providers', methods=['GET'])
def working_providers():
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ curl-cffi==0.5.10
duckduckgo-search==3.9.11
fastapi==0.104.1
Flask==3.0.0
Flask-Cors==4.0.0
frozenlist==1.4.0
g4f==0.1.9.2
gunicorn==21.2.0
Expand Down

0 comments on commit f774366

Please sign in to comment.