fix encoding
This commit is contained in:
@@ -18,15 +18,15 @@ class AIInterface:
|
||||
|
||||
# Подготовка сообщений для чат-комплитшена
|
||||
messages = [{"role": "user", "content": prompt}]
|
||||
if context:
|
||||
# Преобразуем контекст в строку
|
||||
context_str = self._format_context(context)
|
||||
messages.append({"role": "system", "content": context_str})
|
||||
# if context:
|
||||
# # Преобразуем контекст в строку
|
||||
# context_str = self._format_context(context)
|
||||
# messages.append({"role": "system", "content": context_str})
|
||||
|
||||
# Создание запроса к OpenAI
|
||||
response = self.client.chat.completions.create(
|
||||
model=DEFAULT_MODEL,
|
||||
messages=[{"role": "user", "content": "Write a poem about a tree"}],
|
||||
messages=messages,
|
||||
stream=False, # Пока отключаем стриминг для простоты
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user