summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-26 09:54:44 +0200
committerGitHub <noreply@github.com>2023-04-26 09:54:44 +0200
commit0265144b388101f2d9469bbb72366c442381b3e4 (patch)
tree574ce7efa8a3d2c4c8fa06996f75b45e30d9e021
parentannouncement (diff)
parentadded error checking to the remaining methods (diff)
downloadgpt4free-0265144b388101f2d9469bbb72366c442381b3e4.tar
gpt4free-0265144b388101f2d9469bbb72366c442381b3e4.tar.gz
gpt4free-0265144b388101f2d9469bbb72366c442381b3e4.tar.bz2
gpt4free-0265144b388101f2d9469bbb72366c442381b3e4.tar.lz
gpt4free-0265144b388101f2d9469bbb72366c442381b3e4.tar.xz
gpt4free-0265144b388101f2d9469bbb72366c442381b3e4.tar.zst
gpt4free-0265144b388101f2d9469bbb72366c442381b3e4.zip
-rw-r--r--phind/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/phind/__init__.py b/phind/__init__.py
index 9b1650e0..9f000c6f 100644
--- a/phind/__init__.py
+++ b/phind/__init__.py
@@ -55,6 +55,8 @@ class Search:
def create(prompt: str, actualSearch: bool = True, language: str = 'en') -> dict: # None = no search
if user_agent == '':
raise ValueError('user_agent must be set, refer to documentation')
+ if cf_clearance == '' :
+ raise ValueError('cf_clearance must be set, refer to documentation')
if not actualSearch:
return {
@@ -106,8 +108,11 @@ class Completion:
codeContext: str = '',
language: str = 'en') -> PhindResponse:
- if user_agent == '':
+ if user_agent == '' :
raise ValueError('user_agent must be set, refer to documentation')
+
+ if cf_clearance == '' :
+ raise ValueError('cf_clearance must be set, refer to documentation')
if results is None:
results = Search.create(prompt, actualSearch = True)
@@ -235,6 +240,8 @@ class StreamingCompletion:
if user_agent == '':
raise ValueError('user_agent must be set, refer to documentation')
+ if cf_clearance == '' :
+ raise ValueError('cf_clearance must be set, refer to documentation')
if results is None:
results = Search.create(prompt, actualSearch = True)
@@ -281,4 +288,4 @@ class StreamingCompletion:
@staticmethod
def handle_stream_response(response):
- StreamingCompletion.message_queue.put(response) \ No newline at end of file
+ StreamingCompletion.message_queue.put(response)