Skip to content

Commit 0e4c3d4

Browse files
pull the model for the integration tests
1 parent 46713ae commit 0e4c3d4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

integration-tests/src/jvmMain/kotlin/ai/koog/integration/tests/OllamaTestFixture.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class OllamaTestFixture {
4141
val model = OllamaModels.Meta.LLAMA_3_2
4242
val visionModel = OllamaModels.Granite.GRANITE_3_2_VISION
4343
val moderationModel = OllamaModels.Meta.LLAMA_GUARD_3
44+
val modelsWithHallucinations = listOf(OllamaModels.Meta.LLAMA_3_2, OllamaModels.Groq.LLAMA_3_GROK_TOOL_USE_8B)
4445

4546
private lateinit var ollamaContainer: GenericContainer<*>
4647

@@ -67,6 +68,7 @@ class OllamaTestFixture {
6768
client.getModelOrNull(model.id, pullIfMissing = true)
6869
client.getModelOrNull(visionModel.id, pullIfMissing = true)
6970
client.getModelOrNull(moderationModel.id, pullIfMissing = true)
71+
modelsWithHallucinations.forEach { client.getModelOrNull(it.id, pullIfMissing = true) }
7072
} catch (e: Exception) {
7173
logger.error(e) { "Failed to pull models: ${e.message}" }
7274
cleanContainer()

integration-tests/src/jvmTest/kotlin/ai/koog/integration/tests/agent/OllamaAgentIntegrationTest.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ class OllamaAgentIntegrationTest : AIAgentTestBase() {
5454
private lateinit var fixture: OllamaTestFixture
5555
private val executor get() = fixture.executor
5656
private val model get() = fixture.model
57+
private val modelsWithHallucinations get() = fixture.modelsWithHallucinations
5758

5859
@JvmStatic
59-
private fun weakOllamaModels() = Stream.of(
60-
OllamaModels.Meta.LLAMA_3_2,
61-
OllamaModels.Groq.LLAMA_3_GROK_TOOL_USE_8B,
62-
)
60+
private fun modelsWithHallucinations(): Stream<LLModel> =
61+
Stream.of(*modelsWithHallucinations.toTypedArray())
6362
}
6463

6564
@BeforeTest
@@ -209,8 +208,8 @@ class OllamaAgentIntegrationTest : AIAgentTestBase() {
209208

210209
@OptIn(ResponseProcessorApi::class)
211210
@ParameterizedTest
212-
@MethodSource("weakOllamaModels")
213-
fun ollama_testLLMBasedToolCallExtractor(llmModel: LLModel) = runTest(timeout = 600.seconds) {
211+
@MethodSource("modelsWithHallucinations")
212+
fun ollama_testFixToolCallLLMBased(llmModel: LLModel) = runTest(timeout = 600.seconds) {
214213
withRetry(5) {
215214
val fileTools = FileOperationsTools()
216215
fileTools.createNewFileWithText(
@@ -222,7 +221,7 @@ class OllamaAgentIntegrationTest : AIAgentTestBase() {
222221
Charlie,22,78
223222
""".trimIndent()
224223
)
225-
val toolRegistry = ToolRegistry.Companion {
224+
val toolRegistry = ToolRegistry {
226225
tool(fileTools.readFileContentTool)
227226
tool(fileTools.createNewFileWithTextTool)
228227
}

0 commit comments

Comments
 (0)