def create_content(content):
proxy_url = f'http://{PROXY_URL}'
url = 'https://api.openai.com/v1/chat/completions'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {OPENAI_API_KEY}',
}
data = {
"model": "gpt-3.5-turbo",
"messages": [
{"role": "user", "content": content},
],
}
response = requests.post(url, json=data, headers=headers, proxies={"http://": f'http://{proxy_url}', "https://": f'http://{proxy_url}'}, timeout=30)
return response.json()['choices'][0]['message']['content']