[Eva] Убираем длинные тире в ответах AI учителя
This commit is contained in:
@@ -271,6 +271,8 @@ async def call_ai(prompt: str, system_prompt: str, max_tokens: int = 500) -> str
|
|||||||
|
|
||||||
ai_response = ai_response.strip()
|
ai_response = ai_response.strip()
|
||||||
ai_response = re.sub(r'\s*\([a-z_]+_[a-z_]+\)', '', ai_response)
|
ai_response = re.sub(r'\s*\([a-z_]+_[a-z_]+\)', '', ai_response)
|
||||||
|
# 🔧 ФИКС (03.11.2026): убираем длинные тире (— и –) — заменяем на дефис.
|
||||||
|
ai_response = ai_response.replace('—', '-').replace('–', '-')
|
||||||
return ai_response
|
return ai_response
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"AI error: {str(e)}")
|
logger.error(f"AI error: {str(e)}")
|
||||||
|
|||||||
Reference in New Issue
Block a user