Johannes commited on
Commit
670b2b6
·
1 Parent(s): 7e858de

fixes #143 missing cf_clearance raises error

Browse files

Phind Search.create now raises ValueError if missing cf_clearance.

Files changed (1) hide show
  1. phind/__init__.py +2 -2
phind/__init__.py CHANGED
@@ -53,7 +53,7 @@ class PhindResponse:
53
 
54
  class Search:
55
  def create(prompt: str, actualSearch: bool = True, language: str = 'en') -> dict: # None = no search
56
- if user_agent == '':
57
  raise ValueError('user_agent must be set, refer to documentation')
58
 
59
  if not actualSearch:
@@ -281,4 +281,4 @@ class StreamingCompletion:
281
 
282
  @staticmethod
283
  def handle_stream_response(response):
284
- StreamingCompletion.message_queue.put(response)
 
53
 
54
  class Search:
55
  def create(prompt: str, actualSearch: bool = True, language: str = 'en') -> dict: # None = no search
56
+ if user_agent == '' or cf_clearance == '':
57
  raise ValueError('user_agent must be set, refer to documentation')
58
 
59
  if not actualSearch:
 
281
 
282
  @staticmethod
283
  def handle_stream_response(response):
284
+ StreamingCompletion.message_queue.put(response)