@@ -1705,6 +1705,66 @@ describe("ProviderTransform.variants", () => {
17051705 } )
17061706
17071707 describe ( "@ai-sdk/gateway" , ( ) => {
1708+ test ( "anthropic sonnet 4.6 models return adaptive thinking options" , ( ) => {
1709+ const model = createMockModel ( {
1710+ id : "anthropic/claude-sonnet-4-6" ,
1711+ providerID : "gateway" ,
1712+ api : {
1713+ id : "anthropic/claude-sonnet-4-6" ,
1714+ url : "https://gateway.ai" ,
1715+ npm : "@ai-sdk/gateway" ,
1716+ } ,
1717+ } )
1718+ const result = ProviderTransform . variants ( model )
1719+ expect ( Object . keys ( result ) ) . toEqual ( [ "low" , "medium" , "high" , "max" ] )
1720+ expect ( result . medium ) . toEqual ( {
1721+ thinking : {
1722+ type : "adaptive" ,
1723+ } ,
1724+ effort : "medium" ,
1725+ } )
1726+ } )
1727+
1728+ test ( "anthropic sonnet 4.6 dot-format models return adaptive thinking options" , ( ) => {
1729+ const model = createMockModel ( {
1730+ id : "anthropic/claude-sonnet-4-6" ,
1731+ providerID : "gateway" ,
1732+ api : {
1733+ id : "anthropic/claude-sonnet-4.6" ,
1734+ url : "https://gateway.ai" ,
1735+ npm : "@ai-sdk/gateway" ,
1736+ } ,
1737+ } )
1738+ const result = ProviderTransform . variants ( model )
1739+ expect ( Object . keys ( result ) ) . toEqual ( [ "low" , "medium" , "high" , "max" ] )
1740+ expect ( result . medium ) . toEqual ( {
1741+ thinking : {
1742+ type : "adaptive" ,
1743+ } ,
1744+ effort : "medium" ,
1745+ } )
1746+ } )
1747+
1748+ test ( "anthropic opus 4.6 dot-format models return adaptive thinking options" , ( ) => {
1749+ const model = createMockModel ( {
1750+ id : "anthropic/claude-opus-4-6" ,
1751+ providerID : "gateway" ,
1752+ api : {
1753+ id : "anthropic/claude-opus-4.6" ,
1754+ url : "https://gateway.ai" ,
1755+ npm : "@ai-sdk/gateway" ,
1756+ } ,
1757+ } )
1758+ const result = ProviderTransform . variants ( model )
1759+ expect ( Object . keys ( result ) ) . toEqual ( [ "low" , "medium" , "high" , "max" ] )
1760+ expect ( result . high ) . toEqual ( {
1761+ thinking : {
1762+ type : "adaptive" ,
1763+ } ,
1764+ effort : "high" ,
1765+ } )
1766+ } )
1767+
17081768 test ( "anthropic models return anthropic thinking options" , ( ) => {
17091769 const model = createMockModel ( {
17101770 id : "anthropic/claude-sonnet-4" ,
@@ -2064,6 +2124,26 @@ describe("ProviderTransform.variants", () => {
20642124 } )
20652125
20662126 describe ( "@ai-sdk/anthropic" , ( ) => {
2127+ test ( "sonnet 4.6 returns adaptive thinking options" , ( ) => {
2128+ const model = createMockModel ( {
2129+ id : "anthropic/claude-sonnet-4-6" ,
2130+ providerID : "anthropic" ,
2131+ api : {
2132+ id : "claude-sonnet-4-6" ,
2133+ url : "https://api.anthropic.com" ,
2134+ npm : "@ai-sdk/anthropic" ,
2135+ } ,
2136+ } )
2137+ const result = ProviderTransform . variants ( model )
2138+ expect ( Object . keys ( result ) ) . toEqual ( [ "low" , "medium" , "high" , "max" ] )
2139+ expect ( result . high ) . toEqual ( {
2140+ thinking : {
2141+ type : "adaptive" ,
2142+ } ,
2143+ effort : "high" ,
2144+ } )
2145+ } )
2146+
20672147 test ( "returns high and max with thinking config" , ( ) => {
20682148 const model = createMockModel ( {
20692149 id : "anthropic/claude-4" ,
@@ -2092,6 +2172,26 @@ describe("ProviderTransform.variants", () => {
20922172 } )
20932173
20942174 describe ( "@ai-sdk/amazon-bedrock" , ( ) => {
2175+ test ( "anthropic sonnet 4.6 returns adaptive reasoning options" , ( ) => {
2176+ const model = createMockModel ( {
2177+ id : "bedrock/anthropic-claude-sonnet-4-6" ,
2178+ providerID : "bedrock" ,
2179+ api : {
2180+ id : "anthropic.claude-sonnet-4-6" ,
2181+ url : "https://bedrock.amazonaws.com" ,
2182+ npm : "@ai-sdk/amazon-bedrock" ,
2183+ } ,
2184+ } )
2185+ const result = ProviderTransform . variants ( model )
2186+ expect ( Object . keys ( result ) ) . toEqual ( [ "low" , "medium" , "high" , "max" ] )
2187+ expect ( result . max ) . toEqual ( {
2188+ reasoningConfig : {
2189+ type : "adaptive" ,
2190+ maxReasoningEffort : "max" ,
2191+ } ,
2192+ } )
2193+ } )
2194+
20952195 test ( "returns WIDELY_SUPPORTED_EFFORTS with reasoningConfig" , ( ) => {
20962196 const model = createMockModel ( {
20972197 id : "bedrock/llama-4" ,
0 commit comments