summaryrefslogtreecommitdiffstats
path: root/ora/model.py
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-20 16:01:57 +0200
committert.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-20 16:01:57 +0200
commitfce0656ab1008c13a50a9dcec5336d79f22daf3e (patch)
tree5dd85537bf3df315177c59b63aa89c6df601f8d9 /ora/model.py
parentphind.com stream + response formatting (diff)
downloadgpt4free-fce0656ab1008c13a50a9dcec5336d79f22daf3e.tar
gpt4free-fce0656ab1008c13a50a9dcec5336d79f22daf3e.tar.gz
gpt4free-fce0656ab1008c13a50a9dcec5336d79f22daf3e.tar.bz2
gpt4free-fce0656ab1008c13a50a9dcec5336d79f22daf3e.tar.lz
gpt4free-fce0656ab1008c13a50a9dcec5336d79f22daf3e.tar.xz
gpt4free-fce0656ab1008c13a50a9dcec5336d79f22daf3e.tar.zst
gpt4free-fce0656ab1008c13a50a9dcec5336d79f22daf3e.zip
Diffstat (limited to '')
-rw-r--r--ora/model.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/ora/model.py b/ora/model.py
index a0f0e93e..7c967625 100644
--- a/ora/model.py
+++ b/ora/model.py
@@ -8,6 +8,7 @@ class CompletionModel:
createdAt = None
slug = None
id = None
+ modelName = None
model = 'gpt-3.5-turbo'
def create(
@@ -19,13 +20,21 @@ class CompletionModel:
CompletionModel.description = description
CompletionModel.slug = name
+ headers = {
+ 'Origin' : 'https://ora.sh',
+ 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15',
+ 'Referer' : 'https://ora.sh/',
+ 'Host' : 'ora.sh',
+ }
- response = post('https://ora.sh/api/assistant', json = {
+ response = post('https://ora.sh/api/assistant', headers = headers, json = {
'prompt' : system_prompt,
'userId' : f'auto:{uuid4()}',
'name' : name,
'description': description})
+ print(response.json())
+
CompletionModel.id = response.json()['id']
CompletionModel.createdBy = response.json()['createdBy']
CompletionModel.createdAt = response.json()['createdAt']