vibe.assistant.context¶
Model context management for the assistant.
ModelContextManager ¶
Orchestrates conversation context management for the assistant model.
Composes specialized components: - HistoryPruner: Prunes conversation history based on strategy - UserInputProcessor: Applies security protection to user messages - SystemPromptBuilder: Builds system prompts from templates
The class coordinates these components to construct the messages list sent to the LLM, handling different strategies for context management.
__init__ ¶
__init__(provider: LLMProvider) -> None
Initialize the context manager.
| Parameters: |
|
|---|
build_prompt_messages ¶
build_prompt_messages(session_state: dict[str, Any]) -> list[Message]
Construct the full messages list based on the configured strategy.
| Parameters: |
|
|---|
| Returns: |
|
|---|
update_with_turn_result ¶
update_with_turn_result(session_state: dict[str, Any], user_message: UserMessage, assistant_response: AssistantMessage) -> None
Update session state's history after a turn is complete.
| Parameters: |
|
|---|