add error handling
If response code isn't 200, show warning message
diff --git a/R/chatgpt_single.R b/R/chatgpt_single.R
index c2497a6..798cc15 100644
--- a/R/chatgpt_single.R
+++ b/R/chatgpt_single.R
@@ -87,6 +87,11 @@
request_content = httr::content(request_base)
+ if(request_base$status_code != 200){
+ warning(paste0("Request completed with error. Code: ", request_base$status_code
+ , ", message: ", request_content$error$message))
+ }
+
if(n == 1){
core_output = data.table::data.table('n' = 1
, 'prompt_role' = prompt_role