Skip to content

Delete Agent Data By Query

client.Beta.AgentData.DeleteByQuery(ctx, params) (*BetaAgentDataDeleteByQueryResponse, error)
POST/api/v1/beta/agent-data/:delete

Bulk delete agent data by query (deployment_name, collection, optional filters).

ParametersExpand Collapse
params BetaAgentDataDeleteByQueryParams
DeploymentName param.Field[string]

Body param: The agent deployment’s name to delete data for

OrganizationID param.Field[string]optional

Query param

formatuuid
ProjectID param.Field[string]optional

Query param

formatuuid
Collection param.Field[string]optional

Body param: The logical agent data collection to delete from

Filter param.Field[map[string, BetaAgentDataDeleteByQueryParamsFilter]]optional

Body param: Optional filters to select which items to delete

Eq BetaAgentDataDeleteByQueryParamsFilterEqUnionoptional
One of the following:
float64
string
Time
Excludes []BetaAgentDataDeleteByQueryParamsFilterExcludeUnionoptional
One of the following:
float64
string
Time
Gt BetaAgentDataDeleteByQueryParamsFilterGtUnionoptional
One of the following:
float64
string
Time
Gte BetaAgentDataDeleteByQueryParamsFilterGteUnionoptional
One of the following:
float64
string
Time
Includes []BetaAgentDataDeleteByQueryParamsFilterIncludeUnionoptional
One of the following:
float64
string
Time
Lt BetaAgentDataDeleteByQueryParamsFilterLtUnionoptional
One of the following:
float64
string
Time
Lte BetaAgentDataDeleteByQueryParamsFilterLteUnionoptional
One of the following:
float64
string
Time
Ne BetaAgentDataDeleteByQueryParamsFilterNeUnionoptional
One of the following:
float64
string
Time
ReturnsExpand Collapse
type BetaAgentDataDeleteByQueryResponse struct{…}

API response for bulk delete operation

DeletedCount int64

Delete Agent Data By Query

package main

import (
  "context"
  "fmt"

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

func main() {
  client := llamacloudprod.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Beta.AgentData.DeleteByQuery(context.TODO(), llamacloudprod.BetaAgentDataDeleteByQueryParams{
    DeploymentName: "deployment_name",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.DeletedCount)
}
{
  "deleted_count": 0
}
Returns Examples
{
  "deleted_count": 0
}