From a22fe1b9e75eefe8391a53e13f782048d29dfac7 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Wed, 10 Jun 2026 20:43:43 +0700 Subject: [PATCH] Minor change --- .env.example | 46 ++++++++++++++++++++++++++--------------- config.py | 4 ++-- services/xmpp_client.py | 2 +- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.env.example b/.env.example index 1cb0549..8837875 100644 --- a/.env.example +++ b/.env.example @@ -1,33 +1,45 @@ -# Environment Variables for AI Agent # Copy to .env and modify as needed -# LLM Configuration -LLM_BASE_URL=http://localhost:11434/v1 -LLM_MODEL=deepseek-r1:8b -LLM_API_KEY=ollama -AGENT_MAX_ITERATIONS=10 -MAX_TOOL_OUTPUT=4000 +# Transformers API Local +# LLM_BASE_URL=http://localhost:12345/v1 +# LLM_MODEL=granite4.1:8b +# LLM_API_KEY=sk-not-needed -# XMPP (default: disabled) -XMPP_ENABLED=False -XMPP_USERNAME= -XMPP_PASSWORD= -# XMPP_MUC_ROOMS=room1@conference.server,room2@conference.server +# Ollama Local +# LLM_BASE_URL=http://localhost:11434/v1 +# LLM_MODEL=granite4.1:8b +# LLM_API_KEY=ollama -# ─── Persona / Mode ────────────────────────────────────────────────────────── -# Mode AI: "programmer" (default, koding) | "roleplayer" (ngobrol) -PERSONA_MODE=programmer +# Ollama Cloud +# LLM_BASE_URL=https://ollama.com/v1 +# LLM_MODEL=ministral-3:14b-cloud +# LLM_API_KEY= + +# Openrouter AI +# LLM_BASE_URL=https://openrouter.ai/api/v1 +# LLM_MODEL=openrouter/owl-alpha +# LLM_API_KEY= + +AGENT_MAX_ITERATIONS=20 +AGENT_MAX_TOOL_OUTPUT=4000 # Personality +PERSONA_MODE=programmer # Mode AI: "programmer" (default, koding) | "roleplayer" (ngobrol) PERSONA_NAME=OWL PERSONA_TONE=casual # casual | formal | playful | warm PERSONA_VERBOSITY=balanced # concise | balanced | detailed PERSONA_HUMOR=light # none | light | witty PERSONA_LANGUAGE=id # id | en | (kosong = auto) PERSONA_MOOD=cheerful # cheerful | calm | energetic | sarcastic -# PERSONA_CATCHPHRASES=Siap bro!, Haha~, Wkwkwk +PERSONA_CATCHPHRASES=Hai, Gimana kabarnya?, Wkwkwk + +XMPP_ENABLED=False + +# XMPP_USERNAME= +# XMPP_PASSWORD= +# XMPP_MUC_ROOMS=room1@conference.server,room2@conference.server # Selective response (roleplayer mode): true = hanya respon kalau ada mention/relevansi. # false = semua pesan direspon (tanpa filter). -PERSONA_SELECTIVE_RESPONSE=true +XMPP_SELECTIVE_RESPONSE=true diff --git a/config.py b/config.py index 03f00af..598d4ee 100644 --- a/config.py +++ b/config.py @@ -10,7 +10,7 @@ llm_timeout = int( os.getenv("LLM_TIMEOUT", default="600" AGENT_MAX_ITERATIONS = int( os.getenv("AGENT_MAX_ITERATIONS", default="30" ) ) -MAX_TOOL_OUTPUT = int( os.getenv("MAX_TOOL_OUTPUT", default="40000" ) ) +AGENT_MAX_TOOL_OUTPUT = int( os.getenv("AGENT_MAX_TOOL_OUTPUT", default="40000" ) ) RAG_PERSIST_DIR = os.getenv("RAG_PERSIST_DIR", default="chroma_db" ) # Embedding: ChromaDB ONNX default (all-MiniLM-L6-v2, lokal, tidak perlu API call) @@ -50,7 +50,7 @@ PERSONA_CATCHPHRASES = os.getenv("PERSONA_CATCHPHRASES", default="").strip() # Selective response: true = roleplayer hanya respon kalau ada mention/relevansi (default). # false = roleplayer semua pesan ikut respon (seperti biasa, tanpa filter). -PERSONA_SELECTIVE_RESPONSE = os.getenv("PERSONA_SELECTIVE_RESPONSE", default="true").strip().lower() in ("true", "1", "yes") +XMPP_SELECTIVE_RESPONSE = os.getenv("XMPP_SELECTIVE_RESPONSE", default="true").strip().lower() in ("true", "1", "yes") # Humanize Delay Configuration (anti-bot detection) READ_DELAY_MIN = float( os.getenv("READ_DELAY_MIN", default="1.0" ) ) # min reading delay (second) diff --git a/services/xmpp_client.py b/services/xmpp_client.py index e51f61a..dd7158e 100644 --- a/services/xmpp_client.py +++ b/services/xmpp_client.py @@ -369,7 +369,7 @@ class XMPPClient(ClientXMPP): # ── Roleplayer: cek need_response sebelum kirim ── if is_roleplayer: - if config.PERSONA_SELECTIVE_RESPONSE: + if config.XMPP_SELECTIVE_RESPONSE: # Build recent history dari session messages (tanpa system prompt) recent_msgs = [] for msg in session.messages[-6:]: