diff --git a/app/common/message_converters.py b/app/common/message_converters.py index 6a837c4c..fbcb17c7 100644 --- a/app/common/message_converters.py +++ b/app/common/message_converters.py @@ -1,26 +1,5 @@ -from datetime import datetime - from langchain_core.messages import BaseMessage - -from ..domain.data.message_content_dto import MessageContentDTO from ..domain.iris_message import IrisMessage, IrisMessageRole -from ..domain.data.message_dto import MessageDTO, IrisMessageSender - - -def convert_iris_message_to_message_dto(iris_message: IrisMessage) -> MessageDTO: - match iris_message.role: - case "user": - sender = IrisMessageSender.USER - case "assistant": - sender = IrisMessageSender.LLM - case _: - raise ValueError(f"Unknown message role: {iris_message.role}") - - return MessageDTO( - sent_at=datetime.now(), - sender=sender, - contents=[MessageContentDTO(textContent=iris_message.text)], - ) def convert_iris_message_to_langchain_message(iris_message: IrisMessage) -> BaseMessage: diff --git a/app/domain/iris_message.py b/app/domain/iris_message.py index ac89666f..94969c96 100644 --- a/app/domain/iris_message.py +++ b/app/domain/iris_message.py @@ -1,5 +1,4 @@ from enum import Enum -from typing import Literal from pydantic import BaseModel diff --git a/app/domain/status/stage_dto.py b/app/domain/status/stage_dto.py index c050a2d0..f157a737 100644 --- a/app/domain/status/stage_dto.py +++ b/app/domain/status/stage_dto.py @@ -1,4 +1,4 @@ -from typing import Literal, Optional +from typing import Optional from pydantic import BaseModel