ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
gemini.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (c) 2026 ForestHub. All rights reserved.
3// For commercial licensing, visit https://github.com/ForestHubAI/fh-sdk
4
5#ifndef FORESTHUB_PROVIDER_REMOTE_GEMINI_HPP
6#define FORESTHUB_PROVIDER_REMOTE_GEMINI_HPP
7
10
11#include <memory>
12#include <string>
13#include <vector>
14
18
19namespace foresthub {
20namespace provider {
21namespace remote {
22
29public:
33 GeminiProvider(const config::ProviderConfig& cfg, std::shared_ptr<core::HttpClient> http_client);
34
36 core::ProviderID ProviderId() const override;
37
40 std::string Health() const override;
41
45 std::shared_ptr<core::ChatResponse> Chat(const core::ChatRequest& req) override;
46
50 bool SupportsModel(const core::ModelID& model) const override;
51
52private:
53 std::shared_ptr<core::HttpClient> http_;
54 std::string api_key_;
55 std::string base_url_;
56 std::vector<core::ModelID> supported_models_;
57 core::HttpClient::Headers cached_headers_;
58};
59
60} // namespace remote
61} // namespace provider
62} // namespace foresthub
63
64#endif // FORESTHUB_PROVIDER_REMOTE_GEMINI_HPP
Extended LLM interface with health checks and model discovery.
Definition provider.hpp:32
GeminiProvider(const config::ProviderConfig &cfg, std::shared_ptr< core::HttpClient > http_client)
Construct a Gemini provider from configuration.
core::ProviderID ProviderId() const override
Returns "gemini" as the provider identifier.
bool SupportsModel(const core::ModelID &model) const override
Check if this provider handles the given model.
std::shared_ptr< core::ChatResponse > Chat(const core::ChatRequest &req) override
Send a chat request to the Gemini generateContent API.
std::string Health() const override
Check that the Gemini API is reachable.
Client and provider configuration types.
Abstract HTTP client interface and response type.
std::string ModelID
Unique identifier for an LLM model.
Definition model.hpp:23
std::string ProviderID
Unique identifier for an LLM provider.
Definition model.hpp:20
Remote provider implementations (ForestHub, OpenAI, Gemini, Anthropic).
LLM provider implementations.
Top-level namespace for the ForestHub SDK.
LLMClient and Provider interfaces for chat operations.
Shared configuration for any remote LLM provider.
Definition config.hpp:24
Chat completion request sent to an LLM provider.
Definition types.hpp:39