Skip to content

Retrieve vector store file content

FileContentPage vectorStores().files().content(FileContentParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores/{vector_store_id}/files/{file_id}/content

Retrieve the parsed contents of a vector store file.

ParametersExpand Collapse
FileContentParams params
String vectorStoreId
Optional<String> fileId
ReturnsExpand Collapse
class FileContentResponse:
Optional<String> text

The text content

Optional<String> type

The content type (currently only "text")

Retrieve vector store file content

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.vectorstores.files.FileContentPage;
import com.openai.models.vectorstores.files.FileContentParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        FileContentParams params = FileContentParams.builder()
            .vectorStoreId("vs_abc123")
            .fileId("file-abc123")
            .build();
        FileContentPage page = client.vectorStores().files().content(params);
    }
}
{
  "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"
}