更改项目文件夹结构

This commit is contained in:
Kakune55 2023-12-10 16:31:50 +08:00
parent 8d9bd619c4
commit e00a704a56
24 changed files with 12 additions and 14 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/__pycache__
*.json *.json

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,7 @@
import flask , requests , json import flask
from flask_cors import CORS 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__) app = flask.Flask(__name__)
CORS(app,origins="*") CORS(app,origins="*")
@ -48,13 +46,13 @@ def post_data():
elif userRequest["context"] == 0: elif userRequest["context"] == 0:
code , output , tokenUsed = gpt4Turbo.service(userRequest['prompt']) code , output , tokenUsed = gpt4Turbo.service(userRequest['prompt'])
db.reduce_value(userRequest['userkey'], tokenUsed) db.reduce_value(userRequest['userkey'], tokenUsed)
return {"code":code,"output":output,"surplus":surplusToken} return {"code":code,"output":output,"surplus":surplusToken}
@app.route('/')
def index():
return flask.render_template('index.html')
if __name__ == '__main__': if __name__ == '__main__':
app.run(debug=True,host='0.0.0.0',port=5000) app.run(debug=bool(config.readConf()["appconf"]["debug"]),host=config.readConf()["appconf"]["host"],port=config.readConf()["appconf"]["port"])

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
static/img/bg_ants.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
static/img/bg_boobs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
static/img/bg_circles.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
static/img/bg_cross.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
static/img/bg_diag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
static/img/bg_fuzzy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
static/img/bg_life.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
static/img/bg_yourls.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KakuAI</title> <title>KakuAI</title>
<link rel="stylesheet" type="text/css" href="popup.css"> <link rel="stylesheet" type="text/css" href="../static/popup.css">
<style> <style>
body { body {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
@ -15,7 +15,7 @@
align-items: center; align-items: center;
height: 100vh; height: 100vh;
margin: 0; margin: 0;
background-image: url("img/bg_circles.png"); background-image: url("../static/img/bg_circles.png");
background-repeat: repeat; background-repeat: repeat;
} }
#chat-container { #chat-container {
@ -215,7 +215,7 @@
function checkCookie() { function checkCookie() {
var user = getCookie("userkey"); var user = getCookie("userkey");
if (user != "") { if (user != "") {
alert("欢迎回来 UserKey" + user); alert("欢迎回来 UserKey" + user +"\n当前选择模型" + getCookie("modelSet"));
document.getElementById("showUserKey").innerHTML = user; document.getElementById("showUserKey").innerHTML = user;
document.getElementById('setUpDropdown').value = getCookie("modelSet"); document.getElementById('setUpDropdown').value = getCookie("modelSet");
} }