#pragma once

#include <string>
#include <vector>
#include <optional>

namespace secondvoice {

struct WhisperResponse {
    std::string text;
};

class WhisperClient {
public:
    WhisperClient(const std::string& api_key);

    std::optional<WhisperResponse> transcribe(
        const std::vector<float>& audio_data,
        int sample_rate,
        int channels,
        const std::string& model = "whisper-1",
        const std::string& language = "zh",
        float temperature = 0.0f,
        const std::string& prompt = "",
        const std::string& response_format = "text"
    );

private:
    std::string api_key_;
    static constexpr const char* API_URL = "https://api.openai.com/v1/audio/transcriptions";
};

} // namespace secondvoice
