diff options
author | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-01 15:08:23 +0200 |
---|---|---|
committer | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-01 15:08:23 +0200 |
commit | 493c37a81ecc34247189f7339632518268524655 (patch) | |
tree | 2d647b02b5c16ed5d0c2643112f4b7c31d1c62e3 /ora/model.py | |
parent | important note + new site (ora.sh) (diff) | |
download | gpt4free-493c37a81ecc34247189f7339632518268524655.tar gpt4free-493c37a81ecc34247189f7339632518268524655.tar.gz gpt4free-493c37a81ecc34247189f7339632518268524655.tar.bz2 gpt4free-493c37a81ecc34247189f7339632518268524655.tar.lz gpt4free-493c37a81ecc34247189f7339632518268524655.tar.xz gpt4free-493c37a81ecc34247189f7339632518268524655.tar.zst gpt4free-493c37a81ecc34247189f7339632518268524655.zip |
Diffstat (limited to '')
-rw-r--r-- | ora/model.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ora/model.py b/ora/model.py new file mode 100644 index 00000000..69eca526 --- /dev/null +++ b/ora/model.py @@ -0,0 +1,32 @@ +from uuid import uuid4 +from requests import post + +class CompletionModel: + system_prompt = None + description = None + createdBy = None + createdAt = None + slug = None + id = None + + 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 + + response = post('https://ora.sh/api/assistant', json = { + 'prompt' : system_prompt, + 'userId' : f'auto:{uuid4()}', + 'name' : name, + 'description': description}) + + CompletionModel.id = response.json()['id'] + CompletionModel.createdBy = response.json()['createdBy'] + CompletionModel.createdAt = response.json()['createdAt'] + + return CompletionModel +
\ No newline at end of file |