Skip to content

Commit de7ed22

Browse files
chore(multi-turn): remove checkTokenProgression from multi-turn LLM test and update README (#123)
1 parent 00c430b commit de7ed22

2 files changed

Lines changed: 1 addition & 43 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ The `checkInputMessagesSchema` check validates that the input messages attribute
435435

436436
**Multi-Turn LLM Test:**
437437

438-
- `checkAISpanCount(3)`, `checkChatSpanAttributes`, `checkValidTokenUsage`, `checkTokenProgression` (inline), `checkInputMessagesSchema`, `checkInputTokensCached`, `checkOutputTokensReasoning`
438+
- `checkAISpanCount(3)`, `checkChatSpanAttributes`, `checkValidTokenUsage`, `checkInputMessagesSchema`, `checkInputTokensCached`, `checkOutputTokensReasoning`
439439

440440
**Basic Error LLM Test:**
441441

src/test-cases/llm/multi-turn.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,6 @@ import {
1818
import { extractGenAISpans, skipIf } from "../utils.js";
1919
import { CheckError } from "../../validator.js";
2020

21-
/**
22-
* Check that input tokens increase with each turn (more conversation history)
23-
*/
24-
const checkTokenProgression: Check = {
25-
name: "checkTokenProgression",
26-
fn: (spans) => {
27-
const aiSpans = extractGenAISpans(spans);
28-
skipIf(
29-
aiSpans.length < 3,
30-
`Expected 3 spans for multi-turn test, got ${aiSpans.length}`,
31-
);
32-
33-
// Extract input token counts for each turn
34-
const inputTokens = aiSpans.map(
35-
(span) => span.data?.["gen_ai.usage.input_tokens"] as number,
36-
);
37-
38-
// Input tokens should increase with each turn (more conversation history)
39-
const errors: ErrorLocation[] = [];
40-
if (!(inputTokens[1] > inputTokens[0])) {
41-
errors.push({
42-
spanId: aiSpans[1].span_id,
43-
attribute: "gen_ai.usage.input_tokens",
44-
message: `Turn 2 input tokens (${inputTokens[1]}) should be greater than turn 1 (${inputTokens[0]})`,
45-
});
46-
}
47-
if (!(inputTokens[2] > inputTokens[1])) {
48-
errors.push({
49-
spanId: aiSpans[2].span_id,
50-
attribute: "gen_ai.usage.input_tokens",
51-
message: `Turn 3 input tokens (${inputTokens[2]}) should be greater than turn 2 (${inputTokens[1]})`,
52-
});
53-
}
54-
if (errors.length > 0) {
55-
throw new CheckError(
56-
`Input token progression failed: tokens should increase with each turn`,
57-
errors,
58-
);
59-
}
60-
},
61-
};
6221

6322
export const multiTurnLLMTest: TestDefinition = {
6423
name: "Multi-Turn LLM Test",
@@ -109,7 +68,6 @@ export const multiTurnLLMTest: TestDefinition = {
10968

11069
checks: [
11170
checkValidTokenUsage,
112-
checkTokenProgression,
11371
checkInputMessagesSchema,
11472
],
11573

0 commit comments

Comments
 (0)