core.conversation_manager
Client conversation history management with suspend/restore support.
Client conversation history management with suspend/restore support.
- class ConversationManager(client, lock=None)[source]
Bases:
objectManages the underlying client’s conversation history.
Handles: - Thread-safe suspend/restore for declarative history injection - Proxy access to the client’s conversation with error handling - Message appending and conversation clearing
- Parameters:
client (Any) – The AI client whose conversation history is managed.
lock (threading.Lock | None) – Optional lock for thread-safe access.
- should_suspend(prompt, history)[source]
Determine if client history should be suspended for this call.
Suspension is needed when a
historyparameter is provided or the prompt contains{{...}}interpolation patterns.
Classes
- class ConversationManager(client, lock=None)[source]
Bases:
objectManages the underlying client’s conversation history.
Handles: - Thread-safe suspend/restore for declarative history injection - Proxy access to the client’s conversation with error handling - Message appending and conversation clearing
- Parameters:
client (Any) – The AI client whose conversation history is managed.
lock (threading.Lock | None) – Optional lock for thread-safe access.
- should_suspend(prompt, history)[source]
Determine if client history should be suspended for this call.
Suspension is needed when a
historyparameter is provided or the prompt contains{{...}}interpolation patterns.