microsoft-foundry.rest.security.o-auth2-auth
Vector stores
Delete a vector store
DELETE
/openai/v1/vector_stores/{vector_store_id}
Deletes a vector store by its identifier.
Parametri del percorso
vector_store_id
string
necessario
The ID of the vector store to delete.
Risposte
The request has succeeded.
Corpo
Content-Type: application/json
id
string
necessario
deleted
boolean
necessario
object
enum
necessario
vector_store.deleted
Richiedi
curl https://api.openai.com/v1/vector_stores/vs_abc123 \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-H "OpenAI-Beta: assistants=v2" \
-X DELETE
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
vector_store_deleted = client.vector_stores.delete(
"vector_store_id",
)
print(vector_store_deleted.id)
import OpenAI from "openai";
const openai = new OpenAI();
async function main() {
const deletedVectorStore = await openai.vectorStores.delete(
"vs_abc123"
);
console.log(deletedVectorStore);
}
main();
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const vectorStoreDeleted = await client.vectorStores.delete('vector_store_id');
console.log(vectorStoreDeleted.id);
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"),
)
vectorStoreDeleted, err := client.VectorStores.Delete(context.TODO(), "vector_store_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v
", vectorStoreDeleted.ID)
}
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.vectorstores.VectorStoreDeleteParams;
import com.openai.models.vectorstores.VectorStoreDeleted;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
VectorStoreDeleted vectorStoreDeleted = client.vectorStores().delete("vector_store_id");
}
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
vector_store_deleted = openai.vector_stores.delete("vector_store_id")
puts(vector_store_deleted)
Response
{
id: "vs_abc123",
object: "vector_store.deleted",
deleted: true
}