blank-aquamarine
blank-aquamarine15mo ago

interrupting a conversation with the API?

If I abort an http call and send a new one immediately after, like if a user asked a question and then asked another question before the previous request resolved, i get:
{"message": "Error code: 400 - {'error': {'message': \"Can't add messages to thread_eq8ykreRioe2KOYOnG2vTpPa while a run run_cz2j2AdAu3W5nWxooChIVdEY is active.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}",}
{"message": "Error code: 400 - {'error': {'message': \"Can't add messages to thread_eq8ykreRioe2KOYOnG2vTpPa while a run run_cz2j2AdAu3W5nWxooChIVdEY is active.\", 'type': 'invalid_request_error', 'param': None, 'code': None}}",}
is there a way to send a "stop" command or something before sending the users message that they interrupted with?
5 Replies
blank-aquamarine
blank-aquamarineOP15mo ago
bump @W. Williams (SFT) hey how do i end a chat wih the interact api? does sending a new api request to the interact endppint with type "launch" end the previous conversation?
W. Williams (SFT)
I actually don't know. We always end our chats within the flow. @NiKo | Voiceflow does launch restart the chat?
blank-aquamarine
blank-aquamarineOP15mo ago
i believe if you send a launch action you lose the "thread" and its history/context or whatever
W. Williams (SFT)
I believe that is correct I think it starts a new chat. @NiKo | Voiceflow can you explain this?
NiKo | Voiceflow
NiKo | Voiceflow15mo ago
To clarify, is the error message coming from the VF DM API? You can fetch/update state with the DM API (or use the stateless endpoint), so I assume in your case, you want to store the previous state, handle the interruption and then make a new request with an updated version of the previously stored state.

Did you find this page helpful?