import json import requests url = "http://127.0.0.1:8000/apiv1/exam/build_prompt" payload = { "mode": "ai", "client": "pc", "projectType": "bridge", "examTitle": "桥梁工程施工技术考核", "totalScore": 100, "questionTypes": [ { "name": "单选题", "romanNumeral": "一", "questionCount": 20, "scorePerQuestion": 2 }, { "name": "判断题", "romanNumeral": "二", "questionCount": 10, "scorePerQuestion": 3 }, { "name": "多选题", "romanNumeral": "三", "questionCount": 4, "scorePerQuestion": 5 }, { "name": "简答题", "romanNumeral": "四", "questionCount": 1, "scorePerQuestion": 10 } ], "pptContent": "这是桥梁施工的安全规范..." } headers = { "Content-Type": "application/json", "Authorization": "Bearer TEST" } # we can just print the json dumps of payload to see if pydantic parses it print(json.dumps(payload, ensure_ascii=False, indent=2))