searchLocation method

LLMBuilder searchLocation(
  1. WebSearchLocation location
)

Configures search location for localized results

This method sets the geographic context for search results, which can improve relevance for location-specific queries.

Example:

final provider = await ai()
    .anthropic()
    .apiKey(apiKey)
    .enableWebSearch()
    .searchLocation(WebSearchLocation.newYork())
    .build();

Implementation

LLMBuilder searchLocation(WebSearchLocation location) {
  return extension('webSearchLocation', location);
}