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

.Net: How to extend the ChatHistory class? #9935

Open
sphenry opened this issue Dec 10, 2024 · 0 comments
Open

.Net: How to extend the ChatHistory class? #9935

sphenry opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
.NET Issue or Pull requests regarding .NET code

Comments

@sphenry
Copy link
Member

sphenry commented Dec 10, 2024

Discussed in #9931

Originally posted by MalayAgr December 10, 2024
I have a scenario where I want to make the ChatHistory class an observable so that other classes can subscribe to changes in the ChatHistory. The extended class would notify the subscribers whenever a message is added to the ChatHistory.

Unfortunately, I just realised that none of the methods used to add messages to the ChatHistory are virtual and hence, cannot be overridden. I was hoping to leverage polymorphism so that the rest of my code doesn't need to change and I can use this observable ChatHistory and the usual ChatHistory class interchangeably.

How can I achieve this?

@sphenry sphenry added the .NET Issue or Pull requests regarding .NET code label Dec 10, 2024
@github-actions github-actions bot changed the title How to extend the ChatHistory class? .Net: How to extend the ChatHistory class? Dec 10, 2024
@sphenry sphenry moved this to Backlog in Semantic Kernel Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Issue or Pull requests regarding .NET code
Projects
Status: Backlog
Development

No branches or pull requests

3 participants