forgeant docs-test-0
Build LLM-powered agents in C++
Loading...
Searching...
No Matches
message.hpp
Go to the documentation of this file.
1#ifndef FORGEANT_TYPES_MESSAGE_HPP
2#define FORGEANT_TYPES_MESSAGE_HPP
3
6#include <string>
7#include <vector>
8
9namespace forgeant {
10
11struct Message {
13 std::vector<ContentBlock> content;
14
15 Message() = default;
16
17 Message(Role role, std::vector<ContentBlock> content)
18 : role(role), content(std::move(content)) {}
19
20 Message(Role role, std::string text) : role(role), content{TextBlock{std::move(text)}} {}
21
22 bool operator==(const Message&) const = default;
23};
24
25void to_json(Json& j, const Message& msg);
26void from_json(const Json& j, Message& msg);
27
28} // namespace forgeant
29
30#endif // FORGEANT_TYPES_MESSAGE_HPP
Definition json.hpp:27
Definition agent.hpp:25
void to_json(Json &j, const TextBlock &block)
void from_json(const Json &j, TextBlock &block)
Role
Definition role.hpp:9
Definition message.hpp:11
bool operator==(const Message &) const =default
std::vector< ContentBlock > content
Definition message.hpp:13
Message(Role role, std::vector< ContentBlock > content)
Definition message.hpp:17
Role role
Definition message.hpp:12
Message(Role role, std::string text)
Definition message.hpp:20
Definition content.hpp:10