Title: chore: create union for working with message content by LucaButBoring · Pull Request #939 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: chore: create union for working with message content by LucaButBoring · Pull Request #939 · modelcontextprotocol/python-sdk
X Title: chore: create union for working with message content by LucaButBoring · Pull Request #939 · modelcontextprotocol/python-sdk
Description: Moves message content types into a union and uses that throughout the codebase. Suggested by @Kludex in #725. Motivation and Context Simplifies code, makes for fewer places to update when new content types are introduced in the future. How Has This Been Tested? Unit tests Breaking Changes None Types of changes Bug fix (non-breaking change which fixes an issue) New feature (non-breaking change which adds functionality) Breaking change (fix or feature that would cause existing functionality to change) Documentation update Checklist I have read the MCP Documentation My code follows the repository's style guidelines New and existing tests pass locally I have added appropriate error handling I have added or updated documentation as needed Additional context Used a raw union instead of RootModel as suggested at the top of the file to avoid breaking changes. Using a new type extending RootModel would require wrapping all existing usages of TextContent etc. in that new type. Deliberately not used in sampling as sampling messages don't support embedded resources right now (see modelcontextprotocol/modelcontextprotocol#522).
Open Graph Description: Moves message content types into a union and uses that throughout the codebase. Suggested by @Kludex in #725. Motivation and Context Simplifies code, makes for fewer places to update when new conte...
X Description: Moves message content types into a union and uses that throughout the codebase. Suggested by @Kludex in #725. Motivation and Context Simplifies code, makes for fewer places to update when new conte...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/939
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2626be9c-776c-97ba-ef68-95acc63905a0 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B9FE:23E495:B22D88:F06431:6A5A90C3 |
| html-safe-nonce | 5820f5bc7aa8455fb6bccaf0492db3028a5134ad778f07ebef0f807cc133397a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUZFOjIzRTQ5NTpCMjJEODg6RjA2NDMxOjZBNUE5MEMzIiwidmlzaXRvcl9pZCI6IjE1MDU1NTE4NzYzMDk1NTMzNDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 35baaa3804abf893712706155707360f42139b40e0f770f0ae6413e56806c46d |
| hovercard-subject-tag | pull_request:2585507150 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/939/files |
| twitter:image | https://avatars.githubusercontent.com/u/131398524?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/131398524?s=400&v=4 |
| og:image:alt | Moves message content types into a union and uses that throughout the codebase. Suggested by @Kludex in #725. Motivation and Context Simplifies code, makes for fewer places to update when new conte... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9989a1a1d89aa5a38a19e5d0c7ee88a8ffde84acde90048990492aae52f235db |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ba6769fbf719c56dbf7bed650ce454dafc5b1528 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width