Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Web Search and News Search return retrieved web content in each result's content field. Browse returns content for a URL you specify.
Use contentFormat to select passages or a full-document format, and maxLength to limit the number of characters returned. Set both parameters explicitly to avoid relying on defaults. For grounding, use contentFormat: "passage".
Passages
Set contentFormat to passage to get, for each result, the parts of the document most relevant to your query, up to maxLength characters. Web IQ processes the whole document on its side and returns a query-targeted extract, so your model doesn't have to read past unrelated paragraphs to find the relevant sentence.
- Token savings: your model receives a fraction of the document instead of all of it.
- Better factuality: with less off-topic content in the context, the model is less likely to anchor on a tangential paragraph.
Passages work for every application. For Web Search and News Search, a good starting point is maxResults = 10, contentFormat = passage, and maxLength = 3000. Browse doesn't accept maxResults; it returns content for one URL per request. From there, tune for your use case; see How should I tune maxResults and maxLength?
Full document: text, html, markdown
Web IQ doesn't return the original web page. During indexing, it builds a structured document from each page's meaningful content, and passages are selected from that document. Applications with full document access can request the whole document instead of passages:
contentFormat |
Returns |
|---|---|
passage |
The parts of the document most relevant to the query, up to maxLength characters. |
text |
The full document as plain text, up to maxLength characters. |
html |
The full document as HTML, up to maxLength characters. |
markdown |
The full document as Markdown, up to maxLength characters. |
Documents longer than maxLength are cut off. To get a complete document, set maxLength high enough.
If your application doesn't have full document access, a request that sets text, html, or markdown returns HTTP 403 with the error code AuthContentFormatForbidden. Passages remain the recommended format for grounding.
Get the full document formats
To request full document access, open a Web IQ Support request. Applications that already use html or text keep working as today.
Defaults and limits
Available formats and defaults depend on whether your application has full document access. Set contentFormat and maxLength on every request to explicitly control the response format and maximum length.
| Setting | Without full document access | With full document access |
|---|---|---|
| Available formats | passage |
passage, text, html, markdown |
contentFormat if you leave it out |
passage |
html (Web Search), text (News Search) |
maxLength if you leave it out |
3000 | 10000 |
| Maximum returned content length | 3,000 characters, even if you set a larger maxLength |
Up to 500,000 characters, controlled by maxLength |
Browse
Browse returns content for a URL you choose, and supports the same formats. Set contentFormat to passage and send a query to get the parts of the page most relevant to that query, up to maxLength characters. A passage request requires a query.
Without full document access, passage is the default format and the only one you can request, so include query in every Browse request. With full document access, you can also request text, html, or markdown to get the full document, up to maxLength characters.
If you omit contentFormat, Browse defaults to passage without full document access or html with full document access. If you omit maxLength, it defaults to 3000 without full document access or 10000 with full document access. With full document access, you can set maxLength up to 500000 characters; without it, content is capped at 3000 characters.