Skip to content

Type Alias: LlamaChatResponseTextChunk

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

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

Type declaration

type

ts
type: undefined;

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

segmentType

ts
segmentType: undefined;

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;

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[];

The generated tokens