Skip to main content

max_citation_number_in_turn

Function max_citation_number_in_turn 

Source
pub async fn max_citation_number_in_turn(
    conn: &mut PgConnection,
    conversation_id: Uuid,
) -> ModelResult<Option<i32>>
Expand description

The highest citation number already used by a tool call in the turn still in progress, or None if the turn has cited nothing yet. A new search tool numbers its own hits starting after this rather than from zero, since a whole turn’s citations end up on one message (see attach_turn_citations_to_message) and would otherwise collide with an earlier search’s numbers. Scoped identically to that function’s own subquery.