Skip to contents

Launches Mistral AI with your query. Mistral is known for its strong reasoning capabilities and efficiency.

Usage

ask_mistral(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_mistral("How to handle missing data in R?")
#> Using prompts: default (mistral)
#> Please type into your browser:
#> https://chat.mistral.ai/chat?q=As%20an%20R%20expert,%20please%20help%20with%20this%20question.%20Include%20code%20examples%20if%20relevant.%20How%20to%20handle%20missing%20data%20in%20R?

# 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:")
#> Using prompts: function call
#> Please type into your browser:
#> https://chat.mistral.ai/chat?q=Explain%20the%20error%20and%20fix%20it:%20Fix%20this%20code:%20ggplot(mtcars,%20aes(x=mpg,%20y=hp)%20+%20geom_point()