Skip to main content

get_page_chatbot_context

Function get_page_chatbot_context 

Source
pub async fn get_page_chatbot_context(
    conn: &mut PgConnection,
    page_id: Uuid,
) -> ModelResult<PageChatbotContext>
Expand description

Like get_page, but projects only the columns the chatbot needs and folds in the chapter name, so the caller does not also have to fetch the whole page (including content) or the chapter.

chapter_name is None when the page has no chapter or when its chapter has been deleted, the same as looking up the chapter separately and discarding a NotFound error would give.