Strands Agents Typescript SDK
    Preparing search index...

    Class CitationsBlock

    Citations content block within a message. Returned by models when document citations are enabled. This is an output-only block — users do not construct these directly.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    type: "citationsBlock" = ...

    Discriminator for citations content.

    citations: Citation[]

    Array of citations linking generated content to source locations.

    The generated content associated with these citations.

    Methods

    • Serializes the CitationsBlock to a JSON-compatible ContentBlockData object. Called automatically by JSON.stringify().

      Returns {
          citations: {
              citations: {
                  location:
                      | {
                          type: "documentChar";
                          documentIndex: number;
                          start: number;
                          end: number;
                      }
                      | {
                          type: "documentPage";
                          documentIndex: number;
                          start: number;
                          end: number;
                      }
                      | {
                          type: "documentChunk";
                          documentIndex: number;
                          start: number;
                          end: number;
                      }
                      | {
                          type: "searchResult";
                          searchResultIndex: number;
                          start: number;
                          end: number;
                      }
                      | { type: "web"; url: string; domain?: string };
                  source: string;
                  sourceContent: { text: string }[];
                  title: string;
              }[];
              content: { text: string }[];
          };
      }

    • Creates a CitationsBlock instance from its wrapped data format.

      Parameters

      • data: {
            citations: {
                citations: {
                    location:
                        | {
                            type: "documentChar";
                            documentIndex: number;
                            start: number;
                            end: number;
                        }
                        | {
                            type: "documentPage";
                            documentIndex: number;
                            start: number;
                            end: number;
                        }
                        | {
                            type: "documentChunk";
                            documentIndex: number;
                            start: number;
                            end: number;
                        }
                        | {
                            type: "searchResult";
                            searchResultIndex: number;
                            start: number;
                            end: number;
                        }
                        | { type: "web"; url: string; domain?: string };
                    source: string;
                    sourceContent: { text: string }[];
                    title: string;
                }[];
                content: { text: string }[];
            };
        }

        Wrapped CitationsBlockData to deserialize

      Returns CitationsBlock

      CitationsBlock instance