Commit graph

21 commits

Author SHA1 Message Date
Alberto Garcia Illera
301f5cec71
fix: correct session.chat() return type to match server response
The OpenCode server's POST /session/{id}/message endpoint returns a
wrapper object with 'info' (the assistant message) and 'parts' (the
message parts):

    {"info": AssistantMessage, "parts": Part[]}

The SDK was casting this response to bare AssistantMessage, which
caused Pydantic to silently produce a hollow object where all fields
(id, role, tokens, etc.) were None.

This commit:
- Adds SessionChatResponse type with 'info: Message' and 'parts: List[Part]'
  fields matching the actual server response shape
- Updates both sync and async chat() to return SessionChatResponse
- Exports the new type from types/__init__.py
- Updates api.md documentation
2026-02-21 12:37:30 -08:00
stainless-app[bot]
1de4987d50 feat(api): api update 2025-07-28 17:08:39 +00:00
stainless-app[bot]
145229a92b feat(api): api update 2025-07-25 02:26:21 +00:00
stainless-app[bot]
c75867efe7 feat(api): api update 2025-07-24 04:08:59 +00:00
stainless-app[bot]
5f9e3cd004 feat(api): api update 2025-07-22 21:55:44 +00:00
stainless-app[bot]
6e577d0bde feat(api): api update 2025-07-22 16:09:30 +00:00
stainless-app[bot]
ff6b72a6da feat(api): api update 2025-07-22 02:03:53 +00:00
stainless-app[bot]
be1f9d88f0 feat(api): api update 2025-07-21 23:24:56 +00:00
stainless-app[bot]
98315648f7 feat(api): api update 2025-07-21 23:01:10 +00:00
stainless-app[bot]
e2e1f1d384 feat(api): api update 2025-07-21 22:40:17 +00:00
stainless-app[bot]
5f542aa68e feat(api): api update 2025-07-18 17:47:39 +00:00
stainless-app[bot]
5e3dae765d feat(api): api update 2025-07-17 19:29:58 +00:00
stainless-app[bot]
731f553f04 feat(api): api update 2025-07-17 03:06:30 +00:00
stainless-app[bot]
f1d9d8f9ec feat(api): api update 2025-07-16 14:54:11 +00:00
stainless-app[bot]
eaaed9e5e1 feat(api): api update 2025-07-15 14:51:48 +00:00
stainless-app[bot]
d63c6f6f73 feat(api): api update 2025-07-15 13:16:37 +00:00
stainless-app[bot]
64c9b57dda feat(api): manual updates 2025-07-07 03:08:56 +00:00
stainless-app[bot]
ce2269062c feat(api): update via SDK Studio 2025-07-02 10:58:56 +00:00
stainless-app[bot]
a6cf7c5b2a feat(api): update via SDK Studio 2025-06-27 14:47:09 +00:00
stainless-app[bot]
e77f05977e feat(api): update via SDK Studio 2025-06-27 14:26:52 +00:00
stainless-app[bot]
ff05a4adf0 feat(api): update via SDK Studio 2025-06-27 14:25:52 +00:00