summaryrefslogtreecommitdiffstats
path: root/openai_rev/openai_rev.py
diff options
context:
space:
mode:
authornoptuno <repollo.marrero@gmail.com>2023-04-28 12:33:51 +0200
committernoptuno <repollo.marrero@gmail.com>2023-04-28 12:33:51 +0200
commit396d7e11b2623cf05c3b0fd4ff9b6cce667835fd (patch)
tree4d7f4531e082deba4fb6bac7e5b221d887e066d9 /openai_rev/openai_rev.py
parentRemove ignored files from repository (diff)
parentMerge pull request #241 from ethanx40/main (diff)
downloadgpt4free-396d7e11b2623cf05c3b0fd4ff9b6cce667835fd.tar
gpt4free-396d7e11b2623cf05c3b0fd4ff9b6cce667835fd.tar.gz
gpt4free-396d7e11b2623cf05c3b0fd4ff9b6cce667835fd.tar.bz2
gpt4free-396d7e11b2623cf05c3b0fd4ff9b6cce667835fd.tar.lz
gpt4free-396d7e11b2623cf05c3b0fd4ff9b6cce667835fd.tar.xz
gpt4free-396d7e11b2623cf05c3b0fd4ff9b6cce667835fd.tar.zst
gpt4free-396d7e11b2623cf05c3b0fd4ff9b6cce667835fd.zip
Diffstat (limited to 'openai_rev/openai_rev.py')
-rw-r--r--openai_rev/openai_rev.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/openai_rev/openai_rev.py b/openai_rev/openai_rev.py
deleted file mode 100644
index 6b88298b..00000000
--- a/openai_rev/openai_rev.py
+++ /dev/null
@@ -1,42 +0,0 @@
-from enum import Enum
-
-from openai_rev import forefront
-from openai_rev import quora
-from openai_rev import theb
-from openai_rev import you
-
-
-class Provider(Enum):
- You = 'you'
- Poe = 'poe'
- ForeFront = 'fore_front'
- Theb = 'theb'
-
-
-class Completion:
- @staticmethod
- def create(provider: Provider, prompt: str, **kwargs):
- if provider == Provider.Poe:
- return Completion.__poe_service(prompt, **kwargs)
- elif provider == Provider.You:
- return Completion.__you_service(prompt, **kwargs)
- elif provider == Provider.ForeFront:
- return Completion.__fore_front_service(prompt, **kwargs)
- elif provider == Provider.Theb:
- return Completion.__theb_service(prompt, **kwargs)
-
- @classmethod
- def __you_service(cls, prompt: str, **kwargs) -> str:
- return you.Completion.create(prompt, **kwargs).text
-
- @classmethod
- def __poe_service(cls, prompt: str, **kwargs) -> str:
- return quora.Completion.create(prompt=prompt, **kwargs).text
-
- @classmethod
- def __fore_front_service(cls, prompt: str, **kwargs) -> str:
- return forefront.Completion.create(prompt=prompt, **kwargs).text
-
- @classmethod
- def __theb_service(cls, prompt: str, **kwargs):
- return ''.join(theb.Completion.create(prompt=prompt))