1
0
Fork 0

Merge pull request #144 from Joonsey/main

fixes #143 missing cf_clearance raises error
This commit is contained in:
t.me/xtekky 2023-04-26 08:54:44 +01:00 committed by GitHub
commit 0265144b38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)