summaryrefslogtreecommitdiffstats
path: root/quora
diff options
context:
space:
mode:
authorAymane Hrouch <jo.aymane@gmail.com>2023-04-27 16:43:59 +0200
committerAymane Hrouch <jo.aymane@gmail.com>2023-04-27 16:43:59 +0200
commitf1594cfddecf2bd47a25d54852834b392eaa4efd (patch)
tree6fec52831117ee43fe7141a153b7e123ff09d469 /quora
parentMerge pull request #201 from DanielShemesh/patch-4 (diff)
downloadgpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar
gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.gz
gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.bz2
gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.lz
gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.xz
gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.tar.zst
gpt4free-f1594cfddecf2bd47a25d54852834b392eaa4efd.zip
Diffstat (limited to '')
-rw-r--r--quora/__init__.py56
-rw-r--r--quora/api.py62
2 files changed, 59 insertions, 59 deletions
diff --git a/quora/__init__.py b/quora/__init__.py
index d0ed302f..cd5ec8f9 100644
--- a/quora/__init__.py
+++ b/quora/__init__.py
@@ -116,11 +116,11 @@ class ModelResponse:
class Model:
@staticmethod
def create(
- token: str,
- model: str = 'gpt-3.5-turbo', # claude-instant
- system_prompt: str = 'You are ChatGPT a large language model developed by Openai. Answer as consisely as possible',
- description: str = 'gpt-3.5 language model from openai, skidded by poe.com',
- handle: str = None,
+ token: str,
+ model: str = 'gpt-3.5-turbo', # claude-instant
+ system_prompt: str = 'You are ChatGPT a large language model developed by Openai. Answer as consisely as possible',
+ description: str = 'gpt-3.5 language model from openai, skidded by poe.com',
+ handle: str = None,
) -> ModelResponse:
models = {
'gpt-3.5-turbo': 'chinchilla',
@@ -202,9 +202,9 @@ class Model:
class Account:
@staticmethod
def create(
- proxy: Optional[str] = None,
- logging: bool = False,
- enable_bot_creation: bool = False,
+ proxy: Optional[str] = None,
+ logging: bool = False,
+ enable_bot_creation: bool = False,
):
client = TLS(client_identifier='chrome110')
client.proxies = {'http': f'http://{proxy}', 'https': f'http://{proxy}'} if proxy else None
@@ -309,10 +309,10 @@ class Account:
class StreamingCompletion:
@staticmethod
def create(
- model: str = 'gpt-4',
- custom_model: bool = None,
- prompt: str = 'hello world',
- token: str = '',
+ model: str = 'gpt-4',
+ custom_model: bool = None,
+ prompt: str = 'hello world',
+ token: str = '',
):
_model = MODELS[model] if not custom_model else custom_model
@@ -344,10 +344,10 @@ class StreamingCompletion:
class Completion:
def create(
- model: str = 'gpt-4',
- custom_model: str = None,
- prompt: str = 'hello world',
- token: str = '',
+ model: str = 'gpt-4',
+ custom_model: str = None,
+ prompt: str = 'hello world',
+ token: str = '',
):
models = {
'sage': 'capybara',
@@ -389,12 +389,12 @@ class Completion:
class Poe:
def __init__(
- self,
- model: str = 'ChatGPT',
- driver: str = 'firefox',
- download_driver: bool = False,
- driver_path: Optional[str] = None,
- cookie_path: str = './quora/cookie.json',
+ self,
+ model: str = 'ChatGPT',
+ driver: str = 'firefox',
+ download_driver: bool = False,
+ driver_path: Optional[str] = None,
+ cookie_path: str = './quora/cookie.json',
):
# validating the model
if model and model not in MODELS:
@@ -473,12 +473,12 @@ class Poe:
return response
def create_bot(
- self,
- name: str,
- /,
- prompt: str = '',
- base_model: str = 'ChatGPT',
- description: str = '',
+ self,
+ name: str,
+ /,
+ prompt: str = '',
+ base_model: str = 'ChatGPT',
+ description: str = '',
) -> None:
if base_model not in MODELS:
raise RuntimeError('Sorry, the base_model you provided does not exist. Please check and try again.')
diff --git a/quora/api.py b/quora/api.py
index 42814f2c..697f6663 100644
--- a/quora/api.py
+++ b/quora/api.py
@@ -384,7 +384,7 @@ class Client:
continue
# update info about response
- message["text_new"] = message["text"][len(last_text) :]
+ message["text_new"] = message["text"][len(last_text):]
last_text = message["text"]
message_id = message["messageId"]
@@ -456,21 +456,21 @@ class Client:
logger.info(f"No more messages left to delete.")
def create_bot(
- self,
- handle,
- prompt="",
- base_model="chinchilla",
- description="",
- intro_message="",
- api_key=None,
- api_bot=False,
- api_url=None,
- prompt_public=True,
- pfp_url=None,
- linkification=False,
- markdown_rendering=True,
- suggested_replies=False,
- private=False,
+ self,
+ handle,
+ prompt="",
+ base_model="chinchilla",
+ description="",
+ intro_message="",
+ api_key=None,
+ api_bot=False,
+ api_url=None,
+ prompt_public=True,
+ pfp_url=None,
+ linkification=False,
+ markdown_rendering=True,
+ suggested_replies=False,
+ private=False,
):
result = self.send_query(
"PoeBotCreateMutation",
@@ -499,21 +499,21 @@ class Client:
return data
def edit_bot(
- self,
- bot_id,
- handle,
- prompt="",
- base_model="chinchilla",
- description="",
- intro_message="",
- api_key=None,
- api_url=None,
- private=False,
- prompt_public=True,
- pfp_url=None,
- linkification=False,
- markdown_rendering=True,
- suggested_replies=False,
+ self,
+ bot_id,
+ handle,
+ prompt="",
+ base_model="chinchilla",
+ description="",
+ intro_message="",
+ api_key=None,
+ api_url=None,
+ private=False,
+ prompt_public=True,
+ pfp_url=None,
+ linkification=False,
+ markdown_rendering=True,
+ suggested_replies=False,
):
result = self.send_query(
"PoeBotEditMutation",