GeneralApp add
This commit is contained in:
SDE
2023-06-19 17:19:18 +03:00
parent b0ad8e41d2
commit b2bd830b6e
69 changed files with 5337 additions and 16 deletions

View File

@@ -0,0 +1,31 @@
import requests
def send_request(msg):
# url = 'https://api.openai.com/v1/chat/completions'
# headers = {
# 'Content-Type': 'application/json',
# 'Authorization': 'Bearer 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'
# }
# data = {
# "model": "gpt-3.5-turbo",
# "messages": [{
# "role": "user",
# "content": msg
# }]
# }
# res = requests.post(url=url, headers=headers, data=data)
import os
import openai
openai.api_key = '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'
res = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[
{
"role": "user",
"content": msg
}
]
)
return res