state string of the last response.
Conversation state explains what the string holds.
Keep one state per conversation
- On the first call, send an empty string as
state. - After each response, keep its
statein place of the old one. - On the next call, send that
state, copied exactly. Send that field only, never the whole response. - To start a new conversation, send an empty string again.
state is an ordinary argument of the
tool. Copy it from the last result into the next call.
After an error
400 invalid_state: the state was altered. The body carries an emptystate. Keep it, and the conversation starts again.400withinvalid_body,invalid_request,unsupported_field,transcript_removedoranchor_required: the body carries astate. Keep it and send it on the next call.- Every other error carries no state. Keep the one you had.
Send the position
- Send
anchoron the first call. Kviria keeps it in the state. - After that, send
anchoronly when the user moves. A call without one uses the position in the state. - Send the user’s position exactly as you were given it. Never send the coordinate of a place from an answer as the user’s position. Kviria keeps the earlier position when it sees one, and the evidence says so.