17 const std::string& content,
18 const std::vector<std::string>& parameters,
19 const std::vector<std::string>& arguments) :
23 parameters(parameters),
31 if (!read_type(reader)) {
34 if (!read_content(reader)) {
37 if (!read_parameters(reader)) {
40 if (!read_arguments(reader)) {
65 if (!write_type(writer)) {
68 if (!write_content(writer)) {
71 if (!write_parameters(writer)) {
74 if (!write_arguments(writer)) {
207 if constexpr (expected_tag != 0) {
208 if (_csize != 0 && _etype.
code != expected_tag) {
213 for (
size_t _i0 = 0; _i0 < _csize; ++_i0) {
254 if constexpr (expected_tag != 0) {
255 if (_csize != 0 && _etype.
code != expected_tag) {
260 for (
size_t _i0 = 0; _i0 < _csize; ++_i0) {
301 if constexpr (expected_tag != 0) {
302 if (_csize != 0 && _etype.
code != expected_tag) {
307 for (
size_t _i0 = 0; _i0 < _csize; ++_i0) {
348 if constexpr (expected_tag != 0) {
349 if (_csize != 0 && _etype.
code != expected_tag) {
354 for (
size_t _i0 = 0; _i0 < _csize; ++_i0) {
#define BOTTLE_TAG_STRING
std::vector< std::string > parameters
possible parameters
std::string type
type of message (can be prompt, assistant, function, ...)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(const yarp::os::idl::WireWriter &writer) const override
std::vector< std::string > arguments
possible arguments of the parameters
bool read(yarp::os::idl::WireReader &reader) override
LLM_MessageData()=default
std::string toString() const
std::string content
content of the message
A simple collection of objects that can be described and transmitted in a portable way.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
An interface for reading from a network connection.
An interface for writing to a network connection.
static bool copyPortable(const PortWriter &writer, PortReader &reader)
Copy one portable to another, via writing and reading.
IDL-friendly connection reader.
bool readString(std::string &str, bool *is_vocab=nullptr)
void readListBegin(yarp::os::idl::WireState &nstate, size_t &len)
IDL-friendly connection writer.
bool writeListHeader(int len) const
bool writeString(const std::string &str, bool skip_tag=false) const
bool writeListEnd() const
bool writeListBegin(int tag, size_t len) const
For streams capable of holding different kinds of content, check what they actually have.