Skip to content

Commit

Permalink
corect default
Browse files Browse the repository at this point in the history
  • Loading branch information
George Burton committed Sep 9, 2024
1 parent 1618d54 commit 87bed2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions django_app/redbox_app/redbox_core/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ async def llm_conversation(self, selected_files: Sequence[File], session: Chat,
except (TimeoutError, ConnectionClosedError, CancelledError) as e:
logger.exception("Error from core.", exc_info=e)
await self.send_to_client("error", error_messages.CORE_ERROR_MESSAGE)
except Exception as e:
logger.exception("General error.", exc_info=e)
await self.send_to_client("error", error_messages.CORE_ERROR_MESSAGE)

async def send_to_client(self, message_type: str, data: str | Mapping[str, Any] | None = None) -> None:
message = {"type": message_type, "data": data}
Expand Down
8 changes: 6 additions & 2 deletions django_app/redbox_app/redbox_core/views/chat_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get(self, request: HttpRequest, chat_id: uuid.UUID | None = None) -> HttpRes
self.decorate_selected_files(completed_files, messages)
chat_grouped_by_date_group = groupby(chat, attrgetter("date_group"))

chat_backend = current_chat.chat_backend if current_chat else None
chat_backend = current_chat.chat_backend if current_chat else AbstractAISettings.ChatBackend.GPT_4_OMNI.value

context = {
"chat_id": chat_id,
Expand All @@ -53,7 +53,11 @@ def get(self, request: HttpRequest, chat_id: uuid.UUID | None = None) -> HttpRes
"processing_files": processing_files,
"chat_title_length": settings.CHAT_TITLE_LENGTH,
"llm_options": [
{"name": llm, "default": llm == chat_backend, "selected": llm == chat_backend}
{
"name": llm,
"default": llm == AbstractAISettings.ChatBackend.GPT_4_OMNI.value,
"selected": llm == chat_backend,
}
for _, llm in AbstractAISettings.ChatBackend.choices
],
}
Expand Down

0 comments on commit 87bed2d

Please sign in to comment.