test_exam_payload.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import json
  2. import requests
  3. url = "http://127.0.0.1:8000/apiv1/exam/build_prompt"
  4. payload = {
  5. "mode": "ai",
  6. "client": "pc",
  7. "projectType": "bridge",
  8. "examTitle": "桥梁工程施工技术考核",
  9. "totalScore": 100,
  10. "questionTypes": [
  11. {
  12. "name": "单选题",
  13. "romanNumeral": "一",
  14. "questionCount": 20,
  15. "scorePerQuestion": 2
  16. },
  17. {
  18. "name": "判断题",
  19. "romanNumeral": "二",
  20. "questionCount": 10,
  21. "scorePerQuestion": 3
  22. },
  23. {
  24. "name": "多选题",
  25. "romanNumeral": "三",
  26. "questionCount": 4,
  27. "scorePerQuestion": 5
  28. },
  29. {
  30. "name": "简答题",
  31. "romanNumeral": "四",
  32. "questionCount": 1,
  33. "scorePerQuestion": 10
  34. }
  35. ],
  36. "pptContent": "这是桥梁施工的安全规范..."
  37. }
  38. headers = {
  39. "Content-Type": "application/json",
  40. "Authorization": "Bearer TEST"
  41. }
  42. # we can just print the json dumps of payload to see if pydantic parses it
  43. print(json.dumps(payload, ensure_ascii=False, indent=2))