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

Method BaseProviderClient

src/providers/base_provider_client.cpp:9–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace providers {
8
9BaseProviderClient::BaseProviderClient(
10 const ProviderConfig& config,
11 std::unique_ptr<RequestBuilder> request_builder,
12 std::unique_ptr<ResponseParser> response_parser)
13 : config_(config),
14 request_builder_(std::move(request_builder)),
15 response_parser_(std::move(response_parser)) {
16 // Initialize HTTP handler with parsed config
17 auto http_config = http::HttpRequestHandler::parse_base_url(config.base_url);
18
19 // Apply custom retry config if provided
20 if (config.retry_config.has_value()) {
21 http_config.retry_config = config.retry_config.value();
22 }
23
24 http_handler_ = std::make_unique<http::HttpRequestHandler>(http_config);
25
26 ai::logger::log_debug(
27 R"(BaseProviderClient initialized - base_url: {},
28 completions_endpoint: {}, embeddings_endpoint: {})",
29 config.base_url, config.completions_endpoint_path,
30 config.embeddings_endpoint_path);
31}
32
33GenerateResult BaseProviderClient::generate_text(
34 const GenerateOptions& options) {

Callers

nothing calls this directly

Calls 1

log_debugFunction · 0.85

Tested by

no test coverage detected