t.me/xtekky
commited on
Commit
•
d7ea4f9
1
Parent(s):
c38e367
ora.sh load model ( to use gpt-4 )
Browse files- ora/__init__.py +2 -2
- ora/model.py +15 -1
- testing/ora_gpt4.py +27 -0
ora/__init__.py
CHANGED
@@ -26,10 +26,10 @@ class Completion:
|
|
26 |
'chatbotId': model.id,
|
27 |
'input' : prompt,
|
28 |
'userId' : model.createdBy,
|
29 |
-
'model' :
|
30 |
'provider' : 'OPEN_AI',
|
31 |
'includeHistory': includeHistory}).json()
|
32 |
-
|
33 |
return OraResponse({
|
34 |
'id' : response['conversationId'],
|
35 |
'object' : 'text_completion',
|
|
|
26 |
'chatbotId': model.id,
|
27 |
'input' : prompt,
|
28 |
'userId' : model.createdBy,
|
29 |
+
'model' : model.modelName,
|
30 |
'provider' : 'OPEN_AI',
|
31 |
'includeHistory': includeHistory}).json()
|
32 |
+
|
33 |
return OraResponse({
|
34 |
'id' : response['conversationId'],
|
35 |
'object' : 'text_completion',
|
ora/model.py
CHANGED
@@ -8,6 +8,7 @@ class CompletionModel:
|
|
8 |
createdAt = None
|
9 |
slug = None
|
10 |
id = None
|
|
|
11 |
|
12 |
def create(
|
13 |
system_prompt: str = 'You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible',
|
@@ -18,6 +19,7 @@ class CompletionModel:
|
|
18 |
CompletionModel.description = description
|
19 |
CompletionModel.slug = name
|
20 |
|
|
|
21 |
response = post('https://ora.sh/api/assistant', json = {
|
22 |
'prompt' : system_prompt,
|
23 |
'userId' : f'auto:{uuid4()}',
|
@@ -29,4 +31,16 @@ class CompletionModel:
|
|
29 |
CompletionModel.createdAt = response.json()['createdAt']
|
30 |
|
31 |
return CompletionModel
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
createdAt = None
|
9 |
slug = None
|
10 |
id = None
|
11 |
+
model = 'gpt-3.5-turbo'
|
12 |
|
13 |
def create(
|
14 |
system_prompt: str = 'You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible',
|
|
|
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()}',
|
|
|
31 |
CompletionModel.createdAt = response.json()['createdAt']
|
32 |
|
33 |
return CompletionModel
|
34 |
+
|
35 |
+
def load(chatbotId: str, modelName: str = 'gpt-3.5-turbo', userId: str = None):
|
36 |
+
if userId is None: userId = f'{uuid4()}'
|
37 |
+
|
38 |
+
CompletionModel.system_prompt = None
|
39 |
+
CompletionModel.description = None
|
40 |
+
CompletionModel.slug = None
|
41 |
+
CompletionModel.id = chatbotId
|
42 |
+
CompletionModel.createdBy = userId
|
43 |
+
CompletionModel.createdAt = None
|
44 |
+
CompletionModel.modelName = modelName
|
45 |
+
|
46 |
+
return CompletionModel
|
testing/ora_gpt4.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ora
|
2 |
+
|
3 |
+
# 1 normal
|
4 |
+
# 2 solidity contract helper
|
5 |
+
# 3 swift project helper
|
6 |
+
# 4 developer gpt
|
7 |
+
# 5 lawsuit bot for spam call
|
8 |
+
# 6 p5.js code help bot
|
9 |
+
# 8 AI professor, for controversial topics
|
10 |
+
# 9 HustleGPT, your entrepreneurial AI
|
11 |
+
# 10 midjourney prompts bot
|
12 |
+
# 11 AI philosophy professor
|
13 |
+
# 12 TypeScript and JavaScript code review bot
|
14 |
+
# 13 credit card transaction details to merchant and location bot
|
15 |
+
# 15 Chemical Compound Similarity and Purchase Tool bot
|
16 |
+
# 16 expert full-stack developer AI
|
17 |
+
# 17 Solana development bot
|
18 |
+
# 18 price guessing game bot
|
19 |
+
# 19 AI Ethicist and Philosopher
|
20 |
+
|
21 |
+
gpt4_chatbot_ids = ['b8b12eaa-5d47-44d3-92a6-4d706f2bcacf', 'fbe53266-673c-4b70-9d2d-d247785ccd91', 'bd5781cf-727a-45e9-80fd-a3cfce1350c6', '993a0102-d397-47f6-98c3-2587f2c9ec3a', 'ae5c524e-d025-478b-ad46-8843a5745261', 'cc510743-e4ab-485e-9191-76960ecb6040', 'a5cd2481-8e24-4938-aa25-8e26d6233390', '6bca5930-2aa1-4bf4-96a7-bea4d32dcdac', '884a5f2b-47a2-47a5-9e0f-851bbe76b57c', 'd5f3c491-0e74-4ef7-bdca-b7d27c59e6b3', 'd72e83f6-ef4e-4702-844f-cf4bd432eef7', '6e80b170-11ed-4f1a-b992-fd04d7a9e78c', '8ef52d68-1b01-466f-bfbf-f25c13ff4a72', 'd0674e11-f22e-406b-98bc-c1ba8564f749', 'a051381d-6530-463f-be68-020afddf6a8f', '99c0afa1-9e32-4566-8909-f4ef9ac06226', '1be65282-9c59-4a96-99f8-d225059d9001', 'dba16bd8-5785-4248-a8e9-b5d1ecbfdd60', '1731450d-3226-42d0-b41c-4129fe009524', '8e74635d-000e-4819-ab2c-4e986b7a0f48', 'afe7ed01-c1ac-4129-9c71-2ca7f3800b30', 'e374c37a-8c44-4f0e-9e9f-1ad4609f24f5']
|
22 |
+
chatbot_id = gpt4_chatbot_ids[0]
|
23 |
+
|
24 |
+
model = ora.CompletionModel.load(chatbot_id, 'gpt-4')
|
25 |
+
response = ora.Completion.create(model, 'hello')
|
26 |
+
|
27 |
+
print(response)
|