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

Python Bug: Serialized _Chat Content_ types incompatible with .NET #9627

Open
crickman opened this issue Nov 8, 2024 · 0 comments
Open

Python Bug: Serialized _Chat Content_ types incompatible with .NET #9627

crickman opened this issue Nov 8, 2024 · 0 comments
Labels
bug Something isn't working chat history kernel.core kernel Issues or pull requests impacting the core kernel python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)

Comments

@crickman
Copy link
Contributor

crickman commented Nov 8, 2024

Describe the bug
Python and .NET content types are not cross compatible when serialized to JSON.

Repro #1

  1. Serialize python history as JSON
  2. Deserialize JSON in .NET

Repro #2

  1. Serialize .NET history as JSON
  2. Deserialize JSON in .python

Expected behavior
Content types are compatible across platforms

Screenshots

Image

Content Type Compatibility.xlsx
dotnet-history.json
python-history.json

The yellow highlighted items are ones that might be easily addressed with case (upper/lower/snake) conversion (for example, using an ignore case option on deserialization) and also not writing null/empty values.

The pink highlighted items are more structural. Some might be easily addressed (don't write inner_content); while others may challenging to unwind

In addition:

  • .NET utilizes HTML encoding for text content.
  • Meta-data keys differ across platform based on the OpenAI SDK

Additional context
This has compatibility has long been identified as desired, but not directly analyzed or addressed. Performed analysis for critical types as part of agent framework serialization feature and capturing here:

  • KernelContent
  • ChatMessageContent
  • TextContent
  • FunctionCallContent
  • FunctionResultContent

Other content types include:

  • AnnotationContent
  • AudioContent
  • BinaryContent
  • FileReferenceContent
  • ImageContent
@crickman crickman added bug Something isn't working python Pull requests for the Python Semantic Kernel labels Nov 8, 2024
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Nov 9, 2024
@github-actions github-actions bot changed the title Python Bug: Serialized _Chat Content_ types incompatible with .NET .Net: Python Bug: Serialized _Chat Content_ types incompatible with .NET Nov 9, 2024
@crickman crickman added chat history kernel Issues or pull requests impacting the core kernel kernel.core and removed .NET Issue or Pull requests regarding .NET code triage labels Nov 9, 2024
@crickman crickman changed the title .Net: Python Bug: Serialized _Chat Content_ types incompatible with .NET Python Bug: Serialized _Chat Content_ types incompatible with .NET Nov 9, 2024
@crickman crickman added triage sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) labels Nov 9, 2024
@crickman crickman moved this to Backlog in Semantic Kernel Nov 9, 2024
@moonbox3 moonbox3 removed the triage label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chat history kernel.core kernel Issues or pull requests impacting the core kernel python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Projects
Status: Backlog
Development

No branches or pull requests

3 participants