CommencerCommencez gratuitement

Analyzing legal contracts with reasoning mode

V4-Pro's reasoning isn't only good for math and code — it's equally proficient at reasoning with text. This opens the door for interpreting and analyzing legal documents, which are often long and difficult to understand.

You've been provided with a simple, one-sentence legal contract, and a situation to determine whether an employee is in breach of contract.

This is a very simplified version of a legal document for speed of demonstration, but the concept scales to larger documents.

Always consult with legal or information security teams before using AI with confidential documents.

Cet exercice fait partie du cours

<cours>Working with DeepSeek in Python</cours>
Voir le cours

Instructions de l’exercice

  • Add the Task, Contract, and Situation delimiters to the prompt.
  • Send the prompt to deepseek-ai/DeepSeek-V4-Pro.

Exercice interactif pratique

Essayez cet exercice en complétant ce code d’exemple.

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-Pro", messages=[{"role": "user", "content": ____}], max_tokens=600)
print(response.choices[0].message.content)
Modifier et exécuter le code