feat(clients): live: Gemini Live API over WebSocket, RFC 6455 client, session, relay, discovery check
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
// Transport-level WebSocket failure. Messages never carry URLs with query
|
||||
// strings or credentials.
|
||||
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
namespace molo::google::live {
|
||||
|
||||
class WsError : public std::runtime_error {
|
||||
public:
|
||||
enum class Kind { Invalid, Io, Timeout, Handshake, Protocol, TooBig, Closed };
|
||||
|
||||
WsError(Kind kind, const std::string& message, int http_status = 0)
|
||||
: std::runtime_error("molo::google::live::ws: " + message),
|
||||
kind_(kind),
|
||||
http_status_(http_status) {}
|
||||
|
||||
Kind kind() const noexcept { return kind_; }
|
||||
// HTTP status of a refused upgrade, else 0.
|
||||
int http_status() const noexcept { return http_status_; }
|
||||
|
||||
private:
|
||||
Kind kind_;
|
||||
int http_status_;
|
||||
};
|
||||
|
||||
} // namespace molo::google::live
|
||||
Reference in New Issue
Block a user