foreign-sapphire
foreign-sapphire2y ago

Empty response each API request?

Empty response each API request? I have the world's most boring KB-powered agent with (1) start, (2) utterance capture, (3) KB w/ prompt I dispatch the following the curl:
API_KEY='{api_key}'

USER_ID='user_123'
USER_INPUT='Hello world!'

curl --request POST "https://general-runtime.voiceflow.com/state/user/$USER_ID/interact" \
--header "Authorization: $API_KEY" \
--header 'Content-Type: application/json' \
--data "{
\"action\": {
\"type\": \"text\",
\"payload\": \"$USER_INPUT\"
}
}"
API_KEY='{api_key}'

USER_ID='user_123'
USER_INPUT='Hello world!'

curl --request POST "https://general-runtime.voiceflow.com/state/user/$USER_ID/interact" \
--header "Authorization: $API_KEY" \
--header 'Content-Type: application/json' \
--data "{
\"action\": {
\"type\": \"text\",
\"payload\": \"$USER_INPUT\"
}
}"
The 1st api call (just text payload) gets a response and subsequent request is an empty array then after that sending same request results in a response I'm a bit confused with this behavior-- any ideas on a path forward?
No description
No description
No description
5 Replies
NiKo | Voiceflow
Use a 'launch' action first to start your agent.
{
"action": {
"type": "launch"
}
}
{
"action": {
"type": "launch"
}
}
foreign-sapphire
foreign-sapphireOP2y ago
So I was using launch originally wasn't getting any luck keeping track if they had visited before. My solution was to add a set variable in the VF canvas at the end of my "flow" (here super simple ofc) and then check for that variable
foreign-sapphire
foreign-sapphireOP2y ago
No description
foreign-sapphire
foreign-sapphireOP2y ago
Got a good pattern in place for now:
foreign-sapphire
foreign-sapphireOP2y ago
No description

Did you find this page helpful?