Skip to content
1 min read · 196 words

Interface: HistoryTurn<M, TC>

Defined in: src/batteries/context/thrift/relevance.ts:185

One grouped conversation turn: the messages from a user message through the next assistant message (inclusive), plus any tool calls that occurred during it, and qa — the turn's full combined text (every message's content plus every tool call's name args fragment) used for relevance scoring.

Type Parameters

Type ParameterDefault type
M extends RelevanceMessageRelevanceMessage
TC extends RelevanceToolCallRelevanceToolCall

Properties

PropertyTypeDescriptionDefined in
createdAtstringThe turn's timestamp, updated to the latest message folded into it — used for selectNaiveTurns' recency ordering.src/batteries/context/thrift/relevance.ts:194
messagesM[]The messages belonging to this turn, in order.src/batteries/context/thrift/relevance.ts:196
qastringThe turn's combined text (all message content + tool argText(args) fragments), the string relevanceToQuery scores against.src/batteries/context/thrift/relevance.ts:191
toolCallsTC[]The tool calls attributed to this turn (by timestamp — see groupHistoryIntoTurns).src/batteries/context/thrift/relevance.ts:198