Skip to content

Commit 61943c1

Browse files
committed
fix: first encode then hash
1 parent d8269d1 commit 61943c1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/app/api/v1/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ async def non_stream_vllm_response(
194194
# Cache the request-response pair using the chat ID
195195
chat_id = response_data.get("id")
196196
if chat_id:
197-
response_sha256 = sha256(json.dumps(response_data)).hexdigest()
197+
response_sha256 = sha256(json.dumps(response_data).encode("utf-8")).hexdigest()
198198
cache.set_chat(
199199
chat_id, json.dumps(sign_chat(f"{request_sha256}:{response_sha256}"))
200200
)

0 commit comments

Comments
 (0)