Changes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34b9f5b..4f158a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,7 +45,7 @@ set(SOURCE_FILES
src/llm_client.cpp
src/memory.cpp
src/tool.cpp
- src/agent_smith_types.cpp
+ src/message.cpp
)
set(LIBS
@@ -85,7 +85,7 @@ if(AGENT_SMITH_BUILD_TESTS)
src/tool_test.cpp
src/agent_test.cpp
src/llm_client_test.cpp
- src/agent_smith_types_test.cpp
+ src/message_test.cpp
)
add_executable(agent_smith_test
@@ -94,7 +94,7 @@ if(AGENT_SMITH_BUILD_TESTS)
src/memory.cpp
src/tool.cpp
src/llm_client.cpp
- src/agent_smith_types.cpp
+ src/message.cpp
)
set_property(TARGET agent_smith_test PROPERTY CXX_STANDARD 23)
diff --git a/src/agent.hpp b/src/agent.hpp
index e31c592..6a6622e 100644
--- a/src/agent.hpp
+++ b/src/agent.hpp
@@ -7,7 +7,7 @@
#include <mw/error.hpp>
-#include "agent_smith_types.hpp"
+#include "message.hpp"
#include "llm_client.hpp"
#include "memory.hpp"
#include "task.hpp"
diff --git a/src/llm_client.hpp b/src/llm_client.hpp
index fe07751..c2234c2 100644
--- a/src/llm_client.hpp
+++ b/src/llm_client.hpp
@@ -8,7 +8,7 @@
#include <mw/http_client.hpp>
#include <nlohmann/json.hpp>
-#include "agent_smith_types.hpp"
+#include "message.hpp"
#include "task.hpp"
class LlmClient
diff --git a/src/memory.hpp b/src/memory.hpp
index c87c828..4d50c9b 100644
--- a/src/memory.hpp
+++ b/src/memory.hpp
@@ -2,7 +2,7 @@
#include <vector>
-#include "agent_smith_types.hpp"
+#include "message.hpp"
class Memory
{
diff --git a/src/agent_smith_types.cpp b/src/message.cpp
similarity index 97%
rename from src/agent_smith_types.cpp
rename to src/message.cpp
index e759560..7a53ff7 100644
--- a/src/agent_smith_types.cpp
+++ b/src/message.cpp
@@ -1,4 +1,4 @@
-#include "agent_smith_types.hpp"
+#include "message.hpp"
nlohmann::json toJson(const SystemMessage& msg)
{
diff --git a/src/agent_smith_types.hpp b/src/message.hpp
similarity index 100%
rename from src/agent_smith_types.hpp
rename to src/message.hpp
diff --git a/src/agent_smith_types_test.cpp b/src/message_test.cpp
similarity index 80%
rename from src/agent_smith_types_test.cpp
rename to src/message_test.cpp
index dbfd2d4..54ad36e 100644
--- a/src/agent_smith_types_test.cpp
+++ b/src/message_test.cpp
@@ -1,8 +1,8 @@
#include <gtest/gtest.h>
-#include "agent_smith_types.hpp"
+#include "message.hpp"
-TEST(AgentSmithTypesTest, SystemMessageToJson)
+TEST(MessageTest, SystemMessageToJson)
{
SystemMessage msg{"You are a helpful assistant."};
nlohmann::json j = toJson(msg);
@@ -10,7 +10,7 @@ TEST(AgentSmithTypesTest, SystemMessageToJson)
EXPECT_EQ(j["content"], "You are a helpful assistant.");
}
-TEST(AgentSmithTypesTest, UserMessageToJson)
+TEST(MessageTest, UserMessageToJson)
{
UserMessage msg{"What is 2+2?"};
nlohmann::json j = toJson(msg);
@@ -18,7 +18,7 @@ TEST(AgentSmithTypesTest, UserMessageToJson)
EXPECT_EQ(j["content"], "What is 2+2?");
}
-TEST(AgentSmithTypesTest, ToolCallToJson)
+TEST(MessageTest, ToolCallToJson)
{
ToolCall call{"call_1", "calc", {{"a", 2}, {"b", 2}}};
nlohmann::json j = toJson(call);
@@ -28,7 +28,7 @@ TEST(AgentSmithTypesTest, ToolCallToJson)
EXPECT_EQ(j["function"]["arguments"], "{\"a\":2,\"b\":2}");
}
-TEST(AgentSmithTypesTest, AssistantMessageToJson_ContentOnly)
+TEST(MessageTest, AssistantMessageToJson_ContentOnly)
{
AssistantMessage msg{"The answer is 4.", {}};
nlohmann::json j = toJson(msg);
@@ -37,7 +37,7 @@ TEST(AgentSmithTypesTest, AssistantMessageToJson_ContentOnly)
EXPECT_FALSE(j.contains("tool_calls"));
}
-TEST(AgentSmithTypesTest, AssistantMessageToJson_ToolCallsOnly)
+TEST(MessageTest, AssistantMessageToJson_ToolCallsOnly)
{
AssistantMessage msg{std::nullopt,
{{"call_1", "calc", {{"a", 2}, {"b", 2}}}}};
@@ -49,7 +49,7 @@ TEST(AgentSmithTypesTest, AssistantMessageToJson_ToolCallsOnly)
EXPECT_EQ(j["tool_calls"][0]["id"], "call_1");
}
-TEST(AgentSmithTypesTest, ToolResultMessageToJson)
+TEST(MessageTest, ToolResultMessageToJson)
{
ToolResultMessage msg{"call_1", "4"};
nlohmann::json j = toJson(msg);
@@ -58,7 +58,7 @@ TEST(AgentSmithTypesTest, ToolResultMessageToJson)
EXPECT_EQ(j["content"], "4");
}
-TEST(AgentSmithTypesTest, MessageVariantToJson)
+TEST(MessageTest, MessageVariantToJson)
{
Message msg = UserMessage{"Hello"};
nlohmann::json j = toJson(msg);