Describe the bug
Python and .NET content types are not cross compatible when serialized to JSON.
Repro #1
- Serialize python history as JSON
- Deserialize JSON in .NET
Repro #2
- Serialize .NET history as JSON
- Deserialize JSON in .python
Expected behavior
Content types are compatible across platforms
Screenshots

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
Describe the bug
Python and .NET content types are not cross compatible when serialized to JSON.
Repro #1
Repro #2
Expected behavior
Content types are compatible across platforms
Screenshots
Content Type Compatibility.xlsx
dotnet-history.json
python-history.json
In addition:
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:
KernelContentChatMessageContentTextContentFunctionCallContentFunctionResultContentOther content types include:
AnnotationContentAudioContentBinaryContentFileReferenceContentImageContent