feat(types): Refactor Part deserialization to use concrete types#104
Merged
feat(types): Refactor Part deserialization to use concrete types#104
Conversation
…ead of map[string]any - Implement custom JSON marshaling/unmarshaling for Part interface - Add UnmarshalPart() function to deserialize into TextPart, DataPart, FilePart - Add helper functions CreateTextPart(), CreateDataPart(), CreateFilePart() - Update ConvertFromSDK to use concrete types instead of map[string]any - Update client example to use typed assertions with backward compatibility - Add comprehensive tests for new marshaling functionality - All existing tests updated and passing This change improves type safety and developer experience by allowing: - part.(types.TextPart) instead of complex map assertions - Direct field access (textPart.Text) vs map lookups - IDE autocompletion and compile-time checking - Maintains backward compatibility for existing map[string]any usage Fixes #102 Co-authored-by: Eden Reich <edenreich@users.noreply.github.com>
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
…t I'm expecting to receive
edenreich
commented
Oct 11, 2025
edenreich
commented
Oct 11, 2025
…haling and marshaling more solid Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
ig-semantic-release-bot bot
added a commit
that referenced
this pull request
Oct 11, 2025
## [0.14.0](v0.13.1...v0.14.0) (2025-10-11) ### ✨ Features * Add the callbacks ready to be used by the agent ([#94](#94)) ([84632f3](84632f3)) * **types:** Refactor Part deserialization to use concrete types ([#104](#104)) ([22d192e](22d192e)), closes [#102](#102) ### ♻️ Improvements * Consolidate the logic of the agent and remove redundancy ([#93](#93)) ([54e5e71](54e5e71)) * **docker-compose:** Remove port mappings for server service to avoid confusion ([3df7b08](3df7b08)) * **server:** Remove handler duplication between A2AServerImpl and DefaultA2AProtocolHandler ([#101](#101)) ([75b9c20](75b9c20)) ### 🐛 Bug Fixes * Improve validation logic for task handler configuration ([#98](#98)) ([34d6354](34d6354)) ### 👷 CI * Add Prettier setup and formatting steps for Go and markdown files ([#105](#105)) ([f2a1994](f2a1994)) ### 📚 Documentation * **examples:** Add input-required flow examples ([#96](#96)) ([17764f3](17764f3)) ### 🔧 Miscellaneous * **deps:** Update claude-code to 2.0.8 and install gh cli version 2.81.0 in flox environment ([4d6e41a](4d6e41a))
Contributor
|
🎉 This PR is included in version 0.14.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #102
This PR refactors Part deserialization to use concrete types (TextPart, DataPart, FilePart) instead of map[string]any, improving type safety and developer experience.
Changes
Benefits
textPart.Textinstead of complex map assertionsGenerated with Claude Code