Better switch
This commit is contained in:
parent
40ffc2a0d0
commit
17bc828091
22
hendrik.py
22
hendrik.py
@ -87,6 +87,8 @@ def main():
|
||||
parser = argparse.ArgumentParser(description="Hendrik AI Agent")
|
||||
parser.add_argument('--char', type=str, default=None, help='Character name (overrides config.yaml)')
|
||||
parser.add_argument('-w', '--workspace', type=str, default=None, help='Working directory')
|
||||
parser.add_argument('--tui', action='store_true', help='Force run in TUI mode')
|
||||
parser.add_argument('--service', action='store_true', help='Force run in service mode')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.char:
|
||||
@ -144,6 +146,21 @@ def main():
|
||||
)
|
||||
services.append(tg)
|
||||
|
||||
if args.tui:
|
||||
HendrikTUI(
|
||||
llm_client = llm_client,
|
||||
tools_definition = tools_definition,
|
||||
TOOLS = TOOLS,
|
||||
TOOL_HANDLERS = TOOL_HANDLERS,
|
||||
build_system_prompt = personality.build_system_prompt,
|
||||
agent_max_iterations = config.AGENT_MAX_ITERATIONS,
|
||||
).run()
|
||||
return
|
||||
|
||||
if args.service:
|
||||
# Force service mode by ensuring services list is populated if any are enabled in config
|
||||
pass # Fall through to the services logic below
|
||||
|
||||
if services:
|
||||
threads = []
|
||||
for svc in services:
|
||||
@ -170,7 +187,7 @@ def main():
|
||||
_shutdown = True
|
||||
print("Exiting.", flush=True)
|
||||
|
||||
else:
|
||||
elif not args.service:
|
||||
HendrikTUI(
|
||||
llm_client = llm_client,
|
||||
tools_definition = tools_definition,
|
||||
@ -179,6 +196,9 @@ def main():
|
||||
build_system_prompt = personality.build_system_prompt,
|
||||
agent_max_iterations = config.AGENT_MAX_ITERATIONS,
|
||||
).run()
|
||||
else:
|
||||
print("Error: --service requested but no services are enabled in config.yaml", flush=True)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user