From 5d679421de8ecd34105a58eac165878b87343aaa Mon Sep 17 00:00:00 2001 From: Luna Date: Sat, 4 Apr 2026 16:27:45 +0200 Subject: [PATCH] feat: add support for custom thinking effort (resolves #6) --- README.md | 1 + main.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a52ff6e..8da71e7 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ The following environment variables are required for the service to function: | `OPENCLAW_URL` | The endpoint URL for the OpenClaw API. (with hook path) | | `OPENCLAW_TOKEN` | The authentication token for OpenClaw. (from hooks, not gateway ui) | | `OPENCLAW_PROXY_AUTH` | (Optional) Proxy credentials in `username:password` format. | +| `OPENCLAW_THINKING` | (Optional) The thinking effort for the agent (e.g., `low`, `medium`, `high`). Defaults to `low`. | | `DATABASE_STORAGE_NAME` | The name of the database storage to use. | | `AGENT_USERNAME` | The Gitea username of the AI agent (e.g., `whateveryouragentisnamed`). | | `AGENT_PROMPT_FILE` | (Optional) Path to a custom Markdown template for notifications. If not provided, a default template will be used. | diff --git a/main.py b/main.py index c412e64..6a587d2 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ OPENCLAW_URL = os.getenv("OPENCLAW_URL") OPENCLAW_TOKEN = os.getenv("OPENCLAW_TOKEN") OPENCLAW_PROXY_AUTH = os.getenv("OPENCLAW_PROXY_AUTH") OPENCLAW_MODEL = os.getenv("OPENCLAW_MODEL") +OPENCLAW_THINKING = os.getenv("OPENCLAW_THINKING", "low") DATABASE_STORAGE = os.getenv("DATABASE_STORAGE_NAME") AGENT_USERNAME = os.getenv("AGENT_USERNAME") AGENT_PROMPT_FILE = os.getenv("AGENT_PROMPT_FILE") @@ -166,7 +167,7 @@ def sendToAgent(event_object): headers=headers, json={ "message": message, - "thinking": "low", + "thinking": OPENCLAW_THINKING, "model": OPENCLAW_MODEL, "deliver": False, },