conversation-session-mixed-media-path-strip.json 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-mixed-media-path-strip",
  4. "spec": "./test/e2e/conversation-session/attachments/conversation-session-mixed-media-path-strip.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "mixed-media-path-title",
  8. "description": "VI05 mixed-media 会话的标题生成固定响应,避免标题 sidecar 消费功能请求 fixture。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题内容不属于媒体 path/strip 合同,只需与主请求隔离。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/chat/completions",
  18. "bodyIncludes": ["Generate a concise title", "E2E_MIXED_MEDIA_PATH_"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "body": "{\"id\":\"chatcmpl-mixed-media-title\",\"object\":\"chat.completion\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"{\\\"title\\\":\\\"Mixed Media Path\\\"}\"},\"finish_reason\":\"stop\"}]}"
  27. }
  28. },
  29. {
  30. "id": "mixed-media-path-supported",
  31. "description": "VI05 media-capable 首轮同时发送 image/video blocks,并在同一 user content 末尾保留两个 absolute path texts。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "响应只稳定收口;E2E 对真实捕获 requestJson 断言 mixed-media block/path 的数量、顺序和 MCS 边界。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/chat/completions",
  42. "lastUserMessageIncludes": ["E2E_MIXED_MEDIA_PATH_SUPPORTED"],
  43. "bodyIncludes": [
  44. "E2E_MIXED_MEDIA_PATH_SUPPORTED",
  45. "e2e-mixed-media-model",
  46. "data:image/png;base64",
  47. "data:video/mp4;base64",
  48. "[Image: source:",
  49. "[Video: source:"
  50. ],
  51. "bodyExcludes": [
  52. "does not support image input",
  53. "does not support video input",
  54. "Generate a concise title",
  55. "CRITICAL: Respond with TEXT ONLY"
  56. ]
  57. },
  58. "response": {
  59. "statusCode": 200,
  60. "statusMessage": "OK",
  61. "headers": {
  62. "content-type": "text/event-stream; charset=utf-8"
  63. },
  64. "body": "data: {\"id\":\"chatcmpl-mixed-media-supported\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-mixed-media-model\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-mixed-media-supported\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-mixed-media-model\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"E2E_MIXED_MEDIA_PATH_SUPPORTED_OK\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-mixed-media-supported\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"e2e-mixed-media-model\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":180,\"completion_tokens\":12,\"total_tokens\":192}}\n\ndata: [DONE]\n\n"
  65. }
  66. },
  67. {
  68. "id": "mixed-media-path-text-only",
  69. "description": "VI05 切到明确 text-only 后,历史 image/video 都变为 omitted 文本且原 path 保持不变。",
  70. "metadata": {
  71. "kind": "main",
  72. "timingPolicy": "fast-text",
  73. "source": "synthetic",
  74. "syntheticReason": "响应只稳定收口;fixture 与结构化抓包共同要求请求无 media data/block,并保留双 omitted + 双 path。"
  75. },
  76. "maxMatches": 1,
  77. "match": {
  78. "method": "POST",
  79. "pathIncludes": "/chat/completions",
  80. "lastUserMessageIncludes": ["E2E_MIXED_MEDIA_PATH_TEXT_ONLY"],
  81. "bodyIncludes": [
  82. "E2E_MIXED_MEDIA_PATH_TEXT_ONLY",
  83. "deepseek-v4-flash",
  84. "Media omitted from provider request because the selected model does not support image input.",
  85. "Media omitted from provider request because the selected model does not support video input.",
  86. "[Image: source:",
  87. "[Video: source:"
  88. ],
  89. "bodyExcludes": [
  90. "data:image",
  91. "data:video",
  92. "video_url",
  93. "Generate a concise title",
  94. "CRITICAL: Respond with TEXT ONLY"
  95. ]
  96. },
  97. "response": {
  98. "statusCode": 200,
  99. "statusMessage": "OK",
  100. "headers": {
  101. "content-type": "text/event-stream; charset=utf-8"
  102. },
  103. "body": "data: {\"id\":\"chatcmpl-mixed-media-text-only\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-mixed-media-text-only\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"E2E_MIXED_MEDIA_PATH_TEXT_ONLY_OK\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-mixed-media-text-only\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":210,\"completion_tokens\":12,\"total_tokens\":222}}\n\ndata: [DONE]\n\n"
  104. }
  105. }
  106. ]
  107. }