Супутні питання
API Magisterium AI також може повертати пов'язані запитання в об'єкті відповіді через поле related_questions. Це поле є необов'язковим. Щоб повернути пов'язані запитання, потрібно встановити параметр return_related_questions у true у вашому запиті.
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 ...
}Потокова обробка
Як і цитати, пов'язані запитання також включені тільки в останньому шматку.