Skip to content

Commit

Permalink
added temperature to consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
George Burton committed Sep 9, 2024
1 parent 2a5e0f1 commit 3028767
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django_app/redbox_app/redbox_core/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ async def receive(self, text_data=None, bytes_data=None):
selected_file_uuids: Sequence[UUID] = [UUID(u) for u in data.get("selectedFiles", [])]
user: User = self.scope.get("user")
chat_backend = data.get("llm")
temperature = data.get("temperature")

if session_id := data.get("sessionId"):
session = await Chat.objects.aget(id=session_id)
logger.info("updating: chat_backend=%s -> ai_settings=%s", session.chat_backend, chat_backend)
session.chat_backend = chat_backend
session.temperature = temperature
await session.asave()
else:
session = await Chat.objects.acreate(
Expand Down

0 comments on commit 3028767

Please sign in to comment.