mirror of
https://github.com/microsoft/autogen.git
synced 2025-10-01 19:16:50 +00:00

* 1) Removed most framework sleeps 2) refactored connection code * pre-commit fixes * pre-commit * ignore protobuf files in pre-commit checks * Fix duplicate actor registration * refactor change * Nicer printing of Actors * 1) Report recv_multipart errors 4) Always send 4 parts * AutoGen generate_reply expects to wait indefinitely for an answer. CAP can wait a certain amount and give up. In order to reconcile the two, AutoGenConnector is set to wait indefinitely. * pre-commit formatting fixes * pre-commit format changes * don't check autogenerated proto py files * Iterating on CAP interface for AutoGen * User proxy must initiate chat * autogencap pypi package * added dependencies * serialize/deserialize dictionary elements to json when dealing with ReceiveReq * 1) Removed most framework sleeps 2) refactored connection code * Nicer printing of Actors * AutoGen generate_reply expects to wait indefinitely for an answer. CAP can wait a certain amount and give up. In order to reconcile the two, AutoGenConnector is set to wait indefinitely. * pre-commit formatting fixes * pre-commit format changes * Iterating on CAP interface for AutoGen * User proxy must initiate chat * autogencap pypi package * added dependencies * serialize/deserialize dictionary elements to json when dealing with ReceiveReq * pre-commit check fixes * fix pre-commit issues * Better encapsulation of logging * pre-commit fix * pip package update
74 lines
2.2 KiB
Python
74 lines
2.2 KiB
Python
"""
|
|
Demo App
|
|
"""
|
|
|
|
import argparse
|
|
|
|
import _paths
|
|
import autogencap.Config as Config
|
|
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
|
|
from list_agents import list_agents
|
|
from RemoteAGDemo import remote_ag_demo
|
|
from SimpleActorDemo import simple_actor_demo
|
|
|
|
####################################################################################################
|
|
|
|
|
|
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]}")
|
|
Config.LOG_LEVEL = args.log_level
|
|
# Config.IGNORED_LOG_CONTEXTS.extend(["BROKER"])
|
|
|
|
|
|
####################################################################################################
|
|
|
|
|
|
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")
|
|
print("6. List Actors in CAP (Registry)")
|
|
choice = input("Enter your choice (1-6): ")
|
|
|
|
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()
|
|
elif choice == "6":
|
|
list_agents()
|
|
else:
|
|
print("Quitting...")
|
|
break
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|