summaryrefslogtreecommitdiffstats
path: root/openai_rev/openai_rev.py
diff options
context:
space:
mode:
authorRaju Komati <komatiraju032@gmail.com>2023-04-27 23:28:12 +0200
committerRaju Komati <komatiraju032@gmail.com>2023-04-27 23:28:47 +0200
commitdc1d9834f97bc5044c6417aeb44b9ca84bd18118 (patch)
tree23dd20d492eb9e6d3d337692d2683ec15dd60695 /openai_rev/openai_rev.py
parentupdate openai_rev module add test file with simple use (diff)
downloadgpt4free-dc1d9834f97bc5044c6417aeb44b9ca84bd18118.tar
gpt4free-dc1d9834f97bc5044c6417aeb44b9ca84bd18118.tar.gz
gpt4free-dc1d9834f97bc5044c6417aeb44b9ca84bd18118.tar.bz2
gpt4free-dc1d9834f97bc5044c6417aeb44b9ca84bd18118.tar.lz
gpt4free-dc1d9834f97bc5044c6417aeb44b9ca84bd18118.tar.xz
gpt4free-dc1d9834f97bc5044c6417aeb44b9ca84bd18118.tar.zst
gpt4free-dc1d9834f97bc5044c6417aeb44b9ca84bd18118.zip
Diffstat (limited to 'openai_rev/openai_rev.py')
-rw-r--r--openai_rev/openai_rev.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/openai_rev/openai_rev.py b/openai_rev/openai_rev.py
index 7d483c01..6b88298b 100644
--- a/openai_rev/openai_rev.py
+++ b/openai_rev/openai_rev.py
@@ -2,6 +2,7 @@ from enum import Enum
from openai_rev import forefront
from openai_rev import quora
+from openai_rev import theb
from openai_rev import you
@@ -9,6 +10,7 @@ class Provider(Enum):
You = 'you'
Poe = 'poe'
ForeFront = 'fore_front'
+ Theb = 'theb'
class Completion:
@@ -20,6 +22,8 @@ class Completion:
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:
@@ -32,3 +36,7 @@ class Completion:
@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))