Skip to content

Find Files

client.Beta.Retrieval.Find(ctx, params) (*PaginatedCursorPost[BetaRetrievalFindResponse], error)
POST/api/v1/retrieval/files/find

Search for files by name.

ParametersExpand Collapse
params BetaRetrievalFindParams
IndexID param.Field[string]

Body param: ID of the index to search within.

OrganizationID param.Field[string]optional

Query param

formatuuid
ProjectID param.Field[string]optional

Query param

formatuuid
FileName param.Field[string]optional

Body param: Exact file name to match.

FileNameContains param.Field[string]optional

Body param: Substring match on file name (case-insensitive).

PageSize param.Field[int64]optional

Body param: The maximum number of items to return. The service may return fewer than this value. If unspecified, a default page size will be used. The maximum value is typically 1000; values above this will be coerced to the maximum.

PageToken param.Field[string]optional

Body param: A page token, received from a previous list call. Provide this to retrieve the subsequent page.

ReturnsExpand Collapse
type BetaRetrievalFindResponse struct{…}

A file returned by find.

FileID string

ID of the file.

FileName string

Display name of the file.

Find Files

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"),
  )
  page, err := client.Beta.Retrieval.Find(context.TODO(), llamacloudprod.BetaRetrievalFindParams{
    IndexID: "idx-abc123",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "items": [
    {
      "file_id": "file_id",
      "file_name": "file_name"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
Returns Examples
{
  "items": [
    {
      "file_id": "file_id",
      "file_name": "file_name"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}