Skip to content

Type Alias: LlamaChatResponseTextChunk

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

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

Properties

type

ts
type: undefined;

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

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:56

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:66

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:69

The generated tokens