report_ai() 🚀 #599
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an AI-oriented reporting mode to the report package, enabling compact, structured model summaries suitable for LLM/agent consumption via report_ai() and a new audience switch in report().
Changes:
- Introduces
report_ai()S3 generic + methods forlm,glm,merMod, andglmmTMB, plus aprint.report_ai()method. - Extends
report()with anaudienceargument and a globalreport_audienceoption to route output to AI vs human formats. - Adds documentation, tests, NEWS entry, and a vignette explaining usage and global document/project configuration.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| vignettes/report_ai.Rmd | New vignette describing AI-optimized reporting workflow and global option usage. |
| tests/testthat/test-report_ai.R | Adds test coverage for report_ai() methods and report(audience=...) dispatch. |
| man/report_ai.Rd | New generated help page for report_ai() and its methods. |
| man/report.Rd | Updates report() documentation to include the new audience argument. |
| R/report_ai.R | Implements report_ai() generic/methods, formatting logic, and print method. |
| R/report.R | Adds audience argument + routing from report() to report_ai(). |
| NEWS.md | Documents the new AI reporting feature set. |
| NAMESPACE | Registers S3 methods and exports for report_ai + print method. |
| DESCRIPTION | Bumps version and adds report_ai.R to Collate. |
| report <- function(x, ..., audience = getOption("report_audience", "humans")) { | ||
| audience <- match.arg(audience, c("humans", "ai")) | ||
| if (audience == "ai") { | ||
| return(report_ai(x, ...)) | ||
| } | ||
| UseMethod("report") |
| params <- parameters::model_parameters(x, ...) | ||
|
|
| @@ -1,3 +1,13 @@ | |||
| # report 0.6.x | |||
|
To avoid confusion about capabilities, maybe call it |
not sure it's much less confusing, but anyways, I think this function should borderline be private, and we should document its usage through |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Good point. Maybe don't export it in that case? |
|
@gemini-code-assist review |
strengejacke
left a comment
There was a problem hiding this comment.
See also test failures:
- pkgdown
- html
- check warnings
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request introduces report_ai(), a new feature designed to generate compact, structured statistical reports optimized for Large Language Models (LLMs). The report() function has been updated with an audience argument to toggle between standard human-readable prose and the new AI-optimized format, with support for lm, glm, merMod, and glmmTMB model classes. Feedback focuses on maintaining compatibility with R versions prior to 4.1.0 by replacing the native pipe operator |> and adhering to the project's style guide by using insight package helpers for warnings, formula formatting, and call deparsing.
|
I think it LGTM now. |
|
Oh, you still did not add |
|
@strengejacke wdyt do we export report_ai or just document it through report(..., audience="ai")? |
|
Hm... I think we should do the latter, just document the |
#596
Currently mostly a proof of concept for lm glm, and lmer glmmtmb