12#include <agents-cpp/llm_interface.h>
96 const std::vector<Message>& messages,
97 const std::vector<std::shared_ptr<Tool>>&
tools
106 const std::vector<Message>& messages,
107 std::function<
void(
const String&,
bool)> callback
112 String api_base_ =
"https://generativelanguage.googleapis.com/v1";
121 JsonObject messagesToGoogleFormat(
const std::vector<Message>& messages);
128 JsonObject toolsToGoogleFormat(
const std::vector<std::shared_ptr<Tool>>&
tools);
149 String getEndpoint()
const;
Interface for language model providers (OpenAI, Anthropic, Google, Ollama)
Definition llm_interface.h:68
void setApiKey(const String &api_key) override
Set API key.
~GoogleLLM() override=default
Destructor.
LLMOptions getOptions() const override
Get current options.
void streamChat(const std::vector< Message > &messages, std::function< void(const String &, bool)> callback) override
Stream results with callback.
void setModel(const String &model) override
Set the model to use.
std::vector< String > getAvailableModels() override
Get available models from Google.
LLMResponse chatWithTools(const std::vector< Message > &messages, const std::vector< std::shared_ptr< Tool > > &tools) override
Generate completion with available tools.
GoogleLLM(const String &api_key="", const String &model="gemini-1.5-pro")
Constructor.
void setOptions(const LLMOptions &options) override
Set options for API calls.
void setApiBase(const String &api_base) override
Set API base URL (for self-hosted or proxied endpoints)
String getModel() const override
Get current model.
LLMResponse complete(const String &prompt) override
Generate completion from a prompt.
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