import requests from typing import List class DeepSeekClient: def __init__(self, api_key: str): self.api_key = api_key def chat(self, user_message: str, context: List[str], task_type: str) -> str: url = "https://api.deepseek.ai/v1/chat" headers = { "Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json" } payload = { "prompt": user_message, "context": context, "task": task_type } response = requests.post(url, headers=headers, json=payload) response.raise_for_status() data = response.json() return data.get("response", "")