langchain/memory/chat_message_histories/cosmos_db.py/CosmosDBChatMessageHistory/__exit__
class CosmosDBChatMessageHistory:    def __exit__(
        self,
        exc_type: Optional[Type[BaseException]],
        exc_val: Optional[BaseException],
        traceback: Optional[TracebackType],
    ) -> None:
        """Context manager exit"""
        self.upsert_messages()
        self._client.__exit__(exc_type, exc_val, traceback)