Update vector store file attributes
client.VectorStores.Files.Update(ctx, vectorStoreID, fileID, body) (*VectorStoreFile, error)
POST/vector_stores/{vector_store_id}/files/{file_id}
Update attributes on a vector store file.
Parameters
vectorStoreID string
fileID string
Returns
Update vector store file attributes
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
vectorStoreFile, err := client.VectorStores.Files.Update(
context.TODO(),
"vs_abc123",
"file-abc123",
openai.VectorStoreFileUpdateParams{
Attributes: map[string]openai.VectorStoreFileUpdateParamsAttributeUnion{
"foo": openai.VectorStoreFileUpdateParamsAttributeUnion{
OfString: openai.String("string"),
},
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", vectorStoreFile.ID)
}
{
"id": "file-abc123",
"object": "vector_store.file",
"usage_bytes": 1234,
"created_at": 1699061776,
"vector_store_id": "vs_abcd",
"status": "completed",
"last_error": null,
"chunking_strategy": {...},
"attributes": {"key1": "value1", "key2": 2}
}
Returns Examples
{
"id": "file-abc123",
"object": "vector_store.file",
"usage_bytes": 1234,
"created_at": 1699061776,
"vector_store_id": "vs_abcd",
"status": "completed",
"last_error": null,
"chunking_strategy": {...},
"attributes": {"key1": "value1", "key2": 2}
}