HA add-on: add configurable primary model (model_primary option)
This commit is contained in:
@@ -19,14 +19,20 @@ options:
|
|||||||
# Optional: lock DMs to specific Telegram user ids (comma-separated).
|
# Optional: lock DMs to specific Telegram user ids (comma-separated).
|
||||||
# If set, add-on will use dmPolicy=allowlist and allowFrom=<ids>.
|
# If set, add-on will use dmPolicy=allowlist and allowFrom=<ids>.
|
||||||
telegram_allow_from: ""
|
telegram_allow_from: ""
|
||||||
|
|
||||||
|
# Model selection (string like "openai-codex/gpt-5.2" or "ollama/gpt-oss:20b")
|
||||||
|
model_primary: "openai-codex/gpt-5.2"
|
||||||
|
|
||||||
homeassistant_token: ""
|
homeassistant_token: ""
|
||||||
mikrotik_host: "192.168.88.1"
|
mikrotik_host: "192.168.88.1"
|
||||||
mikrotik_ssh_user: "papur"
|
mikrotik_ssh_user: "papur"
|
||||||
mikrotik_ssh_key_path: "/data/keys/mikrotik_papur_nopw"
|
mikrotik_ssh_key_path: "/data/keys/mikrotik_papur_nopw"
|
||||||
|
|
||||||
schema:
|
schema:
|
||||||
telegram_bot_token: str
|
telegram_bot_token: str
|
||||||
timezone: str
|
timezone: str
|
||||||
telegram_allow_from: str?
|
telegram_allow_from: str?
|
||||||
|
model_primary: str
|
||||||
homeassistant_token: str?
|
homeassistant_token: str?
|
||||||
mikrotik_host: str
|
mikrotik_host: str
|
||||||
mikrotik_ssh_user: str
|
mikrotik_ssh_user: str
|
||||||
|
|||||||
+8
-1
@@ -12,6 +12,7 @@ fi
|
|||||||
BOT_TOKEN=$(jq -r '.telegram_bot_token // empty' "$OPTIONS_FILE")
|
BOT_TOKEN=$(jq -r '.telegram_bot_token // empty' "$OPTIONS_FILE")
|
||||||
TZNAME=$(jq -r '.timezone // "Europe/Sofia"' "$OPTIONS_FILE")
|
TZNAME=$(jq -r '.timezone // "Europe/Sofia"' "$OPTIONS_FILE")
|
||||||
ALLOW_FROM_RAW=$(jq -r '.telegram_allow_from // empty' "$OPTIONS_FILE")
|
ALLOW_FROM_RAW=$(jq -r '.telegram_allow_from // empty' "$OPTIONS_FILE")
|
||||||
|
MODEL_PRIMARY=$(jq -r '.model_primary // "openai-codex/gpt-5.2"' "$OPTIONS_FILE")
|
||||||
HA_TOKEN=$(jq -r '.homeassistant_token // empty' "$OPTIONS_FILE")
|
HA_TOKEN=$(jq -r '.homeassistant_token // empty' "$OPTIONS_FILE")
|
||||||
MT_HOST=$(jq -r '.mikrotik_host // "192.168.88.1"' "$OPTIONS_FILE")
|
MT_HOST=$(jq -r '.mikrotik_host // "192.168.88.1"' "$OPTIONS_FILE")
|
||||||
MT_USER=$(jq -r '.mikrotik_ssh_user // "papur"' "$OPTIONS_FILE")
|
MT_USER=$(jq -r '.mikrotik_ssh_user // "papur"' "$OPTIONS_FILE")
|
||||||
@@ -52,7 +53,11 @@ cat > /data/.clawdbot/clawdbot.json <<EOF
|
|||||||
gateway: { mode: "local" },
|
gateway: { mode: "local" },
|
||||||
agents: {
|
agents: {
|
||||||
defaults: {
|
defaults: {
|
||||||
workspace: "/data/clawd"
|
workspace: "/data/clawd",
|
||||||
|
model: { primary: "${MODEL_PRIMARY}" },
|
||||||
|
models: {
|
||||||
|
"${MODEL_PRIMARY}": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
list: [
|
list: [
|
||||||
{ id: "main" }
|
{ id: "main" }
|
||||||
@@ -69,6 +74,8 @@ cat > /data/.clawdbot/clawdbot.json <<EOF
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
echo "Model primary=${MODEL_PRIMARY}"
|
||||||
|
|
||||||
echo "Telegram dmPolicy=${DM_POLICY}${ALLOW_FROM_RAW:+ (allowFrom=${ALLOW_FROM_RAW})}"
|
echo "Telegram dmPolicy=${DM_POLICY}${ALLOW_FROM_RAW:+ (allowFrom=${ALLOW_FROM_RAW})}"
|
||||||
echo "Telegram allowFrom JSON: ${ALLOW_FROM_JSON:-<none>}"
|
echo "Telegram allowFrom JSON: ${ALLOW_FROM_JSON:-<none>}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user