feat: add deterministic message interaction stages
This commit is contained in:
@@ -77,6 +77,39 @@ class StartupActionValidationTests(unittest.IsolatedAsyncioTestCase):
|
||||
startup=startup_body().startup,
|
||||
)
|
||||
|
||||
def test_realtime_rejects_builtin_opening_message(self):
|
||||
with self.assertRaisesRegex(ValueError, "Realtime"):
|
||||
AssistantUpsert(
|
||||
name="Realtime 开场消息",
|
||||
type="prompt",
|
||||
runtimeMode="realtime",
|
||||
startup={
|
||||
"openingMessage": {
|
||||
"title": "重要提示",
|
||||
"message": "请确认已阅读。",
|
||||
"confirmLabel": "确认",
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
async def test_builtin_opening_message_does_not_reference_a_tool(self):
|
||||
body = AssistantUpsert(
|
||||
name="内置开场消息",
|
||||
type="prompt",
|
||||
startup={
|
||||
"openingMessage": {
|
||||
"title": "重要提示",
|
||||
"message": "请确认已阅读。",
|
||||
"confirmLabel": "确认",
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
await _validate_startup_actions(FakeSession(None), body)
|
||||
|
||||
self.assertEqual(body.startup.actions, [])
|
||||
self.assertEqual(body.startup.opening_message.confirm_label, "确认")
|
||||
|
||||
async def test_startup_tool_does_not_need_conversation_binding(self):
|
||||
tool = SimpleNamespace(
|
||||
id="tool_message",
|
||||
|
||||
Reference in New Issue
Block a user