SIGN IN SIGN UP
xtekky / gpt4free UNCLAIMED

The official gpt4free repository | various collection of powerful language models | opus 4.6 gpt 5.3 kimi 2.5 deepseek v3.2 gemini 3

0 0 93 Python

fix: guard choices[0] and message=None before content access

OpenAI-compatible APIs can return empty choices on error or content
filtering; Gemini returns choices[0].message=None on PROHIBITED_CONTENT
(HTTP 200). Both cause unhandled exceptions at runtime.

Example files: adds `if not response.choices or response.choices[0].message is None: raise ValueError(...)`.
Test files: adds `if not ... : self.fail(...)` guard before each assertion.
Y
Your Name committed
86d739eea06ca6a8c4937606787c5dd34e39ed09
Parent: fdf5e58