Agents 0.0.2
Edge AI Agents SDK
|
Abstract interface for live real-time AI clients. More...
#include <ilive_client.h>
Classes | |
struct | Callbacks |
Callbacks for live client events. More... | |
Public Types | |
enum class | ProtocolStrategy { PERFORMANCE , COMPATIBILITY , RELIABILITY , CUSTOM } |
Protocol selection strategies. More... | |
Public Member Functions | |
virtual bool | connect ()=0 |
Connect to the live AI service. | |
virtual void | close ()=0 |
Close the connection to the live AI service. | |
virtual bool | isConnected () const =0 |
Check if currently connected. | |
virtual TransportProtocol | getTransportProtocol () const =0 |
Get the current transport protocol. | |
virtual bool | sendAudio (const void *samples, size_t num_samples, const AudioFormat &format)=0 |
Send audio data with specified format. | |
virtual bool | sendText (const String &text)=0 |
Send text input to the AI. | |
virtual bool | sendTurnComplete ()=0 |
Signal completion of the current turn. | |
virtual void | setCallbacks (const Callbacks &callbacks)=0 |
Set event callbacks. | |
virtual const LiveSessionConfig & | getConfig () const =0 |
Get the current session configuration. | |
virtual bool | sendMessage (const String &text) |
Send a complete user message (text + turn completion) | |
virtual bool | sendAudioAndComplete (const int16_t *samples, size_t num_samples, int sample_rate_hz) |
Send audio data and complete the turn. | |
Static Public Member Functions | |
static std::unique_ptr< ILiveClient > | create (const String &api_key, const LiveSessionConfig &config) |
Create a client (single simple factory) | |
static std::vector< TransportProtocol > | getSupportedProtocols () |
Get supported protocols for this provider. | |
static bool | isProtocolSupported (TransportProtocol protocol) |
Check if a protocol is supported by this provider. | |
static TransportProtocol | getRecommendedProtocol (const String &use_case="general") |
Get the recommended protocol for a given use case. | |
Abstract interface for live real-time AI clients.
This interface provides a common abstraction for different real-time AI providers and transport protocols. It focuses on core functionality that is truly common across all implementations.
|
strong |
Protocol selection strategies.
These strategies help choose the best transport protocol based on the intended use case.
|
pure virtual |
Close the connection to the live AI service.
Gracefully closes the connection and cleans up resources.
|
pure virtual |
Connect to the live AI service.
Establishes a connection using the configured transport protocol.
|
inlinestatic |
Create a client (single simple factory)
Chooses sensible defaults for protocol/transport based on the provider and platform. Advanced selection can be implemented by concrete factories if needed.
api_key | API key for the provider |
config | Configuration for the live session |
|
pure virtual |
Get the current session configuration.
|
inlinestatic |
Get the recommended protocol for a given use case.
use_case | Use case description ("performance", "compatibility", "reliability") |
|
inlinestatic |
Get supported protocols for this provider.
|
pure virtual |
Get the current transport protocol.
|
pure virtual |
Check if currently connected.
|
inlinestatic |
Check if a protocol is supported by this provider.
protocol | Transport protocol |
|
pure virtual |
Send audio data with specified format.
samples | Audio samples |
num_samples | Number of samples |
format | Audio format specification |
|
inlinevirtual |
Send audio data and complete the turn.
This is a convenience method for sending audio and completing the turn in one call, which is common for voice input scenarios.
samples | Audio samples |
num_samples | Number of samples |
sample_rate_hz | Sample rate in Hz |
|
inlinevirtual |
Send a complete user message (text + turn completion)
This is a convenience method that combines sendText() and sendTurnComplete() for common use cases where you want to send a complete message.
text | User message text |
|
pure virtual |
Send text input to the AI.
text | Text message |
|
pure virtual |
Signal completion of the current turn.
This indicates that the user has finished their input and expects a response from the AI.
|
pure virtual |
Set event callbacks.
callbacks | Callback structure |