Maybe this should be a last resort, but it's what I often find myself doing: just plainly letting them know that you are moving on. Hopefully you can also say you enjoyed talking with them.
"Thanks for taking the time to chat with me. I'm going to drift along now."
"Thanks for sharing what you did. I'm going to move along, but will be thinking about _____."
Also, turkey āĀ wondering about this question... is this a general ask or do you have a particular person or situation in mind?