Merge pull request #144 from Joonsey/main
fixes #143 missing cf_clearance raises error
This commit is contained in:
commit
0265144b38
1 changed files with 9 additions and 2 deletions
|
@ -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 {
|
||||
|
@ -109,6 +111,9 @@ class Completion:
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue