@@ -372,19 +372,20 @@ class Chatgpt(SimpleService): tokens += self.count_text_tokens(air_message) history.append(air_message[0]) memory = InMemoryChatMessageHistory() - memory.add_message(SystemMessage( - content=( - 'Think step by step. Use full context. Prioritize depth, clarity, and justification. ' - 'Be thorough and expansive.' - ) - )) - memory.add_message(SystemMessage( + if model_name not in ('o1-preview', 'o1-mini'): + memory.add_message(SystemMessage( content=( - 'Отныне все ответы должны быть представлены как единая строка (str). Не использовать никаких ' - 'структурированных форматов, таких как JSON, словари (dict) или списки (list). ' - 'Любая информация должна быть преобразована в простой строковый текст (str).' + 'Think step by step. Use full context. Prioritize depth, clarity, and justification. ' + 'Be thorough and expansive.' ) )) + memory.add_message(SystemMessage( + content=( + 'Отныне все ответы должны быть представлены как единая строка (str). Не использовать никаких ' + 'структурированных форматов, таких как JSON, словари (dict) или списки (list). ' + 'Любая информация должна быть преобразована в простой строковый текст (str).' + ) + )) memory.add_messages(list(reversed(history))) return memory