@@ -16,23 +16,21 @@ final class LaravelScrapingBeeChatGpt
1616
1717 private readonly string $ baseUrl ;
1818 private readonly string $ apiKey ;
19- private readonly int $ timeout ;
2019
2120 private array $ params = [];
2221 private array $ headers = [];
2322
24- public static function make (#[\SensitiveParameter] ?string $ apiKey = null , ? int $ timeout = null ): self
23+ public static function make (#[\SensitiveParameter] ?string $ apiKey = null ): self
2524 {
26- return new self ($ apiKey, $ timeout );
25+ return new self ($ apiKey );
2726 }
2827
29- public function __construct (#[\SensitiveParameter] ?string $ apiKey = null , ? int $ timeout = null )
28+ public function __construct (#[\SensitiveParameter] ?string $ apiKey = null )
3029 {
3130 // If somebody pass '' into the constructor, we should use '' as the api key
3231 // even if it doesn't make sense.
3332 // If $apiKey is null, then we use the 1 in the config file.
3433 $ this ->apiKey = $ apiKey ?? config ('scrapingbee.api_key ' );
35- $ this ->timeout = $ timeout ?? config ('scrapingbee.timeout ' );
3634
3735 $ this ->baseUrl = config (
3836 'scrapingbee.chatgpt_base_url ' ,
@@ -80,6 +78,27 @@ public function prompt(string $prompt): self
8078 return $ this ;
8179 }
8280
81+ public function addHtml (): self
82+ {
83+ $ this ->params ['add_html ' ] = true ;
84+
85+ return $ this ;
86+ }
87+
88+ public function countryCode (string $ countryCode ): self
89+ {
90+ $ this ->params ['country_code ' ] = $ countryCode ;
91+
92+ return $ this ;
93+ }
94+
95+ public function webSearch (): self
96+ {
97+ $ this ->params ['search ' ] = true ;
98+
99+ return $ this ;
100+ }
101+
83102 /*
84103 * If the API hasn't caught up, and you need to support a new ScrapingBee parameter,
85104 * you can set it using this method.
0 commit comments