IterativeProblemSolver

class IterativeProblemSolver(broker: LlmBroker, model: String, availableTools: List<LlmTool> = emptyList(), maxIterations: Int = 3, systemPrompt: String? = null, config: CompletionConfig = CompletionConfig())

Loop-based problem solver backed by a ChatSession.

Calls the LLM up to maxIterations times. Each turn instructs the LLM to use available tools and reply with only DONE (success) or FAIL (give up). The loop stops on either signal — or when the iteration budget is exhausted — then asks for a final summary turn.

Mirrors the Python reference's IterativeProblemSolver.

Constructors

Link copied to clipboard
constructor(broker: LlmBroker, model: String, availableTools: List<LlmTool> = emptyList(), maxIterations: Int = 3, systemPrompt: String? = null, config: CompletionConfig = CompletionConfig())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun solve(problem: String): String