summaryrefslogtreecommitdiffstats
path: root/interference/app.py
diff options
context:
space:
mode:
authorArran Hobson Sayers <ahobsonsayers@gmail.com>2023-08-31 13:32:23 +0200
committerArran Hobson Sayers <ahobsonsayers@gmail.com>2023-08-31 13:32:23 +0200
commiteee553bd466a14514613073ac3169e919799abfb (patch)
tree2c5ceb7cb6e12b0261e504a5d066d39a231ed726 /interference/app.py
parent~ (diff)
downloadgpt4free-eee553bd466a14514613073ac3169e919799abfb.tar
gpt4free-eee553bd466a14514613073ac3169e919799abfb.tar.gz
gpt4free-eee553bd466a14514613073ac3169e919799abfb.tar.bz2
gpt4free-eee553bd466a14514613073ac3169e919799abfb.tar.lz
gpt4free-eee553bd466a14514613073ac3169e919799abfb.tar.xz
gpt4free-eee553bd466a14514613073ac3169e919799abfb.tar.zst
gpt4free-eee553bd466a14514613073ac3169e919799abfb.zip
Diffstat (limited to 'interference/app.py')
-rw-r--r--interference/app.py7
1 files changed, 6 insertions, 1 deletions
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()