plugin-extension-views.json 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {
  2. "version": 1,
  3. "caseName": "plugin-extension-views",
  4. "spec": "./test/e2e/plugins/extensions/plugin-extension-views.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "plugin-extension-views-title",
  8. "description": "本用例会话标题的既有录制响应。",
  9. "match": {
  10. "method": "POST",
  11. "pathIncludes": "/messages",
  12. "bodyIncludes": ["Generate a concise title", "E2E_EXT_VIEW_TPS"]
  13. },
  14. "response": {
  15. "statusCode": 200,
  16. "statusMessage": "OK",
  17. "headers": {
  18. "content-type": "application/json; charset=utf-8"
  19. },
  20. "body": "{\"id\":\"upstream-e2e-title-fixture\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"Upstream E2E Fixture\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":125,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":24,\"service_tier\":\"standard\"}}"
  21. },
  22. "metadata": {
  23. "kind": "common",
  24. "source": "synthetic",
  25. "timingPolicy": "fast-text",
  26. "note": "从 provider-basic.json 的 upstream-title-generic 迁入;标题不属于本用例断言。",
  27. "syntheticReason": "沿用既有固定标题辅助响应;标题不属于本用例断言,按专属 prompt marker 匹配,避免后台标题请求消耗主业务响应。"
  28. }
  29. },
  30. {
  31. "id": "plugin-extension-views-stream",
  32. "description": "沿用已有录制响应,仅用本用例标记限定请求匹配。",
  33. "match": {
  34. "method": "POST",
  35. "pathIncludes": "/messages",
  36. "lastUserMessageIncludes": ["E2E_EXT_VIEW_TPS"],
  37. "bodyIncludes": ["E2E_EXT_VIEW_TPS"],
  38. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  39. },
  40. "response": {
  41. "statusCode": 200,
  42. "statusMessage": "OK",
  43. "headers": {
  44. "cache-control": "no-cache",
  45. "content-type": "text/event-stream; charset=utf-8"
  46. },
  47. "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-slow-stream\",\"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\":\"deep\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-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",
  48. "events": [
  49. {
  50. "sequence": 0,
  51. "offsetMs": 0,
  52. "byteLength": 333,
  53. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"upstream-e2e-slow-stream\",\"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"
  54. },
  55. {
  56. "sequence": 1,
  57. "offsetMs": 250,
  58. "byteLength": 120,
  59. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  60. },
  61. {
  62. "sequence": 2,
  63. "offsetMs": 8000,
  64. "byteLength": 118,
  65. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"deep\"}}\n\n"
  66. },
  67. {
  68. "sequence": 3,
  69. "offsetMs": 16000,
  70. "byteLength": 118,
  71. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"seek\"}}\n\n"
  72. },
  73. {
  74. "sequence": 4,
  75. "offsetMs": 24000,
  76. "byteLength": 122,
  77. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"-e2e-ok\"}}\n\n"
  78. },
  79. {
  80. "sequence": 5,
  81. "offsetMs": 90000,
  82. "byteLength": 49,
  83. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  84. },
  85. {
  86. "sequence": 6,
  87. "offsetMs": 90100,
  88. "byteLength": 179,
  89. "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"
  90. },
  91. {
  92. "sequence": 7,
  93. "offsetMs": 90200,
  94. "byteLength": 42,
  95. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  96. }
  97. ]
  98. },
  99. "metadata": {
  100. "kind": "main",
  101. "source": "synthetic",
  102. "timingPolicy": "recorded-stream",
  103. "note": "从 provider-basic.json 的 upstream-slow-stream 迁入,响应内容与分块保持不变。",
  104. "syntheticReason": "沿用既有固定慢流样本,为真实扩展生成速率与视图状态断言提供稳定时序;保留 8、16、24 秒分块与 90 秒结束,不代表线上模型速度。"
  105. }
  106. }
  107. ]
  108. }