File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
volcenginesdkarkruntime/resources/batch_chat Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ def _decrypt(
155155 ) -> ChatCompletion :
156156 if resp .choices is not None :
157157 for index , choice in enumerate (resp .choices ):
158- if choice .message is not None and choice .message .content is not None :
158+ if (
159+ choice .finish_reason != 'content_filter' and choice .message is not None
160+ and choice .message .content is not None
161+ ):
159162 choice .message .content = aes_gcm_decrypt_base64_string (
160163 key , nonce , choice .message .content
161164 )
@@ -299,7 +302,10 @@ async def _decrypt(
299302 ) -> ChatCompletion :
300303 if resp .choices is not None :
301304 for index , choice in enumerate (resp .choices ):
302- if choice .message is not None and choice .message .content is not None :
305+ if (
306+ choice .finish_reason != 'content_filter' and choice .message is not None
307+ and choice .message .content is not None
308+ ):
303309 choice .message .content = aes_gcm_decrypt_base64_string (
304310 key , nonce , choice .message .content
305311 )
You can’t perform that action at this time.
0 commit comments