Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Mar 8, 2024
1 parent fd7a1b4 commit 5cf7863
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Imports:
httr2,
purrr,
tibble,
glue,
stringr,
jsonlite
jsonlite,
rlang
4 changes: 3 additions & 1 deletion R/chat.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ print.chat_tibble <- function(x, ...) {
#' Chat with the Mistral api
#'
#' @param text some text
#' @param which model to use. See [models()] for more information about which models are available
#' @param model which model to use. See [models()] for more information about which models are available
#' @param ... ignored
#' @inheritParams httr2::req_perform
#'
#' @return Result text from Mistral
#'
#' @examples
#' \dontrun{
#' chat("Top 5 R packages")
#' }
#'
#' @export
chat <- function(text = "What are the top 5 R packages ?", model = "mistral-tiny", ..., error_call = current_env()) {
Expand Down
4 changes: 3 additions & 1 deletion R/models.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ check_model <- function(model, error_call = caller_env()) {
#' @return A character vector with the models available in the Mistral API
#'
#' @examples
#' models()
#' \dontrun{
#' models()
#' }
#'
#' @export
models <- function(error_call = caller_env()) {
Expand Down
3 changes: 3 additions & 0 deletions R/stream.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#' stream
#'
#' @inheritParams chat
#' @export
stream <- function(text, model = "mistral-tiny", ..., error_call = current_env()) {
check_model(model, error_call = error_call)
Expand Down
6 changes: 4 additions & 2 deletions man/chat.Rd

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

4 changes: 3 additions & 1 deletion man/models.Rd

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

23 changes: 23 additions & 0 deletions man/stream.Rd

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

0 comments on commit 5cf7863

Please sign in to comment.