SearchResponse
Inspect the winner, source material, execution trace, warnings, and reported usage.
On this page
Response fields
interface SearchResponse {
provider: string;
results: readonly SearchResult[];
attempts: readonly SearchAttempt[];
warnings: readonly {
code: 'fallback_used' | 'provider_warning';
provider: string;
}[];
usage: { unit: 'usd' | 'credits'; value: number } | null;
reuse?: 'cache' | 'inflight';
}Result fields
| Field | Meaning |
|---|---|
url | Validated HTTP(S) source link. |
title?, snippet? | Optional provider text; render as untrusted text. |
highlights? | Separate passages, preserved as an array. |
score? | Native score; no cross-provider normalization. |
provenance | Provider ID, sourceUrl, retrievedAt, optional requestId. |
Validation and omissions
Built-in adapters validate consumed fields, including results beyond the output ceiling, before returning. A malformed consumed field rejects with invalid_response instead of being silently discarded. Unknown provider fields are ignored. The orchestrator also checks the normalized shape returned by custom providers, including safe URLs, provenance fields, usage, and warnings, and copies only public fields. Structural validation does not prove source truth or attribution.