feat: real-time reasoning speech, dynamic voice tags, and unified web UI bubbles

This commit is contained in:
Adolfo Reyna
2026-08-12 10:17:47 -04:00
parent b5034b4b16
commit 404a7071fb
8 changed files with 734 additions and 94 deletions
+9 -2
View File
@@ -169,9 +169,9 @@ class MacOSLLM(FrameProcessor):
async def _connect(self):
available, reason = probe_apple_llm()
logger.info(f"macOS LLM engine: {reason}")
if LLM_HELPER_PATH.exists() and "FoundationModels available" in reason:
if LLM_HELPER_PATH.exists() and available and ("FoundationModels" in reason or "Apple Intelligence" in reason):
self._use_swift = True
logger.info("Using Swift FoundationModels engine.")
logger.info("Using native Swift macOS Apple Intelligence / FoundationModels engine.")
else:
self._use_swift = False
logger.info(f"Loading MLX model {self._model_name} on Apple Silicon...")
@@ -199,6 +199,9 @@ class MacOSLLM(FrameProcessor):
await self.cancel_task(task)
async def _run_turn(self, utterance: str):
if not self._use_swift and (self._mlx_model is None or self._mlx_tokenizer is None):
await self._connect()
self._history.append({"role": "user", "content": utterance})
await self.push_frame(LLMFullResponseStartFrame())
@@ -224,6 +227,10 @@ class MacOSLLM(FrameProcessor):
chunk = data["delta"]
chunks.append(chunk)
await self.push_frame(LLMTextFrame(chunk))
elif "content" in data and not chunks:
chunk = data["content"]
chunks.append(chunk)
await self.push_frame(LLMTextFrame(chunk))
elif "text" in data and not chunks:
chunk = data["text"]
chunks.append(chunk)