Files
moloapp/src/vendors/audio/cartesia/client.cpp
T
retoorandClaude Sonnet 5.5 6d80dd0223 feat(clients): audio: ElevenLabs, AssemblyAI, Deepgram, Cartesia, Speechmatics, Hume
Table driven REST (509 rows verified against vendor specs by tools/check_spec.py),
WebSockets over the src/google/live client, neutral SpeechSynthesizer /
SpeechRecognizer seam, /ai/audio demo with dry runs, 110 package tests and 5
route tests. PlayHT has no public API; LeMUR is gone from AssemblyAI's spec.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 15:36:57 +01:00

36 lines
970 B
C++

#include "vendors/audio/cartesia/client.h"
#include "llm/config.h"
namespace molo::audio::cartesia {
llm::ApiClientConfig CartesiaEndpoints::config() {
llm::ApiClientConfig c;
c.vendor = kVendor;
c.base_url = kBase;
c.key_env = kKeyEnv;
c.auth = llm::AuthStyle::kBearer;
c.default_headers["Cartesia-Version"] = kVersion;
return c;
}
std::shared_ptr<const Hosts> CartesiaEndpoints::from_env() {
auto hosts = std::make_shared<Hosts>();
hosts->add("api", HostFactory::from_env(config()));
return hosts;
}
std::shared_ptr<const Hosts> CartesiaEndpoints::with(AudioHost host) {
auto hosts = std::make_shared<Hosts>();
hosts->add("api", std::move(host));
return hosts;
}
std::string CartesiaEndpoints::key() { return llm::Config::get(kKeyEnv); }
AudioSocket::Headers CartesiaEndpoints::ws_headers(const std::string& key) {
return {{"Authorization", "Bearer " + key}, {"Cartesia-Version", kVersion}};
}
} // namespace molo::audio::cartesia