Release v0.7.4

Co-authored-by: Daniel Gafni <danielgafni16@gmail.com>
This commit is contained in:
typesafe-public-bot[bot]andDaniel Gafni authored and GitHub committed 2026-10-09 15:46:17 +00:00
1 parent c743d81416
commit e70bf99a89
5 files changed
+25 -3

No files matched your search

+6
View File
@@ -5,6 +5,12 @@ icon: lucide/history
# Changelog
## v0.7.4 (2026-10-09)
### Bug fixes
- serialize non-finite numbers as strings instead of invalid JSON tokens
## v0.7.3 (2026-10-09)
### Bug fixes
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "typesafe-sdk"
version = "0.7.3"
version = "0.7.4"
description = "Python SDK for TypeSafe AI API."
readme = "README.md"
license = "MIT"
+2 -1
View File
@@ -23,7 +23,8 @@ def _fallback(value: object) -> object:
def serialize(value: object) -> bytes:
return to_json(value, fallback=_fallback)
# JSON has no NaN/Infinity tokens; emit them as the strings "NaN"/"Infinity"/"-Infinity" instead.
return to_json(value, fallback=_fallback, inf_nan_mode="strings")
def deserialize(content: bytes) -> Any:
+15
View File
@@ -161,6 +161,21 @@ async def test_unserializable_request_body_raises(clients: ClientFactory) -> Non
)
async def test_non_finite_numbers_are_stringified(clients: ClientFactory) -> None:
def handler(request: httpx2.Request) -> httpx2.Response:
body = from_json(request.content, allow_inf_nan=False)
assert body["state"] == {"value": "NaN", "arr": [1.0, "Infinity", "-Infinity"]}
assert body["temperature"] == "NaN"
return httpx2.Response(200, content=to_json(RESULT))
await system_one(
clients(handler),
state={"value": float("nan"), "arr": [1.0, float("inf"), float("-inf")]},
questions={"q": {"type": "noul", "instructions": "?"}},
extra_body={"temperature": float("nan")},
)
async def test_raw_question_passthrough(clients: ClientFactory) -> None:
# Explicit escape hatch for fields introduced by the API before this SDK models them.
questions = cast(
Generated
+1 -1
View File
@@ -1238,7 +1238,7 @@ wheels = [
[[package]]
name = "typesafe-sdk"
version = "0.7.3"
version = "0.7.4"
source = { editable = "." }
dependencies = [
{ name = "httpx2" },