1
0
Fork 0

fixes #143 missing cf_clearance raises error

Phind Search.create now raises ValueError if missing cf_clearance.
This commit is contained in:
Johannes 2023-04-26 08:00:06 +02:00
parent 7e858de0d4
commit 670b2b664e

View file

@ -53,7 +53,7 @@ class PhindResponse:
class Search:
def create(prompt: str, actualSearch: bool = True, language: str = 'en') -> dict: # None = no search
if user_agent == '':
if user_agent == '' or cf_clearance == '':
raise ValueError('user_agent must be set, refer to documentation')
if not actualSearch:
@ -281,4 +281,4 @@ class StreamingCompletion:
@staticmethod
def handle_stream_response(response):
StreamingCompletion.message_queue.put(response)
StreamingCompletion.message_queue.put(response)