I’m using Hany Imam code “Query Local Documents with a Shiny App” for using chatGPT to querry a document.
gpt3_endpoint < “https://api.openai.com/v1/engines/curie/completions”
api_key <- “your_api_key_here”
body = jsonlite::toJSON(list( prompt = paste(prompt, all_text),
max_tokens = 50, n = 1, stop = NULL, temperature = 1 ),
auto_unbox = TRUE)
where
all_text <- paste(pdf_text, collapse = “n”)
Now I want to use a dataframe as reference instead of a pdf for all_text. I pasted columns and lines, but if I want to use a big dataframe (or database) it is not practical.
Anyone have a tip on this?