conversation-session-gen-ui-context.json 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-gen-ui-context",
  4. "spec": "./test/e2e/conversation-session/sharing/conversation-session-gen-ui-context.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "gen-ui-context-title",
  8. "description": "本例标题旁路响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "固定标题旁路回复,避免状态快照用例依赖外部网络。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "statusMessage": "OK",
  23. "headers": {
  24. "content-type": "application/json; charset=utf-8"
  25. },
  26. "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\"}}"
  27. },
  28. "maxMatches": 5
  29. },
  30. {
  31. "id": "gen-ui-create",
  32. "description": "GUC create",
  33. "metadata": {
  34. "kind": "main",
  35. "source": "synthetic",
  36. "timingPolicy": "fast-text",
  37. "syntheticReason": "固定页面引用与回复,用实际 UI 操作和 provider 请求验证状态快照。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "bodyIncludes": ["E2E_GEN_UI_CREATE"],
  44. "bodyExcludes": [
  45. "Generate a concise title",
  46. "CRITICAL: Respond with TEXT ONLY",
  47. "E2E_GEN_UI_HOLD",
  48. "E2E_GEN_UI_QUEUE",
  49. "E2E_GEN_UI_COLD"
  50. ]
  51. },
  52. "response": {
  53. "statusCode": 200,
  54. "text": {
  55. "id": "gen-ui-create",
  56. "inputTokens": 80,
  57. "outputTokens": 20,
  58. "text": "::visualize{path=\"{{genUiContextPath}}\" title=\"Context fixture\"}"
  59. }
  60. }
  61. },
  62. {
  63. "id": "gen-ui-hold",
  64. "description": "GUC hold",
  65. "metadata": {
  66. "kind": "main",
  67. "source": "synthetic",
  68. "timingPolicy": "controlled-stream",
  69. "syntheticReason": "固定页面引用与回复,用实际 UI 操作和 provider 请求验证状态快照。"
  70. },
  71. "maxMatches": 1,
  72. "match": {
  73. "method": "POST",
  74. "pathIncludes": "/messages",
  75. "bodyIncludes": ["E2E_GEN_UI_HOLD"],
  76. "bodyExcludes": [
  77. "Generate a concise title",
  78. "CRITICAL: Respond with TEXT ONLY",
  79. "E2E_GEN_UI_QUEUE",
  80. "E2E_GEN_UI_COLD"
  81. ]
  82. },
  83. "response": {
  84. "statusCode": 200,
  85. "headers": {
  86. "content-type": "text/event-stream; charset=utf-8"
  87. },
  88. "chunks": [
  89. {
  90. "offsetMs": 0,
  91. "text": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen-ui-hold\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[],\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":80,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":0}}}\n\n"
  92. },
  93. {
  94. "offsetMs": 0,
  95. "text": "event: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\n"
  96. },
  97. {
  98. "offsetMs": 0,
  99. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"GEN_UI_HOLD_STREAMING \"}}\n\n"
  100. },
  101. {
  102. "offsetMs": 0,
  103. "text": "event: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"GEN_UI_HOLD_OK\"}}\n\n"
  104. },
  105. {
  106. "offsetMs": 0,
  107. "text": "event: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\n"
  108. },
  109. {
  110. "offsetMs": 0,
  111. "text": "event: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":80,\"output_tokens\":8}}\n\n"
  112. },
  113. {
  114. "offsetMs": 0,
  115. "text": "event: message_stop\ndata: {\"type\":\"message_stop\"}\n\n"
  116. }
  117. ],
  118. "releaseAfterChunks": 3
  119. }
  120. },
  121. {
  122. "id": "gen-ui-queue",
  123. "description": "GUC queue",
  124. "metadata": {
  125. "kind": "main",
  126. "source": "synthetic",
  127. "timingPolicy": "fast-text",
  128. "syntheticReason": "固定页面引用与回复,用实际 UI 操作和 provider 请求验证状态快照。"
  129. },
  130. "maxMatches": 1,
  131. "match": {
  132. "method": "POST",
  133. "pathIncludes": "/messages",
  134. "bodyIncludes": ["E2E_GEN_UI_QUEUE"],
  135. "bodyExcludes": [
  136. "Generate a concise title",
  137. "CRITICAL: Respond with TEXT ONLY",
  138. "E2E_GEN_UI_COLD"
  139. ]
  140. },
  141. "response": {
  142. "statusCode": 200,
  143. "text": {
  144. "id": "gen-ui-queue",
  145. "inputTokens": 80,
  146. "outputTokens": 20,
  147. "text": "GEN_UI_QUEUE_OK"
  148. }
  149. }
  150. },
  151. {
  152. "id": "gen-ui-cold",
  153. "description": "GUC cold",
  154. "metadata": {
  155. "kind": "main",
  156. "source": "synthetic",
  157. "timingPolicy": "fast-text",
  158. "syntheticReason": "固定页面引用与回复,用实际 UI 操作和 provider 请求验证状态快照。"
  159. },
  160. "maxMatches": 1,
  161. "match": {
  162. "method": "POST",
  163. "pathIncludes": "/messages",
  164. "bodyIncludes": ["E2E_GEN_UI_COLD"],
  165. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  166. },
  167. "response": {
  168. "statusCode": 200,
  169. "text": {
  170. "id": "gen-ui-cold",
  171. "inputTokens": 80,
  172. "outputTokens": 20,
  173. "text": "GEN_UI_COLD_OK"
  174. }
  175. }
  176. }
  177. ]
  178. }