Reverses name and negates age.
Demonstrates BaseModel input/output round-trip.
Given a HelloIn with name and age, returns HelloOut
with the name reversed and age negated.
Source code in src/woodglue/hello/__init__.py
| def pydantic_hello(input: HelloIn) -> HelloOut:
"""Reverses name and negates age.
Demonstrates BaseModel input/output round-trip.
Given a HelloIn with name and age, returns HelloOut
with the name reversed and age negated.
"""
return HelloOut(eman=input.name[::-1], ega=-input.age)
|