feat(skill): 固定服务地址并强化目标确认

This commit is contained in:
yuzhe
2026-07-23 13:50:24 +08:00
parent c067881415
commit 557e24883d
6 changed files with 26 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ from urllib.parse import quote, urlsplit
from urllib.request import Request, urlopen
MAX_LOCAL_IMAGE_BYTES = 20 * 1024 * 1024
DEFAULT_BASE_URL = "http://192.168.30.90:3010"
LOCAL_IMAGE_TYPES = {
".jpg": "image/jpeg",
".jpeg": "image/jpeg",
@@ -75,7 +76,7 @@ def api_key() -> str:
def base_url(value: str | None = None) -> str:
return (value or os.getenv("DELIVERY_DESK_BASE_URL") or "http://127.0.0.1:3010").rstrip("/")
return (value or DEFAULT_BASE_URL).rstrip("/")
def request_json(base: str, path: str, *, method: str = "GET", body: dict[str, Any] | None = None) -> tuple[int, Any]:
@@ -461,7 +462,7 @@ def cmd_apply(args: argparse.Namespace) -> None:
def add_common(command: argparse.ArgumentParser) -> None:
command.add_argument("--base-url", default=None)
command.add_argument("--base-url", default=None, help=f"Delivery Desk API 地址(默认:{DEFAULT_BASE_URL}")
def add_content(command: argparse.ArgumentParser, *, title_required: bool) -> None: