mirror of
https://github.com/MervinPraison/PraisonAI.git
synced 2026-11-08 17:31:00 -10:00
Harden realtime command path with localhost binding and import guard
Agent-Logs-Url: https://github.com/MervinPraison/PraisonAI/sessions/ac8b740b-5c02-4ded-8957-c9ad738ef410 Co-authored-by: MervinPraison <[email protected]>
This commit is contained in:
1 parent
682a9486fd
commit
d019e0e8e8
2 files changed
+18
-14
No files matched your search
@@ -27,22 +27,26 @@ def realtime_main(
|
||||
praisonai realtime
|
||||
praisonai realtime --model gpt-4o --port 9000
|
||||
"""
|
||||
# Route to new UI realtime subcommand
|
||||
from praisonai.cli.commands.ui import _launch_aiui_app
|
||||
import os
|
||||
|
||||
if model:
|
||||
os.environ["MODEL_NAME"] = model
|
||||
|
||||
print("🎤 Launching PraisonAI Realtime Voice Interface...")
|
||||
print("Note: Migrated from Chainlit to aiui. Full WebRTC voice coming soon.")
|
||||
|
||||
_launch_aiui_app(
|
||||
app_dir="ui_realtime",
|
||||
default_app_name="ui_realtime",
|
||||
port=port,
|
||||
host="0.0.0.0",
|
||||
app_file=None,
|
||||
reload=False,
|
||||
ui_name="Realtime Voice"
|
||||
)
|
||||
print("Note: Migrated from Chainlit to aiui.")
|
||||
|
||||
try:
|
||||
from praisonai.cli.commands.ui import _launch_aiui_app
|
||||
_launch_aiui_app(
|
||||
app_dir="ui_realtime",
|
||||
default_app_name="ui_realtime",
|
||||
port=port,
|
||||
host="127.0.0.1",
|
||||
app_file=None,
|
||||
reload=False,
|
||||
ui_name="Realtime Voice"
|
||||
)
|
||||
except ImportError:
|
||||
print('\033[91mERROR: Realtime UI is not installed.\033[0m')
|
||||
print('Install with: pip install "praisonai[ui]"')
|
||||
raise typer.Exit(1)
|
||||
@@ -1132,7 +1132,7 @@ class PraisonAI:
|
||||
# UI command — routes to Typer CLI for clean chat UI (praisonaiui)
|
||||
pass
|
||||
# chat and code commands are now terminal-native (handled by Typer commands)
|
||||
# They no longer set args.ui = 'chainlit' or open browser
|
||||
# Legacy --ui handling is preserved via the deprecation path above
|
||||
|
||||
# Handle --claudecode flag for code command
|
||||
if getattr(args, 'claudecode', False):
|
||||
|
||||
Reference in new issue
Block a user