mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
update tesou.py
This commit is contained in:
@ -17,7 +17,7 @@ class Tesou(Blackbox):
|
||||
|
||||
# 用户输入的数据格式为:[{"id": "123", "prompt": "叉烧饭,帮我查询叉烧饭的介绍"}]
|
||||
def processing(self, id, prompt) -> str:
|
||||
url = 'http://120.196.116.194:48891/chat/'
|
||||
url = 'http://120.196.116.194:48891/'
|
||||
|
||||
message = {
|
||||
"user_id": id,
|
||||
@ -30,12 +30,10 @@ class Tesou(Blackbox):
|
||||
async def fast_api_handler(self, request: Request) -> Response:
|
||||
try:
|
||||
data = await request.json()
|
||||
print(data)
|
||||
except:
|
||||
return JSONResponse(content={"error": "json parse error"}, status_code=status.HTTP_400_BAD_REQUEST)
|
||||
user_id = data.get("id")
|
||||
user_prompt = data.get("prompt")
|
||||
print(user_id, user_prompt)
|
||||
if user_prompt is None:
|
||||
return JSONResponse(content={"error": "question is required"}, status_code=status.HTTP_400_BAD_REQUEST)
|
||||
return JSONResponse(content={"Response": self.processing(user_id, user_prompt)}, status_code=status.HTTP_200_OK)
|
||||
Reference in New Issue
Block a user