TheOpenAIR0.1.0 package

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

df_to_csv

Convert a data.frame to a CSV-formatted character string

chat_completion

Generate Text Using the OpenAI API's Chat Endpoint

chatlog-class

chatlog class

clean_output

Clean Output From Code Responses

clear_chatlog

Clear a chat log

contains_r_func

Check if a text file or character string contains an R function defini...

contains_roxygen

Check if a text file or character string contains Roxygen2 documentati...

count_tokens

Count the number of tokens in a text string

created

Extract Created DateTime from OpenAI API response

edit_code

Edit code based on user's input

extract_blocks

Extract blocks of a specified type from a list of blocks

extract_blocks_content

Extract the content parts of blocks

extract_entities

Extract Entities from a Text

extract_r_code

Extract R code and comments from a given input string.

extract_roxygen2

Extract roxygen2 documentation lines from a function definition

get_chatlog

Get the current chatlog

grapes-c-grapes

Send a message to ChatGPT and assign the response to a variable

id

Extract ID from OpenAI API response

initialize_messages

Initialize a new messages object for OpenAI API chat completions

install_tiktoken

Install the tiktoken Python package

is_chatlog

Determine if an object is a chatlog

is_json

Check if the provided string is in valid JSON format.

is_python

Check if a Character String Contains Valid Python Code

is_r

Check if a character string contains valid R code

is_xml

Check if the provided string is in valid XML format.

java_to_r

Convert Java code to R code

messages

Extract messages from a response object or a chatlog object

messages_content

Extract Messages Content from OpenAI API Response

model

Extract Model from OpenAI API response

nested_to_pipe

Convert nested R code to pipe syntax

num_tokens

Get number of tokens in a string using OpenAI's tiktoken library

num_tokens_file

Compute total number of tokens in a text file

object

Extract object information from OpenAI API response

openai_api_key

Set OpenAI API Key as an Environment Variable

parse_response

Parse a Response From the API

pipe

Pipe operator

python_to_r

Convert Python code to R code

r_to_python

Convert R Code to Python Code

read_text

Convert Text to Tidy-Text Format

read_text_batches

Load data from text files in batches

refactor

Refactor R Code with AI Assistance

references_to_bibtex

Convert references in plain text to BibTeX format

regenerate

Regenerate the last response in an ongoing chat

replace_file_extension

Replace File Extension

set_chatlog

Set up a new chatlog

split_text

Split Text into Chunks

start_chat

Start a new chat session

TheOpenAIR-package

TheOpenAIR: Integrate 'OpenAI' Large Language Models into Your 'R' Wor...

usage

Extract usage data from OpenAI API response

write_code

Write code based on user's input

write_test

Write test for an R function

add_roxygen

Add Roxygen2 documentation to an R function

add_to_chatlog

Add data to a chat log

chat

Start or continue a chat conversation

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.