Retrieve vector store file content
client.vectorStores.files.content(stringfileID, FileContentParams { vector_store_id } params, RequestOptionsoptions?): Page<FileContentResponse { text, type } >
GET/vector_stores/{vector_store_id}/files/{file_id}/content
Retrieve vector store file content
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const fileContentResponse of client.vectorStores.files.content('file-abc123', {
vector_store_id: 'vs_abc123',
})) {
console.log(fileContentResponse.text);
}{
"object": "vector_store.file_content.page",
"data": [
{"type": "text", "text": "file content"}
],
"has_more": false,
"next_page": null
}
Returns Examples
{
"object": "vector_store.file_content.page",
"data": [
{"type": "text", "text": "file content"}
],
"has_more": false,
"next_page": null
}