Skip to content

Retrieve vector store file batch

client.VectorStores.FileBatches.Get(ctx, vectorStoreID, batchID) (*VectorStoreFileBatch, error)
GET/vector_stores/{vector_store_id}/file_batches/{batch_id}

Retrieves a vector store file batch.

ParametersExpand Collapse
vectorStoreID string
batchID string
ReturnsExpand Collapse
type VectorStoreFileBatch struct{…}

A batch 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 files batch was created.

FileCounts VectorStoreFileBatchFileCounts
Cancelled int64

The number of files that where cancelled.

Completed int64

The number of files that have been processed.

Failed int64

The number of files that have failed to process.

InProgress int64

The number of files that are currently being processed.

Total int64

The total number of files.

Object VectorStoreFilesBatch

The object type, which is always vector_store.file_batch.

Status VectorStoreFileBatchStatus

The status of the vector store files batch, which can be either in_progress, completed, cancelled or failed.

Accepts one of the following:
const VectorStoreFileBatchStatusInProgress VectorStoreFileBatchStatus = "in_progress"
const VectorStoreFileBatchStatusCompleted VectorStoreFileBatchStatus = "completed"
const VectorStoreFileBatchStatusCancelled VectorStoreFileBatchStatus = "cancelled"
const VectorStoreFileBatchStatusFailed VectorStoreFileBatchStatus = "failed"
VectorStoreID string

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

Retrieve vector store file batch

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"),
  )
  vectorStoreFileBatch, err := client.VectorStores.FileBatches.Get(
    context.TODO(),
    "vs_abc123",
    "vsfb_abc123",
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorStoreFileBatch.ID)
}
{
  "id": "id",
  "created_at": 0,
  "file_counts": {
    "cancelled": 0,
    "completed": 0,
    "failed": 0,
    "in_progress": 0,
    "total": 0
  },
  "object": "vector_store.files_batch",
  "status": "in_progress",
  "vector_store_id": "vector_store_id"
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "file_counts": {
    "cancelled": 0,
    "completed": 0,
    "failed": 0,
    "in_progress": 0,
    "total": 0
  },
  "object": "vector_store.files_batch",
  "status": "in_progress",
  "vector_store_id": "vector_store_id"
}