Commit 437737e
authored
[ai] Add JSON serialization for Messages and Content Blocks (#512)
## Summary
This PR builds on top of
#511.
+ Implements JSON marshaling/unmarshaling for all message types
(SystemMessage, UserMessage, AssistantMessage, ToolMessage) and content
blocks.
+ Includes type discriminators in serialized JSON and proper validation
during deserialization.
## How was it tested?
Added tests.
## Community Contribution License
All community contributions in this pull request are licensed to the
project maintainers under the terms of the [Apache 2
License](https://www.apache.org/licenses/LICENSE-2.0).
By creating this pull request I represent that I have the right to
license the contributions to the project maintainers under the Apache 2
License as stated in the [Community Contribution
License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).
---------
Signed-off-by: Daniel Loreto <279789+loreto@users.noreply.github.com>1 parent ed0502d commit 437737e
2 files changed
Lines changed: 1042 additions & 9 deletions
0 commit comments