grammyjs / conversations

Conversational interfaces for grammY.
https://grammy.dev/plugins/conversations
MIT License
49 stars 17 forks source link

Context partially cleared after first turn of conversation #114

Open danielrhodes opened 1 month ago

danielrhodes commented 1 month ago

I noticed that after one turn of a conversation, the Context gets some properties cleared. I assume this is because the Context is being saved to an external store and then when it is unfrozen, it doesn't have things like functions or anything else that was hydrated.

Is there a way around this? One thing that makes it confusing is that the hydrated context is fully available on the first turn.

KnorpelSenf commented 1 month ago

I assume this is because the Context is being saved to an external store and then when it is unfrozen, it doesn't have things like functions or anything else that was hydrated

This is correct

Is there a way around this?

You can either look into conversation.run and https://grammy.dev/plugins/conversations#working-with-plugins, or you can call these functions directly rather than installing them on the context object.

One thing that makes it confusing is that the hydrated context is fully available on the first turn.

That is correct, this was an early design mistake. It will be fixed for the next major version.