常见参数组合
常见参数组合
resp = client.chat.completions.create(
model="...",
temperature=0.2,
top_p=0.9,
max_tokens=800,
messages=[{"role": "system", "content": prompt},
{"role": "user", "content": question}],
)结构化输出
结构化输出
要求返回 JSON:{"answer": str, "citations": [int], "confidence": "high|medium|low"}
服务端用 schema 校验,失败时重试或降级为纯文本。温度与提示词改动都会影响忠实度评测:批量调整前先固化基线。