Skip to content

Commit

Permalink
Merge pull request #278 from isamu/slashbot_options
Browse files Browse the repository at this point in the history
add options
  • Loading branch information
isamu authored Dec 13, 2023
2 parents d805e59 + 1eaa2f2 commit 52ecac5
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/slashgpt/slashbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,28 @@

def run_bot(base_dir: str = ""):
parser = argparse.ArgumentParser(description="SlashBot: SlashGPT bot")
parser.add_argument("agentname")
if "--list" not in sys.argv and "-l" not in sys.argv:
parser.add_argument("agentname")
parser.add_argument("--manifests", default="main")

parser.add_argument("--dir", "-d", default="")
parser.add_argument("--list", "-l", action="store_true")
args = parser.parse_args()
manifests = args.manifests
agent = args.agentname
directory = args.dir

current_dir = base_dir if base_dir != "" else os.path.dirname(__file__)
current_dir = directory if directory else base_dir if base_dir != "" else os.path.dirname(__file__)
manifests_dir = current_dir + "/manifests/" + manifests
agent_file = manifests_dir + "/" + agent

config = ChatConfigWithManifests(current_dir, manifests_dir)
if args.list:
print("Manifest list")
for manifest_key in config.manifests.keys():
manifest = config.manifests[manifest_key]
print(manifest_key + ": " + manifest.get("title", "") + " - " + manifest.get("description", ""))
return

agent = args.agentname
agent_file = manifests_dir + "/" + agent

if os.path.isfile(agent_file + ".yml"):
agent_file = agent_file + ".yml"
Expand Down

0 comments on commit 52ecac5

Please sign in to comment.