From 21a1734714503dc72e12cf84de74910ddd000b9f Mon Sep 17 00:00:00 2001 From: Fangyin Cheng Date: Thu, 4 Jan 2024 23:38:41 +0800 Subject: [PATCH] feat(model): Fix chatgpt message format bug (#1028) --- dbgpt/model/proxy/llms/chatgpt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbgpt/model/proxy/llms/chatgpt.py b/dbgpt/model/proxy/llms/chatgpt.py index b57ae0486..ece9c780c 100755 --- a/dbgpt/model/proxy/llms/chatgpt.py +++ b/dbgpt/model/proxy/llms/chatgpt.py @@ -127,7 +127,8 @@ def _build_request(model: ProxyModel, params): messages: List[ModelMessage] = params["messages"] - history = __convert_2_gpt_messages(messages) + # history = __convert_2_gpt_messages(messages) + history = ModelMessage.to_openai_messages(messages) payloads = { "temperature": params.get("temperature"), "max_tokens": params.get("max_new_tokens"),