chore: regenerate examples (#2477)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
github-actions[bot]
2025-11-01 00:28:24 +01:00
committed by GitHub
parent 4518ff771c
commit f12c3e96ce
3 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
from examples.dataclasses.worker import Input, say_hello
say_hello.run(input=Input(name="Hatchet"))

View File

@@ -0,0 +1,31 @@
from dataclasses import dataclass
from typing import Literal
from hatchet_sdk import Context, EmptyModel, Hatchet
@dataclass
class Input:
name: str
@dataclass
class Output:
message: str
hatchet = Hatchet(debug=True)
@hatchet.task(input_validator=Input)
def say_hello(input: Input, ctx: Context) -> Output:
return Output(message=f"Hello, {input.name}!")
def main() -> None:
worker = hatchet.worker("test-worker", workflows=[say_hello])
worker.start()
if __name__ == "__main__":
main()

View File

@@ -21,6 +21,7 @@ from examples.concurrency_workflow_level.worker import (
)
from examples.conditions.worker import task_condition_workflow
from examples.dag.worker import dag_workflow
from examples.dataclasses.worker import say_hello
from examples.dedupe.worker import dedupe_child_wf, dedupe_parent_wf
from examples.dependency_injection.worker import (
async_task_with_dependencies,
@@ -92,6 +93,7 @@ def main() -> None:
sync_task_with_dependencies,
durable_async_task_with_dependencies,
durable_sync_task_with_dependencies,
say_hello,
],
lifespan=lifespan,
)