|
|
@ -216,16 +216,17 @@ def format_exam_content(raw_text, output_path):
|
|
|
|
内容如下:
|
|
|
|
内容如下:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
prompt += raw_text
|
|
|
|
prompt += raw_text
|
|
|
|
|
|
|
|
|
|
|
|
completion = client.chat.completions.create(
|
|
|
|
completion = client.chat.completions.create(
|
|
|
|
model="deepseek-v3",
|
|
|
|
model="deepseek-v3",
|
|
|
|
messages=[
|
|
|
|
messages=[
|
|
|
|
{"role": "system", "content": "You are a helpful assistant."},
|
|
|
|
{"role": "system", "content": "You are a helpful assistant."},
|
|
|
|
{"role": "user", "content": prompt},
|
|
|
|
{"role": "user", "content": prompt},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
max_tokens=16384 # 支持用户设置16K(16384)及以下的数值。
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
formatted_content = completion.choices[0].message.content
|
|
|
|
formatted_content = completion.choices[0].message.content
|
|
|
|
|
|
|
|
|
|
|
|
with open(output_path, "w", encoding="utf-8") as f:
|
|
|
|
with open(output_path, "w", encoding="utf-8") as f:
|
|
|
|
f.write(formatted_content)
|
|
|
|
f.write(formatted_content)
|
|
|
|