Skip to content

Commit

Permalink
promtptContext added link
Browse files Browse the repository at this point in the history
  • Loading branch information
jacqueline-98 committed Dec 5, 2023
1 parent 458d407 commit 4f84807
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion R/promptContext.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ promptContext <- function(type="simple"){
assertthat::assert_that(
assertthat::is.string(type)
)
#-----------------------------------------------------------------------------

if (!type %in% c("simple","actAs", "CoT", "rbionfoExp")){
stop ("Not a valid context. Valid contexts are: simple, actAs, CoT or rbionfoExp")
}else{
return (eval(parse(text=type)))
}

#-----------------------------------------------------------------------------

}
2 changes: 1 addition & 1 deletion R/selfcorrect.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' \item{code.works}{A boolean value indicating whether the code works.}
#' \item{exec.result}{A character string representing the execution results.}
#' \item{tried.attempts}{An integer representing the number of attempts.}
#' @seealso [promptContext()] for predefined contexts to use.
#' @seealso \code{\link{promptContext}} for predefined contexts to use.
#' @examples
#' \dontrun{
#'
Expand Down
2 changes: 1 addition & 1 deletion R/sendPrompt.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rbionfoExp="Act as an expert bioformatician and R user. Answer questions using y
#' @param return.type The type of output to return, either the text response ("text") or the entire response object ("object").
#' @param ... Additional arguments to be passed to the prompt function.
#' @return The text response or the entire response object, based on the specified return type.
#' @seealso [promptContext()] for predefined contexts to use.
#' @seealso \code{\link{promptContext}} for predefined contexts to use.
#' @examples
#' \dontrun{
#' agent <- setupAgent(name="openai",type="chat",model="gpt-4",
Expand Down
2 changes: 1 addition & 1 deletion man/selfcorrect.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sendPrompt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f84807

Please sign in to comment.