| openai_web_search_tool | R Documentation |
Build the configuration for OpenAI's model-hosted web search, used via the Responses API. The model decides whether to search based on the prompt.
openai_web_search_tool(
allowed_domains = NULL,
user_location = NULL,
search_context_size = NULL,
type = c("web_search", "web_search_preview")
)
allowed_domains |
Optional character vector of domains the search is
restricted to. Forwarded as |
user_location |
Optional named list with any of |
search_context_size |
Optional |
type |
The tool type identifier. Defaults to |
A plain list ready to drop into tools = list(...).
## Not run:
model <- create_openai()$responses_model("gpt-5")
generate_text(
model,
"Latest material AAPL news?",
tools = list(openai_web_search_tool(search_context_size = "high"))
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.