diff --git a/kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/sampling.kt b/kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/sampling.kt index 7cc26851f..f19f3dbb6 100644 --- a/kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/sampling.kt +++ b/kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/sampling.kt @@ -61,7 +61,7 @@ public data class ModelPreferences( } require(speedPriority == null || speedPriority in 0.0..1.0) { - "costPriority must be in 0.0 <= x <= 1.0 value range" + "speedPriority must be in 0.0 <= x <= 1.0 value range" } require(intelligencePriority == null || intelligencePriority in 0.0..1.0) { diff --git a/kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types/SamplingTest.kt b/kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types/SamplingTest.kt index 11866b82b..0a544d0d2 100644 --- a/kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types/SamplingTest.kt +++ b/kotlin-sdk-core/src/commonTest/kotlin/io/modelcontextprotocol/kotlin/sdk/types/SamplingTest.kt @@ -22,8 +22,11 @@ class SamplingTest { @Test fun `should reject ModelPreferences with invalid priority`() { shouldThrow { ModelPreferences(costPriority = 1.5) } + .message shouldBe "costPriority must be in 0.0 <= x <= 1.0 value range" shouldThrow { ModelPreferences(speedPriority = -0.1) } + .message shouldBe "speedPriority must be in 0.0 <= x <= 1.0 value range" shouldThrow { ModelPreferences(intelligencePriority = 1.1) } + .message shouldBe "intelligencePriority must be in 0.0 <= x <= 1.0 value range" } @Test