Skip to content

Unable to serialize ChatHistory #11996

Answered by moonbox3
j-ajim asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @j-ajim, what version of SK are you running?

I am unable to repro this error after adding

history = thread._chat_history
history.store_chat_history_to_file("chat_history.json")

To this sample: https://github.com/microsoft/semantic-kernel/blob/main/python/samples/getting_started_with_agents/chat_completion/step4_chat_completion_agent_plugin_simple.py

The chat history is serialized properly and stored to a file without error.

Looks like you have some custom code in a plugin that is related to an AIServiceSelector? As we don't provide a way to pass in custom exclude attributes to the model_dump_json call that serialize uses, I'd suggest you look into performing the model_dump_json(exclude…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sophialagerkranspandey
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
python Pull requests for the Python Semantic Kernel agents chat history
2 participants