knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
The "Chat" app in gptstudio
is an interactive Shiny app that can be launched directly from RStudio. It serves as a powerful tool to converse with various AI models, similar to ChatGPT and GitHub Copilot Chat, but integrated within your R environment.
knitr::include_graphics("https://raw.githubusercontent.com/MichelNivard/gptstudio/main/media/gptstudio-chat-app.png") # nolint
Usage:
This app is ideal for a range of tasks, including querying AI for coding advice, explanations of complex concepts, or generating code snippets.
Optional:
While "Chat" does not modify your files directly like "Chat in Source", it's an invaluable tool for interactive learning and coding assistance. You can easily copy the responses from the "Chat" app and paste them into your R scripts or .Rmd files.
The Chat
app in gptstudio
is your interactive AI assistant within RStudio. Unlike Chat in Source
, which operates directly on your source code, Chat
provides a separate interface where you can engage in a two-way conversation with AI models. This setup is especially useful for:
Remember, while Chat
is a powerful tool, it's always important to critically evaluate the AI's responses and ensure they align with your project's requirements and standards.
Some examples of how to use the package are below.
{width=700px}
The Chat addin supports internationalization. You can set the "GPTSTUDIO_LANGUAGE" environmental variable to the language of your preference (i.e. GPTSTUDIO_LANGUAGE="es"
for spanish). See the full list of supported languages in the translation file ("inst/translations/translation.json"
).
We're excited to announce that our service now includes models from HuggingFace's inference API, Anthropic's claude models, and Google's AI Studio, Azure OpenAI, and local models with Ollama broadening the range of AI solutions you can use. You can set the model using the setting (gear) button in the Chat addin app.
{width=700px}
You can now save your app settings across sessions. These are saved in a user config file. The easiest way to change these settings is the "Save as Default" button in the add-in app. This also allows you to specify your own custom prompt to pass to the model as instructions.
Addins > GPTSTUDIO > Chat in Source: Apply any edit what YOU desire or can dream up to a selection of code or text.
Addins > GPTSTUDIO > Spelling and Grammar: Takes the selected text sends it to OpenAI's best model and instructs it to return a spelling and grammar checked version.
Addins > GPTSTUDIO > Comment your code: Takes the selected text sends it to OpenAI as a prompt for a code specific model to work with, asks for a version with a comment added explaining the code line by line.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.