summaryrefslogtreecommitdiffstats
path: root/ora/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'ora/model.py')
-rw-r--r--ora/model.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/ora/model.py b/ora/model.py
index 69eca526..a0f0e93e 100644
--- a/ora/model.py
+++ b/ora/model.py
@@ -8,6 +8,7 @@ class CompletionModel:
createdAt = None
slug = None
id = None
+ model = 'gpt-3.5-turbo'
def create(
system_prompt: str = 'You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible',
@@ -18,6 +19,7 @@ class CompletionModel:
CompletionModel.description = description
CompletionModel.slug = name
+
response = post('https://ora.sh/api/assistant', json = {
'prompt' : system_prompt,
'userId' : f'auto:{uuid4()}',
@@ -29,4 +31,16 @@ class CompletionModel:
CompletionModel.createdAt = response.json()['createdAt']
return CompletionModel
- \ No newline at end of file
+
+ def load(chatbotId: str, modelName: str = 'gpt-3.5-turbo', userId: str = None):
+ if userId is None: userId = f'{uuid4()}'
+
+ CompletionModel.system_prompt = None
+ CompletionModel.description = None
+ CompletionModel.slug = None
+ CompletionModel.id = chatbotId
+ CompletionModel.createdBy = userId
+ CompletionModel.createdAt = None
+ CompletionModel.modelName = modelName
+
+ return CompletionModel \ No newline at end of file