From 3c94b931964d8c7c544c2b6804e1f214992d553c Mon Sep 17 00:00:00 2001 From: Kakune55 Date: Fri, 10 Nov 2023 15:21:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A8=A1=E5=9E=8B=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=8A=9F=E8=83=BD=20=E5=8A=A0=E5=85=A5=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Server/main.py | 9 +- src/Web/index.html | 287 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 292 insertions(+), 4 deletions(-) create mode 100644 src/Web/index.html diff --git a/src/Server/main.py b/src/Server/main.py index ef3859a..62ffa39 100644 --- a/src/Server/main.py +++ b/src/Server/main.py @@ -24,10 +24,11 @@ def post_data(): elif surplusToken <= 0: return {"code":40,"output":"Token has been use up"} - if userRequest["context"] == 1: # 是否使用上文关联 - code , output , tokenUsed = qwenTurbo.service(userRequest['userkey'],userRequest['prompt'],userRequest['history']) - elif userRequest["context"] == 0: - code , output , tokenUsed = qwenTurbo.service(userRequest['userkey'],userRequest['prompt']) + if userRequest["model"] == "qwen-turbo": + if userRequest["context"] == 1: # 是否使用上文关联 + code , output , tokenUsed = qwenTurbo.service(userRequest['userkey'],userRequest['prompt'],userRequest['history']) + elif userRequest["context"] == 0: + code , output , tokenUsed = qwenTurbo.service(userRequest['userkey'],userRequest['prompt']) db.reduce_value(userRequest['userkey'], tokenUsed) return {"code":code,"output":output,"surplus":surplusToken} diff --git a/src/Web/index.html b/src/Web/index.html new file mode 100644 index 0000000..6627cba --- /dev/null +++ b/src/Web/index.html @@ -0,0 +1,287 @@ + + + + + + + KakuAI + + + + +
+
+ + + +
+ + +
+
+ + + + + +