@@ -108,8 +108,8 @@ def _decrypt_chunk(
108108 if chunk .choices is not None :
109109 for index , choice in enumerate (chunk .choices ):
110110 if (
111- choice .finish_reason != 'content_filter'
112- and choice .delta is not None and choice . delta . content is not None
111+ choice .delta is not None and choice . delta . content is not None
112+ and choice .finish_reason != 'content_filter'
113113 ):
114114 choice .delta .content = aes_gcm_decrypt_base64_string (
115115 key , nonce , choice .delta .content
@@ -127,7 +127,7 @@ def _decrypt(
127127 if resp .choices is not None :
128128 for index , choice in enumerate (resp .choices ):
129129 if (
130- choice .finish_reason != 'content_filter' and choice .message is not None
130+ choice .message is not None and choice .finish_reason != 'content_filter'
131131 and choice .message .content is not None
132132 ):
133133 choice .message .content = aes_gcm_decrypt_base64_string (
@@ -254,8 +254,8 @@ async def _decrypt_chunk(
254254 if chunk .choices is not None :
255255 for index , choice in enumerate (chunk .choices ):
256256 if (
257- choice .finish_reason != 'content_filter'
258- and choice .delta is not None and choice . delta . content is not None
257+ choice .delta is not None and choice . delta . content is not None
258+ and choice .finish_reason != 'content_filter'
259259 ):
260260 choice .delta .content = aes_gcm_decrypt_base64_string (
261261 key , nonce , choice .delta .content
@@ -273,7 +273,7 @@ async def _decrypt(
273273 if resp .choices is not None :
274274 for index , choice in enumerate (resp .choices ):
275275 if (
276- choice .finish_reason != 'content_filter' and choice .message is not None
276+ choice .message is not None and choice .finish_reason != 'content_filter'
277277 and choice .message .content is not None
278278 ):
279279 choice .message .content = aes_gcm_decrypt_base64_string (
0 commit comments