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

Fixed issue #207 - Error Deserializing ChatMessage #209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zeecorleone
Copy link

Fixed issue #207.
(Important: PR 208 should be merged. The solution contains build errors inside Test project, which I fixed in that PR separately)

/// <summary>
/// Creates an empty <see cref="ImageInput"/>
/// </summary>
public ImageInput() { }
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to support deserialization

image = value;
text = null;
Type = "image_url";
if (value != null)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After spending a lot of time, I found that this was the root cause. Values were being overwritten, hence deserialization was breaking. I tried to think of all cases/paths, and it looks fine to me to add this check. @OkGoDoIt , if you can think of anything where this doesn't fit it, let me know.

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

Successfully merging this pull request may close these issues.

Error deserializing a ChatMessage
1 participant