блоки 2 и 3 доработки интерфейса системы тестирования

This commit is contained in:
Константин Лебединский
2026-04-29 21:06:17 +05:00
parent eff3fda5b0
commit bba96f8f9f
37 changed files with 4440 additions and 1292 deletions
+7 -2
View File
@@ -51,8 +51,13 @@ def chat_completion_text_content(
user: str,
temperature: float = 0.25,
timeout: int = 120,
as_json: bool = True,
) -> str:
"""Возвращает `assistant.message.content` (строку)."""
"""Возвращает `assistant.message.content` (строку).
`as_json=True` (по умолчанию) включает `response_format: json_object`. Для свободного
текста (например, объяснения к вопросу) передайте `as_json=False`.
"""
body: dict = {
'model': cfg.model,
'messages': [
@@ -61,7 +66,7 @@ def chat_completion_text_content(
],
'temperature': temperature,
}
if (os.environ.get('LLM_NO_JSON') or '').strip() != '1':
if as_json and (os.environ.get('LLM_NO_JSON') or '').strip() != '1':
body['response_format'] = {'type': 'json_object'}
req = urllib.request.Request(