#API with function call -> AttributeError: 'NoneType' object has no attribute 'choices'

1 messages · Page 1 of 1 (latest)

polar sequoia
#

I'm making a translator where the user inputs a text in "Bokmål" and get the text outputted in "NewNorwegian." The script works 50% of the time but sometimes I do get an attributeError from messages.choices[0].message.content.strip(), but I'm not sure. I would highly appreciate help and thoughts. Thank you.

frigid steeple