Skip to content

Read File

client.Beta.Retrieval.Read(ctx, params) (*BetaRetrievalReadResponse, error)
POST/api/v1/retrieval/files/read

Read the parsed text content of a specific file.

ParametersExpand Collapse
params BetaRetrievalReadParams
FileID param.Field[string]

Body param: ID of the file to read.

IndexID param.Field[string]

Body param: ID of the index the file belongs to.

OrganizationID param.Field[string]optional

Query param

formatuuid
ProjectID param.Field[string]optional

Query param

formatuuid
MaxLength param.Field[int64]optional

Body param: Maximum number of characters to read from the offset.

Offset param.Field[int64]optional

Body param: Starting character offset.

ReturnsExpand Collapse
type BetaRetrievalReadResponse struct{…}

File read result.

Content string

Parsed text content of the file.

Read File

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.Retrieval.Read(context.TODO(), llamacloudprod.BetaRetrievalReadParams{
    FileID: "file_id",
    IndexID: "idx-abc123",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Content)
}
{
  "content": "content"
}
Returns Examples
{
  "content": "content"
}