From eee553bd466a14514613073ac3169e919799abfb Mon Sep 17 00:00:00 2001 From: Arran Hobson Sayers Date: Thu, 31 Aug 2023 12:32:23 +0100 Subject: Add console script --- interference/app.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'interference/app.py') diff --git a/interference/app.py b/interference/app.py index 8018356f..836a751d 100644 --- a/interference/app.py +++ b/interference/app.py @@ -12,6 +12,7 @@ from g4f import ChatCompletion app = Flask(__name__) CORS(app) + @app.route("/chat/completions", methods=["POST"]) def chat_completions(): model = request.get_json().get("model", "gpt-3.5-turbo") @@ -87,5 +88,9 @@ def chat_completions(): return app.response_class(streaming(), mimetype="text/event-stream") +def main(): + app.run(host="0.0.0.0", port=1337, debug=True) + + if __name__ == "__main__": - app.run(host="0.0.0.0", port=1337, debug=True) \ No newline at end of file + main() -- cgit v1.2.3