Skip to content

Commit 9040e36

Browse files
authored
FAQ Vignette, URL Documentation, & Prompt SVG Graphics (#46)
* Add FAQ and add a note on AI assistants via searcher vs. ellmer * Improve vignettes by adding SVG graphics for prompt details. Incorporate how we establish search/ai service links.
1 parent 58eebfd commit 9040e36

File tree

9 files changed

+1249
-148
lines changed

9 files changed

+1249
-148
lines changed

README.Rmd

Lines changed: 65 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ The goal of `searcher` is to provide a search interface directly inside of _R_.
2626
For example, to look up `rcpp example numeric vector`
2727
or `ggplot2 fix axis labels` call one of the `search_*()` functions to
2828
automatically have a web browser open, go to a search site, and type the query.
29-
`searcher` also provides direct integration with AI assistants, allowing you to
30-
send queries to ChatGPT, Claude, and other AI services with R-optimized prompts.
31-
By default, the search functions will attempt to search the last error on call
32-
if no query is specified.
29+
`searcher` also provides direct integration with AI assistants through `ask_*()`
30+
functions, allowing you to send queries to ChatGPT, Claude, and other AI services
31+
with R-optimized prompts.
32+
33+
By default, the search and ask functions will attempt to search the last error
34+
on call if no query is specified.
3335

3436
![Example workflow of searching and asking AI assistants questions from R.](https://i.imgur.com/Zq2rg6G.gif)
3537

@@ -155,8 +157,54 @@ ask_chatgpt(
155157
)
156158
```
157159

158-
See `vignette("search-with-ai-assistants")` for more details on using AI
159-
assistants in searches through `searcher`.
160+
See `vignette("search-with-ai-assistants", package = "searcher")` for more
161+
details on using AI assistants in searches through `searcher`.
162+
163+
## AI Prompt Management
164+
165+
For those who frequently use AI assistants, searcher provides a prompt management system:
166+
167+
```r
168+
# List available prompts
169+
ai_prompt_list()
170+
171+
# Set a system-level prompt for all AI services
172+
ai_prompt("debugging") # Use a predefined prompt for debugging
173+
174+
# Create custom prompts
175+
ai_prompt_register("my_prompt", "As an R expert analyzing the mtcars dataset...")
176+
177+
# Check active prompt
178+
ai_prompt_active()
179+
180+
# Clear active prompt
181+
ai_prompt_clear()
182+
```
183+
184+
See `vignette("managing-ai-prompts")` for more details on the prompt management system.
185+
186+
187+
### Comparison with ellmer Package
188+
189+
While both `searcher` and `ellmer` provide AI assistance for R users, they take different approaches:
190+
191+
- `searcher` opens a web browser with your query pre-filled in the AI service's interface
192+
- No API keys needed
193+
- Works with multiple AI services
194+
- Visual interface for complex interactions
195+
- Requires browser access and being logged in
196+
- `ellmer` uses API connections to interact with models directly within R
197+
- Requires API keys
198+
- Results returned directly to R console/environment
199+
- Better for programmatic/automated use
200+
- Works in non-interactive environments
201+
202+
These packages are **complementary** rather than competitive:
203+
204+
- Use `searcher` for interactive exploration, debugging, and research
205+
- Use `ellmer` for reproducible workflows, batch processing, and production code
206+
207+
See `vignette("faq", package = "searcher")` for a more detailed comparison.
160208

161209
## Search Errors
162210

@@ -176,9 +224,10 @@ triggers a new browser window to open with the error term listed in verbatim.
176224
# Using the generic search error handler
177225
options(error = searcher("google"))
178226

179-
# Directly specify the search function
180-
options(error = search_github)
227+
# Directly specify the search or ask function
181228
options(error = search_google)
229+
230+
options(error = ask_claude)
182231
```
183232

184233
### Manually
@@ -189,23 +238,15 @@ call the search function. After that, a browser window will open with
189238
the last error message as the search query on the desired search portal.
190239

191240
```r
241+
# Search the last error message with Google
192242
search_google()
193-
search_bing()
194-
search_ecosia()
195-
search_rseek()
196-
search_qwant()
197-
search_brave()
198-
search_kagi()
199-
search_grep()
200-
search_mastodon()
201-
search_bluesky()
202-
search_twitter() # or search_x()
203-
search_duckduckgo() # or search_ddg()
204-
search_startpage() # or search_sp()
205-
search_stackoverflow() # or search_so()
206-
search_posit_community() # or search_posit()
207-
search_github() # or search_gh()
208-
search_bitbucket() # or search_bb()
243+
244+
# Ask an AI assistant about the last error
245+
## Switch into debug mode
246+
ai_prompt("debugging")
247+
248+
## Ask Claude about the last error
249+
ask_claude()
209250
```
210251

211252
## Package Customizations
@@ -248,30 +289,6 @@ From there, add:
248289
}
249290
```
250291

251-
## AI Prompt Management
252-
253-
For those who frequently use AI assistants, searcher provides a prompt management system:
254-
255-
```r
256-
# List available prompts
257-
ai_prompt_list()
258-
259-
# Set a system-level prompt for all AI services
260-
ai_prompt("debugging") # Use a predefined prompt for debugging
261-
262-
# Create custom prompts
263-
ai_prompt_register("my_prompt", "As an R expert analyzing the mtcars dataset...")
264-
265-
# Check active prompt
266-
ai_prompt_active()
267-
268-
# Clear active prompt
269-
ai_prompt_clear()
270-
```
271-
272-
See `vignette("managing-ai-prompts")` for more details on the prompt management system.
273-
274-
275292
## Motivation
276293

277294
The idea for `searcher` began as a project to automatically search errors and

README.md

Lines changed: 65 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,60 @@ ask_chatgpt(
156156
)
157157
```
158158

159-
See `vignette("search-with-ai-assistants")` for more details on using AI
160-
assistants in searches through `searcher`.
159+
See `vignette("search-with-ai-assistants", package = "searcher")` for
160+
more details on using AI assistants in searches through `searcher`.
161+
162+
## AI Prompt Management
163+
164+
For those who frequently use AI assistants, searcher provides a prompt
165+
management system:
166+
167+
``` r
168+
# List available prompts
169+
ai_prompt_list()
170+
171+
# Set a system-level prompt for all AI services
172+
ai_prompt("debugging") # Use a predefined prompt for debugging
173+
174+
# Create custom prompts
175+
ai_prompt_register("my_prompt", "As an R expert analyzing the mtcars dataset...")
176+
177+
# Check active prompt
178+
ai_prompt_active()
179+
180+
# Clear active prompt
181+
ai_prompt_clear()
182+
```
183+
184+
See `vignette("managing-ai-prompts")` for more details on the prompt
185+
management system.
186+
187+
### Comparison with ellmer Package
188+
189+
While both `searcher` and `ellmer` provide AI assistance for R users,
190+
they take different approaches:
191+
192+
- `searcher` opens a web browser with your query pre-filled in the AI
193+
service’s interface
194+
- No API keys needed
195+
- Works with multiple AI services
196+
- Visual interface for complex interactions
197+
- Requires browser access and being logged in
198+
- `ellmer` uses API connections to interact with models directly within
199+
R
200+
- Requires API keys
201+
- Results returned directly to R console/environment
202+
- Better for programmatic/automated use
203+
- Works in non-interactive environments
204+
205+
These packages are **complementary** rather than competitive:
206+
207+
- Use `searcher` for interactive exploration, debugging, and research
208+
- Use `ellmer` for reproducible workflows, batch processing, and
209+
production code
210+
211+
See `vignette("faq", package = "searcher")` for a more detailed
212+
comparison.
161213

162214
## Search Errors
163215

@@ -178,9 +230,10 @@ with the error term listed in verbatim.
178230
# Using the generic search error handler
179231
options(error = searcher("google"))
180232

181-
# Directly specify the search function
182-
options(error = search_github)
233+
# Directly specify the search or ask function
183234
options(error = search_google)
235+
236+
options(error = ask_claude)
184237
```
185238

186239
### Manually
@@ -192,23 +245,15 @@ will open with the last error message as the search query on the desired
192245
search portal.
193246

194247
``` r
248+
# Search the last error message with Google
195249
search_google()
196-
search_bing()
197-
search_ecosia()
198-
search_rseek()
199-
search_qwant()
200-
search_brave()
201-
search_kagi()
202-
search_grep()
203-
search_mastodon()
204-
search_bluesky()
205-
search_twitter() # or search_x()
206-
search_duckduckgo() # or search_ddg()
207-
search_startpage() # or search_sp()
208-
search_stackoverflow() # or search_so()
209-
search_posit_community() # or search_posit()
210-
search_github() # or search_gh()
211-
search_bitbucket() # or search_bb()
250+
251+
# Ask an AI assistant about the last error
252+
## Switch into debug mode
253+
ai_prompt("debugging")
254+
255+
## Ask Claude about the last error
256+
ask_claude()
212257
```
213258

214259
## Package Customizations
@@ -256,31 +301,6 @@ From there, add:
256301
}
257302
```
258303

259-
## AI Prompt Management
260-
261-
For those who frequently use AI assistants, searcher provides a prompt
262-
management system:
263-
264-
``` r
265-
# List available prompts
266-
ai_prompt_list()
267-
268-
# Set a system-level prompt for all AI services
269-
ai_prompt("debugging") # Use a predefined prompt for debugging
270-
271-
# Create custom prompts
272-
ai_prompt_register("my_prompt", "As an R expert analyzing the mtcars dataset...")
273-
274-
# Check active prompt
275-
ai_prompt_active()
276-
277-
# Clear active prompt
278-
ai_prompt_clear()
279-
```
280-
281-
See `vignette("managing-ai-prompts")` for more details on the prompt
282-
management system.
283-
284304
## Motivation
285305

286306
The idea for `searcher` began as a project to automatically search

_pkgdown.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ navbar:
3333
href: articles/search-with-ai-assistants.html
3434
- text: "Managing AI Prompts in `searcher`"
3535
href: articles/managing-ai-prompts.html
36+
- text: "Frequently Asked Questions (FAQ)"
37+
href: articles/faq.html
3638
reference:
3739
text: Reference
3840
href: reference/index.html

0 commit comments

Comments
 (0)