Method
searchWebForLLM POST
Copy POST

Access web search providers to fetch content related to the queries for use in large language model inputs.

Arguments:

REQUIRED KEY TYPE DESCRIPTION
Yes queries List[str] List of queries to send to the search providers. At most 10 queries each less than 512 characters.
No searchProviders List[str] Search providers to use for the search. If not provided a default provider is used. - BING - GOOGLE
No maxResults int Maximum number of results to fetch per provider. Must be in [1, 100]. Defaults to 1 (I'm feeling lucky).
No safe bool Whether content safety is enabled for these search request. Defaults to True.
No fetchContent bool If true fetches the content from the urls in the search results. Defailts to False.
No maxPageTokens int Maximum number of tokens to accumulate if fetching search result contents.
No convertToMarkdown bool Whether content should be converted to markdown. Defaults to True.
Note: The arguments for the API methods follow camelCase but for Python SDK underscore_case is followed.

Response:

KEY TYPE DESCRIPTION
success Boolean true if the call succeeded, false if there was an error
result WebSearchResponse
KEY TYPE Description
searchResults WebSearchResult List of search results.
KEY TYPE Description
title str The title of the search result.
url str The URL of the search result.
snippet str The snippet of the search result.
news str The news search result (if any)
place str The place search result (if any)
entity str The entity search result (if any)
content str The page of content fetched from the url.
Language: