Skip to content

Type Alias: LlamaChatResponseTextChunk ​

ts
type LlamaChatResponseTextChunk = {
  type: undefined;
  segmentType: undefined;
  text: string;
  tokens: Token[];
};

Defined in: evaluator/LlamaChat/LlamaChat.ts:58

Properties ​

type ​

ts
type: undefined;

Defined in: evaluator/LlamaChat/LlamaChat.ts:60

When type is undefined, the chunk is part of the main response and is not a segment


segmentType ​

ts
segmentType: undefined;

Defined in: evaluator/LlamaChat/LlamaChat.ts:65

segmentType has no purpose when type is undefined (meaning that this chunk is part of the main response and is not a segment).


text ​

ts
text: string;

Defined in: evaluator/LlamaChat/LlamaChat.ts:75

The generated text chunk.

Detokenized from the tokens property, but with the context of the previous generation (for better spacing of the text with some models).

Prefer using this property over tokens when streaming the generated response as text.


tokens ​

ts
tokens: Token[];

Defined in: evaluator/LlamaChat/LlamaChat.ts:78

The generated tokens