Skip to main content

Module conversation_context

Module conversation_context 

Source
Expand description

What a chatbot request says about the course material page the learner has open.

Structs§

ChatbotPageContext
What the learner has open when they send a message.

Constants§

PAGE_CONTEXT_RESPONSE_ID 🔒
Stands in for the Azure response id of a page context message, which we write ourselves and which therefore has no Azure response behind it. The not_null_for_llm_generated_messages check constraint demands one for every message that is not from the user; the initial assistant message of a conversation stands in for it the same way.

Functions§

insert_page_context_message_if_changed
Records what the learner is looking at as a developer message in the conversation, so that it survives a history rebuild instead of being prepended in memory on every request.
page_context_message 🔒
page_context_text 🔒
Describes the learner’s place in the course to the model. Parts that could not be resolved are left out rather than named as unknown.
resolve_page_context
The page the learner claims to have open, or None when nothing about it may be shown to the model.