Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add TypedPlugin class #21

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat: add TypedPlugin class #21

wants to merge 4 commits into from

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Jan 17, 2024

Adds TypedPlugin class, which can be inherited from to create something similar to the typed_plugin! macro in the Rust SDK

Example

class Example(example.TypedPlugin):
  def count_vowels(self, s: str) -> typing.Annotated[dict, extism.Json]:
    raise NotImplementedError

example_plugin = Example(manifest)

TypedPlugin attempts to do automatic conversion of input and return values similar to how host_fn does it (one major difference is integers/floats aren't supported by default)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant