diff --git a/.gitignore b/.gitignore index 7043ff1..b605254 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ - +/__pycache__ *.json diff --git a/apiModule/__pycache__/chatglmTurbo.cpython-311.pyc b/apiModule/__pycache__/chatglmTurbo.cpython-311.pyc new file mode 100644 index 0000000..fb3b326 Binary files /dev/null and b/apiModule/__pycache__/chatglmTurbo.cpython-311.pyc differ diff --git a/apiModule/__pycache__/gpt35Turbo.cpython-311.pyc b/apiModule/__pycache__/gpt35Turbo.cpython-311.pyc new file mode 100644 index 0000000..f07632c Binary files /dev/null and b/apiModule/__pycache__/gpt35Turbo.cpython-311.pyc differ diff --git a/apiModule/__pycache__/gpt4Turbo.cpython-311.pyc b/apiModule/__pycache__/gpt4Turbo.cpython-311.pyc new file mode 100644 index 0000000..eb9426f Binary files /dev/null and b/apiModule/__pycache__/gpt4Turbo.cpython-311.pyc differ diff --git a/apiModule/__pycache__/qwenTurbo.cpython-311.pyc b/apiModule/__pycache__/qwenTurbo.cpython-311.pyc new file mode 100644 index 0000000..e2b776b Binary files /dev/null and b/apiModule/__pycache__/qwenTurbo.cpython-311.pyc differ diff --git a/src/Server/chatglmTurbo.py b/apiModule/chatglmTurbo.py similarity index 100% rename from src/Server/chatglmTurbo.py rename to apiModule/chatglmTurbo.py diff --git a/src/Server/gpt35Turbo.py b/apiModule/gpt35Turbo.py similarity index 100% rename from src/Server/gpt35Turbo.py rename to apiModule/gpt35Turbo.py diff --git a/src/Server/gpt4Turbo.py b/apiModule/gpt4Turbo.py similarity index 100% rename from src/Server/gpt4Turbo.py rename to apiModule/gpt4Turbo.py diff --git a/src/Server/qwenTurbo.py b/apiModule/qwenTurbo.py similarity index 100% rename from src/Server/qwenTurbo.py rename to apiModule/qwenTurbo.py diff --git a/src/Server/config.py b/config.py similarity index 100% rename from src/Server/config.py rename to config.py diff --git a/src/Server/db.py b/db.py similarity index 100% rename from src/Server/db.py rename to db.py diff --git a/src/Server/main.py b/main.py similarity index 87% rename from src/Server/main.py rename to main.py index 23d970e..a626ca9 100644 --- a/src/Server/main.py +++ b/main.py @@ -1,9 +1,7 @@ -import flask , requests , json +import flask from flask_cors import CORS -import db , qwenTurbo , chatglmTurbo , gpt35Turbo , gpt4Turbo - - - +import db , config +from apiModule import qwenTurbo , chatglmTurbo , gpt35Turbo , gpt4Turbo app = flask.Flask(__name__) CORS(app,origins="*") @@ -48,13 +46,13 @@ def post_data(): elif userRequest["context"] == 0: code , output , tokenUsed = gpt4Turbo.service(userRequest['prompt']) - - - - db.reduce_value(userRequest['userkey'], tokenUsed) return {"code":code,"output":output,"surplus":surplusToken} +@app.route('/') +def index(): + return flask.render_template('index.html') + if __name__ == '__main__': - app.run(debug=True,host='0.0.0.0',port=5000) \ No newline at end of file + app.run(debug=bool(config.readConf()["appconf"]["debug"]),host=config.readConf()["appconf"]["host"],port=config.readConf()["appconf"]["port"]) \ No newline at end of file diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..51a80b2 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/img/bg_ants.png b/static/img/bg_ants.png new file mode 100644 index 0000000..1b736b0 Binary files /dev/null and b/static/img/bg_ants.png differ diff --git a/static/img/bg_boobs.png b/static/img/bg_boobs.png new file mode 100644 index 0000000..09d2dd4 Binary files /dev/null and b/static/img/bg_boobs.png differ diff --git a/static/img/bg_circles.png b/static/img/bg_circles.png new file mode 100644 index 0000000..27c2884 Binary files /dev/null and b/static/img/bg_circles.png differ diff --git a/static/img/bg_cross.png b/static/img/bg_cross.png new file mode 100644 index 0000000..3129cdd Binary files /dev/null and b/static/img/bg_cross.png differ diff --git a/static/img/bg_diag.png b/static/img/bg_diag.png new file mode 100644 index 0000000..f3c5fb7 Binary files /dev/null and b/static/img/bg_diag.png differ diff --git a/static/img/bg_fuzzy.png b/static/img/bg_fuzzy.png new file mode 100644 index 0000000..6850ca4 Binary files /dev/null and b/static/img/bg_fuzzy.png differ diff --git a/static/img/bg_fuzzy_bits.png b/static/img/bg_fuzzy_bits.png new file mode 100644 index 0000000..91ff805 Binary files /dev/null and b/static/img/bg_fuzzy_bits.png differ diff --git a/static/img/bg_life.png b/static/img/bg_life.png new file mode 100644 index 0000000..7d3e54f Binary files /dev/null and b/static/img/bg_life.png differ diff --git a/static/img/bg_yourls.png b/static/img/bg_yourls.png new file mode 100644 index 0000000..d96cde8 Binary files /dev/null and b/static/img/bg_yourls.png differ diff --git a/src/Web/popup.css b/static/popup.css similarity index 100% rename from src/Web/popup.css rename to static/popup.css diff --git a/src/Web/index.html b/templates/index.html similarity index 97% rename from src/Web/index.html rename to templates/index.html index 5b3b9b8..841ae68 100644 --- a/src/Web/index.html +++ b/templates/index.html @@ -5,7 +5,7 @@