@@ -7,7 +7,7 @@ import ai.koog.agents.core.agent.singleRunStrategy
77import ai.koog.agents.core.tools.ToolRegistry
88import ai.koog.agents.features.eventHandler.feature.EventHandler
99import ai.koog.integration.tests.utils.Models
10- import ai.koog.integration.tests.utils.RetryUtils.withRetry
10+ import ai.koog.integration.tests.utils.RetryUtils
1111import ai.koog.integration.tests.utils.tools.SimpleCalculatorTool
1212import ai.koog.prompt.llm.LLMCapability
1313import ai.koog.prompt.llm.LLModel
@@ -21,7 +21,7 @@ import io.kotest.matchers.shouldBe
2121import io.kotest.matchers.string.shouldContain
2222import io.kotest.matchers.string.shouldNotBeBlank
2323import kotlinx.coroutines.test.runTest
24- import org.junit.jupiter.api.Assumptions.assumeTrue
24+ import org.junit.jupiter.api.Assumptions
2525import org.junit.jupiter.api.BeforeAll
2626import org.junit.jupiter.params.ParameterizedTest
2727import org.junit.jupiter.params.provider.MethodSource
@@ -42,7 +42,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
4242 fun integration_BuilderBasicUsage (model : LLModel ) = runTest(timeout = 180 .seconds) {
4343 Models .assumeAvailable(model.provider)
4444
45- withRetry {
45+ RetryUtils . withRetry {
4646 runWithTracking { eventHandlerConfig, state ->
4747 val agent = AIAgent .builder()
4848 .promptExecutor(getExecutor(model))
@@ -68,13 +68,13 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
6868 @MethodSource(" allModels" )
6969 fun integration_BuilderWithToolRegistry (model : LLModel ) = runTest(timeout = 180 .seconds) {
7070 Models .assumeAvailable(model.provider)
71- assumeTrue(model.capabilities.contains(LLMCapability .Tools ), " Model $model does not support tools" )
71+ Assumptions . assumeTrue(model.capabilities.contains(LLMCapability .Tools ), " Model $model does not support tools" )
7272
73- val toolRegistry = ToolRegistry {
73+ val toolRegistry = ToolRegistry . Companion {
7474 tool(SimpleCalculatorTool )
7575 }
7676
77- withRetry {
77+ RetryUtils . withRetry {
7878 runWithTracking { eventHandlerConfig, state ->
7979 val agent = AIAgent .builder()
8080 .promptExecutor(getExecutor(model))
@@ -102,13 +102,13 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
102102 @MethodSource(" allModels" )
103103 fun integration_BuilderWithGraphStrategy (model : LLModel ) = runTest(timeout = 180 .seconds) {
104104 Models .assumeAvailable(model.provider)
105- assumeTrue(model.capabilities.contains(LLMCapability .Tools ), " Model $model does not support tools" )
105+ Assumptions . assumeTrue(model.capabilities.contains(LLMCapability .Tools ), " Model $model does not support tools" )
106106
107- val toolRegistry = ToolRegistry {
107+ val toolRegistry = ToolRegistry . Companion {
108108 tool(SimpleCalculatorTool )
109109 }
110110
111- withRetry {
111+ RetryUtils . withRetry {
112112 runWithTracking { eventHandlerConfig, state ->
113113 val agent = AIAgent .builder()
114114 .promptExecutor(getExecutor(model))
@@ -138,7 +138,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
138138 fun integration_FunctionalStrategyWithLambda (model : LLModel ) = runTest(timeout = 180 .seconds) {
139139 Models .assumeAvailable(model.provider)
140140
141- withRetry {
141+ RetryUtils . withRetry {
142142 runWithTracking { eventHandlerConfig, state ->
143143 val strategy = functionalStrategy<String , String >(" echo-strategy" ) { input ->
144144 val response = requestLLM(
@@ -186,7 +186,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
186186 }
187187 }
188188
189- withRetry {
189+ RetryUtils . withRetry {
190190 runWithTracking { eventHandlerConfig, state ->
191191 val agent = AIAgent .builder()
192192 .promptExecutor(getExecutor(model))
@@ -238,7 +238,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
238238 " Ideas: $ideas \n\n Best choice: $refinedIdea "
239239 }
240240
241- withRetry {
241+ RetryUtils . withRetry {
242242 runWithTracking { eventHandlerConfig, state ->
243243 val agent = AIAgent .builder()
244244 .promptExecutor(getExecutor(model))
@@ -270,7 +270,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
270270 fun integration_BuilderMethodChaining (model : LLModel ) = runTest(timeout = 180 .seconds) {
271271 Models .assumeAvailable(model.provider)
272272
273- withRetry {
273+ RetryUtils . withRetry {
274274 runWithTracking { eventHandlerConfig, state ->
275275 val agent = AIAgent .builder()
276276 .promptExecutor(getExecutor(model))
@@ -302,7 +302,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
302302 fun integration_BuilderWithMultipleFeatures (model : LLModel ) = runTest(timeout = 180 .seconds) {
303303 Models .assumeAvailable(model.provider)
304304
305- withRetry {
305+ RetryUtils . withRetry {
306306 val eventCallbacks = mutableListOf<String >()
307307
308308 val agent = AIAgent .builder()
@@ -350,7 +350,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
350350 }
351351 }
352352
353- withRetry {
353+ RetryUtils . withRetry {
354354 runWithTracking { eventHandlerConfig, state ->
355355 val agent = AIAgent .builder()
356356 .promptExecutor(getExecutor(model))
@@ -380,7 +380,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
380380 fun integration_BuilderWithTemperatureControl (model : LLModel ) = runTest(timeout = 120 .seconds) {
381381 Models .assumeAvailable(model.provider)
382382
383- withRetry {
383+ RetryUtils . withRetry {
384384 runWithTracking { eventHandlerConfig, state ->
385385 val deterministicAgent = AIAgent .builder()
386386 .promptExecutor(getExecutor(model))
@@ -408,7 +408,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
408408 fun integration_BuilderWithMaxIterations (model : LLModel ) = runTest(timeout = 120 .seconds) {
409409 Models .assumeAvailable(model.provider)
410410
411- withRetry {
411+ RetryUtils . withRetry {
412412 runWithTracking { eventHandlerConfig, state ->
413413 val agent = AIAgent .builder()
414414 .promptExecutor(getExecutor(model))
@@ -432,7 +432,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
432432 fun integration_FunctionalStrategyWithExceptionHandling (model : LLModel ) = runTest(timeout = 120 .seconds) {
433433 Models .assumeAvailable(model.provider)
434434
435- withRetry {
435+ RetryUtils . withRetry {
436436 runWithTracking { eventHandlerConfig, state ->
437437 val strategyWithErrorHandling = functionalStrategy<String , String >(" error-handling" ) { input ->
438438 when (val response = requestLLM(input)) {
@@ -463,7 +463,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
463463 fun integration_BuilderWithNumberOfChoices (model : LLModel ) = runTest(timeout = 120 .seconds) {
464464 Models .assumeAvailable(model.provider)
465465
466- withRetry {
466+ RetryUtils . withRetry {
467467 runWithTracking { eventHandlerConfig, state ->
468468 val agent = AIAgent .builder()
469469 .promptExecutor(getExecutor(model))
@@ -489,7 +489,7 @@ class AIAgentBuilderIntegrationTest : AIAgentTestBase() {
489489 fun integration_FunctionalStrategyWithContextAccess (model : LLModel ) = runTest(timeout = 120 .seconds) {
490490 Models .assumeAvailable(model.provider)
491491
492- withRetry {
492+ RetryUtils . withRetry {
493493 runWithTracking { eventHandlerConfig, state ->
494494 val strategyWithContext = functionalStrategy<String , String >(" context-aware" ) { input ->
495495 val agentId = agentId
0 commit comments