Skip to content

Commit 1c55780

Browse files
VladUZHclaude
andcommitted
fix: explicit constructor params for IDE autocomplete
Change SidClaw and AsyncSidClaw __init__ from **kwargs to explicit keyword-only parameters (api_key, base_url, agent_id, max_retries, timeout). This enables IDE autocomplete and type checking. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 73e156f commit 1c55780

1 file changed

Lines changed: 33 additions & 4 deletions

File tree

src/sidclaw/_client.py

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import httpx
88

99
from ._base_client import BaseClient
10+
from ._constants import DEFAULT_BASE_URL, DEFAULT_MAX_RETRIES, DEFAULT_TIMEOUT
1011
from ._errors import ApprovalExpiredError, ApprovalTimeoutError
1112
from ._types import (
1213
ApprovalStatusResponse,
@@ -20,8 +21,22 @@
2021
class SidClaw(BaseClient):
2122
"""Synchronous SidClaw client."""
2223

23-
def __init__(self, **kwargs: Any) -> None:
24-
super().__init__(**kwargs)
24+
def __init__(
25+
self,
26+
*,
27+
api_key: str,
28+
base_url: str = DEFAULT_BASE_URL,
29+
agent_id: str,
30+
max_retries: int = DEFAULT_MAX_RETRIES,
31+
timeout: float = DEFAULT_TIMEOUT,
32+
) -> None:
33+
super().__init__(
34+
api_key=api_key,
35+
base_url=base_url,
36+
agent_id=agent_id,
37+
max_retries=max_retries,
38+
timeout=timeout,
39+
)
2540
self._http = httpx.Client(
2641
base_url=self.base_url,
2742
headers=self._build_headers(),
@@ -103,8 +118,22 @@ def record_outcome(self, trace_id: str, params: RecordOutcomeParams) -> None:
103118
class AsyncSidClaw(BaseClient):
104119
"""Asynchronous SidClaw client."""
105120

106-
def __init__(self, **kwargs: Any) -> None:
107-
super().__init__(**kwargs)
121+
def __init__(
122+
self,
123+
*,
124+
api_key: str,
125+
base_url: str = DEFAULT_BASE_URL,
126+
agent_id: str,
127+
max_retries: int = DEFAULT_MAX_RETRIES,
128+
timeout: float = DEFAULT_TIMEOUT,
129+
) -> None:
130+
super().__init__(
131+
api_key=api_key,
132+
base_url=base_url,
133+
agent_id=agent_id,
134+
max_retries=max_retries,
135+
timeout=timeout,
136+
)
108137
self._http = httpx.AsyncClient(
109138
base_url=self.base_url,
110139
headers=self._build_headers(),

0 commit comments

Comments
 (0)