Learn R Programming

openaiRtools (version 0.2.2)

create_vector_store: Create a Vector Store (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and creates a new vector store.

Usage

create_vector_store(...)

Value

A vector store object with $id (save this), $name, $status, and $file_counts.

Arguments

...

Parameters passed to VectorStoresClient$create(): name, file_ids, expires_after, chunking_strategy, metadata.

Examples

Run this code
if (FALSE) {
Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx")

vs <- create_vector_store(
  name     = "Economics Literature",
  file_ids = list("file-abc123", "file-def456")
)
cat("Vector Store ID:", vs$id)
}

Run the code above in your browser using DataLab