//#region src/live_search.d.ts
/**
 * Web search source configuration for xAI Live Search.
 * Corresponds to a `{"type": "web", ...}` entry in `search_parameters.sources`.
 */
interface XAIWebSource {
  type: "web";
  /**
   * Optional ISO alpha-2 country code used to bias results
   * towards a specific country/region.
   */
  country?: string;
  /**
   * Websites that should be excluded from the search results.
   * Maximum of 5 entries.
   */
  excluded_websites?: string[];
  /**
   * Websites that should be exclusively included in the search results.
   * Maximum of 5 entries.
   */
  allowed_websites?: string[];
  /**
   * Whether to enable safe search filtering for this source.
   */
  safe_search?: boolean;
}
/**
 * News search source configuration for xAI Live Search.
 * Corresponds to a `{"type": "news", ...}` entry in `search_parameters.sources`.
 */
interface XAINewsSource {
  type: "news";
  /**
   * Optional ISO alpha-2 country code used to bias results
   * towards a specific country/region.
   */
  country?: string;
  /**
   * Websites that should be excluded from the search results.
   * Maximum of 5 entries.
   */
  excluded_websites?: string[];
  /**
   * Whether to enable safe search filtering for this source.
   */
  safe_search?: boolean;
}
/**
 * X (formerly Twitter) search source configuration for xAI Live Search.
 * Corresponds to a `{"type": "x", ...}` entry in `search_parameters.sources`.
 */
interface XAIXSource {
  type: "x";
  /**
   * X handles that should be explicitly included in the search.
   * Maximum of 10 entries.
   */
  included_x_handles?: string[];
  /**
   * X handles that should be excluded from the search.
   * Maximum of 10 entries.
   */
  excluded_x_handles?: string[];
  /**
   * Minimum number of favorites a post must have to be included.
   */
  post_favorite_count?: number;
  /**
   * Minimum number of views a post must have to be included.
   */
  post_view_count?: number;
}
/**
 * RSS feed search source configuration for xAI Live Search.
 * Corresponds to a `{"type": "rss", ...}` entry in `search_parameters.sources`.
 */
interface XAIRssSource {
  type: "rss";
  /**
   * Links to RSS feeds to be used as a data source.
   * The API currently expects a single URL.
   */
  links: string[];
}
type XAISearchSource = XAIWebSource | XAINewsSource | XAIXSource | XAIRssSource;
/**
 * Search parameters for xAI's Live Search API.
 * Controls how the model searches for and retrieves real-time information.
 *
 * @note The Live Search API is being deprecated by xAI in favor of
 * the agentic tool calling approach. Consider using `tools: [{ type: "live_search" }]`
 * for future compatibility.
 */
interface XAISearchParameters {
  /**
   * Controls when the model should perform a search.
   * - "auto": Let the model decide when to search (default)
   * - "on": Always search for every request
   * - "off": Never search
   */
  mode?: "auto" | "on" | "off";
  /**
   * Maximum number of search results to return.
   * @default 20
   */
  max_search_results?: number;
  /**
   * Filter search results to only include content from after this date.
   * Format: ISO 8601 date string (e.g., "2024-01-01")
   */
  from_date?: string;
  /**
   * Filter search results to only include content from before this date.
   * Format: ISO 8601 date string (e.g., "2024-12-31")
   */
  to_date?: string;
  /**
   * Whether to return citations/sources for the search results.
   * @default true
   */
  return_citations?: boolean;
  /**
   * Specific web/news/X/RSS sources that can be used for the search.
   * Each entry corresponds to a `{"type": "...", ...}` object in
   * `search_parameters.sources` as documented in the xAI Live Search docs.
   *
   * If omitted, xAI will default to enabling `web`, `news` and `x` sources.
   */
  sources?: XAISearchSource[];
}
/**
 * Concrete payload shape sent as `search_parameters` to the xAI API.
 */
interface XAISearchParametersPayload {
  mode: "auto" | "on" | "off";
  max_search_results?: number;
  from_date?: string;
  to_date?: string;
  return_citations?: boolean;
  sources?: XAISearchSource[];
}
//#endregion
export { XAISearchParameters, XAISearchParametersPayload };
//# sourceMappingURL=live_search.d.ts.map