更改项目文件夹结构
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
|
||||
/__pycache__
|
||||
*.json
|
||||
|
BIN
apiModule/__pycache__/chatglmTurbo.cpython-311.pyc
Normal file
BIN
apiModule/__pycache__/gpt35Turbo.cpython-311.pyc
Normal file
BIN
apiModule/__pycache__/gpt4Turbo.cpython-311.pyc
Normal file
BIN
apiModule/__pycache__/qwenTurbo.cpython-311.pyc
Normal file
@ -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)
|
||||
app.run(debug=bool(config.readConf()["appconf"]["debug"]),host=config.readConf()["appconf"]["host"],port=config.readConf()["appconf"]["port"])
|
BIN
static/favicon.ico
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
static/img/bg_ants.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
static/img/bg_boobs.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
static/img/bg_circles.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
static/img/bg_cross.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
static/img/bg_diag.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
static/img/bg_fuzzy.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
static/img/bg_fuzzy_bits.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
static/img/bg_life.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
static/img/bg_yourls.png
Normal file
After Width: | Height: | Size: 13 KiB |
@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>KakuAI</title>
|
||||
<link rel="stylesheet" type="text/css" href="popup.css">
|
||||
<link rel="stylesheet" type="text/css" href="../static/popup.css">
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
@ -15,7 +15,7 @@
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
background-image: url("img/bg_circles.png");
|
||||
background-image: url("../static/img/bg_circles.png");
|
||||
background-repeat: repeat;
|
||||
}
|
||||
#chat-container {
|
||||
@ -215,7 +215,7 @@
|
||||
function checkCookie() {
|
||||
var user = getCookie("userkey");
|
||||
if (user != "") {
|
||||
alert("欢迎回来 UserKey:" + user);
|
||||
alert("欢迎回来 UserKey:" + user +"\n当前选择模型:" + getCookie("modelSet"));
|
||||
document.getElementById("showUserKey").innerHTML = user;
|
||||
document.getElementById('setUpDropdown').value = getCookie("modelSet");
|
||||
}
|