conversation-session-deepseek-v4-reasoning-request-shape.json 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-deepseek-v4-reasoning-request-shape",
  4. "spec": "./test/e2e/conversation-session/models/conversation-session-deepseek-v4-reasoning-request-shape.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "upstream-v4-reasoning-request-shape-title",
  8. "description": "DeepSeek V4 OpenAI-compatible 思考档位 case 内的标题生成固定响应,避免严格 case-local replay 依赖其他 case。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题生成不是本 case 的产品语义,只需要稳定返回,防止标题请求误命中 high/max 业务 fixture。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/chat/completions",
  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\":\"chatcmpl-upstream-v4-reasoning-title\",\"object\":\"chat.completion\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"message\":{\"role\":\"assistant\",\"content\":\"{\\\"title\\\":\\\"DeepSeek V4 Reasoning\\\"}\"},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":64,\"completion_tokens\":8,\"total_tokens\":72}}"
  27. }
  28. },
  29. {
  30. "id": "upstream-v4-reasoning-high-main",
  31. "description": "I15 DeepSeek V4 默认 max 首发完成后,在会话内切到 high 的固定最终回复,配合抓包断言 OpenAI-compatible 请求字段。",
  32. "metadata": {
  33. "kind": "main",
  34. "timingPolicy": "fast-text",
  35. "source": "synthetic",
  36. "syntheticReason": "核心断言在会话内切换 high 后的 provider/model 身份、OpenAI-compatible transport 和请求 body;响应只需稳定完成并包含约定文本。"
  37. },
  38. "maxMatches": 1,
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/chat/completions",
  42. "lastUserMessageIncludes": ["E2E_UPSTREAM_V4_REASONING_HIGH"],
  43. "bodyIncludes": ["E2E_UPSTREAM_V4_REASONING_HIGH", "upstream-e2e-ok", "deepseek-v4-flash"],
  44. "bodyExcludes": ["Generate a concise title", "extra_body", "chat_template_kwargs"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "statusMessage": "OK",
  49. "headers": {
  50. "content-type": "text/event-stream; charset=utf-8"
  51. },
  52. "body": "data: {\"id\":\"chatcmpl-upstream-v4-reasoning-high\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-upstream-v4-reasoning-high\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-upstream-v4-reasoning-high\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":128,\"completion_tokens\":12,\"total_tokens\":140,\"completion_tokens_details\":{\"reasoning_tokens\":0}}}\n\ndata: [DONE]\n\n"
  53. }
  54. },
  55. {
  56. "id": "upstream-v4-reasoning-max-main",
  57. "description": "I15 DeepSeek V4 使用 Agent resolver 默认 max 首发普通文本的固定最终回复,配合抓包断言默认档位请求字段。",
  58. "metadata": {
  59. "kind": "main",
  60. "timingPolicy": "fast-text",
  61. "source": "synthetic",
  62. "syntheticReason": "核心断言在 custom provider 只保存 model ID 时,Agent resolver 默认 max 的 DeepSeek V4 请求 body;响应只需稳定完成并包含约定文本。"
  63. },
  64. "maxMatches": 1,
  65. "match": {
  66. "method": "POST",
  67. "pathIncludes": "/chat/completions",
  68. "lastUserMessageIncludes": ["E2E_UPSTREAM_V4_REASONING_MAX"],
  69. "bodyIncludes": ["E2E_UPSTREAM_V4_REASONING_MAX", "upstream-e2e-ok", "deepseek-v4-flash"],
  70. "bodyExcludes": ["Generate a concise title", "extra_body", "chat_template_kwargs"]
  71. },
  72. "response": {
  73. "statusCode": 200,
  74. "statusMessage": "OK",
  75. "headers": {
  76. "content-type": "text/event-stream; charset=utf-8"
  77. },
  78. "body": "data: {\"id\":\"chatcmpl-upstream-v4-reasoning-max\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-upstream-v4-reasoning-max\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"upstream-e2e-ok\"},\"finish_reason\":null}]}\n\ndata: {\"id\":\"chatcmpl-upstream-v4-reasoning-max\",\"object\":\"chat.completion.chunk\",\"created\":0,\"model\":\"deepseek-v4-flash\",\"choices\":[{\"index\":0,\"delta\":{},\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":132,\"completion_tokens\":12,\"total_tokens\":144,\"completion_tokens_details\":{\"reasoning_tokens\":0}}}\n\ndata: [DONE]\n\n"
  79. }
  80. }
  81. ]
  82. }