блоки 2 и 3 доработки интерфейса системы тестирования
This commit is contained in:
@@ -11,7 +11,7 @@ from .llm_client import LlmError, chat_completion_text_content, get_llm_config
|
||||
MAX_EXTRACT_CHARS = 14000
|
||||
|
||||
|
||||
def generation_for_import_document(extracted_text: str) -> dict:
|
||||
def generation_for_import_document(extracted_text: str, user_hint: str = '') -> dict:
|
||||
text = (extracted_text or '').strip()
|
||||
if not text:
|
||||
return {
|
||||
@@ -41,9 +41,10 @@ def generation_for_import_document(extracted_text: str) -> dict:
|
||||
'Для одиночного выбора ровно один isCorrect: true. '
|
||||
'Текст и формулировки — на русском, по содержанию входного материала.'
|
||||
)
|
||||
hint_block = f'\n\nДополнительные инструкции от автора теста:\n{user_hint.strip()}' if user_hint and user_hint.strip() else ''
|
||||
user = (
|
||||
'Составь тест с вопросами с одним или несколькими правильными ответами '
|
||||
'на основе текста:\n\n' + slice_
|
||||
'на основе текста:\n\n' + slice_ + hint_block
|
||||
)
|
||||
raw = chat_completion_text_content(cfg, system, user, 0.25)
|
||||
parsed = parse_json_from_llm_text(raw)
|
||||
|
||||
Reference in New Issue
Block a user