12#include <agents-cpp/llm_interface.h>
100 const std::vector<Message>& messages,
101 const std::vector<std::shared_ptr<Tool>>&
tools
110 const std::vector<Message>& messages,
111 std::function<
void(
const String&,
bool)> callback
116 String api_base_ =
"https://api.anthropic.com";
125 JsonObject messagesToAnthropicFormat(
const std::vector<Message>& messages);
132 JsonObject toolsToAnthropicFormat(
const std::vector<std::shared_ptr<Tool>>&
tools);
Interface for language model providers (OpenAI, Anthropic, Google, Ollama)
Definition llm_interface.h:68
void streamChat(const std::vector< Message > &messages, std::function< void(const String &, bool)> callback) override
Stream results with callback.
void setApiKey(const String &api_key) override
Set API key.
String getModel() const override
Get current model.
AnthropicLLM(const String &api_key="", const String &model="claude-3-5-sonnet-20240620")
Constructor.
~AnthropicLLM() override=default
Destructor.
void setApiBase(const String &api_base) override
Set API base URL (for self-hosted or proxied endpoints)
LLMResponse chatWithTools(const std::vector< Message > &messages, const std::vector< std::shared_ptr< Tool > > &tools) override
Generate completion with available tools.
std::vector< String > getAvailableModels() override
Get available models from Anthropic.
void setModel(const String &model) override
Set the model to use.
LLMResponse complete(const String &prompt) override
Generate completion from a prompt.
LLMOptions getOptions() const override
Get current options.
void setOptions(const LLMOptions &options) override
Set options for API calls.
LLMResponse chat(const std::vector< Message > &messages) override
Generate completion from a list of messages.
Large Language Models Namespace.
Definition anthropic_llm.h:19
Framework Namespace.
Definition agent.h:18
nlohmann::json JsonObject
JSON object type.
Definition types.h:39
std::string String
String type.
Definition types.h:27
Options for LLM API calls.
Definition llm_interface.h:25
Response from an LLM.
Definition types.h:85