Skip to main content

attach_turn_citations_to_message

Function attach_turn_citations_to_message 

Source
pub async fn attach_turn_citations_to_message(
    conn: &mut PgConnection,
    conversation_id: Uuid,
    conversation_message_id: Uuid,
) -> ModelResult<Vec<Uuid>>
Expand description

Points the citations of the conversation’s newest turn at conversation_message_id, the message whose text cites them.

A citation is saved attached to the search tool output it was read from, a message the chatbot ui does not render, so a citation only becomes reachable once it is moved to the answer. The turn is taken to be every message after the newest message from the user: a turn can search in one round and answer in another, and the round that answers has a different Azure response id than the round that searched, both when a tool call was answered on the server and when the turn suspended and a later request resumed it.