Files
hal9000 0772fd5fe8 Implement issue 159: Add new overload to Harness::chat for multimodal input
Add a new overload to Harness::chat that takes a std::string as the user
message and a vector<std::string> const& as image paths. The method reads
the image files and converts them to data URIs internally, then constructs
the multimodal message.

This moves all the multimodal message construction logic from main.cpp
into Harness, simplifying main.cpp.
2026-06-15 16:28:38 -05:00

32 lines
964 B
C++

#pragma once
#include "json_types.hpp"
#include "tool_registry.hpp"
#include "client.hpp"
#include <memory>
#include <string>
#include <expected>
class Harness {
public:
Harness(std::unique_ptr<Client> client, const ToolRegistry& registry,
HarnessConfig config = {});
Harness(std::unique_ptr<Client> client, const ToolRegistry& master_reg,
HarnessState deserialized);
std::expected<std::string, std::string> chat(const std::string& user_message);
std::expected<std::string, std::string> chat(const Message& user_message);
std::expected<std::string, std::string> chat(const std::string& user_message, const std::vector<std::string>& image_paths);
void reset();
HarnessState serialize() const;
private:
void push_message(const Message& msg);
std::unique_ptr<Client> client_;
ToolRegistry registry_;
HarnessConfig config_;
std::vector<Message> history_;
};