Skip to content

Commit 2e0ffb5

Browse files
committed
More updates and api cleanup
1 parent a132f94 commit 2e0ffb5

14 files changed

+21
-59
lines changed

examples/autonomous_agent_example.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ int main() {
155155
String prompt = "Summarize the following text in no more than " +
156156
std::to_string(max_length) + " words:\n\n" + text;
157157

158-
LLMResponse llm_response = summary_context->getLLM()->complete(prompt);
158+
LLMResponse llm_response = summary_context->getLLM()->chat(prompt);
159159
String summary = llm_response.content;
160160

161161
return ToolResult{

examples/routing_example.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ int main(int argc, char* argv[]) {
100100
);
101101

102102
// Get response from LLM
103-
LLMResponse llm_response = opinion_context->getLLM()->complete(input);
103+
LLMResponse llm_response = opinion_context->getLLM()->chat(input);
104104
String response = llm_response.content;
105105

106106
JsonObject result;
@@ -124,7 +124,7 @@ int main(int argc, char* argv[]) {
124124
);
125125

126126
// Get response from LLM
127-
LLMResponse llm_response = technical_context->getLLM()->complete(input);
127+
LLMResponse llm_response = technical_context->getLLM()->chat(input);
128128
String response = llm_response.content;
129129

130130
JsonObject result;
@@ -139,7 +139,7 @@ int main(int argc, char* argv[]) {
139139
Logger::info("Handling with default route: {}", input);
140140

141141
// Get response from LLM
142-
LLMResponse llm_response = context->getLLM()->complete(input);
142+
LLMResponse llm_response = context->getLLM()->chat(input);
143143
String response = llm_response.content;
144144

145145
JsonObject result;

examples/structured_output_example.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int main(int argc, char* argv[]) {
9191

9292
// Send a prompt
9393
std::string prompt = "Give me a simple chocolate chip cookie recipe with 5 ingredients.";
94-
auto response = llm->complete(prompt);
94+
auto response = llm->chat(prompt);
9595

9696
std::cout << "Prompt: " << prompt << std::endl;
9797
std::cout << "Structured Response: " << response.content << std::endl;
@@ -117,7 +117,7 @@ int main(int argc, char* argv[]) {
117117

118118
// Send a prompt for sentiment analysis
119119
std::string prompt = "Classify the sentiment of these statements: 'I love this product', 'This is terrible', 'It's okay'";
120-
auto response = llm->complete(prompt);
120+
auto response = llm->chat(prompt);
121121

122122
std::cout << "Prompt: " << prompt << std::endl;
123123
std::cout << "Enum Response: " << response.content << std::endl;
@@ -170,7 +170,7 @@ int main(int argc, char* argv[]) {
170170

171171
// Send a prompt for ticket creation
172172
std::string prompt = "Create a support ticket for a user who can't log into their account and is getting an 'invalid credentials' error.";
173-
auto response = llm->complete(prompt);
173+
auto response = llm->chat(prompt);
174174

175175
std::cout << "Prompt: " << prompt << std::endl;
176176
std::cout << "Complex Schema Response: " << response.content << std::endl;

include/agents-cpp/coroutine_utils.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
#include <utility>
2525
#include <vector>
2626

27-
// Provide standard C++ coroutine-based APIs similar to Folly,
28-
// implementations that preserve the same public API and usage.
29-
// If you ever need to re-enable Folly, you can restore the original detection
30-
// block and branch on HAS_FOLLY_CORO accordingly.
3127
namespace agents {
3228

3329
/**
34-
* @brief Standard C++20 coroutine-based Task implementation (no external deps)
30+
* @brief Standard C++20 coroutine-based Task implementation
3531
* @tparam T The result type of the task
3632
*/
3733
template <typename T>

include/agents-cpp/llm_interface.h

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -116,28 +116,10 @@ class LLMInterface {
116116

117117
/**
118118
* @brief Generate completion from a prompt
119-
* @param prompt The prompt to generate completion from
120-
* @return The LLM response
121-
*/
122-
virtual LLMResponse complete(const String& prompt);
123-
124-
/**
125-
* @brief Generate completion from a list of messages
126-
* @param messages The messages to generate completion from
127-
* @return The LLM response
128-
*/
129-
virtual LLMResponse complete(const std::vector<Message>& messages);
130-
131-
/**
132-
* @brief Generate completion with available tools
133-
* @param messages The messages to generate completion from
134-
* @param tools_schema The tools schema to use
135-
* @return The LLM response
119+
* @param prompt The prompt
120+
* @return The completion
136121
*/
137-
virtual LLMResponse completeWithTools(
138-
const std::vector<Message>& messages,
139-
const std::vector<JsonObject>& tools_schema
140-
);
122+
virtual LLMResponse chat(const String& prompt) = 0;
141123

142124
/**
143125
* @brief Generate completion from a list of messages
@@ -167,20 +149,6 @@ class LLMInterface {
167149
std::function<void(const String&, bool)> callback
168150
) = 0;
169151

170-
/**
171-
* @brief Async complete from a prompt
172-
* @param prompt The prompt to generate completion from
173-
* @return The LLM response
174-
*/
175-
virtual Task<LLMResponse> completeAsync(const String& prompt);
176-
177-
/**
178-
* @brief Async complete from a list of messages
179-
* @param messages The messages to generate completion from
180-
* @return The LLM response
181-
*/
182-
virtual Task<LLMResponse> completeAsync(const std::vector<Message>& messages);
183-
184152
/**
185153
* @brief Async chat from a list of messages
186154
* @param messages The messages to generate completion from

include/agents-cpp/llms/anthropic_llm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class AnthropicLLM : public LLMInterface {
8181
* @param prompt The prompt
8282
* @return The completion
8383
*/
84-
LLMResponse complete(const String& prompt) override;
84+
LLMResponse chat(const String& prompt) override;
8585

8686
/**
8787
* @brief Generate completion from a list of messages

include/agents-cpp/llms/google_llm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class GoogleLLM : public LLMInterface {
7777
* @param prompt The prompt
7878
* @return The completion
7979
*/
80-
LLMResponse complete(const String& prompt) override;
80+
LLMResponse chat(const String& prompt) override;
8181

8282
/**
8383
* @brief Generate completion from a list of messages

include/agents-cpp/llms/ollama_llm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class OllamaLLM : public LLMInterface {
7676
* @param prompt The prompt
7777
* @return The completion
7878
*/
79-
LLMResponse complete(const String& prompt) override;
79+
LLMResponse chat(const String& prompt) override;
8080

8181
/**
8282
* @brief Generate completion from a list of messages

include/agents-cpp/llms/openai_llm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class OpenAILLM : public LLMInterface {
7777
* @param prompt The prompt
7878
* @return The completion
7979
*/
80-
LLMResponse complete(const String& prompt) override;
80+
LLMResponse chat(const String& prompt) override;
8181

8282
/**
8383
* @brief Generate completion from a list of messages

include/agents-cpp/realtime/ilive_client.h renamed to include/agents-cpp/realtime/live_client_interface.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
/**
2-
* @file ilive_client.h
2+
* @file live_client_interface.h
33
* @brief Abstract interface for live real-time AI clients
4-
*
5-
* This interface provides a common abstraction for different real-time
4+
* @details This interface provides a common abstraction for different real-time
65
* AI providers and transport protocols (WebSocket, WebRTC, etc.).
76
*
8-
* @author Agents-CPP Team
97
* @version 1.0
10-
* @date 2024
8+
* @date 2025-07-20
119
*/
1210

1311
#pragma once
1412

1513
#include <agents-cpp/types.h>
14+
#include <algorithm>
1615
#include <functional>
16+
#include <map>
1717
#include <memory>
1818
#include <vector>
19-
#include <map>
20-
#include <algorithm>
2119

2220
namespace agents {
2321

0 commit comments

Comments
 (0)