diff --git a/NAMESPACE b/NAMESPACE index dbd2589..e8db0f2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -24,7 +24,6 @@ export(search_gh) export(search_github) export(search_google) export(search_grep) -export(search_ixquick) export(search_kagi) export(search_posit) export(search_posit_community) diff --git a/NEWS.md b/NEWS.md index b48f175..e3e6fb1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -26,6 +26,25 @@ ([#42](https://github.com/coatless-rpkg/searcher/pull/42)) - Added searcher logo ([#40](https://github.com/coatless-rpkg/searcher/pull/40)) +## Documentation + +### Package Website + +- Enhanced `_pkgdown.yml` with a more organized structure and improved navigation + - Set the theme to use Bootstrap 5's Flatly theme for a modern look +- Added categorized function reference sections for better discoverability + +### Function Documentation + +- Reorganized search functions into separate help pages by category: + - Search engines (Google, Bing, etc.) + - Community sites (StackOverflow, Twitter, etc.) + - Code repositories (GitHub, BitBucket, etc.) + - AI assistants (ChatGPT, Claude, etc.) +- Implemented `@family` tags to group related functions in the "See also" section +- Added more specific, relevant examples for each function +- Added brief descriptions of each AI service's strengths and characteristics + ## Deprecations - Deprecated `search_rstudio_community()` and `search_rscom()` functions. ([#43](https://github.com/coatless-rpkg/searcher/pull/43)) diff --git a/R/ai-search-functions.R b/R/ai-search-functions.R index db3ff72..c748507 100644 --- a/R/ai-search-functions.R +++ b/R/ai-search-functions.R @@ -59,106 +59,137 @@ ai_searcher = function(site) { ########################### Start Search with Generative AI -#' Search Generative AI Services from R +#' Search with ChatGPT #' -#' Opens a browser to query various generative AI assistants directly from R. -#' These functions allow you to ask questions, get code help, or search for information -#' using popular AI services. +#' Opens a browser with OpenAI's ChatGPT interface and your query. +#' This function allows you to ask questions, get code help, +#' or search for information using ChatGPT. #' -#' @param query Contents of string to send to the AI. Default is the last error message. -#' @param prompt Optional prompt prefix to add before your query to guide how the AI +#' @param query Contents of string to send to ChatGPT. Default is the last error message. +#' @param prompt Optional prompt prefix to add before your query to guide how ChatGPT #' responds. If NULL, uses the service-specific default prompt option. #' #' @return The generated search URL or an empty string. #' -#' @rdname search_genai #' @export -#' @seealso [search_site()] +#' @family AI assistants #' @examples -#' \dontrun{ -#' # Basic AI queries +#' # Basic query #' ask_chatgpt("How to join two dataframes in R?") -#' ask_claude("Explain what purrr::map_df does") -#' ask_perplexity("Compare dplyr vs data.table") #' -#' # Using custom prompts -#' ask_mistral("Find bug: ggplot(mtcars, aes(x=mpg, y=hp) + geom_point()", -#' prompt = "Debug this code step by step:") +#' # Using a custom prompt +#' ask_chatgpt("Error: object 'mtcrs' not found", +#' prompt = "Debug this error step by step:") #' #' # Searching the last error +#' \dontrun{ #' tryCatch( #' median("not a number"), #' error = function(e) ask_chatgpt() #' ) -#' -#' # Setting default prompts -#' options( -#' searcher.chatgpt_prompt = "You are an R viz expert. Help with:", -#' searcher.claude_prompt = "As an R statistics expert, answer:" -#' ) #' } -#' -#' @section ChatGPT Search: -#' The `ask_chatgpt()` function opens a browser with OpenAI's ChatGPT interface and your query using: -#' `https://chat.openai.com/?model=auto&q=` -#' -#' You can customize the AI's behavior by setting a prompt prefix through: -#' 1. The `prompt` parameter for per-call customization -#' 2. The `options(searcher.chatgpt_prompt = "...")` setting for persistent customization ask_chatgpt = ai_searcher("chatgpt") -#' @rdname search_genai +#' Search with Claude +#' +#' Opens Anthropic's Claude AI assistant with your query. +#' Claude can provide thorough answers to complex questions +#' and offers excellent code explanations. +#' +#' @inheritParams ask_chatgpt +#' @return The generated search URL or an empty string. +#' #' @export -#' @section Claude Search: -#' The `ask_claude()` function opens Anthropic's Claude AI assistant with your query using: -#' `https://claude.ai/new?q=` +#' @family AI assistants +#' @examples +#' # Basic query +#' ask_claude("Explain what purrr::map_df does") #' -#' Claude can be directed to respond in specific ways by using the prompt parameter or by -#' setting a default prompt via `options()`. +#' # Using a custom prompt +#' ask_claude("Compare tidyr::pivot_wider vs tidyr::spread", +#' prompt = "Provide examples of when to use each:") ask_claude = ai_searcher("claude") -#' @rdname search_genai -#' @export -#' @section Perplexity Search: -#' The `ask_perplexity()` function searches with Perplexity AI using: -#' `https://www.perplexity.ai/search?q=&focus=internet&copilot=false` +#' Search with Perplexity #' -#' Perplexity AI provides answers with citations to sources, making it particularly +#' Searches with Perplexity AI, which provides answers with +#' citations to sources. This makes it particularly #' useful for research-oriented queries. +#' +#' @inheritParams ask_chatgpt +#' @return The generated search URL or an empty string. +#' +#' @export +#' @family AI assistants +#' @examples +#' # Basic query +#' ask_perplexity("Compare dplyr vs data.table") +#' +#' # Using a custom prompt +#' ask_perplexity("Best packages for time series in R", +#' prompt = "Provide citations and compare performance:") ask_perplexity = ai_searcher("perplexity") -#' @rdname search_genai +#' Search with Mistral AI +#' +#' Launches Mistral AI with your query. Mistral is known for +#' its strong reasoning capabilities and efficiency. +#' +#' @inheritParams ask_chatgpt +#' @return The generated search URL or an empty string. +#' #' @export -#' @section Mistral Search: -#' The `ask_mistral()` function launches Mistral AI with your query using: -#' `https://chat.mistral.ai/chat?q=` +#' @family AI assistants +#' @examples +#' # Basic query +#' ask_mistral("How to handle missing data in R?") #' -#' The default prompt can be customized through the `searcher.mistral_prompt` option. +#' # Using a custom prompt +#' ask_mistral("Fix this code: ggplot(mtcars, aes(x=mpg, y=hp) + geom_point()", +#' prompt = "Explain the error and fix it:") ask_mistral = ai_searcher("mistral") -#' @rdname search_genai +#' Search with Bing Copilot +#' +#' Searches Microsoft Bing Copilot, which combines web search results +#' with AI-generated responses. This makes it useful for queries that +#' benefit from current web information. +#' +#' @inheritParams ask_chatgpt +#' @return The generated search URL or an empty string. +#' #' @export -#' @section Bing Copilot Search: -#' The `ask_bing_copilot()` and `search_copilot()` functions both search -#' Microsoft Bing Copilot using: -#' `https://www.bing.com/search?showconv=1&sendquery=1&q=` +#' @family AI assistants +#' @examples +#' # Basic query +#' ask_bing_copilot("Latest R package for geospatial analysis") #' -#' Bing Copilot combines search results with AI-generated responses, making it -#' useful for queries that benefit from web information. +#' # Using a custom prompt +#' ask_bing_copilot("Write a function to calculate the median", +#' prompt = "Show multiple approaches:") ask_bing_copilot = ai_searcher("copilot") -#' @rdname search_genai +#' @rdname ask_bing_copilot #' @export ask_copilot = ask_bing_copilot -#' @rdname search_genai +#' Search with Meta AI +#' +#' Searches Meta AI, which provides general-purpose AI assistance +#' with a focus on conversational responses. +#' +#' @inheritParams ask_chatgpt +#' @return The generated search URL or an empty string. +#' #' @export -#' @section Meta AI Search: -#' The `ask_meta_ai()` function searches Meta AI using: -#' `https://www.meta.ai/?q=` +#' @family AI assistants +#' @examples +#' # Basic query +#' ask_meta_ai("What are the best R packages for visualization?") #' -#' Meta AI provides general-purpose AI assistance with a focus on conversational -#' responses. +#' # Using a custom prompt +#' ask_meta_ai("How to create a heatmap in R", +#' prompt = "Compare ggplot2 and base R approaches:") ask_meta_ai = ai_searcher("meta") ########################### End Search with Generative AI diff --git a/R/defunct-functions.R b/R/defunct-functions.R index 054841e..43d6f44 100644 --- a/R/defunct-functions.R +++ b/R/defunct-functions.R @@ -2,8 +2,13 @@ #' #' Functions listed below are no longer included in the `searcher` package #' -#' - [search_ixquick()]: The function binding was removed as the search engine +#' - `search_ixquick()`: The function binding was removed as the search engine #' name changed to "Startpage". Please use [search_startpage()]. #' +#' - `search_rstudio_community()`: The function binding was removed as the +#' company name changed to "Posit". Please use [search_posit_community()]. +#' +#' - `search_rscom()`: The function binding was removed as the +#' company name changed to "Posit". Please use [search_posit()]. #' @name searcher-defunct NULL diff --git a/R/search-functions.R b/R/search-functions.R index d069e34..d7558f2 100644 --- a/R/search-functions.R +++ b/R/search-functions.R @@ -4,10 +4,15 @@ #' up the resulting page in a web browser. #' #' @param site Name of site to search on. Supported options: -#' `"google"` (default), `"bing"`, `"duckduckgo"`, `"startpage"`, -#' `"qwant"`,`"posit community"`, `"brave"`, `"kagi"`, +#' `"google"` (default), `"bing"`, `"duckduckgo"` or `"ddg"`, +#' `"startpage"` (formerly `"ixquick"`) or `"sp"`, +#' `"qwant"`, `"rseek"`, `"brave"`, `"kagi"`, +#' `"posit community"` (formerly `"rstudio community"`) or `"posit"`, #' `"twitter"`, `"stackoverflow"`, -#' `"github"`, `"grep"`, and `"bitbucket"`. +#' `"github"`, `"grep"`, `"bitbucket"`, +#' `"chatgpt"`, `"claude"`, `"perplexity"`, +#' `"mistral"`, `"bing copilot"` or `"copilot"`, and +#' `"meta ai"` or `"meta"`. #' @param query Contents of string to search. Default is the error message. #' @param rlang Search for results written in R. Default is `TRUE` #' @param prompt Optional prompt prefix to add before your query to guide how the AI @@ -16,70 +21,10 @@ #' @return #' The generated search URL or an empty string. #' -#' @rdname search_site #' @export -#' @seealso [search_google()], [search_bing()], [search_duckduckgo()], -#' [search_startpage()], [search_rseek()], [search_qwant()], -#' [search_brave()], [search_kagi()], [search_twitter()], -#' [search_posit_community()], [search_stackoverflow()], -#' [search_github()], [search_grep()], [search_bitbucket()], and [searcher()] #' @examples #' # Search in a generic way #' search_site("r-project", "google") -#' -#' # Search Google -#' search_google("r-project") -#' -#' # Search Bing -#' search_bing("Microsoft R") -#' -#' # Search DuckDuckGo -#' search_duckduckgo("R language") -#' -#' # Search startpage -#' search_startpage("VS Code") -#' -#' # Search Rseek -#' search_rseek("searcher") -#' -#' # Search Qwant -#' search_qwant("Quarto") -#' -#' # Search Brave -#' search_brave("webR") -#' -#' # Search Posit Community -#' search_posit_community("RStudio IDE") -#' -#' # Search Twitter -#' search_twitter("searcher") -#' -#' # Search StackOverflow for Convolutions in the r tag -#' search_stackoverflow("convolutions") -#' -#' # Search all languages on StackOverflow for convolutions -#' search_stackoverflow("convolutions", rlang = FALSE) -#' -#' # Search GitHub Issues for bivariate normal in the language:r -#' search_github("bivariate normal") -#' -#' # Search all languages on GitHub Issues for bivariate normal -#' search_github("bivariate normal", rlang = FALSE) -#' -#' # Search R code on GitHub for numerical optimization -#' search_grep("optim") -#' -#' # Search all code on GitHub for numerical optimization -#' search_grep("optim", rlang = FALSE) -#' -#' # Search BitBucket for assertions -#' search_bitbucket("assertions") -#' -#' \dontrun{ -#' # On error, automatically search the message on google -#' options(error = searcher("google")) -#' options(error = search_google) -#' } search_site = function(query, site = c( "google", @@ -197,143 +142,225 @@ searcher = function(site, keyword = getOption("searcher.default_keyword")) { ########################### Start Search Engines -#' @rdname search_site -#' @export -#' @section Google Search: +#' Search Google +#' #' The `search_google` function searches [Google](https://www.google.com/) using: #' `https://www.google.com/search?q=` #' -#' See \url{https://moz.com/learn/seo/search-operators} -#' for details. +#' @inheritParams search_site +#' @return +#' The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search Google +#' search_google("r-project") +#' +#' \dontrun{ +#' # On error, automatically search the message on google +#' options(error = searcher("google")) +#' options(error = search_google) +#' } search_google = searcher("google") -#' @rdname search_site -#' @export -#' @section Bing Search: +#' Search Bing +#' #' The `search_bing()` function searches [Bing](https://www.bing.com/) using: #' `https://www.bing.com/search?q=` +#' +#' @inheritParams search_site +#' @return +#' The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search Bing +#' search_bing("Microsoft R") search_bing = searcher("bing") -#' @rdname search_site -#' @export -#' @section DuckDuckGo Search: +#' Search DuckDuckGo +#' #' The `search_duckduckgo()` and `search_ddg()` functions both search #' [DuckDuckGo](https://duckduckgo.com) using: `https://duckduckgo.com/?q=` +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search DuckDuckGo +#' search_duckduckgo("R language") search_duckduckgo = searcher("ddg") -#' @rdname search_site +#' @rdname search_duckduckgo #' @export search_ddg = search_duckduckgo - -#' @rdname search_site -#' @export -search_ixquick = function(query = geterrmessage(), rlang = TRUE) { - .Defunct(msg = "ixquick is now startpage, please use `search_startpage()`.") -} - -#' @rdname search_site -#' @export -#' @section Startpage Search: +#' Search Startpage +#' #' The `search_startpage()` function searches #' [startpage](https://startpage.com) using: -#' \code{https://startpage.com/do/dsearch?query=} +#' `https://startpage.com/do/dsearch?query=` +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search startpage +#' search_startpage("VS Code") search_startpage = searcher("sp") -#' @rdname search_site +#' @rdname search_startpage #' @export search_sp = search_startpage -#' @rdname search_site -#' @export -#' @section Ecosia Search: +#' Search Ecosia +#' #' The `search_ecosia()` function searches -#' Ecosia using: -#' \code{https://www.ecosia.org/search?q=} +#' Ecosia using: `https://www.ecosia.org/search?q=` #' -#' For additional details regarding Ecosia's -#' search interface please see: -#' \url{https://support.ecosia.org/article/657-installing-ecosia-on-your-desktop-device} +#' For additional details regarding Ecosia's search interface please see: +#' +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search Ecosia +#' search_ecosia("climate change R analysis") search_ecosia = searcher("ecosia") -#' @rdname search_site -#' @export -#' @section Rseek Search: +#' Search Rseek +#' #' The `search_rseek()` function searches [Rseek](https://rseek.org) using: #' `https://rseek.org/?q=` +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search Rseek +#' search_rseek("searcher") search_rseek = searcher("rseek") -#' @rdname search_site -#' @export -#' @section Qwant Search: +#' Search Qwant +#' #' The `search_qwant()` function searches #' Qwant using: `https://www.qwant.com/?q=` +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search Qwant +#' search_qwant("Quarto") search_qwant = searcher("qwant") -#' @rdname search_site -#' @export -#' @section Brave Search: +#' Search Brave +#' #' The `search_brave()` function searches #' Brave using: `https://search.brave.com/search?q=&source=web` +#' +#' @inheritParams search_site +#' @return +#' The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search Brave +#' search_brave("webR") search_brave = searcher("brave") -#' @rdname search_site -#' @export -#' @section Kagi Search: +#' Search Kagi +#' #' The `search_kagi()` function searches #' Kagi using: `https://kagi.com/search?q=` #' #' This is a paid search engine, and you will need to #' sign up for an account to use it. +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family search engines +#' @examples +#' # Search Kagi +#' search_kagi("advanced R programming") search_kagi = searcher("kagi") ########################### End Search Engines - ########################### Start Search Development Community Websites -#' @rdname search_site -#' @export -#' @section Posit Community Search: +#' Search Posit Community +#' #' The `search_posit_community()` and `search_posit()` functions both search #' [Posit Community](https://forum.posit.co/) using: -#' \code{https://forum.posit.co/search?q=} +#' `https://forum.posit.co/search?q=` #' #' For additional details regarding [Posit Community](https://forum.posit.co/)'s #' search interface please see the [Discourse](https://discourse.org) API documentation: -#' \url{https://docs.discourse.org/#tag/Search} +#' +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family community sites +#' @examples +#' # Search Posit Community +#' search_posit_community("RStudio IDE") search_posit_community = searcher("posit") -#' @rdname search_site +#' @rdname search_posit_community #' @export search_posit = search_posit_community -#' @rdname search_site -#' @export -#' @section Twitter Search: +#' Search Twitter +#' #' The `search_twitter()` functions search -#' Twitter using: -#' \code{https://twitter.com/search?q=} +#' Twitter using: `https://twitter.com/search?q=` #' #' For additional details regarding Twitter's #' search interface please see: -#' `https://help.twitter.com/en/using-x/x-advanced-search` +#' +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family community sites +#' @examples +#' # Search Twitter +#' search_twitter("searcher") search_twitter = searcher("twitter") -#' @rdname search_site -#' @export -#' @section StackOverflow Search: +#' Search StackOverflow +#' #' The `search_stackoverflow()` and `search_so()` functions both search #' [StackOverflow](https://stackoverflow.com) using: -#' \code{https://stackoverflow.com/search?q=\%5Br\%5D+} +#' `https://stackoverflow.com/search?q=\%5Br\%5D+` #' #' For additional details regarding [StackOverflow](https://stackoverflow.com)'s #' search interface please see: -#' `https://stackoverflow.com/help/searching` +#' +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family community sites +#' @examples +#' # Search StackOverflow for Convolutions in the r tag +#' search_stackoverflow("convolutions") +#' +#' # Search all languages on StackOverflow for convolutions +#' search_stackoverflow("convolutions", rlang = FALSE) search_stackoverflow = searcher("so") -#' @rdname search_site +#' @rdname search_stackoverflow #' @export search_so = search_stackoverflow @@ -341,48 +368,76 @@ search_so = search_stackoverflow ########################### Start Search Code Repos -#' @rdname search_site -#' @export -#' @section GitHub Search: +#' Search GitHub +#' #' The `search_github()` and `search_gh()` functions both search #' [GitHub](https://github.com) using: -#' \code{https://github.com/search?q=+language\%3Ar+type\%3Aissue&type=Issues} +#' `https://github.com/search?q=+language\%3Ar+type\%3Aissue&type=Issues` #' #' For additional details regarding [GitHub](https://github.com)'s #' search interface please see: #' #' and +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family code repositories +#' @examples +#' # Search GitHub Issues for bivariate normal in the language:r +#' search_github("bivariate normal") +#' +#' # Search all languages on GitHub Issues for bivariate normal +#' search_github("bivariate normal", rlang = FALSE) search_github = searcher("gh") -#' @rdname search_site +#' @rdname search_github #' @export search_gh = search_github -#' @rdname search_site -#' @export -#' @section grep.app Search: +#' Search Grep.app +#' #' The `search_grep()` function searches all public code on #' [GitHub](https://github.com) using [grep.app](https://grep.app) by #' querying: `https://grep.app/search?q=&filter[lang][0]=R` +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family code repositories +#' @examples +#' # Search R code on GitHub for numerical optimization +#' search_grep("optim") +#' +#' # Search all code on GitHub for numerical optimization +#' search_grep("optim", rlang = FALSE) search_grep = searcher("grep") -#' @rdname search_site -#' @export -#' @section BitBucket Search: +#' Search BitBucket +#' #' The `search_bitbucket()` and `search_bb()` functions both search #' [BitBucket](https://bitbucket.org) using: -#' \code{https://bitbucket.org/search?q=lang\%3Ar+} +#' `https://bitbucket.org/search?q=lang\%3Ar+` #' #' For additional details regarding [BitBucket](https://bitbucket.org)'s #' search interface please see: -#' \url{https://confluence.atlassian.com/bitbucket/code-search-in-bitbucket-873876782.html} +#' +#' +#' @inheritParams search_site +#' @return The generated search URL or an empty string. +#' @export +#' @family code repositories +#' @examples +#' # Search BitBucket for assertions +#' search_bitbucket("assertions") +#' +#' # Search all languages on BitBucket for assertions +#' search_bitbucket("assertions", rlang = FALSE) search_bitbucket = searcher("bb") -#' @rdname search_site +#' @rdname search_bitbucket #' @export search_bb = search_bitbucket ########################### End Search Code Repos - - diff --git a/README.Rmd b/README.Rmd index 14b22e0..b2da912 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,8 +12,7 @@ knitr::opts_chunk$set( ) ``` -# searcher A hexagonal logo for searcher - +# searcher A hexagonal logo for searcher [![R-CMD-check](https://github.com/coatless-rpkg/searcher/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/coatless-rpkg/searcher/actions/workflows/R-CMD-check.yaml) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/searcher)](https://www.r-pkg.org/pkg/searcher) @@ -24,10 +23,12 @@ The goal of `searcher` is to provide a search interface directly inside of _R_. For example, to look up `rcpp example numeric vector` or `ggplot2 fix axis labels` call one of the `search_*()` functions to automatically have a web browser open, go to a search site, and type the query. -`searcher` also provides direct integration with AI assistants, allowing you to send queries to ChatGPT, Claude, and other AI services with R-optimized prompts. +`searcher` also provides direct integration with AI assistants, allowing you to +send queries to ChatGPT, Claude, and other AI services with R-optimized prompts. By default, the search functions will attempt to search the last error on call if no query is specified. -![](https://i.imgur.com/Zq2rg6G.gif) + +![Example workflow of searching and asking AI assistants questions from R.](https://i.imgur.com/Zq2rg6G.gif) ## Installation diff --git a/README.md b/README.md index fd3e96c..cc22053 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,13 @@ query. `searcher` also provides direct integration with AI assistants, allowing you to send queries to ChatGPT, Claude, and other AI services with R-optimized prompts. By default, the search functions will attempt to search the last error on call if no query is specified. -![](https://i.imgur.com/Zq2rg6G.gif) + +
+ + +
## Installation diff --git a/_pkgdown.yml b/_pkgdown.yml index 0d55f7b..5d5c8f2 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -2,10 +2,126 @@ url: https://r-pkg.thecoatlessprofessor.com/searcher authors: "James Balamuta": - href: https://thecoatlessprofessor.com - -development: - mode: auto + href: https://blog.thecoatlessprofessor.com home: strip_header: true + title: searcher - Search from R + description: > + Provides a search interface directly inside of R. Opens a web browser with + the query for various search engines, code repositories, and developer communities. + Also includes AI assistant integration for ChatGPT, Claude, and other services. + +template: + bootstrap: 5 + bootswatch: flatly + +navbar: + structure: + left: [intro, reference, articles, news] + right: [github] + components: + intro: + text: Get started + href: articles/search-patterns.html + articles: + text: Articles + menu: + - text: "Search Patterns" + href: articles/search-patterns.html + - text: "Search with AI Assistants" + href: articles/search-with-ai-assistants.html + - text: "Managing AI Prompts in `searcher`" + href: articles/managing-ai-prompts.html + reference: + text: Reference + href: reference/index.html + github: + icon: fab fa-github fa-lg + aria-label: View on GitHub + href: https://github.com/coatless-rpkg/searcher + +reference: + - title: "Search Engines" + desc: > + Functions to search general search engines + contents: + - search_google + - search_bing + - search_duckduckgo + - search_ddg + - search_startpage + - search_sp + - search_ecosia + - search_rseek + - search_qwant + - search_brave + - search_kagi + - search_site + + - title: "AI Assistants" + desc: > + Functions to interact with AI assistants + contents: + - ask_chatgpt + - ask_claude + - ask_perplexity + - ask_mistral + - ask_bing_copilot + - ask_copilot + - ask_meta_ai + + - title: "Community Sites" + desc: > + Functions to search developer communities + contents: + - search_stackoverflow + - search_so + - search_posit_community + - search_posit + - search_twitter + + - title: "Code Repositories" + desc: > + Functions to search code repositories + contents: + - search_github + - search_gh + - search_grep + - search_bitbucket + - search_bb + + - title: "AI Prompt Management" + desc: > + Functions to manage AI prompts + contents: + - ai_prompt + - ai_prompt_active + - ai_prompt_list + - ai_prompt_register + - ai_prompt_remove + - ai_prompt_clear + - ai_prompt_management + + - title: "Helper Functions" + desc: > + General utility functions + contents: + - searcher + + - title: "Package Options and Details" + desc: > + Package configuration options and function deprecation details + contents: + - "searcher-package" + - "searcher-defunct" + + +footer: + structure: + left: developed_by + right: [built_with, legal] + components: + legal: Distributed under GPL (>= 2) license. + built_with: Built with pkgdown. + diff --git a/man/ask_bing_copilot.Rd b/man/ask_bing_copilot.Rd new file mode 100644 index 0000000..2e16d8a --- /dev/null +++ b/man/ask_bing_copilot.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ai-search-functions.R +\name{ask_bing_copilot} +\alias{ask_bing_copilot} +\alias{ask_copilot} +\title{Search with Bing Copilot} +\usage{ +ask_bing_copilot(query = geterrmessage(), prompt = NULL) + +ask_copilot(query = geterrmessage(), prompt = NULL) +} +\arguments{ +\item{query}{Contents of string to send to ChatGPT. Default is the last error message.} + +\item{prompt}{Optional prompt prefix to add before your query to guide how ChatGPT +responds. If NULL, uses the service-specific default prompt option.} +} +\value{ +The generated search URL or an empty string. +} +\description{ +Searches Microsoft Bing Copilot, which combines web search results +with AI-generated responses. This makes it useful for queries that +benefit from current web information. +} +\examples{ +# Basic query +ask_bing_copilot("Latest R package for geospatial analysis") + +# Using a custom prompt +ask_bing_copilot("Write a function to calculate the median", + prompt = "Show multiple approaches:") +} +\seealso{ +Other AI assistants: +\code{\link{ask_chatgpt}()}, +\code{\link{ask_claude}()}, +\code{\link{ask_meta_ai}()}, +\code{\link{ask_mistral}()}, +\code{\link{ask_perplexity}()} +} +\concept{AI assistants} diff --git a/man/ask_chatgpt.Rd b/man/ask_chatgpt.Rd new file mode 100644 index 0000000..7e4c5db --- /dev/null +++ b/man/ask_chatgpt.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ai-search-functions.R +\name{ask_chatgpt} +\alias{ask_chatgpt} +\title{Search with ChatGPT} +\usage{ +ask_chatgpt(query = geterrmessage(), prompt = NULL) +} +\arguments{ +\item{query}{Contents of string to send to ChatGPT. Default is the last error message.} + +\item{prompt}{Optional prompt prefix to add before your query to guide how ChatGPT +responds. If NULL, uses the service-specific default prompt option.} +} +\value{ +The generated search URL or an empty string. +} +\description{ +Opens a browser with OpenAI's ChatGPT interface and your query. +This function allows you to ask questions, get code help, +or search for information using ChatGPT. +} +\examples{ +# Basic query +ask_chatgpt("How to join two dataframes in R?") + +# Using a custom prompt +ask_chatgpt("Error: object 'mtcrs' not found", + prompt = "Debug this error step by step:") + +# Searching the last error +\dontrun{ +tryCatch( + median("not a number"), + error = function(e) ask_chatgpt() +) +} +} +\seealso{ +Other AI assistants: +\code{\link{ask_bing_copilot}()}, +\code{\link{ask_claude}()}, +\code{\link{ask_meta_ai}()}, +\code{\link{ask_mistral}()}, +\code{\link{ask_perplexity}()} +} +\concept{AI assistants} diff --git a/man/ask_claude.Rd b/man/ask_claude.Rd new file mode 100644 index 0000000..2010881 --- /dev/null +++ b/man/ask_claude.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ai-search-functions.R +\name{ask_claude} +\alias{ask_claude} +\title{Search with Claude} +\usage{ +ask_claude(query = geterrmessage(), prompt = NULL) +} +\arguments{ +\item{query}{Contents of string to send to ChatGPT. Default is the last error message.} + +\item{prompt}{Optional prompt prefix to add before your query to guide how ChatGPT +responds. If NULL, uses the service-specific default prompt option.} +} +\value{ +The generated search URL or an empty string. +} +\description{ +Opens Anthropic's Claude AI assistant with your query. +Claude can provide thorough answers to complex questions +and offers excellent code explanations. +} +\examples{ +# Basic query +ask_claude("Explain what purrr::map_df does") + +# Using a custom prompt +ask_claude("Compare tidyr::pivot_wider vs tidyr::spread", + prompt = "Provide examples of when to use each:") +} +\seealso{ +Other AI assistants: +\code{\link{ask_bing_copilot}()}, +\code{\link{ask_chatgpt}()}, +\code{\link{ask_meta_ai}()}, +\code{\link{ask_mistral}()}, +\code{\link{ask_perplexity}()} +} +\concept{AI assistants} diff --git a/man/ask_meta_ai.Rd b/man/ask_meta_ai.Rd new file mode 100644 index 0000000..84b795d --- /dev/null +++ b/man/ask_meta_ai.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ai-search-functions.R +\name{ask_meta_ai} +\alias{ask_meta_ai} +\title{Search with Meta AI} +\usage{ +ask_meta_ai(query = geterrmessage(), prompt = NULL) +} +\arguments{ +\item{query}{Contents of string to send to ChatGPT. Default is the last error message.} + +\item{prompt}{Optional prompt prefix to add before your query to guide how ChatGPT +responds. If NULL, uses the service-specific default prompt option.} +} +\value{ +The generated search URL or an empty string. +} +\description{ +Searches Meta AI, which provides general-purpose AI assistance +with a focus on conversational responses. +} +\examples{ +# Basic query +ask_meta_ai("What are the best R packages for visualization?") + +# Using a custom prompt +ask_meta_ai("How to create a heatmap in R", + prompt = "Compare ggplot2 and base R approaches:") +} +\seealso{ +Other AI assistants: +\code{\link{ask_bing_copilot}()}, +\code{\link{ask_chatgpt}()}, +\code{\link{ask_claude}()}, +\code{\link{ask_mistral}()}, +\code{\link{ask_perplexity}()} +} +\concept{AI assistants} diff --git a/man/ask_mistral.Rd b/man/ask_mistral.Rd new file mode 100644 index 0000000..2e6d4f5 --- /dev/null +++ b/man/ask_mistral.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ai-search-functions.R +\name{ask_mistral} +\alias{ask_mistral} +\title{Search with Mistral AI} +\usage{ +ask_mistral(query = geterrmessage(), prompt = NULL) +} +\arguments{ +\item{query}{Contents of string to send to ChatGPT. Default is the last error message.} + +\item{prompt}{Optional prompt prefix to add before your query to guide how ChatGPT +responds. If NULL, uses the service-specific default prompt option.} +} +\value{ +The generated search URL or an empty string. +} +\description{ +Launches Mistral AI with your query. Mistral is known for +its strong reasoning capabilities and efficiency. +} +\examples{ +# Basic query +ask_mistral("How to handle missing data in R?") + +# Using a custom prompt +ask_mistral("Fix this code: ggplot(mtcars, aes(x=mpg, y=hp) + geom_point()", + prompt = "Explain the error and fix it:") +} +\seealso{ +Other AI assistants: +\code{\link{ask_bing_copilot}()}, +\code{\link{ask_chatgpt}()}, +\code{\link{ask_claude}()}, +\code{\link{ask_meta_ai}()}, +\code{\link{ask_perplexity}()} +} +\concept{AI assistants} diff --git a/man/ask_perplexity.Rd b/man/ask_perplexity.Rd new file mode 100644 index 0000000..49e751c --- /dev/null +++ b/man/ask_perplexity.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ai-search-functions.R +\name{ask_perplexity} +\alias{ask_perplexity} +\title{Search with Perplexity} +\usage{ +ask_perplexity(query = geterrmessage(), prompt = NULL) +} +\arguments{ +\item{query}{Contents of string to send to ChatGPT. Default is the last error message.} + +\item{prompt}{Optional prompt prefix to add before your query to guide how ChatGPT +responds. If NULL, uses the service-specific default prompt option.} +} +\value{ +The generated search URL or an empty string. +} +\description{ +Searches with Perplexity AI, which provides answers with +citations to sources. This makes it particularly +useful for research-oriented queries. +} +\examples{ +# Basic query +ask_perplexity("Compare dplyr vs data.table") + +# Using a custom prompt +ask_perplexity("Best packages for time series in R", + prompt = "Provide citations and compare performance:") +} +\seealso{ +Other AI assistants: +\code{\link{ask_bing_copilot}()}, +\code{\link{ask_chatgpt}()}, +\code{\link{ask_claude}()}, +\code{\link{ask_meta_ai}()}, +\code{\link{ask_mistral}()} +} +\concept{AI assistants} diff --git a/man/search_bing.Rd b/man/search_bing.Rd new file mode 100644 index 0000000..62b448b --- /dev/null +++ b/man/search_bing.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_bing} +\alias{search_bing} +\title{Search Bing} +\usage{ +search_bing(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_bing()} function searches \href{https://www.bing.com/}{Bing} using: +\verb{https://www.bing.com/search?q=} +} +\examples{ +# Search Bing +search_bing("Microsoft R") +} +\seealso{ +Other search engines: +\code{\link{search_brave}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_google}()}, +\code{\link{search_kagi}()}, +\code{\link{search_qwant}()}, +\code{\link{search_rseek}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_bitbucket.Rd b/man/search_bitbucket.Rd new file mode 100644 index 0000000..6b129fc --- /dev/null +++ b/man/search_bitbucket.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_bitbucket} +\alias{search_bitbucket} +\alias{search_bb} +\title{Search BitBucket} +\usage{ +search_bitbucket(query = geterrmessage(), rlang = TRUE) + +search_bb(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_bitbucket()} and \code{search_bb()} functions both search +\href{https://bitbucket.org}{BitBucket} using: +\verb{https://bitbucket.org/search?q=lang\\\%3Ar+} +} +\details{ +For additional details regarding \href{https://bitbucket.org}{BitBucket}'s +search interface please see: +\url{https://confluence.atlassian.com/bitbucket/code-search-in-bitbucket-873876782.html} +} +\examples{ +# Search BitBucket for assertions +search_bitbucket("assertions") + +# Search all languages on BitBucket for assertions +search_bitbucket("assertions", rlang = FALSE) +} +\seealso{ +Other code repositories: +\code{\link{search_github}()}, +\code{\link{search_grep}()} +} +\concept{code repositories} diff --git a/man/search_brave.Rd b/man/search_brave.Rd new file mode 100644 index 0000000..6537617 --- /dev/null +++ b/man/search_brave.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_brave} +\alias{search_brave} +\title{Search Brave} +\usage{ +search_brave(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_brave()} function searches +Brave using: \verb{https://search.brave.com/search?q=&source=web} +} +\examples{ +# Search Brave +search_brave("webR") +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_google}()}, +\code{\link{search_kagi}()}, +\code{\link{search_qwant}()}, +\code{\link{search_rseek}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_duckduckgo.Rd b/man/search_duckduckgo.Rd new file mode 100644 index 0000000..83b42d7 --- /dev/null +++ b/man/search_duckduckgo.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_duckduckgo} +\alias{search_duckduckgo} +\alias{search_ddg} +\title{Search DuckDuckGo} +\usage{ +search_duckduckgo(query = geterrmessage(), rlang = TRUE) + +search_ddg(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_duckduckgo()} and \code{search_ddg()} functions both search +\href{https://duckduckgo.com}{DuckDuckGo} using: \verb{https://duckduckgo.com/?q=} +} +\examples{ +# Search DuckDuckGo +search_duckduckgo("R language") +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_brave}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_google}()}, +\code{\link{search_kagi}()}, +\code{\link{search_qwant}()}, +\code{\link{search_rseek}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_ecosia.Rd b/man/search_ecosia.Rd new file mode 100644 index 0000000..474f4ab --- /dev/null +++ b/man/search_ecosia.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_ecosia} +\alias{search_ecosia} +\title{Search Ecosia} +\usage{ +search_ecosia(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_ecosia()} function searches +Ecosia using: \verb{https://www.ecosia.org/search?q=} +} +\details{ +For additional details regarding Ecosia's search interface please see: +\url{https://support.ecosia.org/article/657-installing-ecosia-on-your-desktop-device} +} +\examples{ +# Search Ecosia +search_ecosia("climate change R analysis") +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_brave}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_google}()}, +\code{\link{search_kagi}()}, +\code{\link{search_qwant}()}, +\code{\link{search_rseek}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_genai.Rd b/man/search_genai.Rd deleted file mode 100644 index 9d20fcd..0000000 --- a/man/search_genai.Rd +++ /dev/null @@ -1,125 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/ai-search-functions.R -\name{ask_chatgpt} -\alias{ask_chatgpt} -\alias{ask_claude} -\alias{ask_perplexity} -\alias{ask_mistral} -\alias{ask_bing_copilot} -\alias{ask_copilot} -\alias{ask_meta_ai} -\title{Search Generative AI Services from R} -\usage{ -ask_chatgpt(query = geterrmessage(), prompt = NULL) - -ask_claude(query = geterrmessage(), prompt = NULL) - -ask_perplexity(query = geterrmessage(), prompt = NULL) - -ask_mistral(query = geterrmessage(), prompt = NULL) - -ask_bing_copilot(query = geterrmessage(), prompt = NULL) - -ask_copilot(query = geterrmessage(), prompt = NULL) - -ask_meta_ai(query = geterrmessage(), prompt = NULL) -} -\arguments{ -\item{query}{Contents of string to send to the AI. Default is the last error message.} - -\item{prompt}{Optional prompt prefix to add before your query to guide how the AI -responds. If NULL, uses the service-specific default prompt option.} -} -\value{ -The generated search URL or an empty string. -} -\description{ -Opens a browser to query various generative AI assistants directly from R. -These functions allow you to ask questions, get code help, or search for information -using popular AI services. -} -\section{ChatGPT Search}{ - -The \code{ask_chatgpt()} function opens a browser with OpenAI's ChatGPT interface and your query using: -\verb{https://chat.openai.com/?model=auto&q=} - -You can customize the AI's behavior by setting a prompt prefix through: -\enumerate{ -\item The \code{prompt} parameter for per-call customization -\item The \code{options(searcher.chatgpt_prompt = "...")} setting for persistent customization -} -} - -\section{Claude Search}{ - -The \code{ask_claude()} function opens Anthropic's Claude AI assistant with your query using: -\verb{https://claude.ai/new?q=} - -Claude can be directed to respond in specific ways by using the prompt parameter or by -setting a default prompt via \code{options()}. -} - -\section{Perplexity Search}{ - -The \code{ask_perplexity()} function searches with Perplexity AI using: -\verb{https://www.perplexity.ai/search?q=&focus=internet&copilot=false} - -Perplexity AI provides answers with citations to sources, making it particularly -useful for research-oriented queries. -} - -\section{Mistral Search}{ - -The \code{ask_mistral()} function launches Mistral AI with your query using: -\verb{https://chat.mistral.ai/chat?q=} - -The default prompt can be customized through the \code{searcher.mistral_prompt} option. -} - -\section{Bing Copilot Search}{ - -The \code{ask_bing_copilot()} and \code{search_copilot()} functions both search -Microsoft Bing Copilot using: -\verb{https://www.bing.com/search?showconv=1&sendquery=1&q=} - -Bing Copilot combines search results with AI-generated responses, making it -useful for queries that benefit from web information. -} - -\section{Meta AI Search}{ - -The \code{ask_meta_ai()} function searches Meta AI using: -\verb{https://www.meta.ai/?q=} - -Meta AI provides general-purpose AI assistance with a focus on conversational -responses. -} - -\examples{ -\dontrun{ -# Basic AI queries -ask_chatgpt("How to join two dataframes in R?") -ask_claude("Explain what purrr::map_df does") -ask_perplexity("Compare dplyr vs data.table") - -# Using custom prompts -ask_mistral("Find bug: ggplot(mtcars, aes(x=mpg, y=hp) + geom_point()", - prompt = "Debug this code step by step:") - -# Searching the last error -tryCatch( - median("not a number"), - error = function(e) ask_chatgpt() -) - -# Setting default prompts -options( - searcher.chatgpt_prompt = "You are an R viz expert. Help with:", - searcher.claude_prompt = "As an R statistics expert, answer:" -) -} - -} -\seealso{ -\code{\link[=search_site]{search_site()}} -} diff --git a/man/search_github.Rd b/man/search_github.Rd new file mode 100644 index 0000000..a73d819 --- /dev/null +++ b/man/search_github.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_github} +\alias{search_github} +\alias{search_gh} +\title{Search GitHub} +\usage{ +search_github(query = geterrmessage(), rlang = TRUE) + +search_gh(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_github()} and \code{search_gh()} functions both search +\href{https://github.com}{GitHub} using: +\verb{https://github.com/search?q=+language\\\%3Ar+type\\\%3Aissue&type=Issues} +} +\details{ +For additional details regarding \href{https://github.com}{GitHub}'s +search interface please see: +\url{https://docs.github.com/en/enterprise-cloud@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github} +and \url{https://docs.github.com/en/search-github/searching-on-github/searching-code/} +} +\examples{ +# Search GitHub Issues for bivariate normal in the language:r +search_github("bivariate normal") + +# Search all languages on GitHub Issues for bivariate normal +search_github("bivariate normal", rlang = FALSE) +} +\seealso{ +Other code repositories: +\code{\link{search_bitbucket}()}, +\code{\link{search_grep}()} +} +\concept{code repositories} diff --git a/man/search_google.Rd b/man/search_google.Rd new file mode 100644 index 0000000..c09e00a --- /dev/null +++ b/man/search_google.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_google} +\alias{search_google} +\title{Search Google} +\usage{ +search_google(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_google} function searches \href{https://www.google.com/}{Google} using: +\verb{https://www.google.com/search?q=} +} +\examples{ +# Search Google +search_google("r-project") + +\dontrun{ +# On error, automatically search the message on google +options(error = searcher("google")) +options(error = search_google) +} +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_brave}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_kagi}()}, +\code{\link{search_qwant}()}, +\code{\link{search_rseek}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_grep.Rd b/man/search_grep.Rd new file mode 100644 index 0000000..7103c76 --- /dev/null +++ b/man/search_grep.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_grep} +\alias{search_grep} +\title{Search Grep.app} +\usage{ +search_grep(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_grep()} function searches all public code on +\href{https://github.com}{GitHub} using \href{https://grep.app}{grep.app} by +querying: \verb{https://grep.app/search?q=&filter[lang][0]=R} +} +\examples{ +# Search R code on GitHub for numerical optimization +search_grep("optim") + +# Search all code on GitHub for numerical optimization +search_grep("optim", rlang = FALSE) +} +\seealso{ +Other code repositories: +\code{\link{search_bitbucket}()}, +\code{\link{search_github}()} +} +\concept{code repositories} diff --git a/man/search_kagi.Rd b/man/search_kagi.Rd new file mode 100644 index 0000000..d30cf9b --- /dev/null +++ b/man/search_kagi.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_kagi} +\alias{search_kagi} +\title{Search Kagi} +\usage{ +search_kagi(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_kagi()} function searches +Kagi using: \verb{https://kagi.com/search?q=} +} +\details{ +This is a paid search engine, and you will need to +sign up for an account to use it. +} +\examples{ +# Search Kagi +search_kagi("advanced R programming") +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_brave}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_google}()}, +\code{\link{search_qwant}()}, +\code{\link{search_rseek}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_posit_community.Rd b/man/search_posit_community.Rd new file mode 100644 index 0000000..2263b07 --- /dev/null +++ b/man/search_posit_community.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_posit_community} +\alias{search_posit_community} +\alias{search_posit} +\title{Search Posit Community} +\usage{ +search_posit_community(query = geterrmessage(), rlang = TRUE) + +search_posit(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_posit_community()} and \code{search_posit()} functions both search +\href{https://forum.posit.co/}{Posit Community} using: +\verb{https://forum.posit.co/search?q=} +} +\details{ +For additional details regarding \href{https://forum.posit.co/}{Posit Community}'s +search interface please see the \href{https://discourse.org}{Discourse} API documentation: +\url{https://docs.discourse.org/#tag/Search} +} +\examples{ +# Search Posit Community +search_posit_community("RStudio IDE") +} +\seealso{ +Other community sites: +\code{\link{search_stackoverflow}()}, +\code{\link{search_twitter}()} +} +\concept{community sites} diff --git a/man/search_qwant.Rd b/man/search_qwant.Rd new file mode 100644 index 0000000..f37b57a --- /dev/null +++ b/man/search_qwant.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_qwant} +\alias{search_qwant} +\title{Search Qwant} +\usage{ +search_qwant(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_qwant()} function searches +Qwant using: \verb{https://www.qwant.com/?q=} +} +\examples{ +# Search Qwant +search_qwant("Quarto") +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_brave}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_google}()}, +\code{\link{search_kagi}()}, +\code{\link{search_rseek}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_rseek.Rd b/man/search_rseek.Rd new file mode 100644 index 0000000..f5f87b6 --- /dev/null +++ b/man/search_rseek.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_rseek} +\alias{search_rseek} +\title{Search Rseek} +\usage{ +search_rseek(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_rseek()} function searches \href{https://rseek.org}{Rseek} using: +\verb{https://rseek.org/?q=} +} +\examples{ +# Search Rseek +search_rseek("searcher") +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_brave}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_google}()}, +\code{\link{search_kagi}()}, +\code{\link{search_qwant}()}, +\code{\link{search_startpage}()} +} +\concept{search engines} diff --git a/man/search_site.Rd b/man/search_site.Rd index 5496ee2..727a7bc 100644 --- a/man/search_site.Rd +++ b/man/search_site.Rd @@ -2,28 +2,6 @@ % Please edit documentation in R/search-functions.R \name{search_site} \alias{search_site} -\alias{search_google} -\alias{search_bing} -\alias{search_duckduckgo} -\alias{search_ddg} -\alias{search_ixquick} -\alias{search_startpage} -\alias{search_sp} -\alias{search_ecosia} -\alias{search_rseek} -\alias{search_qwant} -\alias{search_brave} -\alias{search_kagi} -\alias{search_posit_community} -\alias{search_posit} -\alias{search_twitter} -\alias{search_stackoverflow} -\alias{search_so} -\alias{search_github} -\alias{search_gh} -\alias{search_grep} -\alias{search_bitbucket} -\alias{search_bb} \title{Search a Query on a Search Portal in a Web Browser} \usage{ search_site( @@ -35,59 +13,20 @@ search_site( rlang = TRUE, prompt = NULL ) - -search_google(query = geterrmessage(), rlang = TRUE) - -search_bing(query = geterrmessage(), rlang = TRUE) - -search_duckduckgo(query = geterrmessage(), rlang = TRUE) - -search_ddg(query = geterrmessage(), rlang = TRUE) - -search_ixquick(query = geterrmessage(), rlang = TRUE) - -search_startpage(query = geterrmessage(), rlang = TRUE) - -search_sp(query = geterrmessage(), rlang = TRUE) - -search_ecosia(query = geterrmessage(), rlang = TRUE) - -search_rseek(query = geterrmessage(), rlang = TRUE) - -search_qwant(query = geterrmessage(), rlang = TRUE) - -search_brave(query = geterrmessage(), rlang = TRUE) - -search_kagi(query = geterrmessage(), rlang = TRUE) - -search_posit_community(query = geterrmessage(), rlang = TRUE) - -search_posit(query = geterrmessage(), rlang = TRUE) - -search_twitter(query = geterrmessage(), rlang = TRUE) - -search_stackoverflow(query = geterrmessage(), rlang = TRUE) - -search_so(query = geterrmessage(), rlang = TRUE) - -search_github(query = geterrmessage(), rlang = TRUE) - -search_gh(query = geterrmessage(), rlang = TRUE) - -search_grep(query = geterrmessage(), rlang = TRUE) - -search_bitbucket(query = geterrmessage(), rlang = TRUE) - -search_bb(query = geterrmessage(), rlang = TRUE) } \arguments{ \item{query}{Contents of string to search. Default is the error message.} \item{site}{Name of site to search on. Supported options: -\code{"google"} (default), \code{"bing"}, \code{"duckduckgo"}, \code{"startpage"}, -\code{"qwant"},\code{"posit community"}, \code{"brave"}, \code{"kagi"}, +\code{"google"} (default), \code{"bing"}, \code{"duckduckgo"} or \code{"ddg"}, +\code{"startpage"} (formerly \code{"ixquick"}) or \code{"sp"}, +\code{"qwant"}, \code{"rseek"}, \code{"brave"}, \code{"kagi"}, +\code{"posit community"} (formerly \code{"rstudio community"}) or \code{"posit"}, \code{"twitter"}, \code{"stackoverflow"}, -\code{"github"}, \code{"grep"}, and \code{"bitbucket"}.} +\code{"github"}, \code{"grep"}, \code{"bitbucket"}, +\code{"chatgpt"}, \code{"claude"}, \code{"perplexity"}, +\code{"mistral"}, \code{"bing copilot"} or \code{"copilot"}, and +\code{"meta ai"} or \code{"meta"}.} \item{rlang}{Search for results written in R. Default is \code{TRUE}} @@ -101,197 +40,7 @@ The generated search URL or an empty string. Creates an appropriate query string for a search engine and then opens up the resulting page in a web browser. } -\section{Google Search}{ - -The \code{search_google} function searches \href{https://www.google.com/}{Google} using: -\verb{https://www.google.com/search?q=} - -See \url{https://moz.com/learn/seo/search-operators} -for details. -} - -\section{Bing Search}{ - -The \code{search_bing()} function searches \href{https://www.bing.com/}{Bing} using: -\verb{https://www.bing.com/search?q=} -} - -\section{DuckDuckGo Search}{ - -The \code{search_duckduckgo()} and \code{search_ddg()} functions both search -\href{https://duckduckgo.com}{DuckDuckGo} using: \verb{https://duckduckgo.com/?q=} -} - -\section{Startpage Search}{ - -The \code{search_startpage()} function searches -\href{https://startpage.com}{startpage} using: -\code{https://startpage.com/do/dsearch?query=} -} - -\section{Ecosia Search}{ - -The \code{search_ecosia()} function searches -Ecosia using: -\code{https://www.ecosia.org/search?q=} - -For additional details regarding Ecosia's -search interface please see: -\url{https://support.ecosia.org/article/657-installing-ecosia-on-your-desktop-device} -} - -\section{Rseek Search}{ - -The \code{search_rseek()} function searches \href{https://rseek.org}{Rseek} using: -\verb{https://rseek.org/?q=} -} - -\section{Qwant Search}{ - -The \code{search_qwant()} function searches -Qwant using: \verb{https://www.qwant.com/?q=} -} - -\section{Brave Search}{ - -The \code{search_brave()} function searches -Brave using: \verb{https://search.brave.com/search?q=&source=web} -} - -\section{Kagi Search}{ - -The \code{search_kagi()} function searches -Kagi using: \verb{https://kagi.com/search?q=} - -This is a paid search engine, and you will need to -sign up for an account to use it. -} - -\section{Posit Community Search}{ - -The \code{search_posit_community()} and \code{search_posit()} functions both search -\href{https://forum.posit.co/}{Posit Community} using: -\code{https://forum.posit.co/search?q=} - -For additional details regarding \href{https://forum.posit.co/}{Posit Community}'s -search interface please see the \href{https://discourse.org}{Discourse} API documentation: -\url{https://docs.discourse.org/#tag/Search} -} - -\section{Twitter Search}{ - -The \code{search_twitter()} functions search -Twitter using: -\code{https://twitter.com/search?q=} - -For additional details regarding Twitter's -search interface please see: -\verb{https://help.twitter.com/en/using-x/x-advanced-search} -} - -\section{StackOverflow Search}{ - -The \code{search_stackoverflow()} and \code{search_so()} functions both search -\href{https://stackoverflow.com}{StackOverflow} using: -\code{https://stackoverflow.com/search?q=\%5Br\%5D+} - -For additional details regarding \href{https://stackoverflow.com}{StackOverflow}'s -search interface please see: -\verb{https://stackoverflow.com/help/searching} -} - -\section{GitHub Search}{ - -The \code{search_github()} and \code{search_gh()} functions both search -\href{https://github.com}{GitHub} using: -\code{https://github.com/search?q=+language\%3Ar+type\%3Aissue&type=Issues} - -For additional details regarding \href{https://github.com}{GitHub}'s -search interface please see: -\url{https://docs.github.com/en/enterprise-cloud@latest/search-github/getting-started-with-searching-on-github/about-searching-on-github} -and \url{https://docs.github.com/en/search-github/searching-on-github/searching-code/} -} - -\section{grep.app Search}{ - -The \code{search_grep()} function searches all public code on -\href{https://github.com}{GitHub} using \href{https://grep.app}{grep.app} by -querying: \verb{https://grep.app/search?q=&filter[lang][0]=R} -} - -\section{BitBucket Search}{ - -The \code{search_bitbucket()} and \code{search_bb()} functions both search -\href{https://bitbucket.org}{BitBucket} using: -\code{https://bitbucket.org/search?q=lang\%3Ar+} - -For additional details regarding \href{https://bitbucket.org}{BitBucket}'s -search interface please see: -\url{https://confluence.atlassian.com/bitbucket/code-search-in-bitbucket-873876782.html} -} - \examples{ # Search in a generic way search_site("r-project", "google") - -# Search Google -search_google("r-project") - -# Search Bing -search_bing("Microsoft R") - -# Search DuckDuckGo -search_duckduckgo("R language") - -# Search startpage -search_startpage("VS Code") - -# Search Rseek -search_rseek("searcher") - -# Search Qwant -search_qwant("Quarto") - -# Search Brave -search_brave("webR") - -# Search Posit Community -search_posit_community("RStudio IDE") - -# Search Twitter -search_twitter("searcher") - -# Search StackOverflow for Convolutions in the r tag -search_stackoverflow("convolutions") - -# Search all languages on StackOverflow for convolutions -search_stackoverflow("convolutions", rlang = FALSE) - -# Search GitHub Issues for bivariate normal in the language:r -search_github("bivariate normal") - -# Search all languages on GitHub Issues for bivariate normal -search_github("bivariate normal", rlang = FALSE) - -# Search R code on GitHub for numerical optimization -search_grep("optim") - -# Search all code on GitHub for numerical optimization -search_grep("optim", rlang = FALSE) - -# Search BitBucket for assertions -search_bitbucket("assertions") - -\dontrun{ -# On error, automatically search the message on google -options(error = searcher("google")) -options(error = search_google) -} -} -\seealso{ -\code{\link[=search_google]{search_google()}}, \code{\link[=search_bing]{search_bing()}}, \code{\link[=search_duckduckgo]{search_duckduckgo()}}, -\code{\link[=search_startpage]{search_startpage()}}, \code{\link[=search_rseek]{search_rseek()}}, \code{\link[=search_qwant]{search_qwant()}}, -\code{\link[=search_brave]{search_brave()}}, \code{\link[=search_kagi]{search_kagi()}}, \code{\link[=search_twitter]{search_twitter()}}, -\code{\link[=search_posit_community]{search_posit_community()}}, \code{\link[=search_stackoverflow]{search_stackoverflow()}}, -\code{\link[=search_github]{search_github()}}, \code{\link[=search_grep]{search_grep()}}, \code{\link[=search_bitbucket]{search_bitbucket()}}, and \code{\link[=searcher]{searcher()}} } diff --git a/man/search_stackoverflow.Rd b/man/search_stackoverflow.Rd new file mode 100644 index 0000000..e97ce2a --- /dev/null +++ b/man/search_stackoverflow.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_stackoverflow} +\alias{search_stackoverflow} +\alias{search_so} +\title{Search StackOverflow} +\usage{ +search_stackoverflow(query = geterrmessage(), rlang = TRUE) + +search_so(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_stackoverflow()} and \code{search_so()} functions both search +\href{https://stackoverflow.com}{StackOverflow} using: +\verb{https://stackoverflow.com/search?q=\\\%5Br\\\%5D+} +} +\details{ +For additional details regarding \href{https://stackoverflow.com}{StackOverflow}'s +search interface please see: +\url{https://stackoverflow.com/help/searching} +} +\examples{ +# Search StackOverflow for Convolutions in the r tag +search_stackoverflow("convolutions") + +# Search all languages on StackOverflow for convolutions +search_stackoverflow("convolutions", rlang = FALSE) +} +\seealso{ +Other community sites: +\code{\link{search_posit_community}()}, +\code{\link{search_twitter}()} +} +\concept{community sites} diff --git a/man/search_startpage.Rd b/man/search_startpage.Rd new file mode 100644 index 0000000..559a84c --- /dev/null +++ b/man/search_startpage.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_startpage} +\alias{search_startpage} +\alias{search_sp} +\title{Search Startpage} +\usage{ +search_startpage(query = geterrmessage(), rlang = TRUE) + +search_sp(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_startpage()} function searches +\href{https://startpage.com}{startpage} using: +\verb{https://startpage.com/do/dsearch?query=} +} +\examples{ +# Search startpage +search_startpage("VS Code") +} +\seealso{ +Other search engines: +\code{\link{search_bing}()}, +\code{\link{search_brave}()}, +\code{\link{search_duckduckgo}()}, +\code{\link{search_ecosia}()}, +\code{\link{search_google}()}, +\code{\link{search_kagi}()}, +\code{\link{search_qwant}()}, +\code{\link{search_rseek}()} +} +\concept{search engines} diff --git a/man/search_twitter.Rd b/man/search_twitter.Rd new file mode 100644 index 0000000..bfb4cbd --- /dev/null +++ b/man/search_twitter.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/search-functions.R +\name{search_twitter} +\alias{search_twitter} +\title{Search Twitter} +\usage{ +search_twitter(query = geterrmessage(), rlang = TRUE) +} +\arguments{ +\item{query}{Contents of string to search. Default is the error message.} + +\item{rlang}{Search for results written in R. Default is \code{TRUE}} +} +\value{ +The generated search URL or an empty string. +} +\description{ +The \code{search_twitter()} functions search +Twitter using: \verb{https://twitter.com/search?q=} +} +\details{ +For additional details regarding Twitter's +search interface please see: +\url{https://help.twitter.com/en/using-x/x-advanced-search} +} +\examples{ +# Search Twitter +search_twitter("searcher") +} +\seealso{ +Other community sites: +\code{\link{search_posit_community}()}, +\code{\link{search_stackoverflow}()} +} +\concept{community sites} diff --git a/man/searcher-defunct.Rd b/man/searcher-defunct.Rd index a0189da..295edb7 100644 --- a/man/searcher-defunct.Rd +++ b/man/searcher-defunct.Rd @@ -8,7 +8,11 @@ Functions listed below are no longer included in the \code{searcher} package } \details{ \itemize{ -\item \code{\link[=search_ixquick]{search_ixquick()}}: The function binding was removed as the search engine +\item \code{search_ixquick()}: The function binding was removed as the search engine name changed to "Startpage". Please use \code{\link[=search_startpage]{search_startpage()}}. +\item \code{search_rstudio_community()}: The function binding was removed as the +company name changed to "Posit". Please use \code{\link[=search_posit_community]{search_posit_community()}}. +\item \code{search_rscom()}: The function binding was removed as the +company name changed to "Posit". Please use \code{\link[=search_posit]{search_posit()}}. } } diff --git a/man/searcher.Rd b/man/searcher.Rd index 6971d1c..ad75361 100644 --- a/man/searcher.Rd +++ b/man/searcher.Rd @@ -8,10 +8,15 @@ searcher(site, keyword = getOption("searcher.default_keyword")) } \arguments{ \item{site}{Name of site to search on. Supported options: -\code{"google"} (default), \code{"bing"}, \code{"duckduckgo"}, \code{"startpage"}, -\code{"qwant"},\code{"posit community"}, \code{"brave"}, \code{"kagi"}, +\code{"google"} (default), \code{"bing"}, \code{"duckduckgo"} or \code{"ddg"}, +\code{"startpage"} (formerly \code{"ixquick"}) or \code{"sp"}, +\code{"qwant"}, \code{"rseek"}, \code{"brave"}, \code{"kagi"}, +\code{"posit community"} (formerly \code{"rstudio community"}) or \code{"posit"}, \code{"twitter"}, \code{"stackoverflow"}, -\code{"github"}, \code{"grep"}, and \code{"bitbucket"}.} +\code{"github"}, \code{"grep"}, \code{"bitbucket"}, +\code{"chatgpt"}, \code{"claude"}, \code{"perplexity"}, +\code{"mistral"}, \code{"bing copilot"} or \code{"copilot"}, and +\code{"meta ai"} or \code{"meta"}.} \item{keyword}{Opt to search under different default terms.} } diff --git a/vignettes/managing-ai-prompts.Rmd b/vignettes/managing-ai-prompts.Rmd index df50e90..76fd276 100644 --- a/vignettes/managing-ai-prompts.Rmd +++ b/vignettes/managing-ai-prompts.Rmd @@ -4,7 +4,7 @@ author: "James Joseph Balamuta" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Managing AI Prompts} + %\VignetteIndexEntry{Managing AI Prompts in `searcher`} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- @@ -23,8 +23,8 @@ knitr::opts_chunk$set( The `searcher` package includes a powerful prompt management system for working with AI assistants. This vignette explains how to use this system to create, manage, and apply effective prompts when using AI search functions. It -complements the main `vignette("search-with-ai-assistants")`, which provides a broader -overview of using AI services with R. +complements the main `vignette("search-with-ai-assistants", package = "searcher")`, +which provides a broader overview of using AI services with R. ## What are Prompts? @@ -227,7 +227,7 @@ approach enhances the quality of AI-generated responses and, subsequently, helps you save time and improve the efficiency of your R workflow. The system presented in this vignette transforms the custom prompts described -in `vignette("search-with-ai-assistants")` from one-off tools into a systematic -library that can be maintained, shared, and reused. This represents a shift from -ad-hoc prompting to a more deliberate approach that treats prompts as valuable -assets in your R programming toolkit. +in `vignette("search-with-ai-assistants", package = "searcher")` from one-off tools +into a systematic library that can be maintained, shared, and reused. This +represents a shift from ad-hoc prompting to a more deliberate approach that +treats prompts as valuable assets in your R programming toolkit. diff --git a/vignettes/search-with-ai-assistants.Rmd b/vignettes/search-with-ai-assistants.Rmd index 58de50e..38394ea 100644 --- a/vignettes/search-with-ai-assistants.Rmd +++ b/vignettes/search-with-ai-assistants.Rmd @@ -314,7 +314,7 @@ For comprehensive documentation on these advanced features, see the dedicated vignette: ```r -vignette("managing-ai-prompts") +vignette("managing-ai-prompts", package = "searcher") ``` With the prompt management system, you can move beyond single-use prompts to