Skip to content

Commit

Permalink
fix to relax structured output test
Browse files Browse the repository at this point in the history
  • Loading branch information
morisil committed Oct 15, 2024
1 parent d0d48a1 commit 1e5b818
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/jvmTest/kotlin/StructuredOutputTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.xemantic.anthropic.tool.UsableTool
import io.kotest.assertions.assertSoftly
import io.kotest.matchers.collections.shouldHaveSize
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldStartWith
import kotlinx.coroutines.test.runTest
import kotlinx.serialization.Serializable
import kotlin.test.Test
Expand Down Expand Up @@ -70,7 +71,9 @@ class StructuredOutputTest {

report.assets shouldHaveSize 6
assertSoftly(report.assets[0]) {
assetName shouldBe "11 Zinfandel Lane - Home & Vineyard [RP]"
// it seems that sometimes the model is not returning content in square brackets
// so we are going for shouldStartWith
assetName shouldStartWith "11 Zinfandel Lane - Home & Vineyard"
owner shouldBe "JT"
location shouldBe "St. Helena/Napa, CA, US"
assetValueLow shouldBe 5000001
Expand All @@ -81,7 +84,7 @@ class StructuredOutputTest {
txGt1000 shouldBe false
}
assertSoftly(report.assets[1]) {
assetName shouldBe "25 Point Lobos - Commercial Property [RP]"
assetName shouldStartWith "25 Point Lobos - Commercial Property"
owner shouldBe "SP"
location shouldBe "San Francisco/San Francisco, CA, US"
assetValueLow shouldBe 5000001
Expand Down

0 comments on commit 1e5b818

Please sign in to comment.