Skip to content
Framework Docs

Read File

RetrievalReadResponse beta().retrieval().read(RetrievalReadParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v1/retrieval/files/read

Read the parsed text content of a specific file.

ParametersExpand Collapse
RetrievalReadParams params
Optional<String> organizationId
Optional<String> projectId
String fileId

ID of the file to read.

String indexId

ID of the index the file belongs to.

Optional<Long> maxLength

Maximum number of characters to read from the offset.

Optional<Long> offset

Starting character offset.

ReturnsExpand Collapse
class RetrievalReadResponse:

File read result.

String content

Parsed text content of the file.

Read File

package com.llamacloud_prod.api.example;

import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.beta.retrieval.RetrievalReadParams;
import com.llamacloud_prod.api.models.beta.retrieval.RetrievalReadResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        RetrievalReadParams params = RetrievalReadParams.builder()
            .fileId("file_id")
            .indexId("idx-abc123")
            .build();
        RetrievalReadResponse response = client.beta().retrieval().read(params);
    }
}
{
  "content": "content"
}
Returns Examples
{
  "content": "content"
}