| ask_ai | R Documentation |
Collect recent R error context, active script context, session information,
and workspace object summaries, then open console_chat() with that context
as the initial prompt.
Collects the recent R error/session context and opens console_chat() with
that context as the first user message. In RStudio, this function also reads
the active source document when available, making it suitable as an Addin
binding.
ask_ai(
prompt = NULL,
model = NULL,
skills = "auto",
skill = NULL,
context = NULL,
startup_dir = getwd(),
working_dir = tempdir(),
sandbox_mode = "permissive",
stream = TRUE,
verbose = FALSE,
show_context = FALSE,
max_context_chars = Inf,
max_error_age_secs = 300,
confirm_stale_errors = TRUE,
...
)
prompt |
Optional user instruction to add above the collected context. |
model |
Optional model string, |
skills |
Skill paths, |
skill |
Optional skill name to force for the initial turn. |
context |
Optional additional context text, or an |
startup_dir |
R session startup directory for project-aware context. |
working_dir |
Working directory for sandboxed console tools. |
sandbox_mode |
Sandbox mode for the console agent. |
stream |
Whether to stream model output. |
verbose |
Whether to show debug console output. |
show_context |
If |
max_context_chars |
Maximum formatted context characters. Defaults to
|
max_error_age_secs |
Maximum age in seconds for errors/warnings to be
included. Defaults to 300 (5 minutes). Set to |
confirm_stale_errors |
If |
... |
Additional arguments passed to |
Invisibly returns the ChatSession from console_chat(), or a
preview list when show_context = TRUE.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.