View source: R/ai-search-functions.R
ai_searcher | R Documentation |
Creates a search function specifically for interacting with AI services. Unlike regular search functions, AI searchers support custom prompts that can guide how the AI responds to queries.
ai_searcher(site)
site |
Name of the site to search on (e.g., "chatgpt", "claude") |
The returned function will apply prompts in the following priority order:
System-level prompt set via ai_prompt()
(if any)
Function call prompt or service-specific option
The query itself
The returned function accepts two parameters:
query
: The question or request to send to the AI (defaults to last error message)
prompt
: Custom prompt to guide the AI's response (optional)
A function that can be used to search the specified AI service with optional prompt customization
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.