src/google: GoogleClient over molo::clients (key in x-goog-api-key, never in
URLs), Service base, TextToSpeech, SpeechToText, Generative (replies, audio
in, audio out), Recognizer/Synthesizer seams with cloud, gemini and vertex
backends, VoicePipeline with bounded history. Example: /voice live
conversation page, /voice/{say,hear,turn,reset}, /google/status. Keys load
from env, .env.json.local, .env.json. Paid routes are excluded from locust.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
#pragma once
|
|
|
|
// Recognizer and Synthesizer over Gemini: audio understanding for speech to
|
|
// text, Gemini TTS models for text to speech. Works with any credential the
|
|
// Gemini endpoint accepts (AI Studio key, Vertex express key, OAuth).
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "google/generative.h"
|
|
#include "google/voice_io.h"
|
|
|
|
namespace molo::google {
|
|
|
|
class GeminiRecognizer : public Recognizer {
|
|
public:
|
|
explicit GeminiRecognizer(std::shared_ptr<Generative> generative,
|
|
std::string model = "");
|
|
Transcript recognize(const RecognitionRequest& request) const override;
|
|
|
|
private:
|
|
std::shared_ptr<Generative> generative_;
|
|
std::string model_;
|
|
};
|
|
|
|
class GeminiSynthesizer : public Synthesizer {
|
|
public:
|
|
explicit GeminiSynthesizer(std::shared_ptr<Generative> generative,
|
|
std::string model = "");
|
|
Audio synthesize(const SynthesisRequest& request) const override;
|
|
|
|
private:
|
|
std::shared_ptr<Generative> generative_;
|
|
std::string model_;
|
|
};
|
|
|
|
} // namespace molo::google
|