Schema Mapping
Here’s how different return types translate to schemas:| Return type | Generated schema |
|---|---|
BaseModel | Schema from model fields (recommended) |
TypedDict | Schema from typed keys |
dict[str, T] | Root-level dict schema |
list[T], int, str | Wrapped as {"result": value} |
| No annotation | No schema — breaks Gumloop |
Examples
See how different return types generate schemas that Gumloop can use.BaseModel (recommended)
Lists
Typed dicts
Primitives
Primitives are wrapped in aresult key:
{"result": 17}
