哪bubu

Error in calling OpenAI

Programming


Hi all, I tried using the openai library for analyzing news data, but it returns error "unsupported_country_region_territory"
How can I fix it? 
 
Duval LC
Algogene has servers across different regions. When you start a backtest on the platform, the task will be assigned to a random server to execute. As OpenAI has access restrictions for some regions (eg. Hong Kong), that's why you will see that error if your task is assigned to run in restricted regions.
 
Duval LC
Original Posted by - b'Duval LC': Algogene has servers across different regions. When you start a backtest on the platform, the task will be assigned to a random server to execute. As OpenAI has access restrictions for some regions (eg. Hong Kong), that's why you will see that error if your task is assigned to run in restricted regions.
To solve this, you can simply add a proxy when you call OpenAI. Details can refer to their github doc (https://github.com/openai/openai-python)