Save a chat as a test
save_chat_as_testKeep one of a site's real chats (an id from list_chat_replay_conversations) as a test of its chat: at each visitor message (the latest 12) the move the chat makes now is what it must keep making, unless expected_moves says what it should do instead (to teach it a chat that went wrong: visitor_turn 0 is their first message in the test). Saved with the chat's guidance as a new version (at most 5 tests). Every later change to the moves or details runs the tests and reports any that go differently; run_chat_tests runs them on demand. The result lists each visitor message with the move it should make and the move it makes now.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site_id": "<site_id>",
"conversation_id": "<conversation_id>"
},
"name": "save_chat_as_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | A short name, e.g. "Asks for the plate before booking" | |
| site_id | Yes | The site, from list_sites | |
| user_goal | No | Optional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details. | |
| expected_moves | No | Corrections: what the chat should do at these visitor messages instead of what it does now | |
| conversation_id | Yes | The chat, from list_chat_replay_conversations | |
| expected_version | No | The `version` get_chat_playbook returned. When given, the save is refused if someone saved since. |