Skip to content

Commit 0225abb

Browse files
author
liuhuiqi.7
committed
feat(e2ee): content case
1 parent 0c8e681 commit 0225abb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

volcenginesdkarkruntime/resources/chat/completions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ def _decrypt(
151151
key, nonce, choice.message.content
152152
)
153153
except Exception:
154-
pass
155-
if not decrypt_validate(choice.message.content):
154+
content = ''
155+
if content == '' or not decrypt_validate(choice.message.content):
156156
content = aes_gcm_decrypt_base64_list(
157157
key, nonce, choice.message.content
158158
)
@@ -317,8 +317,8 @@ async def _decrypt(
317317
key, nonce, choice.message.content
318318
)
319319
except Exception:
320-
pass
321-
if not decrypt_validate(choice.message.content):
320+
content = ''
321+
if content == '' or not decrypt_validate(choice.message.content):
322322
content = aes_gcm_decrypt_base64_list(
323323
key, nonce, choice.message.content
324324
)

0 commit comments

Comments
 (0)