Skip to content

Commit 2fe3a16

Browse files
committed
test(clients): set dummy contextLength for LLModels defined in test
1 parent 741f168 commit 2fe3a16

File tree

7 files changed

+29
-15
lines changed

7 files changed

+29
-15
lines changed

agents/agents-features/agents-features-trace/src/jvmTest/kotlin/ai/koog/agents/features/tracing/writer/TraceFeatureMessageFileWriterTest.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ class TraceFeatureMessageFileWriterTest {
6363
val testModel = LLModel(
6464
provider = TestLLMProvider(),
6565
id = "test-llm-id",
66-
capabilities = emptyList()
66+
capabilities = emptyList(),
67+
contextLength = 1_000,
6768
)
6869

6970
var runId = ""
@@ -310,7 +311,8 @@ class TraceFeatureMessageFileWriterTest {
310311
val testModel = LLModel(
311312
provider = TestLLMProvider(),
312313
id = "test-llm-id",
313-
capabilities = emptyList()
314+
capabilities = emptyList(),
315+
contextLength = 1_000,
314316
)
315317

316318
var runId = ""
@@ -388,4 +390,4 @@ class TraceFeatureMessageFileWriterTest {
388390
assertContentEquals(expectedLogMessages, actualMessages)
389391
}
390392
}
391-
}
393+
}

agents/agents-features/agents-features-trace/src/jvmTest/kotlin/ai/koog/agents/features/tracing/writer/TraceFeatureMessageLogWriterTest.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class TraceFeatureMessageLogWriterTest {
5050
val testModel = LLModel(
5151
provider = TestLLMProvider(),
5252
id = "test-llm-id",
53-
capabilities = emptyList()
53+
capabilities = emptyList(),
54+
contextLength = 1_000,
5455
)
5556

5657
var runId = ""
@@ -282,7 +283,8 @@ class TraceFeatureMessageLogWriterTest {
282283
val testModel = LLModel(
283284
provider = TestLLMProvider(),
284285
id = "test-llm-id",
285-
capabilities = emptyList()
286+
capabilities = emptyList(),
287+
contextLength = 1_000,
286288
)
287289

288290
var runId = ""
@@ -360,4 +362,4 @@ class TraceFeatureMessageLogWriterTest {
360362
assertContentEquals(expectedLogMessages, actualMessages)
361363
}
362364
}
363-
}
365+
}

agents/agents-features/agents-features-trace/src/jvmTest/kotlin/ai/koog/agents/features/tracing/writer/TraceFeatureMessageRemoteWriterTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ class TraceFeatureMessageRemoteWriterTest {
115115
val testModel = LLModel(
116116
provider = TestLLMProvider(),
117117
id = "test-llm-id",
118-
capabilities = emptyList()
118+
capabilities = emptyList(),
119+
contextLength = 1_000,
119120
)
120121

121122
val expectedLLMCallWithToolsPrompt = expectedPrompt.copy(
@@ -379,7 +380,8 @@ class TraceFeatureMessageRemoteWriterTest {
379380
val testModel = LLModel(
380381
provider = TestLLMProvider(),
381382
id = "test-llm-id",
382-
capabilities = emptyList()
383+
capabilities = emptyList(),
384+
contextLength = 1_000,
383385
)
384386

385387
val expectedPrompt = Prompt(

prompt/prompt-executor/prompt-executor-cached/src/jvmTest/kotlin/ai/koog/prompt/executor/cached/CachedPromptExecutorTest.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ class CachedPromptExecutorTest {
2525
private val testClock = object : Clock {
2626
override fun now() = testResponse.first().metaInfo.timestamp
2727
}
28-
private val testModel = LLModel(object : LLMProvider("", "") {}, "", emptyList())
28+
private val testModel = LLModel(
29+
provider = object : LLMProvider("", "") {},
30+
id = "",
31+
capabilities = emptyList(),
32+
contextLength = 1_000L,
33+
)
2934
}
3035

3136
// Mock implementation of PromptCache

prompt/prompt-executor/prompt-executor-clients/prompt-executor-bedrock-client/src/jvmTest/kotlin/ai/koog/prompt/executor/clients/bedrock/modelfamilies/ai21/BedrockAI21JambaSerializationTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ class BedrockAI21JambaSerializationTest {
144144
val modelWithoutTemperature = LLModel(
145145
provider = LLMProvider.Bedrock,
146146
id = "test-model",
147-
capabilities = listOf(LLMCapability.Completion) // No temperature capability
147+
capabilities = listOf(LLMCapability.Completion), // No temperature capability
148+
contextLength = 1_000L,
148149
)
149150

150151
val requestWithoutTemp = BedrockAI21JambaSerialization.createJambaRequest(
@@ -357,4 +358,4 @@ class BedrockAI21JambaSerializationTest {
357358
val content = BedrockAI21JambaSerialization.parseJambaStreamChunk(chunkJson)
358359
assertEquals("", content)
359360
}
360-
}
361+
}

prompt/prompt-executor/prompt-executor-clients/prompt-executor-bedrock-client/src/jvmTest/kotlin/ai/koog/prompt/executor/clients/bedrock/modelfamilies/amazon/BedrockAmazonNovaSerializationTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class BedrockAmazonNovaSerializationTest {
9393
val modelWithoutTemperature = LLModel(
9494
provider = LLMProvider.Bedrock,
9595
id = "test-model",
96-
capabilities = listOf(LLMCapability.Completion) // No temperature capability
96+
capabilities = listOf(LLMCapability.Completion), // No temperature capability
97+
contextLength = 1_000L,
9798
)
9899

99100
val requestWithoutTemp = BedrockAmazonNovaSerialization.createNovaRequest(
@@ -242,4 +243,4 @@ class BedrockAmazonNovaSerializationTest {
242243
val content = BedrockAmazonNovaSerialization.parseNovaStreamChunk(chunkJson)
243244
assertEquals("", content)
244245
}
245-
}
246+
}

prompt/prompt-executor/prompt-executor-clients/prompt-executor-bedrock-client/src/jvmTest/kotlin/ai/koog/prompt/executor/clients/bedrock/modelfamilies/meta/BedrockMetaLlamaSerializationTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ class BedrockMetaLlamaSerializationTest {
8181
val modelWithoutTemperature = LLModel(
8282
provider = LLMProvider.Bedrock,
8383
id = "test-model",
84-
capabilities = listOf(LLMCapability.Completion) // No temperature capability
84+
capabilities = listOf(LLMCapability.Completion), // No temperature capability
85+
contextLength = 1_000L,
8586
)
8687

8788
val requestWithoutTemp =
@@ -174,4 +175,4 @@ class BedrockMetaLlamaSerializationTest {
174175
val content = BedrockMetaLlamaSerialization.parseLlamaStreamChunk(chunkJson)
175176
assertEquals("", content)
176177
}
177-
}
178+
}

0 commit comments

Comments
 (0)