|
ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
|
Direct Anthropic Claude provider using the native Messages API (POST /v1/messages). More...
#include <anthropic.hpp>
Public Member Functions | |
| AnthropicProvider (const config::ProviderConfig &cfg, std::shared_ptr< core::HttpClient > http_client) | |
| Construct an Anthropic provider from configuration. | |
| core::ProviderID | ProviderId () const override |
| Returns "anthropic" as the provider identifier. | |
| std::string | Health () const override |
| Check that the Anthropic API is reachable. | |
| std::shared_ptr< core::ChatResponse > | Chat (const core::ChatRequest &req) override |
| Send a chat request to the Anthropic Messages API. | |
| bool | SupportsModel (const core::ModelID &model) const override |
| Check if this provider handles the given model. | |
Direct Anthropic Claude provider using the native Messages API (POST /v1/messages).
Supported options: temperature, max_tokens, top_p, top_k. Anthropic requires max_tokens; defaults to 4096 when not explicitly set via WithMaxTokens(). Unsupported options (seed, frequency_penalty, presence_penalty) are silently ignored.
Web search is NOT supported in this version. When a ChatRequest contains a WebSearch tool, it is silently filtered out. Anthropic's server-side web search returns server_tool_use and web_search_tool_result content blocks with encrypted_content tokens that must be passed back verbatim in multi-turn conversations. The SDK's InputItems system does not currently support opaque provider-specific content block passthrough, which would cause HTTP 400 errors in multi-turn agent loops.
| foresthub::provider::remote::AnthropicProvider::AnthropicProvider | ( | const config::ProviderConfig & | cfg, |
| std::shared_ptr< core::HttpClient > | http_client ) |
Construct an Anthropic provider from configuration.
| cfg | Provider configuration (api_key, base_url, supported_models). |
| http_client | HTTP implementation for API calls. |
|
overridevirtual |
Send a chat request to the Anthropic Messages API.
| req | Chat request with model, input, and options. |
Implements foresthub::core::LLMClient.
|
overridevirtual |
Check that the Anthropic API is reachable.
Implements foresthub::core::Provider.
|
overridevirtual |
Check if this provider handles the given model.
| model | Model identifier to check. |
Implements foresthub::core::Provider.