feat: make structured mirroring explicit - #1085
Conversation
|
cc @olaservo can you review? |
|
Hi @alexhancock @DaleSeo , thanks for putting together this alternative! After reviewing the surveyed clients again and considering that mirroring is a For reference, here is a snapshot of what a sample of clients do with the different payloads: https://gist.github.com/olaservo/3bb819673c444e4fe282c3af44a1ae01 |
|
Thanks, @olaservo, for the review and client survey. After comparing the current Tier 1 SDKs, I agree that keeping mirroring on by default with an explicit opt-out is the better direction for v3. |
Motivation and Context
Automatic mirroring can double large structured payloads and makes a compatibility fallback an implicit SDK policy. This implements the alternative discussed in #1046: structured output is the default, and callers that need text content choose it explicitly without adding another return-type wrapper or macro behavior.
How Has This Been Tested?
Added integration tests
Breaking changes
Technically none because the API hasn't changed.
However, code that relies on
structured,structured_error, orJson<T>to automatically populatecontentnow needs to add the fallback explicitly withwith_contentor construct theCallToolResultdirectly.Types of changes
Checklist