2024-03-13 00:48:52 -04:00
|
|
|
"""
|
|
|
|
Demo App
|
|
|
|
"""
|
2024-03-19 03:55:37 +01:00
|
|
|
|
2024-03-13 00:48:52 -04:00
|
|
|
import argparse
|
2024-04-05 10:26:06 +08:00
|
|
|
|
2024-03-13 00:48:52 -04:00
|
|
|
import _paths
|
2024-03-27 18:14:39 -04:00
|
|
|
import autogencap.Config as Config
|
2024-03-13 00:48:52 -04:00
|
|
|
import autogencap.DebugLog as DebugLog
|
|
|
|
from AGDemo import ag_demo
|
|
|
|
from AGGroupChatDemo import ag_groupchat_demo
|
|
|
|
from CAPAutGenGroupDemo import cap_ag_group_demo
|
|
|
|
from CAPAutoGenPairDemo import cap_ag_pair_demo
|
|
|
|
from ComplexActorDemo import complex_actor_demo
|
2024-03-27 18:14:39 -04:00
|
|
|
from list_agents import list_agents
|
2024-04-05 10:26:06 +08:00
|
|
|
from RemoteAGDemo import remote_ag_demo
|
|
|
|
from SimpleActorDemo import simple_actor_demo
|
2024-03-13 00:48:52 -04:00
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
def parse_args():
|
|
|
|
# Create a parser for the command line arguments
|
|
|
|
parser = argparse.ArgumentParser(description="Demo App")
|
|
|
|
parser.add_argument("--log_level", type=int, default=1, help="Set the log level (0-3)")
|
|
|
|
# Parse the command line arguments
|
|
|
|
args = parser.parse_args()
|
|
|
|
# Set the log level
|
|
|
|
# Print log level string based on names in debug_log.py
|
|
|
|
print(f"Log level: {DebugLog.LEVEL_NAMES[args.log_level]}")
|
2024-03-27 18:14:39 -04:00
|
|
|
Config.LOG_LEVEL = args.log_level
|
|
|
|
# Config.IGNORED_LOG_CONTEXTS.extend(["BROKER"])
|
2024-03-13 00:48:52 -04:00
|
|
|
|
|
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
parse_args()
|
|
|
|
while True:
|
|
|
|
print("Select the Composable Actor Platform (CAP) demo app to run:")
|
|
|
|
print("(enter anything else to quit)")
|
|
|
|
print("1. Hello World")
|
|
|
|
print("2. Complex Agent (e.g. Name or Quit)")
|
|
|
|
print("3. AutoGen Pair")
|
|
|
|
print("4. AutoGen GroupChat")
|
|
|
|
print("5. AutoGen Agents in different processes")
|
2024-03-27 18:14:39 -04:00
|
|
|
print("6. List Actors in CAP")
|
|
|
|
choice = input("Enter your choice (1-6): ")
|
2024-03-13 00:48:52 -04:00
|
|
|
|
|
|
|
if choice == "1":
|
|
|
|
simple_actor_demo()
|
|
|
|
elif choice == "2":
|
|
|
|
complex_actor_demo()
|
|
|
|
# elif choice == "3":
|
|
|
|
# ag_demo()
|
|
|
|
elif choice == "3":
|
|
|
|
cap_ag_pair_demo()
|
|
|
|
# elif choice == "5":
|
|
|
|
# ag_groupchat_demo()
|
|
|
|
elif choice == "4":
|
|
|
|
cap_ag_group_demo()
|
|
|
|
elif choice == "5":
|
|
|
|
remote_ag_demo()
|
2024-03-27 18:14:39 -04:00
|
|
|
elif choice == "6":
|
|
|
|
list_agents()
|
2024-03-13 00:48:52 -04:00
|
|
|
else:
|
|
|
|
print("Quitting...")
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|