Skip to content

Retrieve vector store file content

vector_stores.files.content(file_id, **kwargs) -> Page<FileContentResponse { text, type } >
GET/vector_stores/{vector_store_id}/files/{file_id}/content

Retrieve the parsed contents of a vector store file.

ParametersExpand Collapse
vector_store_id: String
file_id: String
ReturnsExpand Collapse
class FileContentResponse { text, type }
text: String

The text content

type: String

The content type (currently only "text")

Retrieve vector store file content

require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

page = openai.vector_stores.files.content("file-abc123", vector_store_id: "vs_abc123")

puts(page)
{
  "data": [
    {
      "text": "text",
      "type": "type"
    }
  ],
  "has_more": true,
  "next_page": "next_page",
  "object": "vector_store.file_content.page"
}
Returns Examples
{
  "data": [
    {
      "text": "text",
      "type": "type"
    }
  ],
  "has_more": true,
  "next_page": "next_page",
  "object": "vector_store.file_content.page"
}