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);
}{
"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": "..."},
...
]
}