Cleanup pelan-pelan
This commit is contained in:
parent
b6cecd686d
commit
44fca6c366
20
hendrik.py
20
hendrik.py
@ -1,4 +1,4 @@
|
||||
import os, sys, argparse, threading, time, signal
|
||||
import os, sys, threading, time, signal
|
||||
|
||||
import config
|
||||
|
||||
@ -11,6 +11,8 @@ from services.telegram_client import TelegramClient
|
||||
|
||||
from interfaces.tui import HendrikTUI
|
||||
|
||||
from modules import argsparser
|
||||
|
||||
tools_definition = [
|
||||
# Coder Tools
|
||||
gadget.tools_mapping( schema = coder.schema_read_file, handler = coder.read_file ),
|
||||
@ -71,16 +73,12 @@ TOOLS = gadget.tool_schemas (tools_definition)
|
||||
TOOL_HANDLERS = gadget.tool_handlers (tools_definition)
|
||||
|
||||
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()
|
||||
|
||||
args = argsparser.args
|
||||
# Override char configuration from args
|
||||
if args.char:
|
||||
config.load_service_config(char_override=args.char)
|
||||
|
||||
# Set workspace from args
|
||||
if args.workspace:
|
||||
resolved = os.path.abspath(args.workspace)
|
||||
if not os.path.isdir(resolved):
|
||||
@ -88,7 +86,10 @@ def main():
|
||||
sys.exit(1)
|
||||
coder.set_current_workspace(resolved)
|
||||
|
||||
# Inference
|
||||
llm_client = LLMClient("", "", "", config.llm_timeout)
|
||||
|
||||
# Pesan saat opsi model belum dipilih
|
||||
if not moop.configure_client(llm_client):
|
||||
if config.XMPP_ENABLED or config.TELEGRAM_ENABLED:
|
||||
print(
|
||||
@ -145,8 +146,7 @@ def main():
|
||||
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
|
||||
pass # Ya kocak sih, pakai --service dan ga pake --service jalannya ya sama-sama aja.
|
||||
|
||||
if services:
|
||||
threads = []
|
||||
|
||||
8
modules/argsparser.py
Normal file
8
modules/argsparser.py
Normal file
@ -0,0 +1,8 @@
|
||||
import argparse
|
||||
|
||||
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()
|
||||
Loading…
Reference in New Issue
Block a user