import so'rovlari import json sinfi OpenAssistantAPI: def __init__(self, api_key): self.api_key = api_key self.base_url = "https://api.openai.com/v1/engines/openai" def send_prompt: how get headers = { "Content-Type": "application/json", "Authorization": f"Bearer {self.api_key}" } data = { "prompt": prompt, "max_tokens": 100, "temperature": 0.5 } response = requests.post_f"{self.base_url}/jobs", headers=headers, data=json.dumps)) if response.status_code 200 == return response.json) [self_json"] raise: else_id: api_key "Failed
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence