@@ -63,7 +63,8 @@ def __init__(
63
63
"""Initialize AsyncClient with configurable parameters.
64
64
65
65
Args:
66
- api_key: API key for authentication. If None, will try to load from environment
66
+ api_key: API key for authentication. If None, will try to
67
+ load from environment
67
68
verify_ssl: Whether to verify SSL certificates
68
69
timeout: Request timeout in seconds. None means no timeout (infinite)
69
70
max_retries: Maximum number of retry attempts
@@ -83,7 +84,8 @@ def __init__(
83
84
84
85
validate_api_key (api_key )
85
86
logger .debug (
86
- f"🛠️ Configuration: verify_ssl={ verify_ssl } , timeout={ timeout } , max_retries={ max_retries } "
87
+ f"🛠️ Configuration: verify_ssl={ verify_ssl } , "
88
+ f"timeout={ timeout } , max_retries={ max_retries } "
87
89
)
88
90
self .api_key = api_key
89
91
self .headers = {** DEFAULT_HEADERS , "SGAI-APIKEY" : api_key }
@@ -104,7 +106,8 @@ async def _make_request(self, method: str, url: str, **kwargs) -> Any:
104
106
for attempt in range (self .max_retries ):
105
107
try :
106
108
logger .info (
107
- f"🚀 Making { method } request to { url } (Attempt { attempt + 1 } /{ self .max_retries } )"
109
+ f"🚀 Making { method } request to { url } "
110
+ f"(Attempt { attempt + 1 } /{ self .max_retries } )"
108
111
)
109
112
logger .debug (f"🔍 Request parameters: { kwargs } " )
110
113
@@ -255,7 +258,8 @@ async def get_credits(self):
255
258
f"{ API_BASE_URL } /credits" ,
256
259
)
257
260
logger .info (
258
- f"✨ Credits info retrieved: { result .get ('remaining_credits' )} credits remaining"
261
+ f"✨ Credits info retrieved: "
262
+ f"{ result .get ('remaining_credits' )} credits remaining"
259
263
)
260
264
return result
261
265
@@ -271,8 +275,9 @@ async def searchscraper(
271
275
Args:
272
276
user_prompt: The search prompt string
273
277
num_results: Number of websites to scrape (3-20). Default is 3.
274
- More websites provide better research depth but cost more credits.
275
- Credit calculation: 30 base + 10 per additional website beyond 3.
278
+ More websites provide better research depth but cost more
279
+ credits. Credit calculation: 30 base + 10 per additional
280
+ website beyond 3.
276
281
headers: Optional headers to send with the request
277
282
output_schema: Optional schema to structure the output
278
283
"""
@@ -323,7 +328,8 @@ async def crawl(
323
328
batch_size : Optional [int ] = None ,
324
329
sitemap : bool = False ,
325
330
):
326
- """Send a crawl request with support for both AI extraction and markdown conversion modes"""
331
+ """Send a crawl request with support for both AI extraction and
332
+ markdown conversion modes"""
327
333
logger .info ("🔍 Starting crawl request" )
328
334
logger .debug (f"🌐 URL: { url } " )
329
335
logger .debug (
0 commit comments