Learn R Programming

openaiRtools (version 0.2.2)

retrieve_vector_store: Retrieve a Vector Store (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and retrieves a vector store by its ID.

Usage

retrieve_vector_store(vector_store_id)

Value

A vector store object with $id, $name, $status, and $file_counts.

Arguments

vector_store_id

Character. Required. The vector store ID (e.g. "vs_abc123").

Examples

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

vs <- retrieve_vector_store("vs_abc123")
cat("Name:", vs$name)
cat("Files:", vs$file_counts$completed, "ready")
}

Run the code above in your browser using DataLab