Skip to content

Commit 7a26a5a

Browse files
authored
Merge pull request #32 from petrsnd/skills-improvements
Improve SDK skill documentation (params kwarg, HiddenString)
2 parents 4edaad3 + 0f75537 commit 7a26a5a

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

.agents/skills/api-patterns/SKILL.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,21 @@ private_key = A2AContext.quick_retrieve_private_key(
299299
| `broker_access_request(api_key, access_request)` | `str` | Submit an access request |
300300
| `get_retrievable_accounts(*, filter=None)` | `list[dict]` | List accounts (uses cert auth) |
301301

302+
### HiddenString return values
303+
304+
Methods that return secrets (like `A2AContext.retrieve_password()`) return a
305+
`HiddenString` object that displays as `***` when printed, formatted, or
306+
converted with `str()`. To access the raw value:
307+
308+
```python
309+
password = ctx.retrieve_password(api_key)
310+
print(password) # prints: ***
311+
print(password.value) # prints the actual password string
312+
raw = password.value
313+
```
314+
315+
This prevents accidental credential leakage in logs or REPL output.
316+
302317
### A2A Authorization Header
303318

304319
A2A requests use `Authorization: A2A <apiKey>` (not Bearer).
@@ -336,15 +351,18 @@ Set these when the appliance uses a certificate signed by an internal CA.
336351

337352
## Common Patterns
338353

339-
### GET with query parameters
354+
### Query parameters
355+
356+
Use the `params` keyword argument (not `parameters`) to pass query string values:
340357

341358
```python
342-
users = client.get(
343-
Service.CORE, "Users",
344-
params={"filter": "UserName eq 'admin'", "fields": "Id,UserName"},
345-
).json()
359+
users = client.get(Service.CORE, "Users", params={"fields": "Id,Name", "filter": "Disabled eq false"})
360+
assets = client.get(Service.CORE, "Assets", params={"filter": "Name eq 'MyAsset'"})
346361
```
347362

363+
> **Note:** The keyword is `params` (matching the `requests` library convention),
364+
> not `parameters` (which is the .NET SDK's name for the same concept).
365+
348366
### POST with JSON body
349367

350368
```python

0 commit comments

Comments
 (0)