WebSearch
class WebSearch extends ProviderTool
Properties
| protected array<string, mixed>|SerializableClosure | $providerOptions | from ProviderTool | |
| string|null | $city | ||
| string|null | $region | ||
| string|null | $country |
Methods
Attach provider-specific options to the tool payload. Closures may only capture serializable values.
Get the provider-specific options for the given provider.
Create a web search tool with optional search limits and allowed domains.
Set the user's location to refine search results based on the given location.
Determine if the web search uses the user's location.
Details
in
ProviderTool at line 23
ProviderTool
withProviderOptions(array|Closure $options)
Attach provider-specific options to the tool payload. Closures may only capture serializable values.
in
ProviderTool at line 37
array
providerOptions(Lab|string $provider)
Get the provider-specific options for the given provider.
at line 18
__construct(int|null $maxSearches = null, array $allowedDomains = [])
Create a web search tool with optional search limits and allowed domains.
at line 27
WebSearch
max(int $max)
Set the maximum number of searches.
at line 37
WebSearch
allow(array $domains)
Set the allowed domains.
at line 47
WebSearch
location(string|null $city = null, string|null $region = null, string|null $country = null)
Set the user's location to refine search results based on the given location.
at line 59
bool
hasLocation()
Determine if the web search uses the user's location.