mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-04-30 14:39:56 -05:00
Fe overhaul docs (#1640)
* api changes * doc changes * move docs * generated * generate * pkg * backmerge main * revert to main * revert main * race? * remove go tests
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
from hatchet_sdk import Context
|
||||
|
||||
from ..hatchet_client import hatchet
|
||||
|
||||
|
||||
class SimpleInput(BaseModel):
|
||||
message: str
|
||||
|
||||
|
||||
class SimpleOutput(BaseModel):
|
||||
transformed_message: str
|
||||
|
||||
|
||||
# Declare the task to run
|
||||
@hatchet.task(name="first-task", input_validator=SimpleInput)
|
||||
def first_task(input: SimpleInput, ctx: Context) -> SimpleOutput:
|
||||
print("first-task task called")
|
||||
|
||||
return SimpleOutput(transformed_message=input.message.lower())
|
||||
Reference in New Issue
Block a user