Schemas
You can create custom object schemas (variable types) to validate the data you are working with. This is useful when you want to ensure that the data you are working with is in the correct format.
- Create a schema for a user object with the following properties:
zui.object({
name: zui.string(),
age: zui.number(),
email: zui.string().email(),
address: zui.object({
street: zui.string(),
city: zui.string(),
zip: zui.string().length(5)
})
})
- Create a Variable of the user schema type and name it
UserInformation
.
Usage in AI Task
- Task Instructions:
Fetch name, age, email and address from the provided input
- AI Task Input:
Rohan Kokkula, 26, at rohan@email.com, received a mysterious parcel at his doorstep:
42 Emerald Lane, Mystic Falls, 560078.
Inside, a map beckoned him to a hidden world beneath Mumbai's bustling streets,
where history and magic intertwined.
- Store result in variables: Select the Variable we created above.