|
ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
|
Main entry point for interacting with multiple LLM providers. More...
#include <client.hpp>
Public Member Functions | |
| Client () | |
| Default constructor. Prefer Client::Create() for initialization. | |
| void | RegisterProvider (const std::shared_ptr< core::Provider > &provider) |
| Register a provider instance manually. | |
| std::string | Health () const |
| Check health of all registered providers. | |
| bool | SupportsModel (const core::ModelID &model) const |
| Check if any registered provider supports the given model. | |
| std::shared_ptr< core::ChatResponse > | Chat (const core::ChatRequest &req) override |
| Send a chat request, auto-selecting the provider by model ID. | |
| const std::map< core::ProviderID, std::shared_ptr< core::Provider > > & | providers () const |
| Read-only access to the registered providers. | |
Static Public Member Functions | |
| static std::unique_ptr< Client > | Create (const config::ClientConfig &cfg, const std::shared_ptr< core::HttpClient > &http_client=nullptr) |
| Create and initialize a Client from configuration. | |
Main entry point for interacting with multiple LLM providers.
Routes chat requests to the appropriate provider based on model ID.
|
overridevirtual |
Send a chat request, auto-selecting the provider by model ID.
| req | Chat request with model, input, and options. |
Implements foresthub::core::LLMClient.
|
static |
| std::string foresthub::Client::Health | ( | ) | const |
Check health of all registered providers.
| void foresthub::Client::RegisterProvider | ( | const std::shared_ptr< core::Provider > & | provider | ) |
Register a provider instance manually.
| provider | Provider to add to the routing table; nullptr is silently ignored. |
| bool foresthub::Client::SupportsModel | ( | const core::ModelID & | model | ) | const |
Check if any registered provider supports the given model.
| model | Model identifier to check. |