使用推理模式分析法律合同
V4-Pro 的推理不仅适用于数学和代码——在文本推理方面同样出色。这为解读和分析常常冗长且难以理解的法律文书打开了大门。
您将获得一个由一句话构成的简单法律合同,以及一个情境,用来判断某位员工是否违反合同。
这是为演示速度而大幅简化的法律文书版本,但这一思路可以扩展到更长的文档。
在将 AI 应用于涉密文档之前,请务必咨询法务或信息安全团队。
本练习是课程的一部分
在 Python 中使用 DeepSeek
练习说明
- 在
prompt中加入Task、Contract和Situation分隔段。 - 将该提示发送给
deepseek-ai/DeepSeek-V4.1-Flash。
交互式实操练习
通过完成这段示例代码来试试这个练习。
client = OpenAI(api_key="", base_url="https://api.together.xyz/v1")
# Add the delimiters to the prompt
prompt = """[____: Determine whether the employee is in breach of contract.]
____:
The employee is not allowed to undertake work that generates an income of any sort.
____:
The employee is cleaning part-time for an hourly wage.
"""
# Send the prompt — V4-Pro reasons by default
response = client.chat.completions.create(model="deepseek-ai/DeepSeek-V4.1-Flash", messages=[{"role": "user", "content": ____}], max_tokens=600)
print(response.choices[0].message.content)