mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-06 00:40:10 -06:00
chore: regenerate examples (#2208)
Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
committed by
GitHub
parent
cf0aa21623
commit
a50579d837
19
examples/python/stubs/implementation.py
Normal file
19
examples/python/stubs/implementation.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
from hatchet_sdk import Context, Hatchet
|
||||
|
||||
|
||||
class TaskInput(BaseModel):
|
||||
user_id: int
|
||||
|
||||
|
||||
class TaskOutput(BaseModel):
|
||||
ok: bool
|
||||
|
||||
|
||||
hatchet = Hatchet()
|
||||
|
||||
|
||||
@hatchet.task(name="externally-triggered-task", input_validator=TaskInput)
|
||||
async def externally_triggered_task(input: TaskInput, ctx: Context) -> TaskOutput:
|
||||
return TaskOutput(ok=True)
|
||||
Reference in New Issue
Block a user