diff options
author | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-05-02 12:46:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 12:46:54 +0200 |
commit | 33fa009125c1c6c249054f92f59a325ca06cba87 (patch) | |
tree | 1f114e794695779679135bac586d255f820f0e93 /gpt4free/forefront/__init__.py | |
parent | add italygpt.it (diff) | |
parent | Update README.md (diff) | |
download | gpt4free-33fa009125c1c6c249054f92f59a325ca06cba87.tar gpt4free-33fa009125c1c6c249054f92f59a325ca06cba87.tar.gz gpt4free-33fa009125c1c6c249054f92f59a325ca06cba87.tar.bz2 gpt4free-33fa009125c1c6c249054f92f59a325ca06cba87.tar.lz gpt4free-33fa009125c1c6c249054f92f59a325ca06cba87.tar.xz gpt4free-33fa009125c1c6c249054f92f59a325ca06cba87.tar.zst gpt4free-33fa009125c1c6c249054f92f59a325ca06cba87.zip |
Diffstat (limited to 'gpt4free/forefront/__init__.py')
-rw-r--r-- | gpt4free/forefront/__init__.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gpt4free/forefront/__init__.py b/gpt4free/forefront/__init__.py index 969b33b8..4d679a14 100644 --- a/gpt4free/forefront/__init__.py +++ b/gpt4free/forefront/__init__.py @@ -5,8 +5,8 @@ from typing import Generator, Optional from uuid import uuid4 from fake_useragent import UserAgent -from requests import post from pymailtm import MailTm, Message +from requests import post from tls_client import Session from .typing import ForeFrontResponse @@ -43,10 +43,7 @@ class Account: response = client.post( f'https://clerk.forefront.ai/v1/client/sign_ups/{trace_token}/prepare_verification?_clerk_js_version=4.38.4', - data={ - 'strategy': 'email_link', - 'redirect_url': 'https://accounts.forefront.ai/sign-up/verify' - }, + data={'strategy': 'email_link', 'redirect_url': 'https://accounts.forefront.ai/sign-up/verify'}, ) if logging: @@ -93,14 +90,14 @@ class StreamingCompletion: action_type='new', default_persona='607e41fe-95be-497e-8e97-010a59b2e2c0', # default model='gpt-4', - proxy=None + proxy=None, ) -> Generator[ForeFrontResponse, None, None]: if not token: raise Exception('Token is required!') if not chat_id: chat_id = str(uuid4()) - proxies = { 'http': 'http://' + proxy, 'https': 'http://' + proxy } if proxy else None + proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else None headers = { 'authority': 'chat-server.tenant-forefront-default.knative.chi.coreweave.com', @@ -168,7 +165,7 @@ class Completion: action_type='new', default_persona='607e41fe-95be-497e-8e97-010a59b2e2c0', # default model='gpt-4', - proxy=None + proxy=None, ) -> ForeFrontResponse: text = '' final_response = None @@ -179,7 +176,7 @@ class Completion: action_type=action_type, default_persona=default_persona, model=model, - proxy=proxy + proxy=proxy, ): if response: final_response = response @@ -191,4 +188,3 @@ class Completion: raise Exception('Unable to get the response, Please try again') return final_response -
\ No newline at end of file |