conversation-session-running-model-switch-usage.json 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-running-model-switch-usage",
  4. "spec": "./test/e2e/conversation-session/conversation-session-running-model-switch-usage.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "running-model-switch-usage-main",
  8. "description": "N16 普通主对话慢流,在 response 完成前稳定切换 session 默认模型。",
  9. "metadata": {
  10. "kind": "main",
  11. "timingPolicy": "controlled-stream",
  12. "source": "synthetic",
  13. "syntheticReason": "真实 provider 响应速度不确定,无法稳定保证模型切换 ACK 早于最终 usage 到达。"
  14. },
  15. "maxMatches": 1,
  16. "match": {
  17. "method": "POST",
  18. "pathIncludes": "/messages",
  19. "bodyIncludes": [
  20. "E2E_RUNNING_MODEL_SWITCH_USAGE"
  21. ],
  22. "bodyExcludes": [
  23. "Generate a concise title",
  24. "CRITICAL: Respond with TEXT ONLY"
  25. ],
  26. "lastUserMessageIncludes": [
  27. "E2E_RUNNING_MODEL_SWITCH_USAGE"
  28. ]
  29. },
  30. "response": {
  31. "statusCode": 200,
  32. "statusMessage": "OK",
  33. "headers": {
  34. "cache-control": "no-cache",
  35. "content-type": "text/event-stream; charset=utf-8"
  36. },
  37. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-running-model-switch-usage\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"upstream-e2e-ok\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n",
  38. "events": [
  39. {
  40. "sequence": 0,
  41. "offsetMs": 0,
  42. "byteLength": 328,
  43. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-running-model-switch-usage\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":120,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0,\"service_tier\":\"standard\"}}}\n\n"
  44. },
  45. {
  46. "sequence": 1,
  47. "offsetMs": 250,
  48. "byteLength": 120,
  49. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  50. },
  51. {
  52. "sequence": 2,
  53. "offsetMs": 1000,
  54. "byteLength": 129,
  55. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"upstream-e2e-ok\"}}\n\n"
  56. },
  57. {
  58. "sequence": 3,
  59. "offsetMs": 30000,
  60. "byteLength": 49,
  61. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  62. },
  63. {
  64. "sequence": 4,
  65. "offsetMs": 30100,
  66. "byteLength": 179,
  67. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":120,\"output_tokens\":12,\"service_tier\":\"standard\"}}\n\n"
  68. },
  69. {
  70. "sequence": 5,
  71. "offsetMs": 30200,
  72. "byteLength": 42,
  73. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  74. }
  75. ]
  76. }
  77. }
  78. ]
  79. }