From 250752c620c5949328fc3f44813d290718cafb5c Mon Sep 17 00:00:00 2001 From: theluyuan <1162963624@qq.com> Date: Wed, 12 Jun 2024 21:46:14 +0800 Subject: [PATCH] fix: new OpenAi api --- backend-python/routes/completion.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend-python/routes/completion.py b/backend-python/routes/completion.py index 3ffad8b..3b3066a 100644 --- a/backend-python/routes/completion.py +++ b/backend-python/routes/completion.py @@ -171,12 +171,15 @@ async def eval_rwkv( ), # "response": response, "model": model.name, + "id": "chatcmpl-123", + "system_fingerprint": "fp_44709d6fcb", "choices": [ ( { - "delta": {"content": delta}, + "delta": {"role":Role.Assistant.value,"content": delta}, "index": 0, "finish_reason": None, + "logprobs":None } if chat_mode else { @@ -218,11 +221,14 @@ async def eval_rwkv( ), # "response": response, "model": model.name, + "id": "chatcmpl-123", + "system_fingerprint": "fp_44709d6fcb", "choices": [ ( { "delta": {}, "index": 0, + "logprobs": None, "finish_reason": "stop", } if chat_mode