Skip to contents

Opens Anthropic's Claude AI assistant with your query. Claude can provide thorough answers to complex questions and offers excellent code explanations.

Usage

ask_claude(query = geterrmessage(), prompt = NULL)

Arguments

query

Contents of string to send to ChatGPT. Default is the last error message.

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.

See also

Examples

# Basic query
ask_claude("Explain what purrr::map_df does")
#> Using prompts: default (claude)
#> Please type into your browser:
#> https://claude.ai/new?q=You%20are%20an%20R%20programming%20assistant.%20Focus%20on%20providing%20clear%20explanations%20and%20efficient%20code%20solutions.%20Explain%20what%20purrr::map_df%20does

# Using a custom prompt
ask_claude("Compare tidyr::pivot_wider vs tidyr::spread",
           prompt = "Provide examples of when to use each:")
#> Using prompts: function call
#> Please type into your browser:
#> https://claude.ai/new?q=Provide%20examples%20of%20when%20to%20use%20each:%20Compare%20tidyr::pivot_wider%20vs%20tidyr::spread