SearchParameters class

Search parameters for LLM providers that support search functionality

This class configures search behavior for providers like xAI Grok that support real-time web search capabilities. The parameters follow xAI's Live Search API specification.

Reference: https://docs.x.ai/docs/guides/live-search

Constructors

SearchParameters.new({String? mode, List<SearchSource>? sources, int? maxSearchResults, String? fromDate, String? toDate})
const
SearchParameters.combined({String mode = 'auto', int? maxResults, String? fromDate, String? toDate, List<String>? excludedWebsites})
Creates search parameters for both web and news sources
factory
SearchParameters.webSearch({String mode = 'auto', int? maxResults, List<String>? excludedWebsites})
Creates search parameters with default web search configuration
factory
SearchParameters.newsSearch({String mode = 'auto', int? maxResults, String? fromDate, String? toDate, List<String>? excludedWebsites})
Creates search parameters for news search
factory

Properties

fromDate String?
Start date for search results (format: "YYYY-MM-DD")
final
hashCode int
The hash code for this object.
no setterinherited
maxSearchResults int?
Maximum number of search results to return
final
mode String?
Search mode (e.g., "auto")
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sources List<SearchSource>?
List of search sources with exclusions
final
toDate String?
End date for search results (format: "YYYY-MM-DD")
final

Methods

copyWith({String? mode, List<SearchSource>? sources, int? maxSearchResults, String? fromDate, String? toDate}) SearchParameters
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited