Skip to content

Commit

Permalink
history option added for mergenstudio break
Browse files Browse the repository at this point in the history
  • Loading branch information
jacqueline-98 committed Mar 14, 2024
1 parent eca29d2 commit 0ad7961
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/selfcorrect.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' response <- selfcorrect(agent,prompt,context=rbionfoExp, max_tokens = 500)
#' }
#' @export
selfcorrect<-function(agent,prompt,context=rbionfoExp,attempts=3,output.file=NULL,responseWithError=NULL,...){
selfcorrect<-function(agent,prompt,context=rbionfoExp,attempts=3,output.file=NULL,responseWithError=NULL, history=NULL,...){

#---------------------------------------------------------------------------
# Validate arguments
Expand Down Expand Up @@ -76,7 +76,11 @@ selfcorrect<-function(agent,prompt,context=rbionfoExp,attempts=3,output.file=NUL


# Send prompt
response <- sendPrompt(agent,prompt,context,return.type="text",...)
if (is.null(history)){
response <- sendPrompt(agent,prompt,context,return.type="text",...)
}else{
response <- sendPrompt(agent,prompt,context,return.type="text",previous.msgs=history)
}

# Clean the code backtick structure and install.packages calls
init.response <- response
Expand Down

0 comments on commit 0ad7961

Please sign in to comment.