Skip to content

Commit f6bdf62

Browse files
committed
fix check errors
1 parent 39568b8 commit f6bdf62

File tree

6 files changed

+21
-5
lines changed

6 files changed

+21
-5
lines changed

DESCRIPTION

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ Imports:
1717
cli,
1818
dplyr,
1919
httr2,
20+
jsonlite,
21+
methods,
2022
prettyunits,
2123
purrr,
22-
tibble,
23-
utils
24+
tibble
2425
Suggests:
2526
knitr,
2627
rmarkdown,
@@ -29,3 +30,4 @@ Suggests:
2930
VignetteBuilder: knitr
3031
Config/testthat/edition: 3
3132
Language: en-US
33+
URL: https://jbgruber.github.io/rollama/

R/models.r

+7-1
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,15 @@ copy_model <- function(model,
155155

156156
#' List models that are available locally.
157157
#'
158+
#' @inheritParams query
159+
#'
158160
#' @return a tibble of installed models
159161
#' @export
160-
list_models <- function() {
162+
list_models <- function(server = NULL) {
163+
164+
if (is.null(server)) server <- getOption("rollama_server",
165+
default = "http://localhost:11434")
166+
161167
httr2::request(server) |>
162168
httr2::req_url_path_append("/api/tags") |>
163169
httr2::req_perform() |>

R/utils.r

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ the <- new.env()
33

44
#' Ping server to see if Ollama is reachable
55
#'
6+
#' @param silent suppress warnings and status (only return `TRUE`/`FALSE`).
67
#' @inheritParams query
78
#'
89
#' @return TRUE if server is running
@@ -94,7 +95,6 @@ screen_answer <- function(x) {
9495
pgrs <- function(resp) {
9596
if (!getOption("rollama_verbose", default = interactive())) return(TRUE)
9697
the$str_prgs$stream_resp <- c(the$str_prgs$stream_resp, resp)
97-
x <<- the$str_prgs$stream_resp
9898
resp <- the$str_prgs$stream_resp
9999

100100
status <- strsplit(rawToChar(resp), "\n")[[1]] |>

inst/WORDLIST

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CMD
12
ChatGPT
23
Embeddings
34
LLM
@@ -7,6 +8,7 @@ Modelfile
78
Ollama
89
OpenAI's
910
OpenAI’s
11+
RMDs
1012
Reichardt
1113
config
1214
embeddings

man/list_models.Rd

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ping_ollama.Rd

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)