Skip to content

Commit 01c7238

Browse files
committed
Update to Long input test
1 parent 817851c commit 01c7238

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

cognitive/src/test/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIPromptSuite.scala

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -421,24 +421,21 @@ class OpenAIPromptSuite extends TransformerFuzzing[OpenAIPrompt] with OpenAIAPIK
421421
.select("outParsed", prompt.getErrorCol)
422422
.collect()
423423

424-
// First 3 rows should have valid outputs
424+
// Row 0: "apple" - normal input, should have valid output
425425
assert(Option(results(0).get(0)).isDefined)
426-
assert(Option(results(1).get(0)).isDefined)
427-
assert(Option(results(2).get(0)).isDefined)
428-
429-
// Null input should return null output
430-
assert(results(3).get(0) == null)
431-
432-
// Long inputs should either succeed or have an error (token limit exceeded)
433-
// Row 4: 1000 repetitions - may succeed or fail depending on model limits
434-
// Row 5: 10000 repetitions - likely to exceed token limits
435-
val row4HasOutput = Option(results(4).get(0)).isDefined
436-
val row4HasError = Option(results(4).getAs[Row](1)).isDefined
437-
assert(row4HasOutput || row4HasError, "Row 4 should have either output or error")
438-
439-
val row5HasOutput = Option(results(5).get(0)).isDefined
440-
val row5HasError = Option(results(5).getAs[Row](1)).isDefined
441-
assert(row5HasOutput || row5HasError, "Row 5 should have either output or error")
426+
427+
// Row 1: null input should return null output
428+
assert(results(1).get(0) == null)
429+
430+
// Row 2: 1000 repetitions - may succeed or fail depending on model limits
431+
val row2HasOutput = Option(results(2).get(0)).isDefined
432+
val row2HasError = Option(results(2).getAs[Row](1)).isDefined
433+
assert(row2HasOutput || row2HasError, "Row 2 should have either output or error")
434+
435+
// Row 3: 10000 repetitions - possible to exceed token limits
436+
val row3HasOutput = Option(results(3).get(0)).isDefined
437+
val row3HasError = Option(results(3).getAs[Row](1)).isDefined
438+
assert(row3HasOutput || row3HasError, "Row 3 should have either output or error")
442439
}
443440

444441
test("Timeout Configuration") {

0 commit comments

Comments
 (0)