tidyprompt: Prompt Large Language Models and Enhance Their Functionality

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.

Package details

AuthorLuka Koning [aut, cre, cph], Tjark Van de Merwe [aut, cph], Kennispunt Twente [fnd]
MaintainerLuka Koning <l.koning@kennispunttwente.nl>
LicenseGPL (>= 3) | file LICENSE
Version0.0.1
URL https://github.com/tjarkvandemerwe/tidyprompt https://tjarkvandemerwe.github.io/tidyprompt/
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("tidyprompt")

Try the tidyprompt package in your browser

Any scripts or data that you put into this service are public.

tidyprompt documentation built on April 4, 2025, 12:24 a.m.