Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

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)
{
  "file_id": "file-abc123",
  "filename": "example.txt",
  "attributes": {"key": "value"},
  "content": [
    {"type": "text", "text": "..."},
    ...
  ]
}
Returns Examples
{
  "file_id": "file-abc123",
  "filename": "example.txt",
  "attributes": {"key": "value"},
  "content": [
    {"type": "text", "text": "..."},
    ...
  ]
}