Skip to content

v0.1.4

Latest
Compare
Choose a tag to compare
@G4Vi G4Vi released this 17 Jan 01:20
· 2 commits to main since this release
3d14e8b

What's Changed

  • ci: fix publish by @G4Vi in #45
  • ci: added target explicitly by @G4Vi in #46
  • chore: bump verison to 0.1.4 by @G4Vi in #47

Full Changelog: v0.1.3...v0.1.4

Attention python-pdk users: v0.1.3/v0.1.4 contains some breaking changes. In particular, the custom JSON handling has been removed (including extism.Json). The reason being the previous serialization method relied on trial and error, so it led to types sometimes being misdecoded as the wrong types. To make the python-pdk unopinionated on the serialization method of choice, in-line with the other extism’s pdks, and to keep the python-pdk lightweight, no replacement has been added to the python-pdk.

For an opinionated serialization, I recommend trying out XTP: https://docs.xtp.dylibso.com/docs/overview , using the service is not a requirement for developing an XTP schema and using the cli to generate bindings for Python and many other languages. The source for the python bindgen is here https://github.com/dylibso/xtp-python-bindgen/ it uses dataclass wizard https://dataclass-wizard.readthedocs.io/en/latest/overview.html to handle JSON serialization/deserialization.

As for a migration guide, if you were using extism.Json as a base class, you can try instead deriving fromJSONWizard if you use dataclass-wizard. These mcp.run servlets https://github.com/dylibso/mcp.run-servlets/tree/main/servlets/obsidian and https://github.com/dylibso/mcp.run-servlets/tree/main/servlets/eval-py also serve as examples of using dataclass-wizard with extism. Unfortunately, extism.input and extism.output became a lot less smart in this update, so you’ll see there .from_json() and .to_json() are explicitly called. We’re open to suggestions or better PRs on how to add back that type based handling without making dataclass-wizard a hard dependency of the extism python-pdk.