Type: Package
Title: AI Coding Agent for 'RStudio'
Version: 1.0.0
Maintainer: Juan Cruz Rodriguez <jcrodriguez@unc.edu.ar>
Description: Provides an 'RStudio' extension with a chat interface for an AI coding agent to help users with R programming tasks.
License: MIT + file LICENSE
URL: https://myownrobs.github.io/myownrobs/, https://github.com/MyOwnRobs/myownrobs
BugReports: https://github.com/MyOwnRobs/myownrobs/issues
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: ellmer, fs, httr, jsonlite, methods, promises, rstudio.prefs, rstudioapi, shiny, tools, uuid, yaml
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-01-22 15:00:42 UTC; jcrodriguez
Author: Juan Cruz Rodriguez [aut, cre]
Repository: CRAN
Date/Publication: 2026-01-22 15:20:02 UTC

Add a Provider to be Used

Description

Set API keys for running models locally.

Usage

configure_provider(name, api_key)

Arguments

name

Name of the provider (one of "anthropic", "deepseek", "google_gemini", "ollama", or "openai").

api_key

The provider's API key to use for authentication. If 'NULL', the provider will be deleted.

Examples

## Not run: 
# Configure providers.
configure_provider("anthropic", Sys.getenv("ANTHROPIC_API_KEY"))
configure_provider("deepseek", Sys.getenv("DEEPSEEK_API_KEY"))
configure_provider("google_gemini", Sys.getenv("GEMINI_API_KEY"))
configure_provider("openai", Sys.getenv("OPENAI_API_KEY"))
configure_provider("ollama", Sys.getenv("OLLAMA_API_KEY"))
# Delete the provider for google_gemini.
configure_provider("google_gemini", NULL)

## End(Not run)


Convert a Turn Content into a User-Readable UI

Description

Convert a Turn Content into a User-Readable UI

Usage

content_to_ui(content, role)

Arguments

content

A Content.

role

The Turn's main role.


Debug Print Function

Description

Prints a value to the console with a timestamp if the 'DEBUG' environment variable is set. This function is useful for conditional debugging output in R projects.

Usage

debug_print(value)

Arguments

value

The R object to be printed.


Get API Key

Description

Retrieves the configured AI provider API keys from the user's configuration directory.

Usage

get_api_key()

Return the Available Models

Description

Return the Available Models

Usage

get_available_models()

Get the ellmer Chat Instance

Description

Get the ellmer Chat Instance

Usage

get_chat_instance(mode, model, project_context, api_key, available_models)

Arguments

mode

The mode of operation, one of "agent" or "ask".

model

The ID of the model to use (E.g., "gemini-2.5-pro").

project_context

The context of the session executing the addin, obtained with 'get_project_context()'.

api_key

The API key for MyOwnRobs, obtained with 'get_api_key()'.

available_models

List of available models to use.


Get a Configuration Value

Description

Get a Configuration Value

Usage

get_config(config)

Arguments

config

The name of the configuration value to obtain.


Get Ellmer Models

Description

Get Ellmer Models

Usage

get_ellmer_models(provider, api_key)

Arguments

provider

A character string indicating the model provider (e.g., "anthropic", "deepseek", "google_gemini", "ollama", "openai").

api_key

A character string containing the API key or credentials used to query the provider.


Get LLM Tools

Description

Get the LLM tools for ellmer chat interface.

Usage

get_llm_tools(mode)

Arguments

mode

The mode of operation, one of "agent" or "ask".


Get Project Context Information

Description

Gathers various pieces of context information about the current R session and project. It includes details about the working directory, RStudio project, source editor context, and operating system.

Usage

get_project_context()

Load Turns from Disk

Description

Load Turns from Disk

Usage

load_turns()

Retrieve Available DeepSeek Models

Description

Fetches a list of currently available models from the DeepSeek API.

Usage

models_deepseek(credentials = NULL)

Arguments

credentials

A function that returns the API key as a character string.


Launch MyOwnRobs

Description

Open the RStudio addin with the chat interface.

Usage

myownrobs()

Value

No return value. Called for its side effects to launch the MyOwnRobs RStudio addin.

Examples

if (interactive()) {
  # Configure your API providers first.
  configure_provider("google_gemini", Sys.getenv("GEMINI_API_KEY"))
  # Then launch MyOwnRobs.
  myownrobs()
}


MyOwnRobs Shiny Server

Description

MyOwnRobs Shiny Server

Usage

myownrobs_server(available_models, project_context)

Arguments

available_models

List of available models to use, obtained with 'get_available_models()'.

project_context

The context of the session executing the addin, obtained with 'get_project_context()'.


MyOwnRobs Shiny UI

Description

MyOwnRobs Shiny UI

Usage

myownrobs_ui(available_models)

Arguments

available_models

List of available models to use.


Make Nicer Names

Description

Make Nicer Names

Usage

nice_names(names)

Arguments

names

A character vector of names to be converted to a nicer, title-cased form.


Policy Acceptance Shiny Server

Description

Policy Acceptance Shiny Server

Usage

policy_server(policy)

Arguments

policy

A list with the policy.


Policy Acceptance Shiny UI

Description

Policy Acceptance Shiny UI

Usage

policy_ui(policy)

Arguments

policy

A list with the policy.


Save Run MyOwnRobs At Startup

Description

Save Run MyOwnRobs At Startup

Usage

save_run_at_startup()

Save Turns to Disk

Description

Save Turns to Disk

Usage

save_turns(value)

Arguments

value

The turns object to save.


Set a Configuration Value

Description

Set a Configuration Value

Usage

set_config(config, value)

Arguments

config

The name of the configuration value to set.

value

The value to assign to the configuration.


Set the Initial State of the Project

Description

Whether to save the initial state or to restore it.

Usage

set_initial_project(restore = FALSE)

Arguments

restore

If TRUE, it will restore the initial state. If FALSE, it will save the initial store in R's temp dir.


Settings Module

Description

Settings Module

Usage

settings_module(id, r_trigger)

Arguments

id

Module id.

r_trigger

A reactive expression that triggers opening the modal.


Convert a Turns Structure Into a User-Readable UI

Description

Convert a Turns Structure Into a User-Readable UI

Usage

turns_to_ui(turns)

Arguments

turns

A list of Turns.


Validate MyOwnRobs Credentials

Description

Validate MyOwnRobs Credentials

Usage

validate_credentials()

Validate MyOwnRobs Policy Acceptance

Description

Checks if the user already accepted the usage policy. If the user didn't it prompts the policies.

Usage

validate_policy_acceptance()