Skip to content

Commit c6daa9b

Browse files
committed
Refactor LLM request functions to simplify logic by using superclass implementation
1 parent 549d800 commit c6daa9b

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

agents/agents-core/src/commonMain/kotlin/ai/koog/agents/core/agent/session/AIAgentLLMWriteSession.kt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,7 @@ public class AIAgentLLMWriteSession internal constructor(
388388
* @return the response from the LLM after processing the request, as a [Message.Response].
389389
*/
390390
override suspend fun requestLLMWithoutTools(): Message.Response {
391-
return requestLLMMultiple().let { responses ->
392-
appendPrompt {
393-
responses.filterIsInstance<Message.Reasoning>().forEach { message(it) }
394-
}
395-
responses.first { it !is Message.Reasoning }.also { response -> appendPrompt { message(response) } }
396-
}
391+
return super.requestLLMWithoutTools().also { response -> appendPrompt { message(response) } }
397392
}
398393

399394
/**
@@ -434,12 +429,7 @@ public class AIAgentLLMWriteSession internal constructor(
434429
* @return A [Message.Response] object containing the response from the LLM.
435430
*/
436431
override suspend fun requestLLM(): Message.Response {
437-
return requestLLMMultiple().let { responses ->
438-
appendPrompt {
439-
responses.filterIsInstance<Message.Reasoning>().forEach { message(it) }
440-
}
441-
responses.first { it !is Message.Reasoning }.also { response -> appendPrompt { message(response) } }
442-
}
432+
return super.requestLLM().also { response -> appendPrompt { message(response) } }
443433
}
444434

445435
/**

0 commit comments

Comments
 (0)