R/tenants.R

Defines functions get_tenant create_tenant

Documented in create_tenant get_tenant

#' Create a Tenant
#'
#' @param client A ChromaDB client object
#' @param name The name of the tenant
#'
#' @return A tenant object containing the tenant details
#' @export
create_tenant <- function(client, name) {
  body <- list(name = name)
  resp <- make_request(client$req, "tenants", body = body, method = "POST")
  get_tenant(client, name)
}

#' Get a Tenant
#'
#' @param client A ChromaDB client object
#' @param name The name of the tenant
#'
#' @return A tenant object containing the tenant details
#' @export
get_tenant <- function(client, name) {
  endpoint <- paste0("tenants/", name)
  make_request(client$req, endpoint)
}

Try the rchroma package in your browser

Any scripts or data that you put into this service are public.

rchroma documentation built on April 4, 2025, 1:37 a.m.