10#ifndef PIPECAT_TRANSPORT_H
11#define PIPECAT_TRANSPORT_H
15#include <nlohmann/json.hpp>
101 virtual void connect(
const nlohmann::json& params) = 0;
Definition transport.h:54
virtual void on_transport_disconnected()=0
virtual void on_bot_connected(const Participant &bot)=0
The bot joined the session.
virtual void on_transport_message(const nlohmann::json &message)=0
A message arrived from the bot. message is the RTVI message as JSON.
virtual void on_participant_left(const Participant &participant)=0
Someone other than the bot left the session.
virtual void on_participant_joined(const Participant &participant)=0
Someone other than the bot joined the session.
virtual void on_transport_error(const std::string &error, bool fatal)=0
virtual void on_bot_disconnected(const Participant &bot)=0
The bot left the session.
Definition transport.h:88
virtual void send_ready_message(const rtvi::Message &message)=0
virtual void initialize(TransportObserver *observer)=0
virtual void connect(const nlohmann::json ¶ms)=0
virtual size_t max_message_size() const
The largest message, in bytes, that send_message() accepts.
Definition transport.h:118
virtual void send_message(const rtvi::Message &message)=0
Sends a message to the bot. Returns right away.
virtual int32_t read_bot_audio(int16_t *frames, size_t num_frames)=0
virtual void disconnect()=0
virtual int32_t send_user_audio(const int16_t *frames, size_t num_frames)=0
The Pipecat C++ client SDK.
Definition client.h:29
TransportState
The state of the connection to the bot.
Definition transport.h:24
@ Disconnecting
Disconnecting from the bot.
@ Connected
Connected, waiting for the bot to be ready.
@ Initializing
The transport is getting ready.
@ Initialized
The transport is ready to connect.
@ Error
Starting or connecting to the bot failed.
@ Authenticated
The bot was started.
@ Connecting
Connecting to the bot.
@ Authenticating
Starting the bot.
@ Disconnected
Not connected.
const char * to_string(TransportState state)
The name of a state, e.g. "ready".
Someone in the session, like the bot or another user.
Definition transport.h:41
std::string id
Unique ID of the participant.
Definition transport.h:43
bool local
Whether this is the local user.
Definition transport.h:47
std::string name
Display name. Can be empty.
Definition transport.h:45
Definition messages.h:280