Skip to content

Files

List vector store files
client.VectorStores.Files.List(ctx, vectorStoreID, query) (*CursorPage[VectorStoreFile], error)
GET/vector_stores/{vector_store_id}/files
Create vector store file
client.VectorStores.Files.New(ctx, vectorStoreID, body) (*VectorStoreFile, error)
POST/vector_stores/{vector_store_id}/files
Update vector store file attributes
client.VectorStores.Files.Update(ctx, vectorStoreID, fileID, body) (*VectorStoreFile, error)
POST/vector_stores/{vector_store_id}/files/{file_id}
Retrieve vector store file
client.VectorStores.Files.Get(ctx, vectorStoreID, fileID) (*VectorStoreFile, error)
GET/vector_stores/{vector_store_id}/files/{file_id}
Delete vector store file
client.VectorStores.Files.Delete(ctx, vectorStoreID, fileID) (*VectorStoreFileDeleted, error)
DELETE/vector_stores/{vector_store_id}/files/{file_id}
Retrieve vector store file content
client.VectorStores.Files.Content(ctx, vectorStoreID, fileID) (*Page[VectorStoreFileContentResponse], error)
GET/vector_stores/{vector_store_id}/files/{file_id}/content
ModelsExpand Collapse
type VectorStoreFile struct{…}

A list of files attached to a vector store.

ID string

The identifier, which can be referenced in API endpoints.

CreatedAt int64

The Unix timestamp (in seconds) for when the vector store file was created.

LastError VectorStoreFileLastError

The last error associated with this vector store file. Will be null if there are no errors.

Code string

One of server_error, unsupported_file, or invalid_file.

Accepts one of the following:
const VectorStoreFileLastErrorCodeServerError VectorStoreFileLastErrorCode = "server_error"
const VectorStoreFileLastErrorCodeUnsupportedFile VectorStoreFileLastErrorCode = "unsupported_file"
const VectorStoreFileLastErrorCodeInvalidFile VectorStoreFileLastErrorCode = "invalid_file"
Message string

A human-readable description of the error.

Object VectorStoreFile

The object type, which is always vector_store.file.

Status VectorStoreFileStatus

The status of the vector store file, which can be either in_progress, completed, cancelled, or failed. The status completed indicates that the vector store file is ready for use.

Accepts one of the following:
const VectorStoreFileStatusInProgress VectorStoreFileStatus = "in_progress"
const VectorStoreFileStatusCompleted VectorStoreFileStatus = "completed"
const VectorStoreFileStatusCancelled VectorStoreFileStatus = "cancelled"
const VectorStoreFileStatusFailed VectorStoreFileStatus = "failed"
UsageBytes int64

The total vector store usage in bytes. Note that this may be different from the original file size.

VectorStoreID string

The ID of the vector store that the File is attached to.

Attributes map[string, VectorStoreFileAttributeUnion]optional

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters, booleans, or numbers.

Accepts one of the following:
string
float64
bool
ChunkingStrategy FileChunkingStrategyUnionoptional

The strategy used to chunk the file.

type VectorStoreFileDeleted struct{…}
ID string
Deleted bool
Object VectorStoreFileDeleted