incomplete value which I can't figure out #1641
-
// Schema of configurations
import "list"
#literal: string | bool | number
#operator: "<" | ">" | "=" | "!=" | "!"
#mustHaveAsk: {
ask: string
...
}
#choice: #mustHaveAsk & {
type: "choice"
options: [...string]
}
#multiple_choice: #mustHaveAsk & {
type: "multiple_choice"
options: [...string]
}
#boolean: #mustHaveAsk & {
type: "bool"
}
#name: #mustHaveAsk & {
type: "name"
}
#address: #mustHaveAsk & {
type: "address"
}
#amount: #mustHaveAsk & {
type: "amount"
}
#email: #mustHaveAsk & {
type: "email"
}
#slot: #choice | #multiple_choice | #boolean | #amount | #name | #address | #email | #literal
#binary: [#boolean_value, #operator, #boolean_value]
#variadic: {all: [...#boolean_value]} | {any: [...#boolean_value]}
#attribute: [string, #slot | #boolean_value | #entity]
#entity: [...#attribute] | {some: #entity}
#boolean_value: #binary | #variadic | #boolean
#fullfillment: {say: string} | {call: string}
#action: {
when: #boolean_value
do: #fullfillment
needs: #entity
}
#qna: {
question: string
answer: string
}
knowledge: [...#qna]
actions: [...#action]
// Example configuration
#user_name: {type: "name", ask: "what is your name?"}
#user_address: {type: "address", ask: "what is your address?"}
#user_wants_pizza: {
type: "bool"
ask: "do you want to order a pizza?"
}
#user_is_vegan: {
type: "bool"
ask: "are you vegan?"
}
#conditions_for_ordering: {
all: [
#user_wants_pizza,
#user_is_vegan,
[#user_age, "<", 10],
]
}
#user_age: {
type: "amount"
ask: "how old are you?"
}
#pizza_size: {
type: "choice"
ask: "what size?"
options: ["small", "medium", "large"]
}
#pizza_toppings: {
type: "multiple_choice"
ask: "what toppings?"
options: ["pineapple", "mushrooms"]
}
#pizza_amount: {
type: "amount"
ask: "how many pizzas?"
}
actions: [
{
when: #conditions_for_ordering
do: say: "hello"
needs: [
[
"order",
{
some: [
["size", #pizza_size],
["topping", #pizza_toppings],
["amount", #pizza_amount],
]
},
],
["age", #user_age],
["name", #user_name],
["address", #user_address],
]
},
]
knowledge: [
{question: "what is the opening hours?", answer: "5pm to 10pm"},
] this gives me an incomplete value, supposedly it can't figure out whether the |
Beta Was this translation helpful? Give feedback.
Answered by
slewiskelly
Apr 17, 2022
Replies: 1 comment 1 reply
-
I didn't go through the whole example, but It appears fixed by closing |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
uriva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I didn't go through the whole example, but It appears fixed by closing
#mustHaveAsk
and embedding it, rather than using a conjunction.https://cuelang.org/play/?id=ObgO2x25Nqq#cue@export@yaml