adk_live_session (erlang_adk v0.7.0)

View Source

One supervised, server-owned bidirectional Live session.

The session owns provider setup legality, bounded ingress, transport flow, subscriber cardinality/credit, interruption handling and principal authorization. It is intentionally independent of the process which starts it. Subscriber admission is serialized and capped per session; detaching or process death immediately makes capacity reusable.

Summary

Functions

ack(Pid, Principal, Sequence)

-spec ack(pid(), binary(), non_neg_integer()) -> ok | {error, term()}.

ack(Pid, Principal, Subscriber, Sequence)

-spec ack(pid(), binary(), pid(), non_neg_integer()) -> ok | {error, term()}.

activity_end(Pid, Principal)

-spec activity_end(pid(), binary()) -> {ok, pos_integer()} | {error, term()}.

activity_start(Pid, Principal)

-spec activity_start(pid(), binary()) -> {ok, pos_integer()} | {error, term()}.

audio_stream_end(Pid, Principal)

-spec audio_stream_end(pid(), binary()) -> {ok, pos_integer()} | {error, term()}.

callback_mode()

close(Pid, Principal, Reason)

-spec close(pid(), binary(), term()) -> ok | {error, term()}.

code_change(OldVsn, State, Data, Extra)

format_status(Status)

handle_event(Type, Event, State, Data)

handoff(Pid, HandoffRef, SessionId, Principal, Config)

-spec handoff(pid(), reference(), binary(), binary(), map()) -> ok | {error, term()}.

init(HandoffRef)

send_audio(Pid, Principal, Media)

-spec send_audio(pid(), binary(), adk_live_media:media()) -> {ok, pos_integer()} | {error, term()}.

send_text(Pid, Principal, Text)

-spec send_text(pid(), binary(), binary()) -> {ok, pos_integer()} | {error, term()}.

send_tool_response(Pid, Principal, Id, Name, Response)

-spec send_tool_response(pid(), binary(), binary(), binary(), map()) ->
                            {ok, pos_integer()} | {error, term()}.

send_video_frame(Pid, Principal, Media)

-spec send_video_frame(pid(), binary(), adk_live_media:media()) -> {ok, pos_integer()} | {error, term()}.

send_voice_audio(Pid, Principal, Continuity, Media)

-spec send_voice_audio(pid(), binary(), reference(), adk_live_media:media()) ->
                          {ok, pos_integer()} | {error, term()}.

start_link(HandoffRef)

-spec start_link(reference()) -> gen_statem:start_ret().

status(Pid, Principal)

-spec status(pid(), binary()) -> {ok, map()} | {error, term()}.

status(Pid, Principal, TimeoutMs)

-spec status(pid(), binary(), pos_integer()) -> {ok, map()} | {error, term()}.

subscribe(Pid, Principal, Credit)

-spec subscribe(pid(), binary(), map()) -> {ok, map()} | {error, term()}.

subscribe(Pid, Principal, Subscriber, Credit)

-spec subscribe(pid(), binary(), pid(), map()) -> {ok, map()} | {error, term()}.

subscribe_voice(Pid, Principal, Subscriber, Credit)

-spec subscribe_voice(pid(), binary(), pid(), map()) -> {ok, map()} | {error, term()}.

terminate(Reason, State, Data)

unsubscribe(Pid, Principal)

-spec unsubscribe(pid(), binary()) -> ok | {error, term()}.

unsubscribe(Pid, Principal, Subscriber)

-spec unsubscribe(pid(), binary(), pid()) -> ok | {error, term()}.

voice_activity_end(Pid, Principal, Continuity)

-spec voice_activity_end(pid(), binary(), reference()) -> {ok, pos_integer()} | {error, term()}.

voice_activity_start(Pid, Principal, Continuity)

-spec voice_activity_start(pid(), binary(), reference()) -> {ok, pos_integer()} | {error, term()}.

voice_audio_stream_end(Pid, Principal, Continuity)

-spec voice_audio_stream_end(pid(), binary(), reference()) -> {ok, pos_integer()} | {error, term()}.