fixed markdown rendering by shifting it to javascript

This commit is contained in:
2026-03-06 13:48:47 -07:00
parent c747f1d4ce
commit 6d5ca55900
7 changed files with 128 additions and 46 deletions

View File

@@ -131,7 +131,11 @@ defmodule ElixirAiWeb.ChatLive do
socket.assigns.streaming_response.reasoning_content <> reasoning_content
}
{:noreply, assign(socket, streaming_response: updated_response)}
# Update assign (controls toggle button visibility) and stream chunk to hook.
{:noreply,
socket
|> assign(streaming_response: updated_response)
|> push_event("reasoning_chunk", %{chunk: reasoning_content})}
end
def handle_info(
@@ -148,7 +152,11 @@ defmodule ElixirAiWeb.ChatLive do
| content: socket.assigns.streaming_response.content <> text_content
}
{:noreply, assign(socket, streaming_response: updated_response)}
# Update assign (accumulated for final message) and stream chunk to hook.
{:noreply,
socket
|> assign(streaming_response: updated_response)
|> push_event("md_chunk", %{chunk: text_content})}
end
def handle_info(:tool_calls_finished, socket) do