t.me/xtekky
commited on
Commit
•
fce0656
1
Parent(s):
fa113e6
ora.sh
Browse files- ora/model.py +10 -1
- testing/ora_gpt4.py +1 -1
ora/model.py
CHANGED
@@ -8,6 +8,7 @@ class CompletionModel:
|
|
8 |
createdAt = None
|
9 |
slug = None
|
10 |
id = None
|
|
|
11 |
model = 'gpt-3.5-turbo'
|
12 |
|
13 |
def create(
|
@@ -19,13 +20,21 @@ class CompletionModel:
|
|
19 |
CompletionModel.description = description
|
20 |
CompletionModel.slug = name
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
response = post('https://ora.sh/api/assistant', json = {
|
24 |
'prompt' : system_prompt,
|
25 |
'userId' : f'auto:{uuid4()}',
|
26 |
'name' : name,
|
27 |
'description': description})
|
28 |
|
|
|
|
|
29 |
CompletionModel.id = response.json()['id']
|
30 |
CompletionModel.createdBy = response.json()['createdBy']
|
31 |
CompletionModel.createdAt = response.json()['createdAt']
|
|
|
8 |
createdAt = None
|
9 |
slug = None
|
10 |
id = None
|
11 |
+
modelName = None
|
12 |
model = 'gpt-3.5-turbo'
|
13 |
|
14 |
def create(
|
|
|
20 |
CompletionModel.description = description
|
21 |
CompletionModel.slug = name
|
22 |
|
23 |
+
headers = {
|
24 |
+
'Origin' : 'https://ora.sh',
|
25 |
+
'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',
|
26 |
+
'Referer' : 'https://ora.sh/',
|
27 |
+
'Host' : 'ora.sh',
|
28 |
+
}
|
29 |
|
30 |
+
response = post('https://ora.sh/api/assistant', headers = headers, json = {
|
31 |
'prompt' : system_prompt,
|
32 |
'userId' : f'auto:{uuid4()}',
|
33 |
'name' : name,
|
34 |
'description': description})
|
35 |
|
36 |
+
print(response.json())
|
37 |
+
|
38 |
CompletionModel.id = response.json()['id']
|
39 |
CompletionModel.createdBy = response.json()['createdBy']
|
40 |
CompletionModel.createdAt = response.json()['createdAt']
|
testing/ora_gpt4.py
CHANGED
@@ -24,4 +24,4 @@ chatbot_id = gpt4_chatbot_ids[0]
|
|
24 |
model = ora.CompletionModel.load(chatbot_id, 'gpt-4')
|
25 |
response = ora.Completion.create(model, 'hello')
|
26 |
|
27 |
-
print(response)
|
|
|
24 |
model = ora.CompletionModel.load(chatbot_id, 'gpt-4')
|
25 |
response = ora.Completion.create(model, 'hello')
|
26 |
|
27 |
+
print(response.completion.choices[0].text)
|