Python
Variables - Python SDK
Strings and Numbers
You can pass in strings and numbers as variables:
recipe = pd.generate("recipe-generator", {
"cuisine": "italian",
"minutes": 20
})
Lists and Arrays
You can pass in a python list as a variable:
recipe = pd.generate("recipe-generator", {
"cuisine": "italian",
"minutes": 20,
"ingredients": [
"butter",
"flour",
"onion",
"garlic",
"tomato",
"eggs"
]
})
Objects and Dictionaries
You can pass in a python dictionary as a variable:
person = {
"name": "John",
"age": 30,
"city": "New York"
}
character = pd.generate("character-generator", {
"type": "scientist",
"user": person
})