MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / generate_text

Method generate_text

src/providers/base_provider_client.cpp:33–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33GenerateResult 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
57GenerateResult BaseProviderClient::generate_text_single_step(
58 const GenerateOptions& options) {

Callers 1

generate_textFunction · 0.45

Calls 4

log_debugFunction · 0.85
has_toolsMethod · 0.80
is_multi_stepMethod · 0.45

Tested by

no test coverage detected