| 31 | } |
| 32 | |
| 33 | GenerateResult BaseProviderClient::generate_text( |
| 34 | const GenerateOptions& options) { |
| 35 | ai::logger::log_debug( |
| 36 | "Starting text generation - model: {}, prompt length: {}, tools: {}, " |
| 37 | "max_steps: {}", |
| 38 | options.model, options.prompt.length(), options.tools.size(), |
| 39 | options.max_steps); |
| 40 | |
| 41 | // Check if multi-step tool calling is enabled |
| 42 | if (options.has_tools() && options.is_multi_step()) { |
| 43 | ai::logger::log_debug("Using multi-step tool calling with {} tools", |
| 44 | options.tools.size()); |
| 45 | |
| 46 | // Use MultiStepCoordinator for complex workflows |
| 47 | return MultiStepCoordinator::execute_multi_step( |
| 48 | options, [this](const GenerateOptions& step_options) { |
| 49 | return this->generate_text_single_step(step_options); |
| 50 | }); |
| 51 | } else { |
| 52 | // Single step generation |
| 53 | return generate_text_single_step(options); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | GenerateResult BaseProviderClient::generate_text_single_step( |
| 58 | const GenerateOptions& options) { |
no test coverage detected