Skip to content

Releases: restatedev/sdk-python

v0.17.1

08 Apr 12:43

Choose a tag to compare

What's Changed

  • Logfire Tracing: fix default arguments for Tracer.start_as_current_span by @gvdongen in #188

Full Changelog: v0.17.0...v0.17.1

v0.17.0

07 Apr 07:44

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.16.0...v0.17.0

v0.16.0

17 Mar 10:09
9e75895

Choose a tag to compare

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

New Contributors

Full Changelog: v0.15.0...v0.16.0

v0.15.0

20 Feb 11:07

Choose a tag to compare

What's Changed

Full Changelog: v0.14.2...v0.15.0

v0.14.2

15 Jan 15:49

Choose a tag to compare

What's Changed

Full Changelog: v0.14.0...v0.14.2

v0.14.0

08 Jan 11:08

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.13.2...v0.14.0

v0.13.2

17 Dec 15:42

Choose a tag to compare

What's Changed

Full Changelog: v0.13.1...v0.13.2

v0.13.1

11 Dec 13:51

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.13.0...v0.13.1

v0.13.0

09 Dec 18:28

Choose a tag to compare

New features 🎉

  • Use context manager together with service handlers:
@contextvar
@asynccontextmanager
async def my_resource_manager():
    yield "hello"


@greeter.handler(invocation_context_managers=[my_resource_manager])
async def greet_with_cm(ctx: Context, name: str) -> str:
    return my_resource_manager.value
  • Add msgspec support, works out of the box when adding restate_sdk[serde] dependency:
# models
class GreetingRequest(msgspec.Struct):
    name: str

class Greeting(msgspec.Struct):
    message: str

msgspec_greeter = Service("msgspec_greeter")

@msgspec_greeter.handler()
async def greet(ctx: Context, req: GreetingRequest) -> Greeting:
    return Greeting(message=f"Hello {req.name}!")
  • Add extension modules for Google ADK and OpenAI, more info soon!

What's Changed

New Contributors

Full Changelog: v0.12.0...v0.13.0

v0.12.0

18 Nov 17:12

Choose a tag to compare

New features 🎉

  • Added ingress client to send requests from your python applications to restate services:
async with restate.create_client("http://localhost:8080") as client:
  await client.object_call(increment, key="a", arg=5)
  await client.object_send(increment, key="a", arg=5)

  current_count = await client.object_call(count, key="a", arg=None)
  • Added new test harness constructor to be used in combination with @pytest.fixture:
# Your fixture
@pytest.fixture(scope="session")
async def restate_test_harness():
  app = restate.app([greeter])
  async with restate.create_test_harness(app) as harness:
        yield harness
        
# A test example, using the client
async def test_greeter(restate_test_harness: HarnessEnvironment):
    greeting = await restate_test_harness.client.service_call(greet, arg="Pippo")
    assert greeting == "Hello Pippo!"
  • Various type hints improvements, such as #112

What's Changed

Full Changelog: v0.11.0...v0.12.0