summaryrefslogtreecommitdiffstats
path: root/ora/model.py
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-25 19:40:17 +0200
committert.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-25 19:40:17 +0200
commite341c75e5e9c34c5aa583e67b8711799d74040eb (patch)
tree9838ce842a78a0226bb9d55e83bfc0a7d7b2249d /ora/model.py
parent_ (diff)
downloadgpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.gz
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.bz2
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.lz
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.xz
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.zst
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.zip
Diffstat (limited to '')
-rw-r--r--ora/model.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/ora/model.py b/ora/model.py
deleted file mode 100644
index 34720c2d..00000000
--- a/ora/model.py
+++ /dev/null
@@ -1,57 +0,0 @@
-from uuid import uuid4
-from requests import post
-
-class CompletionModel:
- system_prompt = None
- description = None
- createdBy = None
- createdAt = None
- slug = None
- id = None
- modelName = 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',
- description : str = 'ChatGPT Openai Language Model',
- name : str = 'gpt-3.5'):
-
- CompletionModel.system_prompt = system_prompt
- CompletionModel.description = description
- CompletionModel.slug = name
-
- json_data = {
- 'prompt' : system_prompt,
- 'userId' : f'auto:{uuid4()}',
- 'name' : name,
- 'description': description}
-
- 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', headers = headers, json = json_data)
-
- print(response.json())
-
- CompletionModel.id = response.json()['id']
- CompletionModel.createdBy = response.json()['createdBy']
- CompletionModel.createdAt = response.json()['createdAt']
-
- return CompletionModel
-
- 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