-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathcli.py
More file actions
644 lines (574 loc) · 26.5 KB
/
cli.py
File metadata and controls
644 lines (574 loc) · 26.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
# praisonai/cli.py
import sys
import argparse
from .version import __version__
import yaml
import os
from rich import print
from dotenv import load_dotenv
load_dotenv()
import shutil
import subprocess
import logging
import importlib
from .auto import AutoGenerator
from .agents_generator import AgentsGenerator
from .inbuilt_tools import *
from .inc.config import generate_config
# Optional module imports with availability checks
CHAINLIT_AVAILABLE = False
GRADIO_AVAILABLE = False
CALL_MODULE_AVAILABLE = False
CREWAI_AVAILABLE = False
AUTOGEN_AVAILABLE = False
PRAISONAI_AVAILABLE = False
try:
# Create necessary directories and set CHAINLIT_APP_ROOT
if "CHAINLIT_APP_ROOT" not in os.environ:
chainlit_root = os.path.join(os.path.expanduser("~"), ".praison")
os.environ["CHAINLIT_APP_ROOT"] = chainlit_root
else:
chainlit_root = os.environ["CHAINLIT_APP_ROOT"]
os.makedirs(chainlit_root, exist_ok=True)
os.makedirs(os.path.join(chainlit_root, ".files"), exist_ok=True)
from chainlit.cli import chainlit_run
CHAINLIT_AVAILABLE = True
except ImportError:
pass
try:
import gradio as gr
GRADIO_AVAILABLE = True
except ImportError:
pass
try:
import praisonai.api.call as call_module
CALL_MODULE_AVAILABLE = True
except ImportError:
pass
try:
from crewai import Agent, Task, Crew
CREWAI_AVAILABLE = True
except ImportError:
pass
try:
import autogen
AUTOGEN_AVAILABLE = True
except ImportError:
pass
try:
from praisonaiagents import Agent as PraisonAgent, Task as PraisonTask, PraisonAIAgents
PRAISONAI_AVAILABLE = True
except ImportError:
pass
logging.basicConfig(level=os.environ.get('LOGLEVEL', 'INFO'), format='%(asctime)s - %(levelname)s - %(message)s')
logging.getLogger('alembic').setLevel(logging.ERROR)
logging.getLogger('gradio').setLevel(logging.ERROR)
logging.getLogger('gradio').setLevel(os.environ.get('GRADIO_LOGLEVEL', 'WARNING'))
logging.getLogger('rust_logger').setLevel(logging.WARNING)
logging.getLogger('duckduckgo').setLevel(logging.ERROR)
logging.getLogger('_client').setLevel(logging.ERROR)
def stream_subprocess(command, env=None):
"""
Execute a subprocess command and stream the output to the terminal in real-time.
Args:
command (list): A list containing the command and its arguments.
env (dict, optional): Environment variables for the subprocess.
"""
process = subprocess.Popen(
command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
bufsize=1,
universal_newlines=True,
env=env
)
for line in iter(process.stdout.readline, ''):
print(line, end='')
sys.stdout.flush() # Ensure output is flushed immediately
process.stdout.close()
return_code = process.wait()
if return_code != 0:
raise subprocess.CalledProcessError(return_code, command)
class PraisonAI:
def __init__(self, agent_file="agents.yaml", framework="", auto=False, init=False, agent_yaml=None, tools=None):
"""
Initialize the PraisonAI object with default parameters.
"""
self.agent_yaml = agent_yaml
self.config_list = [
{
'model': os.environ.get("OPENAI_MODEL_NAME", "gpt-4o"),
'base_url': os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"),
'api_key': os.environ.get("OPENAI_API_KEY")
}
]
self.agent_file = agent_file
self.framework = framework
self.auto = auto
self.init = init
self.tools = tools or [] # Store tool class names as a list
def run(self):
"""
Run the PraisonAI application.
"""
return self.main()
def main(self):
"""
The main function of the PraisonAI object. It parses the command-line arguments,
initializes the necessary attributes, and then calls the appropriate methods based on the
provided arguments.
"""
# Store the original agent_file from constructor
original_agent_file = self.agent_file
args = self.parse_args()
# Store args for use in handle_direct_prompt
self.args = args
invocation_cmd = "praisonai"
version_string = f"PraisonAI version {__version__}"
self.framework = args.framework or self.framework
if args.command:
if args.command.startswith("tests.test") or args.command.startswith("tests/test"): # Argument used for testing purposes
print("test")
return "test"
else:
self.agent_file = args.command
elif hasattr(args, 'direct_prompt') and args.direct_prompt:
# Only handle direct prompt if agent_file wasn't explicitly set in constructor
if original_agent_file == "agents.yaml": # Default value, so safe to use direct prompt
result = self.handle_direct_prompt(args.direct_prompt)
print(result)
return result
else:
# Agent file was explicitly set, ignore direct prompt and use the file
pass
# If no command or direct_prompt, preserve agent_file from constructor (don't overwrite)
if args.deploy:
from .deploy import CloudDeployer
deployer = CloudDeployer()
deployer.run_commands()
return
if getattr(args, 'chat', False):
self.create_chainlit_chat_interface()
return
if getattr(args, 'code', False):
self.create_code_interface()
return
if getattr(args, 'realtime', False):
self.create_realtime_interface()
return
if getattr(args, 'call', False):
call_args = []
if args.public:
call_args.append('--public')
call_module.main(call_args)
return
if args.command == 'train':
package_root = os.path.dirname(os.path.abspath(__file__))
config_yaml_destination = os.path.join(os.getcwd(), 'config.yaml')
if not os.path.exists(config_yaml_destination):
config = generate_config(
model_name=args.model,
hf_model_name=args.hf,
ollama_model_name=args.ollama,
dataset=[{
"name": args.dataset
}]
)
with open('config.yaml', 'w') as f:
yaml.dump(config, f, default_flow_style=False, indent=2)
elif args.model or args.hf or args.ollama or (args.dataset and args.dataset != "yahma/alpaca-cleaned"):
config = generate_config(
model_name=args.model,
hf_model_name=args.hf,
ollama_model_name=args.ollama,
dataset=[{
"name": args.dataset
}]
)
with open('config.yaml', 'w') as f:
yaml.dump(config, f, default_flow_style=False, indent=2)
else:
with open(config_yaml_destination, 'r') as f:
config = yaml.safe_load(f)
# Overwrite huggingface_save and ollama_save if --hf or --ollama are provided
if args.hf:
config["huggingface_save"] = "true"
if args.ollama:
config["ollama_save"] = "true"
if 'init' in sys.argv:
from praisonai.setup.setup_conda_env import main as setup_conda_main
setup_conda_main()
print("All packages installed")
return
try:
result = subprocess.check_output(['conda', 'env', 'list'])
if 'praison_env' in result.decode('utf-8'):
print("Conda environment 'praison_env' found.")
else:
raise subprocess.CalledProcessError(1, 'grep')
except subprocess.CalledProcessError:
print("Conda environment 'praison_env' not found. Setting it up...")
from praisonai.setup.setup_conda_env import main as setup_conda_main
setup_conda_main()
print("All packages installed.")
train_args = sys.argv[2:] # Get all arguments after 'train'
# Check if this is a vision model - handle all case variations
model_name = config.get("model_name", "").lower()
is_vision_model = any(x in model_name for x in ["-vl-", "-vl", "vl-", "-vision-", "-vision", "vision-", "visionmodel"])
# Choose appropriate training script
if is_vision_model:
train_script_path = os.path.join(package_root, 'train_vision.py')
print("Using vision training script for VL model...")
else:
train_script_path = os.path.join(package_root, 'train.py')
print("Using standard training script...")
# Set environment variables
env = os.environ.copy()
env['PYTHONUNBUFFERED'] = '1'
stream_subprocess(['conda', 'run', '--no-capture-output', '--name', 'praison_env', 'python', '-u', train_script_path, 'train'], env=env)
return
if args.auto or self.auto:
temp_topic = args.auto if args.auto else self.auto
if isinstance(temp_topic, list):
temp_topic = ' '.join(temp_topic)
self.topic = temp_topic
self.agent_file = "test.yaml"
generator = AutoGenerator(topic=self.topic, framework=self.framework, agent_file=self.agent_file)
self.agent_file = generator.generate()
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
result = agents_generator.generate_crew_and_kickoff()
print(result)
return result
elif args.init or self.init:
temp_topic = args.init if args.init else self.init
if isinstance(temp_topic, list):
temp_topic = ' '.join(temp_topic)
self.topic = temp_topic
self.agent_file = "agents.yaml"
generator = AutoGenerator(topic=self.topic, framework=self.framework, agent_file=self.agent_file)
self.agent_file = generator.generate()
print(f"File {self.agent_file} created successfully")
return f"File {self.agent_file} created successfully"
if args.ui:
if args.ui == "gradio":
self.create_gradio_interface()
elif args.ui == "chainlit":
self.create_chainlit_interface()
else:
# Modify code to allow default UI
agents_generator = AgentsGenerator(
self.agent_file,
self.framework,
self.config_list,
agent_yaml=self.agent_yaml,
tools=self.tools
)
result = agents_generator.generate_crew_and_kickoff()
print(result)
return result
else:
agents_generator = AgentsGenerator(
self.agent_file,
self.framework,
self.config_list,
agent_yaml=self.agent_yaml,
tools=self.tools
)
result = agents_generator.generate_crew_and_kickoff()
print(result)
return result
def parse_args(self):
"""
Parse the command-line arguments for the PraisonAI CLI.
"""
# Check if we're running in a test environment
in_test_env = (
'pytest' in sys.argv[0] or
'unittest' in sys.argv[0] or
any('test' in arg for arg in sys.argv[1:3]) or # Check first few args for test indicators
'pytest' in sys.modules or
'unittest' in sys.modules
)
# Define special commands
special_commands = ['chat', 'code', 'call', 'realtime', 'train', 'ui']
parser = argparse.ArgumentParser(prog="praisonai", description="praisonAI command-line interface")
parser.add_argument("--framework", choices=["crewai", "autogen", "praisonai"], help="Specify the framework")
parser.add_argument("--ui", choices=["chainlit", "gradio"], help="Specify the UI framework (gradio or chainlit).")
parser.add_argument("--auto", nargs=argparse.REMAINDER, help="Enable auto mode and pass arguments for it")
parser.add_argument("--init", nargs=argparse.REMAINDER, help="Initialize agents with optional topic")
parser.add_argument("command", nargs="?", help="Command to run or direct prompt")
parser.add_argument("--deploy", action="store_true", help="Deploy the application")
parser.add_argument("--model", type=str, help="Model name")
parser.add_argument("--llm", type=str, help="LLM model to use for direct prompts")
parser.add_argument("--hf", type=str, help="Hugging Face model name")
parser.add_argument("--ollama", type=str, help="Ollama model name")
parser.add_argument("--dataset", type=str, help="Dataset name for training", default="yahma/alpaca-cleaned")
parser.add_argument("--realtime", action="store_true", help="Start the realtime voice interaction interface")
parser.add_argument("--call", action="store_true", help="Start the PraisonAI Call server")
parser.add_argument("--public", action="store_true", help="Use ngrok to expose the server publicly (only with --call)")
# If we're in a test environment, parse with empty args to avoid pytest interference
if in_test_env:
args, unknown_args = parser.parse_known_args([])
else:
args, unknown_args = parser.parse_known_args()
# Handle special cases first
if unknown_args and unknown_args[0] == '-b' and unknown_args[1] == 'api:app':
args.command = 'agents.yaml'
if args.command == 'api:app' or args.command == '/app/api:app':
args.command = 'agents.yaml'
if args.command == 'ui':
args.ui = 'chainlit'
if args.command == 'chat':
args.ui = 'chainlit'
args.chat = True
if args.command == 'code':
args.ui = 'chainlit'
args.code = True
if args.command == 'realtime':
args.realtime = True
if args.command == 'call':
args.call = True
# Handle both command and flag versions for call
if args.command == 'call' or args.call:
if not CALL_MODULE_AVAILABLE:
print("[red]ERROR: Call feature is not installed. Install with:[/red]")
print("\npip install \"praisonai[call]\"\n")
sys.exit(1)
call_args = []
if args.public:
call_args.append('--public')
call_module.main(call_args)
sys.exit(0)
# Handle special commands
if args.command in special_commands:
if args.command == 'chat':
if not CHAINLIT_AVAILABLE:
print("[red]ERROR: Chat UI is not installed. Install with:[/red]")
print("\npip install \"praisonai[chat]\"\n")
sys.exit(1)
try:
self.create_chainlit_chat_interface()
except ModuleNotFoundError as e:
missing_module = str(e).split("'")[1]
print(f"[red]ERROR: Missing dependency {missing_module}. Install with:[/red]")
print(f"\npip install \"praisonai[chat]\"\n")
sys.exit(1)
sys.exit(0)
elif args.command == 'code':
if not CHAINLIT_AVAILABLE:
print("[red]ERROR: Code UI is not installed. Install with:[/red]")
print("\npip install \"praisonai[code]\"\n")
sys.exit(1)
try:
self.create_code_interface()
except ModuleNotFoundError as e:
missing_module = str(e).split("'")[1]
print(f"[red]ERROR: Missing dependency {missing_module}. Install with:[/red]")
print(f"\npip install \"praisonai[code]\"\n")
sys.exit(1)
sys.exit(0)
elif args.command == 'call':
if not CALL_MODULE_AVAILABLE:
print("[red]ERROR: Call feature is not installed. Install with:[/red]")
print("\npip install \"praisonai[call]\"\n")
sys.exit(1)
call_module.main()
sys.exit(0)
elif args.command == 'realtime':
if not CHAINLIT_AVAILABLE:
print("[red]ERROR: Realtime UI is not installed. Install with:[/red]")
print("\npip install \"praisonai[realtime]\"\n")
sys.exit(1)
self.create_realtime_interface()
sys.exit(0)
elif args.command == 'train':
package_root = os.path.dirname(os.path.abspath(__file__))
config_yaml_destination = os.path.join(os.getcwd(), 'config.yaml')
elif args.command == 'ui':
if not CHAINLIT_AVAILABLE:
print("[red]ERROR: UI is not installed. Install with:[/red]")
print("\npip install \"praisonai[ui]\"\n")
sys.exit(1)
self.create_chainlit_interface()
sys.exit(0)
# Only check framework availability for agent-related operations
if not args.command and (args.init or args.auto or args.framework):
if not CREWAI_AVAILABLE and not AUTOGEN_AVAILABLE and not PRAISONAI_AVAILABLE:
print("[red]ERROR: No framework is installed. Please install at least one framework:[/red]")
print("\npip install \"praisonai\\[crewai]\" # For CrewAI")
print("pip install \"praisonai\\[autogen]\" # For AutoGen")
print("pip install \"praisonai\\[crewai,autogen]\" # For both frameworks\n")
print("pip install praisonaiagents # For PraisonAIAgents\n")
sys.exit(1)
# Handle direct prompt if command is not a special command or file
# Skip this during testing to avoid pytest arguments interfering
if not in_test_env and args.command and not args.command.endswith('.yaml') and args.command not in special_commands:
args.direct_prompt = args.command
args.command = None
return args
def handle_direct_prompt(self, prompt):
"""
Handle direct prompt by creating a single agent and running it.
"""
if PRAISONAI_AVAILABLE:
agent_config = {
"name": "DirectAgent",
"role": "Assistant",
"goal": "Complete the given task",
"backstory": "You are a helpful AI assistant"
}
# Add llm if specified
if hasattr(self, 'args') and self.args.llm:
agent_config["llm"] = self.args.llm
agent = PraisonAgent(**agent_config)
result = agent.start(prompt)
return result
elif CREWAI_AVAILABLE:
agent_config = {
"name": "DirectAgent",
"role": "Assistant",
"goal": "Complete the given task",
"backstory": "You are a helpful AI assistant"
}
# Add llm if specified
if hasattr(self, 'args') and self.args.llm:
agent_config["llm"] = self.args.llm
agent = Agent(**agent_config)
task = Task(
description=prompt,
agent=agent
)
crew = Crew(
agents=[agent],
tasks=[task]
)
return crew.kickoff()
elif AUTOGEN_AVAILABLE:
config_list = self.config_list
# Add llm if specified
if hasattr(self, 'args') and self.args.llm:
config_list[0]['model'] = self.args.llm
assistant = autogen.AssistantAgent(
name="DirectAgent",
llm_config={"config_list": config_list}
)
user_proxy = autogen.UserProxyAgent(
name="UserProxy",
code_execution_config={"work_dir": "coding"}
)
user_proxy.initiate_chat(assistant, message=prompt)
return "Task completed"
else:
print("[red]ERROR: No framework is installed. Please install at least one framework:[/red]")
print("\npip install \"praisonai\\[crewai]\" # For CrewAI")
print("pip install \"praisonai\\[autogen]\" # For AutoGen")
print("pip install \"praisonai\\[crewai,autogen]\" # For both frameworks\n")
print("pip install praisonaiagents # For PraisonAIAgents\n")
sys.exit(1)
def create_chainlit_chat_interface(self):
"""
Create a Chainlit interface for the chat application.
"""
if CHAINLIT_AVAILABLE:
import praisonai
os.environ["CHAINLIT_PORT"] = "8084"
root_path = os.path.join(os.path.expanduser("~"), ".praison")
if "CHAINLIT_APP_ROOT" not in os.environ:
os.environ["CHAINLIT_APP_ROOT"] = root_path
chat_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'chat.py')
chainlit_run([chat_ui_path])
else:
print("ERROR: Chat UI is not installed. Please install it with 'pip install \"praisonai[chat]\"' to use the chat UI.")
def create_code_interface(self):
"""
Create a Chainlit interface for the code application.
"""
if CHAINLIT_AVAILABLE:
import praisonai
os.environ["CHAINLIT_PORT"] = "8086"
root_path = os.path.join(os.path.expanduser("~"), ".praison")
if "CHAINLIT_APP_ROOT" not in os.environ:
os.environ["CHAINLIT_APP_ROOT"] = root_path
public_folder = os.path.join(os.path.dirname(__file__), 'public')
if not os.path.exists(os.path.join(root_path, "public")):
if os.path.exists(public_folder):
shutil.copytree(public_folder, os.path.join(root_path, "public"), dirs_exist_ok=True)
logging.info("Public folder copied successfully!")
else:
logging.info("Public folder not found in the package.")
else:
logging.info("Public folder already exists.")
code_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'code.py')
chainlit_run([code_ui_path])
else:
print("ERROR: Code UI is not installed. Please install it with 'pip install \"praisonai[code]\"' to use the code UI.")
def create_gradio_interface(self):
"""
Create a Gradio interface for generating agents and performing tasks.
"""
if GRADIO_AVAILABLE:
def generate_crew_and_kickoff_interface(auto_args, framework):
self.framework = framework
self.agent_file = "test.yaml"
generator = AutoGenerator(topic=auto_args, framework=self.framework)
self.agent_file = generator.generate()
agents_generator = AgentsGenerator(self.agent_file, self.framework, self.config_list)
result = agents_generator.generate_crew_and_kickoff()
return result
gr.Interface(
fn=generate_crew_and_kickoff_interface,
inputs=[gr.Textbox(lines=2, label="Auto Args"), gr.Dropdown(choices=["crewai", "autogen"], label="Framework")],
outputs="textbox",
title="Praison AI Studio",
description="Create Agents and perform tasks",
theme="default"
).launch()
else:
print("ERROR: Gradio is not installed. Please install it with 'pip install gradio' to use this feature.")
def create_chainlit_interface(self):
"""
Create a Chainlit interface for generating agents and performing tasks.
"""
if CHAINLIT_AVAILABLE:
import praisonai
os.environ["CHAINLIT_PORT"] = "8082"
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
if not os.path.exists("public"):
if os.path.exists(public_folder):
shutil.copytree(public_folder, 'public', dirs_exist_ok=True)
logging.info("Public folder copied successfully!")
else:
logging.info("Public folder not found in the package.")
else:
logging.info("Public folder already exists.")
chainlit_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'agents.py')
chainlit_run([chainlit_ui_path])
else:
print("ERROR: Chainlit is not installed. Please install it with 'pip install \"praisonai[ui]\"' to use the UI.")
def create_realtime_interface(self):
"""
Create a Chainlit interface for the realtime voice interaction application.
"""
if CHAINLIT_AVAILABLE:
import praisonai
os.environ["CHAINLIT_PORT"] = "8088"
root_path = os.path.join(os.path.expanduser("~"), ".praison")
if "CHAINLIT_APP_ROOT" not in os.environ:
os.environ["CHAINLIT_APP_ROOT"] = root_path
public_folder = os.path.join(os.path.dirname(praisonai.__file__), 'public')
if not os.path.exists(os.path.join(root_path, "public")):
if os.path.exists(public_folder):
shutil.copytree(public_folder, os.path.join(root_path, "public"), dirs_exist_ok=True)
logging.info("Public folder copied successfully!")
else:
logging.info("Public folder not found in the package.")
else:
logging.info("Public folder already exists.")
realtime_ui_path = os.path.join(os.path.dirname(praisonai.__file__), 'ui', 'realtime.py')
chainlit_run([realtime_ui_path])
else:
print("ERROR: Realtime UI is not installed. Please install it with 'pip install \"praisonai[realtime]\"' to use the realtime UI.")
if __name__ == "__main__":
praison_ai = PraisonAI()
praison_ai.main()