Skip to content

docs: fix send_message, CallOptions and rewake samples in the README - #17

Merged
sanctrl merged 2 commits into
mainfrom
docs/readme-fixes
Nov 10, 2026
Merged

sanctrl merged 2 commits into
mainfrom
docs/readme-fixes

Conversation

@sanctrl

@sanctrl sanctrl commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

The README samples didn't run as written. Each fix was checked against the SDK and the server.

  • send_message(content="...") posts a bare string, and the server rejects it with 400. The samples now use text=, which the SDK wraps as {"text": ...}. The file sample uses type="file" plus attachment_id= instead of a content dict with a "type" key, which the server strips.
  • opts={"idempotency_key": ...} raises AttributeError, because CallOptions is a dataclass. The sample imports CallOptions and passes CallOptions(idempotency_key=...).
  • Wake frames: the sample now says that unanswered wakes come only on a socket created with capabilities={"rewake": True} (off by default).
  • The package docstring and the send tests use text= too. The sync test now asserts the wrapped {"text": ...} body.

No behaviour change in the SDK itself.

- send_message(content="...") posts a bare string and the server rejects
  it (400): the samples now use text= (the SDK wraps it in {"text": ...}).
  The file sample uses type="file" + attachment_id= instead of a content
  dict with a "type" key the server strips.
- opts={"idempotency_key": ...} raises AttributeError: CallOptions is a
  dataclass. The sample imports and passes CallOptions(idempotency_key=...).
- The wake-frame sample notes that "unanswered" wakes come only on a
  socket created with capabilities={"rewake": True} (default False).
- The package docstring and the send tests use text= too; the sync test
  now asserts the wrapped {"text": ...} body.
@sanctrl
sanctrl merged commit 16a0174 into main Nov 10, 2026
11 checks passed
@sanctrl
sanctrl deleted the docs/readme-fixes branch November 11, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant