Type Alias: LlamaChatResponseSegmentChunk
type LlamaChatResponseSegmentChunk = {
type: "segment";
segmentType: ChatModelSegmentType;
text: string;
tokens: Token[];
segmentStartTime: Date;
segmentEndTime: Date;
};
Defined in: evaluator/LlamaChat/LlamaChat.ts:71
Type declaration
type
type: "segment";
segmentType
segmentType: ChatModelSegmentType;
Segment type
text
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
tokens: Token[];
The generated tokens
segmentStartTime?
optional segmentStartTime: Date;
When the current chunk is the start of a segment, this field will be set.
It's possible that a chunk with no tokens and empty text will be emitted just to set this field to signify that the segment has started.
segmentEndTime?
optional segmentEndTime: Date;
When the current chunk is the last one of a segment (meaning the current segment has ended), this field will be set.
It's possible that a chunk with no tokens and empty text will be emitted just to set this field to signify that the segment has ended.