general solution to voice control
Some checks failed
CI/CD Pipeline / build (push) Failing after 4s

This commit is contained in:
2026-03-25 09:22:48 -06:00
parent 86ff82a015
commit d857e91241
14 changed files with 309 additions and 31 deletions

View File

@@ -0,0 +1,23 @@
defmodule ElixirAiWeb.Plugs.VoiceSessionId do
@moduledoc """
Ensures a `voice_session_id` exists in the Plug session.
This UUID ties VoiceLive (root layout) to page LiveViews (inner content)
so they can discover each other via `:pg` process groups.
"""
import Plug.Conn
def init(opts), do: opts
def call(conn, _opts) do
case get_session(conn, "voice_session_id") do
nil ->
id = Ecto.UUID.generate()
put_session(conn, "voice_session_id", id)
_existing ->
conn
end
end
end