Skip to content

Commit

Permalink
ora.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
xtekky committed Apr 20, 2023
1 parent fa113e6 commit fce0656
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion ora/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class CompletionModel:
createdAt = None
slug = None
id = None
modelName = None
model = 'gpt-3.5-turbo'

def create(
Expand All @@ -19,13 +20,21 @@ def create(
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']
Expand Down
2 changes: 1 addition & 1 deletion testing/ora_gpt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
model = ora.CompletionModel.load(chatbot_id, 'gpt-4')
response = ora.Completion.create(model, 'hello')

print(response)
print(response.completion.choices[0].text)

0 comments on commit fce0656

Please sign in to comment.