Create vector store file
client.VectorStores.Files.New(ctx, vectorStoreID, body) (*VectorStoreFile, error)
POST/vector_stores/{vector_store_id}/files
Create a vector store file by attaching a File to a vector store.
Parameters
vectorStoreID string
Returns
Create vector store file
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.New(
context.TODO(),
"vs_abc123",
openai.VectorStoreFileNewParams{
FileID: "file_id",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", vectorStoreFile.ID)
}
{
"id": "id",
"created_at": 0,
"last_error": {
"code": "server_error",
"message": "message"
},
"object": "vector_store.file",
"status": "in_progress",
"usage_bytes": 0,
"vector_store_id": "vector_store_id",
"attributes": {
"foo": "string"
},
"chunking_strategy": {
"static": {
"chunk_overlap_tokens": 0,
"max_chunk_size_tokens": 100
},
"type": "static"
}
}Returns Examples
{
"id": "id",
"created_at": 0,
"last_error": {
"code": "server_error",
"message": "message"
},
"object": "vector_store.file",
"status": "in_progress",
"usage_bytes": 0,
"vector_store_id": "vector_store_id",
"attributes": {
"foo": "string"
},
"chunking_strategy": {
"static": {
"chunk_overlap_tokens": 0,
"max_chunk_size_tokens": 100
},
"type": "static"
}
}