Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context partially cleared after first turn of conversation #114

Open
danielrhodes opened this issue Sep 4, 2024 · 1 comment
Open

Context partially cleared after first turn of conversation #114

danielrhodes opened this issue Sep 4, 2024 · 1 comment

Comments

@danielrhodes
Copy link

danielrhodes commented Sep 4, 2024

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants