fix to encoding issue; no forcing fill=T for error handling
diff --git a/R/gpt3_completions.R b/R/gpt3_completions.R
index c0338ea..7414e35 100644
--- a/R/gpt3_completions.R
+++ b/R/gpt3_completions.R
@@ -115,8 +115,15 @@
}
- bunch_core_output = data.table::rbindlist(empty_list)
- bunch_meta_output = data.table::rbindlist(meta_list)
+
+ bunch_core_output = try(data.table::rbindlist(empty_list), silent = T)
+ if("try-error" %in% class(bunch_core_output)){
+ bunch_core_output = data.table::rbindlist(empty_list, fill = T)
+ }
+ bunch_meta_output = try(data.table::rbindlist(meta_list), silent = T)
+ if("try-error" %in% class(bunch_meta_output)){
+ bunch_meta_output = data.table::rbindlist(meta_list, fill = T)
+ }
if(param_output_type == 'complete'){
output = list(bunch_core_output
diff --git a/R/gpt3_single_completion.R b/R/gpt3_single_completion.R
index bbf5495..f8df93a 100644
--- a/R/gpt3_single_completion.R
+++ b/R/gpt3_single_completion.R
@@ -99,6 +99,7 @@
, encode = "json")
request_content = httr::content(request_base)
+ # request_content = httr::content(request_base, encoding = "Latin-ASCII")
if(n == 1){
core_output = data.table::data.table('n' = 1