summaryrefslogtreecommitdiffstats
path: root/interference
diff options
context:
space:
mode:
authorRyan Jordan <ryjordan@gmail.com>2023-09-06 02:39:57 +0200
committerGitHub <noreply@github.com>2023-09-06 02:39:57 +0200
commitf81e618958318a092ca4c70a1b3ea15260bda97c (patch)
tree3ce022a8d719011268da7f1a0befc97bf32a60d8 /interference
parentfeat(docker): add Docker and Docker Compose support (diff)
parent~ | Merge pull request #869 from ahobsonsayers/add-console-script (diff)
downloadgpt4free-f81e618958318a092ca4c70a1b3ea15260bda97c.tar
gpt4free-f81e618958318a092ca4c70a1b3ea15260bda97c.tar.gz
gpt4free-f81e618958318a092ca4c70a1b3ea15260bda97c.tar.bz2
gpt4free-f81e618958318a092ca4c70a1b3ea15260bda97c.tar.lz
gpt4free-f81e618958318a092ca4c70a1b3ea15260bda97c.tar.xz
gpt4free-f81e618958318a092ca4c70a1b3ea15260bda97c.tar.zst
gpt4free-f81e618958318a092ca4c70a1b3ea15260bda97c.zip
Diffstat (limited to 'interference')
-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()