#pragma once
// agentty::provider::anthropic::AnthropicProvider — the concrete adapter that
// satisfies the `provider::Provider` concept by translating the abstract
// request into an anthropic::transport call.

#include <utility>

#include "agentty/provider/provider.hpp"
#include "agentty/provider/anthropic/transport.hpp"

namespace agentty::provider::anthropic {

class AnthropicProvider {
public:
    void stream(provider::Request req, provider::EventSink sink) {
        Request areq;
        areq.model         = std::move(req.model);
        areq.system_prompt = std::move(req.system_prompt);
        areq.messages      = std::move(req.messages);
        areq.max_tokens    = req.max_tokens;
        areq.auth          = std::move(req.auth);
        areq.tools.reserve(req.tools.size());
        for (auto& t : req.tools)
            areq.tools.push_back({std::move(t.name),
                                  std::move(t.description),
                                  std::move(t.input_schema),
                                  t.eager_input_streaming});
        run_stream_sync(std::move(areq), std::move(sink), std::move(req.cancel));
    }
};

static_assert(provider::Provider<AnthropicProvider>);

} // namespace agentty::provider::anthropic
