|
@@ -1705,6 +1705,66 @@ describe("ProviderTransform.variants", () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe("@ai-sdk/gateway", () => {
|
|
describe("@ai-sdk/gateway", () => {
|
|
|
|
|
+ test("anthropic sonnet 4.6 models return adaptive thinking options", () => {
|
|
|
|
|
+ const model = createMockModel({
|
|
|
|
|
+ id: "anthropic/claude-sonnet-4-6",
|
|
|
|
|
+ providerID: "gateway",
|
|
|
|
|
+ api: {
|
|
|
|
|
+ id: "anthropic/claude-sonnet-4-6",
|
|
|
|
|
+ url: "https://gateway.ai",
|
|
|
|
|
+ npm: "@ai-sdk/gateway",
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ const result = ProviderTransform.variants(model)
|
|
|
|
|
+ expect(Object.keys(result)).toEqual(["low", "medium", "high", "max"])
|
|
|
|
|
+ expect(result.medium).toEqual({
|
|
|
|
|
+ thinking: {
|
|
|
|
|
+ type: "adaptive",
|
|
|
|
|
+ },
|
|
|
|
|
+ effort: "medium",
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ test("anthropic sonnet 4.6 dot-format models return adaptive thinking options", () => {
|
|
|
|
|
+ const model = createMockModel({
|
|
|
|
|
+ id: "anthropic/claude-sonnet-4-6",
|
|
|
|
|
+ providerID: "gateway",
|
|
|
|
|
+ api: {
|
|
|
|
|
+ id: "anthropic/claude-sonnet-4.6",
|
|
|
|
|
+ url: "https://gateway.ai",
|
|
|
|
|
+ npm: "@ai-sdk/gateway",
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ const result = ProviderTransform.variants(model)
|
|
|
|
|
+ expect(Object.keys(result)).toEqual(["low", "medium", "high", "max"])
|
|
|
|
|
+ expect(result.medium).toEqual({
|
|
|
|
|
+ thinking: {
|
|
|
|
|
+ type: "adaptive",
|
|
|
|
|
+ },
|
|
|
|
|
+ effort: "medium",
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ test("anthropic opus 4.6 dot-format models return adaptive thinking options", () => {
|
|
|
|
|
+ const model = createMockModel({
|
|
|
|
|
+ id: "anthropic/claude-opus-4-6",
|
|
|
|
|
+ providerID: "gateway",
|
|
|
|
|
+ api: {
|
|
|
|
|
+ id: "anthropic/claude-opus-4.6",
|
|
|
|
|
+ url: "https://gateway.ai",
|
|
|
|
|
+ npm: "@ai-sdk/gateway",
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ const result = ProviderTransform.variants(model)
|
|
|
|
|
+ expect(Object.keys(result)).toEqual(["low", "medium", "high", "max"])
|
|
|
|
|
+ expect(result.high).toEqual({
|
|
|
|
|
+ thinking: {
|
|
|
|
|
+ type: "adaptive",
|
|
|
|
|
+ },
|
|
|
|
|
+ effort: "high",
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
test("anthropic models return anthropic thinking options", () => {
|
|
test("anthropic models return anthropic thinking options", () => {
|
|
|
const model = createMockModel({
|
|
const model = createMockModel({
|
|
|
id: "anthropic/claude-sonnet-4",
|
|
id: "anthropic/claude-sonnet-4",
|
|
@@ -2064,6 +2124,26 @@ describe("ProviderTransform.variants", () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe("@ai-sdk/anthropic", () => {
|
|
describe("@ai-sdk/anthropic", () => {
|
|
|
|
|
+ test("sonnet 4.6 returns adaptive thinking options", () => {
|
|
|
|
|
+ const model = createMockModel({
|
|
|
|
|
+ id: "anthropic/claude-sonnet-4-6",
|
|
|
|
|
+ providerID: "anthropic",
|
|
|
|
|
+ api: {
|
|
|
|
|
+ id: "claude-sonnet-4-6",
|
|
|
|
|
+ url: "https://api.anthropic.com",
|
|
|
|
|
+ npm: "@ai-sdk/anthropic",
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ const result = ProviderTransform.variants(model)
|
|
|
|
|
+ expect(Object.keys(result)).toEqual(["low", "medium", "high", "max"])
|
|
|
|
|
+ expect(result.high).toEqual({
|
|
|
|
|
+ thinking: {
|
|
|
|
|
+ type: "adaptive",
|
|
|
|
|
+ },
|
|
|
|
|
+ effort: "high",
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
test("returns high and max with thinking config", () => {
|
|
test("returns high and max with thinking config", () => {
|
|
|
const model = createMockModel({
|
|
const model = createMockModel({
|
|
|
id: "anthropic/claude-4",
|
|
id: "anthropic/claude-4",
|
|
@@ -2092,6 +2172,26 @@ describe("ProviderTransform.variants", () => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe("@ai-sdk/amazon-bedrock", () => {
|
|
describe("@ai-sdk/amazon-bedrock", () => {
|
|
|
|
|
+ test("anthropic sonnet 4.6 returns adaptive reasoning options", () => {
|
|
|
|
|
+ const model = createMockModel({
|
|
|
|
|
+ id: "bedrock/anthropic-claude-sonnet-4-6",
|
|
|
|
|
+ providerID: "bedrock",
|
|
|
|
|
+ api: {
|
|
|
|
|
+ id: "anthropic.claude-sonnet-4-6",
|
|
|
|
|
+ url: "https://bedrock.amazonaws.com",
|
|
|
|
|
+ npm: "@ai-sdk/amazon-bedrock",
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ const result = ProviderTransform.variants(model)
|
|
|
|
|
+ expect(Object.keys(result)).toEqual(["low", "medium", "high", "max"])
|
|
|
|
|
+ expect(result.max).toEqual({
|
|
|
|
|
+ reasoningConfig: {
|
|
|
|
|
+ type: "adaptive",
|
|
|
|
|
+ maxReasoningEffort: "max",
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
test("returns WIDELY_SUPPORTED_EFFORTS with reasoningConfig", () => {
|
|
test("returns WIDELY_SUPPORTED_EFFORTS with reasoningConfig", () => {
|
|
|
const model = createMockModel({
|
|
const model = createMockModel({
|
|
|
id: "bedrock/llama-4",
|
|
id: "bedrock/llama-4",
|