Magisterium AI

संबंधित प्रश्न

Magisterium AI API संबंधित प्रश्नांनाही प्रतिसाद वस्तूत related_questions क्षेत्राद्वारे परत करू शकतो. हे क्षेत्र ऐच्छिक आहे. संबंधित प्रश्न परत करण्यासाठी, तुम्हाला तुमच्या विनंतीत return_related_questions पॅरामीटर खरे म्हणून सेट करणे आवश्यक आहे.

python
url = "https://www.magisterium.com/api/v1/chat/completions"
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json",
}
data = {
    "model": "magisterium-1",
    "messages": [
    {
        "role": "user",
        "content": "What is the Magisterium?",
    }
    ],
    "stream": False,
    "return_related_questions": True
}

संबंधित प्रश्न प्रतिसाद वस्तूमध्ये स्ट्रिंगच्या अॅरेच्या स्वरूपात समाविष्ट केले जातील.

json
{
  "object": "chat.completion",
  "related_questions": [
    "What is the Magisterium's teaching on faith and morals?",
    "What is the Magisterium's teaching on Scripture?",
    "What is the Magisterium's teaching on tradition?",
  ],
  // other fields ...
}

स्ट्रीमिंग

उधरणांसारखेच, संबंधित प्रश्नही फक्त शेवटच्या खंडात समाविष्ट केले जातात.