Skip to content

Delete a Knowledge Base

client.KnowledgeBases.Delete(ctx, uuid) (*KnowledgeBaseDeleteResponse, error)
delete/v2/gen-ai/knowledge_bases/{uuid}

To delete a knowledge base, send a DELETE request to /v2/gen-ai/knowledge_bases/{uuid}.

ParametersExpand Collapse
uuid string
ReturnsExpand Collapse
type KnowledgeBaseDeleteResponse struct{…}

Information about a deleted knowledge base

Uuid stringoptional

The id of the deleted knowledge base

Delete a Knowledge Base
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := gradient.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  knowledgeBase, err := client.KnowledgeBases.Delete(context.TODO(), `"123e4567-e89b-12d3-a456-426614174000"`)
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", knowledgeBase.Uuid)
}
{
  "uuid": "123e4567-e89b-12d3-a456-426614174000"
}
Returns Examples
{
  "uuid": "123e4567-e89b-12d3-a456-426614174000"
}