Delete a file and remove it from all vector stores.
Parameters
fileID string
Returns
Delete 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"),
)
fileDeleted, err := client.Files.Delete(context.TODO(), "file_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", fileDeleted.ID)
}
{
"id": "id",
"deleted": true,
"object": "file"
}Returns Examples
{
"id": "id",
"deleted": true,
"object": "file"
}