Skip to content

Type Alias: RankingOptions ​

ts
type RankingOptions = {
  onOverflow?:   | "throw"
     | "maxChunk"
     | {
     type: "throw";
   }
     | {
     type: "maxChunk";
     overlapPercentage?: number;
   };
};

Defined in: evaluator/LlamaRankingContext.ts:66

Properties ​

onOverflow? ​

ts
optional onOverflow: 
  | "throw"
  | "maxChunk"
  | {
  type: "throw";
}
  | {
  type: "maxChunk";
  overlapPercentage?: number;
};

Defined in: evaluator/LlamaRankingContext.ts:76

When the given document it too big that it exceeds the context size, this option determines how to handle it.

  • "throw": throw an error
  • "maxChunk": split the document into smaller chunks that would fit the context, rank all of them, and return the highest ranking score among the chunks. By default, sequential chunks will overlap by at least 50%.

Default to "throw".

Type Declaration ​

"throw"

"maxChunk"

ts
{
  type: "throw";
}

type ​

ts
type: "throw";
ts
{
  type: "maxChunk";
  overlapPercentage?: number;
}

type ​

ts
type: "maxChunk";

overlapPercentage? ​

ts
optional overlapPercentage: number;

The percentage of overlap between sequential chunks when splitting the document.

Defaults to 0.5.