Package: TheOpenAIR 0.1.0

TheOpenAIR: Integrate 'OpenAI' Large Language Models into Your 'R' Workflows

Utilizing the 'OpenAI' API as the back end (<https://platform.openai.com/docs/api-reference>), 'TheOpenAIR' offers 'R' wrapper functions for the 'ChatGPT' endpoint and several high-level functions that enable the integration of 'ChatGPT' capabilities in diverse data-related tasks, such as data cleansing and automated analytics script generation.

Authors:Ulrich Matter [aut, cre, cph], Jonathan Chassot [aut]

TheOpenAIR_0.1.0.tar.gz
TheOpenAIR_0.1.0.zip(r-4.5)TheOpenAIR_0.1.0.zip(r-4.4)TheOpenAIR_0.1.0.zip(r-4.3)
TheOpenAIR_0.1.0.tgz(r-4.4-any)TheOpenAIR_0.1.0.tgz(r-4.3-any)
TheOpenAIR_0.1.0.tar.gz(r-4.5-noble)TheOpenAIR_0.1.0.tar.gz(r-4.4-noble)
TheOpenAIR_0.1.0.tgz(r-4.4-emscripten)TheOpenAIR_0.1.0.tgz(r-4.3-emscripten)
TheOpenAIR.pdf |TheOpenAIR.html
TheOpenAIR/json (API)

# Install 'TheOpenAIR' in R:
install.packages('TheOpenAIR', repos = c('https://umatter.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Datasets:

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

1.70 score 1 stars 5 scripts 238 downloads 49 exports 37 dependencies

Last updated 2 years agofrom:ba62dce0ab. Checks:OK: 3 NOTE: 4. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 31 2024
R-4.5-winOKOct 31 2024
R-4.5-linuxOKOct 31 2024
R-4.4-winNOTEOct 31 2024
R-4.4-macNOTEOct 31 2024
R-4.3-winNOTEOct 31 2024
R-4.3-macNOTEOct 31 2024

Exports:%>%%c%add_roxygenadd_to_chatlogchatchat_completionclean_outputclear_chatlogcontains_r_funccontains_roxygencount_tokenscreateddf_to_csvedit_codeextract_blocksextract_blocks_contentextract_entitiesextract_r_codeextract_roxygen2get_chatlogidinitialize_messagesis_chatlogis_jsonis_pythonis_ris_xmljava_to_rmessagesmessages_contentmodelnested_to_pipeobjectopenai_api_keyparse_responsepython_to_rr_to_pythonread_textread_text_batchesrefactorreferences_to_bibtexregeneratereplace_file_extensionset_chatlogsplit_textstart_chatusagewrite_codewrite_test

Dependencies:askpassclicurldata.tablefansiglueherehttrjsonlitelatticelifecyclemagrittrMatrixmimeopensslpillarpkgconfigpngR.methodsS3R.ooR.utilsR6rappdirsRcppRcppTOMLreticulaterlangrprojrootrstudioapistringistringrsystibbleutf8vctrswithrxml2

Readme and manuals

Help Manual

Help pageTopics
Send a message to ChatGPT and assign the response to a variable%c%
Add Roxygen2 documentation to an R functionadd_roxygen
Input: message content template for add_roxygen()add_roxygen_prompt
Add data to a chat logadd_to_chatlog
Start or continue a chat conversationchat
Generate Text Using the OpenAI API's Chat Endpointchat_completion
chatlog classchatlog-class
Clean Output From Code Responsesclean_output
Clear a chat logclear_chatlog
Check if a text file or character string contains an R function definitioncontains_r_func
Check if a text file or character string contains Roxygen2 documentationcontains_roxygen
Count the number of tokens in a text stringcount_tokens
Extract Created DateTime from OpenAI API responsecreated
Convert a data.frame to a CSV-formatted character stringdf_to_csv
Edit code based on user's inputedit_code
Extract blocks of a specified type from a list of blocksextract_blocks
Extract the content parts of blocksextract_blocks_content
Extract Entities from a Textextract_entities
Input: message content template for extract_entities()extract_entities_prompt
Extract R code and comments from a given input string.extract_r_code
Extract roxygen2 documentation lines from a function definitionextract_roxygen2
Get the current chatlogget_chatlog
Extract ID from OpenAI API responseid
Initialize a new messages object for OpenAI API chat completionsinitialize_messages
Install the tiktoken Python packageinstall_tiktoken
Determine if an object is a chatlogis_chatlog
Check if the provided string is in valid JSON format.is_json
Check if a Character String Contains Valid Python Codeis_python
Check if a character string contains valid R codeis_r
Check if the provided string is in valid XML format.is_xml
Convert Java code to R codejava_to_r
Input: message content template for java_to_r()java_to_r_prompt
Extract messages from a response object or a chatlog objectmessages
Extract Messages Content from OpenAI API Responsemessages_content
Extract Model from OpenAI API responsemodel
Convert nested R code to pipe syntaxnested_to_pipe
Input: message content template for nested_to_pipe()nested_to_pipe_prompt
Get number of tokens in a string using OpenAI's tiktoken librarynum_tokens
Compute total number of tokens in a text filenum_tokens_file
Extract object information from OpenAI API responseobject
Set OpenAI API Key as an Environment Variableopenai_api_key
Parse a Response From the APIparse_response
Convert Python code to R codepython_to_r
Input: message content template for python_to_r()python_to_r_prompt
Convert R Code to Python Coder_to_python
Input: message content template for r_to_python()r_to_python_prompt
Convert Text to Tidy-Text Formatread_text
Load data from text files in batchesread_text_batches
Refactor R Code with AI Assistancerefactor
Input: message content template for refactor()refactor_prompt
Convert references in plain text to BibTeX formatreferences_to_bibtex
Input: message content template for references_to_bibtex()references_to_bibtex_prompt
Regenerate the last response in an ongoing chatregenerate
Replace File Extensionreplace_file_extension
Set up a new chatlogset_chatlog
Split Text into Chunkssplit_text
Start a new chat sessionstart_chat
Essay on How Donald Trump Became President of the United Statestrump
Extract usage data from OpenAI API responseusage
Write code based on user's inputwrite_code
Write test for an R functionwrite_test
Input: message content template for write_test()write_test_prompt