Prompt Large Language Models and Enhance Their Functionality
Overview
Easily construct prompts and associated logic for interacting with large language models (LLMs). 'tidyprompt' introduces the concept of prompt wraps, which are building blocks that you can use to quickly turn a simple prompt into a complex one. Prompt wraps do not just modify the prompt text, but also add extraction and validation functions that will be applied to the response of the LLM. This ensures that the user gets the desired output. 'tidyprompt' can add various features to prompts and their evaluation by LLMs, such as structured output, automatic feedback, retries, reasoning modes, autonomous R function calling, and R code generation and evaluation. It is designed to be compatible with any LLM provider that offers chat completion.
- New prompt wrap
answer_as_dataframe()for extracting tabular results via
structured output, with support for row schemas, array-of-row schemas,
and optional row-count validation.
- New prompt wrap
answer_as_numeric()for extracting numeric responses,
including optional minimum and maximum value validation.
send_prompt()can now directly use an 'ellmer' chat object as
the llm_provider to evaluate the prompt with (will build
an llm_provider_ellmer() under the hood)
llm_provider_ellmer()was improved to better synchronize with
the native 'ellmer' state, for instance for streaming, multimodal/image
content, and persistent chats, with clearer warnings when settings need to
be configured on the underlying ellmer chat object.
Show all changes in 0.4.0Hide the rest of the changes in 0.4.0
answer_as_json()andanswer_using_tools()have broader ellmer
compatibility, including ellmer::type_from_schema(), ellmer built-in tools,
and better handling of optional or ignored tool arguments.
- Chat history handling is more robust for tool and ellmer-native workflows:
tool rows are supported, non-replayable native rows (tool call and thinking rows)
are kept for inspection but not re-sent to the LLM provider, and related
metadata is normalized more reliably.
- Update e-mail address of maintainer in DESCRIPTION file
(change to a personal e-mail address due to leaving the organization).
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK12 OK2026-04-25
- ERROR13 OK, 1 ERROR2026-03-10
Documentation
- Help pages
- 59 (4 internal)includes a package overview page
- Examples that run
- 64%35 run in a plain check (2 of them under a condition) · 20 never run
- Exported functions with examples
- 100%
- Documented parameters
- 92%
- Return-value docs
- 95%
- Help pages citing references
- 3%
Downloads
Repository
- PRs merged (all time)
- 90%
- Median days to close, 50 most recently updated closed issues
- 4
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
11 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/kennispunttwente/tidyprompt on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-29 · The repository has a site deploy workflow
pkgdown site last built 2026-09-29
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2025-09-24Seen in the repository: .github/copilot-instructions.mdPull request: opened by its own accountCommits: 1 by its own account
Dependencies
Installing tidyprompt adds 24 packages (16 with compiled code, 20 MB of source tarballs). Heaviest: stringi 11 MB, openssl 1.1 MB, jsonlite 1.0 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.4.0Latest
- 0.3.0
- 0.2.0
- 0.1.02025-08-18 · diff ↗ ·
added 4 exports
answer_as_category, answer_as_multi_category, llm_break_soft, llm_provider_ellmer - RR 4.5.0 released · 2025-04-11
- 0.0.12025-01-08
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2025-01-08
- Total releases
- 5 / 1 yrs
- License
- GPL (>= 3) | file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 271 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("tidyprompt")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.