Skip to content

Commit d021b8e

Browse files
authored
Add grok (#48)
* Add grok * Rename vignette Add grok reference Add URLs into README * Add grok and update vignette urls * regenerate with ai service instead of chatgpt * Add aliases for `ask_le_chat()` to `ask_mistral()` and `ask_xai()` to `ask_grok()` * Remove the "about searcher" part from FAQ title. * Bump package version & news
1 parent 9040e36 commit d021b8e

21 files changed

+175
-57
lines changed

DESCRIPTION

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: searcher
2-
Title: Query Search Interfaces
3-
Version: 0.0.7.2
2+
Title: Query Search Interfaces and AI Assistants
3+
Version: 0.1.0
44
Authors@R: c(
55
person("James", "Balamuta",
66
email = "[email protected]",
@@ -13,11 +13,17 @@ Authors@R: c(
1313
comment = c(ORCID = "0000-0001-9412-0457")
1414
)
1515
)
16-
Description: Provides a search interface to look up terms
17-
on 'Google', 'Bing', 'DuckDuckGo', 'Startpage', 'Ecosia', 'rseek',
18-
'Twitter', 'StackOverflow', 'RStudio Community', 'GitHub', and 'BitBucket'.
19-
Upon searching, a browser window will open with the aforementioned search
20-
results.
16+
Description: Provides search interfaces to look up terms on major search engines
17+
including 'Google', 'Bing', 'DuckDuckGo', 'Startpage', 'Ecosia', 'Brave',
18+
'Kagi', 'rseek', social platforms like 'X' (formerly Twitter), 'BlueSky',
19+
'Mastodon', programming communities such as 'StackOverflow', 'Posit Community',
20+
and code repositories including 'GitHub', 'grep.app', and 'BitBucket'.
21+
Additionally, provides direct integration with AI assistants through
22+
specialized query functions for 'ChatGPT', 'Claude AI', 'Perplexity AI',
23+
'Mistral AI', 'Microsoft Copilot', and 'Meta AI', complete with an AI prompt
24+
management system for R-optimized interactions. Upon searching or querying,
25+
a browser window will open with the search results or AI interface pre-populated
26+
with the specified query.
2127
URL: https://github.com/coatless-rpkg/searcher, https://r-pkg.thecoatlessprofessor.com/searcher/
2228
BugReports: https://github.com/coatless-rpkg/searcher/issues
2329
Depends: R (>= 3.3.0)

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ export(ask_bing_copilot)
1010
export(ask_chatgpt)
1111
export(ask_claude)
1212
export(ask_copilot)
13+
export(ask_grok)
14+
export(ask_le_chat)
1315
export(ask_meta_ai)
1416
export(ask_mistral)
1517
export(ask_perplexity)
18+
export(ask_xai)
1619
export(search_bb)
1720
export(search_bing)
1821
export(search_bitbucket)

NEWS.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# searcher 0.0.8
1+
# searcher 0.1.0
22

33
## Features
44

55
- Added GenAI Search Portals:
6-
- `ask_chatgpt()`: Searches with ChatGPT
7-
- `ask_claude()`: Searches with Claude AI
8-
- `ask_perplexity()`: Searches with Perplexity AI
9-
- `ask_mistral()`: Searches with Mistral AI
10-
- `ask_copilot()`: Searches with Microsoft Bing's Copilot
11-
- `ask_meta_ai()`: Searches with Meta AI
6+
- `ask_chatgpt()`: Discuss with OpenAI's ChatGPT
7+
- `ask_claude()`: Discuss with Anthropic's Claude AI
8+
- `ask_perplexity()`: Discuss with Perplexity AI
9+
- `ask_mistral()`/`ask_le_chat()`: Discuss with Mistral AI's Le Chat
10+
- `ask_copilot()`: Discuss with Microsoft Bing's Copilot
11+
- `ask_xai()`/`ask_grok()`: Discuss with xAI's Grok
12+
- `ask_meta_ai()`: Discuss with Meta AI
1213
- Added an AI Prompt Management System with Persona Prompts:
1314
- `ai_prompt()`: Set a prompt for the AI
1415
- `ai_prompt_active()`: View the active prompt
@@ -17,7 +18,7 @@
1718
- `ai_prompt_register()`: Add a custom prompt
1819
- `ai_prompt_remove()`: Remove a prompt
1920
- Added new vignettes:
20-
- `search-with-ai-assistants.Rmd`: Overview of the AI Searching Techniques
21+
- `using-ai-assistants-with-searcher.Rmd`: Overview of the AI Searching Techniques
2122
- `managing-ai-prompts.Rmd`: Overview of `searcher`'s AI Prompt Management System
2223
- Added search portals:
2324
- `search_brave()`: Searches on Brave.
@@ -42,9 +43,9 @@
4243

4344
- Reorganized search functions into separate help pages by category:
4445
- Search engines (Google, Bing, etc.)
46+
- AI assistants (ChatGPT, Claude, etc.)
4547
- Community sites (StackOverflow, Twitter, etc.)
4648
- Code repositories (GitHub, BitBucket, etc.)
47-
- AI assistants (ChatGPT, Claude, etc.)
4849
- Implemented `@family` tags to group related functions in the "See also" section
4950
- Added more specific, relevant examples for each function
5051
- Added brief descriptions of each AI service's strengths and characteristics

R/ai-search-functions.R

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ ai_searcher = function(site) {
6565
#' This function allows you to ask questions, get code help,
6666
#' or search for information using ChatGPT.
6767
#'
68-
#' @param query Contents of string to send to ChatGPT. Default is the last error message.
69-
#' @param prompt Optional prompt prefix to add before your query to guide how ChatGPT
68+
#' @param query Contents of string to send to AI Service. Default is the last error message.
69+
#' @param prompt Optional prompt prefix to add before your query to guide how the AI Service
7070
#' responds. If NULL, uses the service-specific default prompt option.
7171
#'
7272
#' @return The generated search URL or an empty string.
@@ -149,6 +149,11 @@ ask_perplexity = ai_searcher("perplexity")
149149
#' prompt = "Explain the error and fix it:")
150150
ask_mistral = ai_searcher("mistral")
151151

152+
153+
#' @rdname ask_mistral
154+
#' @export
155+
ask_le_chat = ask_mistral
156+
152157
#' Search with Bing Copilot
153158
#'
154159
#' Searches Microsoft Bing Copilot, which combines web search results
@@ -173,6 +178,29 @@ ask_bing_copilot = ai_searcher("copilot")
173178
#' @export
174179
ask_copilot = ask_bing_copilot
175180

181+
#' Search with Grok
182+
#'
183+
#' Searches xAI's Grok, which provides AI assistance focused on
184+
#' maximize truth and objectivity.
185+
#'
186+
#' @inheritParams ask_chatgpt
187+
#' @return The generated search URL or an empty string.
188+
#'
189+
#' @export
190+
#' @family AI assistants
191+
#' @examples
192+
#' # Basic query
193+
#' ask_grok("What are the best practices for R package development?")
194+
#'
195+
#' # Using a custom prompt
196+
#' ask_grok("How to optimize this R code for performance?",
197+
#' prompt = "Focus on efficiency and best practices:")
198+
ask_grok = ai_searcher("grok")
199+
200+
#' @rdname ask_grok
201+
#' @export
202+
ask_xai = ask_grok
203+
176204
#' Search with Meta AI
177205
#'
178206
#' Searches Meta AI, which provides general-purpose AI assistance

R/index-sites.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ site_index =
111111
site_entry("bing copilot", "https://www.bing.com/search?showconv=1&sendquery=1&q=",
112112
"copilot",
113113
keywords = NULL),
114+
site_entry("grok", "https://www.grok.com/?q=",
115+
keywords = NULL),
114116
site_entry("meta ai", "https://www.meta.ai/?q=",
115117
"meta",
116118
keywords = NULL)

R/search-functions.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#' `"twitter"` or `"x"`, `"bluesky"`, `"mastodon"`, `"stackoverflow"`,
1212
#' `"github"`, `"grep"`, `"bitbucket"`,
1313
#' `"chatgpt"`, `"claude"`, `"perplexity"`,
14-
#' `"mistral"`, `"bing copilot"` or `"copilot"`, and
15-
#' `"meta ai"` or `"meta"`.
14+
#' `"mistral"` or `"le chat"`, `"bing copilot"` or `"copilot"`, and
15+
#' `"grok"` or `"xai"`, `"meta ai"` or `"meta"`.
1616
#' @param query Contents of string to search. Default is the error message.
1717
#' @param rlang Search for results written in R. Default is `TRUE`
1818
#' @param prompt Optional prompt prefix to add before your query to guide how the AI
@@ -56,6 +56,7 @@ search_site = function(query,
5656
"mistral",
5757
"bing copilot",
5858
"copilot",
59+
"grok",
5960
"meta ai",
6061
"meta"
6162
),
@@ -92,9 +93,12 @@ search_site = function(query,
9293
chatgpt = ask_chatgpt(query, prompt),
9394
claude = ask_claude(query, prompt),
9495
perplexity = ask_perplexity(query, prompt),
96+
`le chat` = , # empty case carried below
9597
mistral = ask_mistral(query, prompt),
9698
`bing copilot` = , # empty case carried below
9799
copilot = ask_bing_copilot(query, prompt),
100+
xai = , # empty case carried below
101+
grok = ask_grok(query, prompt),
98102
`meta ai` = , # empty case carried below,
99103
meta = ask_meta_ai(query, prompt)
100104
)

README.Rmd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ search_bitbucket("assertions", rlang = FALSE) # or search_bb(...)
127127
## AI Assistants
128128

129129
The package also provides functions to query AI assistants directly from R.
130+
The following AI Assistant platforms are supported: OpenAI's [ChatGPT](https://chatgpt.com/),
131+
Anthropic's [Claude](https://claude.ai/),
132+
[Perplexity](https://www.perplexity.ai/),
133+
Microsoft (Bing)'s [Copilot](https://copilot.microsoft.com/),
134+
Mistral's [le Chat](https://chat.mistral.ai/chat),
135+
xAI's [Grok](https://grok.com/), and [Meta.ai](https://www.meta.ai/).
130136
These functions open a browser with your query pre-filled, using customizable
131137
prompts that help the AI give more effective responses for R programming:
132138

@@ -137,6 +143,7 @@ ask_claude("Explain what purrr::map_df does")
137143
ask_perplexity("Compare dplyr vs data.table performance")
138144
ask_mistral("How to handle missing data in R?")
139145
ask_bing_copilot("Write a function to calculate the median")
146+
ask_grok("What is better base R or tidyverse for research?")
140147
ask_meta_ai("What are the best R packages for time series analysis?")
141148

142149
# Search with an error message
@@ -157,7 +164,7 @@ ask_chatgpt(
157164
)
158165
```
159166

160-
See `vignette("search-with-ai-assistants", package = "searcher")` for more
167+
See `vignette("using-ai-assistants-with-searcher", package = "searcher")` for more
161168
details on using AI assistants in searches through `searcher`.
162169

163170
## AI Prompt Management

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ The goal of `searcher` is to provide a search interface directly inside
1717
of *R*. For example, to look up `rcpp example numeric vector` or
1818
`ggplot2 fix axis labels` call one of the `search_*()` functions to
1919
automatically have a web browser open, go to a search site, and type the
20-
query. `searcher` also provides direct integration with AI assistants,
21-
allowing you to send queries to ChatGPT, Claude, and other AI services
22-
with R-optimized prompts. By default, the search functions will attempt
23-
to search the last error on call if no query is specified.
20+
query. `searcher` also provides direct integration with AI assistants
21+
through `ask_*()` functions, allowing you to send queries to ChatGPT,
22+
Claude, and other AI services with R-optimized prompts.
23+
24+
By default, the search and ask functions will attempt to search the last
25+
error on call if no query is specified.
2426

2527
<figure>
2628
<img src="https://i.imgur.com/Zq2rg6G.gif"
@@ -125,9 +127,15 @@ search_bitbucket("assertions", rlang = FALSE) # or search_bb(...)
125127
## AI Assistants
126128

127129
The package also provides functions to query AI assistants directly from
128-
R. These functions open a browser with your query pre-filled, using
129-
customizable prompts that help the AI give more effective responses for
130-
R programming:
130+
R. The following AI Assistant platforms are supported: OpenAI’s
131+
[ChatGPT](https://chatgpt.com/), Anthropic’s
132+
[Claude](https://claude.ai/), [Perplexity](https://www.perplexity.ai/),
133+
Microsoft (Bing)’s [Copilot](https://copilot.microsoft.com/), Mistral’s
134+
[le Chat](https://chat.mistral.ai/chat), xAI’s
135+
[Grok](https://grok.com/), and [Meta.ai](https://www.meta.ai/). These
136+
functions open a browser with your query pre-filled, using customizable
137+
prompts that help the AI give more effective responses for R
138+
programming:
131139

132140
``` r
133141
# Get coding help from AI assistants
@@ -136,6 +144,7 @@ ask_claude("Explain what purrr::map_df does")
136144
ask_perplexity("Compare dplyr vs data.table performance")
137145
ask_mistral("How to handle missing data in R?")
138146
ask_bing_copilot("Write a function to calculate the median")
147+
ask_grok("What is better base R or tidyverse for research?")
139148
ask_meta_ai("What are the best R packages for time series analysis?")
140149

141150
# Search with an error message

_pkgdown.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ navbar:
2929
menu:
3030
- text: "Search Patterns"
3131
href: articles/search-patterns.html
32-
- text: "Search with AI Assistants"
33-
href: articles/search-with-ai-assistants.html
34-
- text: "Managing AI Prompts in `searcher`"
32+
- text: "Using AI Assistants with searcher"
33+
href: articles/using-ai-assistants-with-searcher.html
34+
- text: "Managing AI Prompts in searcher"
3535
href: articles/managing-ai-prompts.html
3636
- text: "Frequently Asked Questions (FAQ)"
3737
href: articles/faq.html
@@ -71,6 +71,7 @@ reference:
7171
- ask_mistral
7272
- ask_bing_copilot
7373
- ask_copilot
74+
- ask_grok
7475
- ask_meta_ai
7576

7677
- title: "Community Sites"

man/ask_bing_copilot.Rd

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)