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.
Usage:
- Open the RStudio Addins menu and select “Chat”.
- A Shiny app window will appear, providing an interface to interact with the AI.
- Type your questions, code snippets, or text in the provided input box.
- The AI model, such as OpenAI’s GPT, will process your input and display the response within the app.
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.
What is Chat?
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:
- Exploring ideas or seeking advice on R coding problems.
- Getting quick explanations or clarifications on programming concepts.
- Experimenting with AI-generated code or text before incorporating it into your projects.
- Using it as a learning tool to enhance your understanding of R and data science topics.
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.
Usage
Some examples of how to use the package are below.
Chat in RStudio
- Addins > gptstudio > Chat
- Type your question.
- Click “Send” button or press “Enter”
- Ask more questions
- Copy and try code
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"
).
Using Other Models
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.
Persistent User Settings & Custom Prompt
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.
Provide your own instructions in R, R Markdown, or Quarto files
Addins > GPTSTUDIO > Chat in Source: Apply any edit what YOU desire or can dream up to a selection of code or text.