What’s Changed
- Logfire Tracing: fix default arguments for Tracer.start_as_current_span by @gvdongen in https://github.com/restatedev/sdk-python/pull/188
What’s Changed
- Use WarpBuild runners for CI workflows by @tillrohrmann in https://github.com/restatedev/sdk-python/pull/185
- Introduce RetryableError by @hatstand in https://github.com/restatedev/sdk-python/pull/184
- Add a RestateTracer and RestateTracerProvider for AI observability by @gvdongen in https://github.com/restatedev/sdk-python/pull/187
New Contributors
- @hatstand made their first contribution in https://github.com/restatedev/sdk-python/pull/184
What’s Changed
- Pydantic AI integration: upgrade pydantic ai library to 1.68.0. Disable autowrapping tools in ctx.run. Default retry strategy for LLM calls is now 10 attemps with 1 second minimum interval.
- Google ADK integration: Added RestateEventsSummarizer to wrap LLM summarization calls in durable steps and added flushing compaction events in append_event to Restate.
Bug fixes
- fix: #175 BidiStream SIGTERM causes CPU hot loop and pod stuck in Terminating by @brightsparc in https://github.com/restatedev/sdk-python/pull/176
- Bump shared core, bump max protocol version, update feature matrix by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/183
New Contributors
- @brightsparc made their first contribution in https://github.com/restatedev/sdk-python/pull/176
What’s Changed
- Support zstd compression in python 3.14+ by @jackkleeman in https://github.com/restatedev/sdk-python/pull/174
What’s Changed
- Update shared core by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/170
- Fix stacktrace propagation inside ctx.run by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/171
What’s Changed
- doc: fix various typos by @didier-durand in https://github.com/restatedev/sdk-python/pull/168
- Add pydantic ai by @igalshilman in https://github.com/restatedev/sdk-python/pull/167
- [extensions] Avoid global state in the ADK plugin by @igalshilman in https://github.com/restatedev/sdk-python/pull/169
New Contributors
- @didier-durand made their first contribution in https://github.com/restatedev/sdk-python/pull/168
What’s Changed
- OpenAI integration: DurableRunner with LLM retry opts and lazy session flushing by @gvdongen in https://github.com/restatedev/sdk-python/pull/164
- Add explicit tool execution synchronization by @igalshilman in https://github.com/restatedev/sdk-python/pull/165
- Cancel subsequent tools by @igalshilman in https://github.com/restatedev/sdk-python/pull/166
What’s Changed
- Update Google ADK extension by @gvdongen in https://github.com/restatedev/sdk-python/pull/163
New Contributors
- @gvdongen made their first contribution in https://github.com/restatedev/sdk-python/pull/163
New features :tada:
- Use context manager together with service handlers:
- Add
msgspecsupport, works out of the box when addingrestate_sdk[serde]dependency:
- Add extension modules for Google ADK and OpenAI, more info soon!
What’s Changed
- Add current_context() extension point by @igalshilman in https://github.com/restatedev/sdk-python/pull/148
- Add context manager support by @igalshilman in https://github.com/restatedev/sdk-python/pull/149
- Rename to invocation_context_managers by @igalshilman in https://github.com/restatedev/sdk-python/pull/150
- Rethrow TerminalError/SdkBaseException accidentally wrapped by @igalshilman in https://github.com/restatedev/sdk-python/pull/151
- feat: add msgspec support by @v1gnesh in https://github.com/restatedev/sdk-python/pull/154
- Consolidate msgspec conditional imports into a single place by @igalshilman in https://github.com/restatedev/sdk-python/pull/155
- Use DefaultSerde instead of JsonSerde for promise() default parameter by @Gustavo-Hagenbeck in https://github.com/restatedev/sdk-python/pull/157
- Support
union | Nonereturn types by @igalshilman in https://github.com/restatedev/sdk-python/pull/158 - Use HttpError for the typed ingress client by @igalshilman in https://github.com/restatedev/sdk-python/pull/159
- Replace traceback.print_exc() with logger.exception() for proper logging by @Gustavo-Hagenbeck in https://github.com/restatedev/sdk-python/pull/160
- Add an optional extension module for Google ADK integration by @igalshilman in https://github.com/restatedev/sdk-python/pull/161
- Add an optional ext module for openai by @igalshilman in https://github.com/restatedev/sdk-python/pull/162
New Contributors
- @v1gnesh made their first contribution in https://github.com/restatedev/sdk-python/pull/154
- @Gustavo-Hagenbeck made their first contribution in https://github.com/restatedev/sdk-python/pull/157
New features :tada:
- Added ingress client to send requests from your python applications to restate services:
- Added new test harness constructor to be used in combination with
@pytest.fixture:
- Various type hints improvements, such as https://github.com/restatedev/sdk-python/issues/112
What’s Changed
- Revert usage of asyncio cancellation mechanism by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/142
- Update
crazy-max/ghaction-setup-dockerto v4 by @muhamadazmy in https://github.com/restatedev/sdk-python/pull/144 - Use modern lints, tools and type checkers by @igalshilman in https://github.com/restatedev/sdk-python/pull/143
- Add typed client by @igalshilman in https://github.com/restatedev/sdk-python/pull/145
- Add test for harness and typed client. Fix name of TestHarnessEnvironment so it doesn’t get mixed up in pytest. Fix imports in init by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/147
New features
- You can configure more retry options for
ctx.run_typed:
- You can now provide a name to
sleep, you’ll be able to see this name in the UI.
Notable changes
- When suspending, the SDK will now throw an
asyncio.CancelledError, instead of the previously thrown custom error. Catch this exception only if you need to cleanup some external resources between execution attempts.
What’s Changed
- Use task cancellation instead of custom suspension exception by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/132
- Remove typing_extensions dependency by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/133
- Copy RunOptions when mutating them by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/135
- Add name parameter to sleep by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/136
- Fix ctx.time() by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/138
- Expose all run retry options by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/137
- Test suite 3.2 upgrade by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/139
- Use service image by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/140
- Fix lint warning by @igalshilman in https://github.com/restatedev/sdk-python/pull/141
Removed
typing_extensions dependency.View on GitHubWhat’s Changed
- Add better closed error by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/131
Invocation retry policy
When used with Restate 1.5, you can now configure the invocation retry policy from the SDK directly. See https://github.com/restatedev/restate/releases/tag/v1.5.0 for more details on the new invocation retry policy configuration.What’s Changed
- Retry Policy by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/126
- Clarify ctx.run max attempts by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/127
- Bring back Python 3.10 support by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/129
What’s Changed
- Add
always_replayflag to test harness by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/124 - Add
disable_retriesflag to test harness by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/125
New features :sparkles:
ctx.random()andctx.uuid()for deterministic random and uuid. by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/120- Add
ctx.time()as wrapper aroundctx.run(time.time)by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/121 - Integration with standard library
loggingmodule: replay aware logging filterrestate.RestateLoggingFilterand log factoryrestate.getLogger()by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/122
What’s Changed
- enhancement: Add support for function args & kwargs type hints in ctx.run. by @objecthuman in https://github.com/restatedev/sdk-python/pull/109
- Bump PyO3 version, this required few changes by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/110
- Update pyproject.toml to include correct license metadata by @tillrohrmann in https://github.com/restatedev/sdk-python/pull/111
New Contributors
- @objecthuman made their first contribution in https://github.com/restatedev/sdk-python/pull/109
- Introduce new Service/Object/Workflow constructor fields and the decorator fields
inactivity_timeout,abort_timeout,journal_retention,idempotency_retention,ingress_private,workflow_retention. Please note these work only from Restate 1.4 onward. Check the in-code documentation for more details. - Improved error messages
What’s Changed
- Discovery manifest V3 by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/103
- Bump shared core by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/106
- Use shared core 0.4 by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/107
New Contributors
- @muhamadazmy made their first contribution in https://github.com/restatedev/sdk-python/pull/101
What’s Changed
- Minor type hint improvments by @igalshilman in https://github.com/restatedev/sdk-python/pull/95
What’s Changed
- Trigger building docker by @igalshilman in https://github.com/restatedev/sdk-python/pull/92
- Asgi recv() on lambda should hang when there are no more events by @igalshilman in https://github.com/restatedev/sdk-python/pull/93
- Add an explicit HTTP input closed event by @igalshilman in https://github.com/restatedev/sdk-python/pull/94
What’s Changed
- Fix DefaultSerde with_type_hint by @igalshilman in https://github.com/restatedev/sdk-python/pull/79
- Make the restate app mountable by @igalshilman in https://github.com/restatedev/sdk-python/pull/80
- [test] Use single element tuples by @igalshilman in https://github.com/restatedev/sdk-python/pull/81
- Rename created Docker image into test-services-python by @tillrohrmann in https://github.com/restatedev/sdk-python/pull/77
- [docs] Add types to the attributes section by @igalshilman in https://github.com/restatedev/sdk-python/pull/82
- Introduce attempt completion event by @igalshilman in https://github.com/restatedev/sdk-python/pull/83
- Auto cancel tasks when an attempt is over by @igalshilman in https://github.com/restatedev/sdk-python/pull/84
- Support concurrent side effects more robustly by @igalshilman in https://github.com/restatedev/sdk-python/pull/86
- Fix task error is ignored by @igalshilman in https://github.com/restatedev/sdk-python/pull/87
- Catch asyncio.CancelledError during attempt tear down by @igalshilman in https://github.com/restatedev/sdk-python/pull/88
- Wait for the side effect to complete by @igalshilman in https://github.com/restatedev/sdk-python/pull/89
- Use stable rust in rust-toolchain.toml by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/91
- Separate the ASGI types from the restate types by @igalshilman in https://github.com/restatedev/sdk-python/pull/90
We are pleased to announce the release of the Python SDK 0.6.0, in combination with Restate 1.3.
Check out the announcement blog post for more details about Restate 1.3 and the new SDK features: https://restate.dev/blog/announcing-restate-1.3/Check out the docs and examples to learn about the latest features:
https://docs.restate.dev/category/python-sdk/
What’s Changed
- Service Protocol V4 by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/33
- [tests] Add Docker GHA for test-services by @igalshilman in https://github.com/restatedev/sdk-python/pull/42
- [verification] Move the interpreter to test-services/ by @igalshilman in https://github.com/restatedev/sdk-python/pull/43
- Protocol V5 by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/44
- Offload synchronous actions in ctx.run via asyncio.to_thread to prevent event loop blocking by @ouatu-ro in https://github.com/restatedev/sdk-python/pull/47
- Export Public API via all in init.py by @ouatu-ro in https://github.com/restatedev/sdk-python/pull/49
- Add CLA automation by @tillrohrmann in https://github.com/restatedev/sdk-python/pull/50
- Expose new SDK features by @igalshilman in https://github.com/restatedev/sdk-python/pull/51
- Pass call headers in call/send by @igalshilman in https://github.com/restatedev/sdk-python/pull/52
- Use a custom future by @igalshilman in https://github.com/restatedev/sdk-python/pull/53
- Feature/general serde by @ouatu-ro in https://github.com/restatedev/sdk-python/pull/48
- Add invocation_id to a call promise by @igalshilman in https://github.com/restatedev/sdk-python/pull/54
- Lazy create the run() coroutine by @igalshilman in https://github.com/restatedev/sdk-python/pull/55
- Add additional features by @igalshilman in https://github.com/restatedev/sdk-python/pull/56
- Support ctx.run combinators by @igalshilman in https://github.com/restatedev/sdk-python/pull/58
- Rename combinators to asyncio by @igalshilman in https://github.com/restatedev/sdk-python/pull/59
- Add sleep future by @igalshilman in https://github.com/restatedev/sdk-python/pull/60
- Use RestateDurableFuture in workflow methods by @igalshilman in https://github.com/restatedev/sdk-python/pull/61
- Add
selectfuture combinator by @igalshilman in https://github.com/restatedev/sdk-python/pull/62 - Chore/fix type hints and general clarity by @ouatu-ro in https://github.com/restatedev/sdk-python/pull/57
- Try to auto deduce the types provided for ctx.run() by @igalshilman in https://github.com/restatedev/sdk-python/pull/63
- Use DefaultSerde in more places by @igalshilman in https://github.com/restatedev/sdk-python/pull/64
- Add optional args= param to ctx.run by @igalshilman in https://github.com/restatedev/sdk-python/pull/65
- Notify the VM about a transient error by @igalshilman in https://github.com/restatedev/sdk-python/pull/66
- Update test suite to 3.0 by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/68
- Rename cancel_invocation by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/69
- Add health check by @igalshilman in https://github.com/restatedev/sdk-python/pull/70
- Fix discovery information for void args by @igalshilman in https://github.com/restatedev/sdk-python/pull/71
- Fix type inference in PyCharm for ctx.run(). by @igalshilman in https://github.com/restatedev/sdk-python/pull/72
- Add a shortcut f.cancel_invocation() by @igalshilman in https://github.com/restatedev/sdk-python/pull/73
- Support dataclasses serde by @igalshilman in https://github.com/restatedev/sdk-python/pull/74
- Cleanup the concurrent example by @igalshilman in https://github.com/restatedev/sdk-python/pull/75
- Bump shared core by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/76
New Contributors
- @ouatu-ro made their first contribution in https://github.com/restatedev/sdk-python/pull/47
- @tillrohrmann made their first contribution in https://github.com/restatedev/sdk-python/pull/50
What’s Changed
- Infer basic json schema by @igalshilman in https://github.com/restatedev/sdk-python/pull/28
- Use test suite 2.4 by @jackkleeman in https://github.com/restatedev/sdk-python/pull/31
- Add test harness by @igalshilman in https://github.com/restatedev/sdk-python/pull/36
- Make test_harness a conditional import by @igalshilman in https://github.com/restatedev/sdk-python/pull/37
- Bumped shared core and bumped pyo3 by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/38
- Fix delay by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/41
New Contributors
- @jackkleeman made their first contribution in https://github.com/restatedev/sdk-python/pull/31
What’s Changed
- Convert stringized annotations to real types by @igalshilman in https://github.com/restatedev/sdk-python/pull/27
What’s Changed
- Add support for pydantic by @igalshilman in https://github.com/restatedev/sdk-python/pull/26
Breaking changes
This SDK is compatible only with Restate >= 1.1New features
- It is now possible to configure the max number of retry attempts/max duration of retries for
ctx.run
What’s Changed
- Add x-restate-server to the response headers by @igalshilman in https://github.com/restatedev/sdk-python/pull/20
- Add side effect retry by @igalshilman in https://github.com/restatedev/sdk-python/pull/21
- Run retry e2e tests by @slinkydeveloper in https://github.com/restatedev/sdk-python/pull/22
New features
- AWS Lambda support. Develop your service as usual and when deploying on AWS Lambda set the handler name to the variable containing
restate.app. - Implement request verification, to secure your service when interacting with Restate cloud: https://docs.restate.dev/deploy/cloud#http
- Implement
ctx.state_keys()andctx.clear_all()
What’s Changed
- We now test the SDK with the new SDK test tool