Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
kaancayli committed Mar 11, 2024
1 parent f683132 commit 257ea62
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
21 changes: 0 additions & 21 deletions app/common/message_converters.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 0 additions & 1 deletion app/domain/iris_message.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from enum import Enum
from typing import Literal

from pydantic import BaseModel

Expand Down
2 changes: 1 addition & 1 deletion app/domain/status/stage_dto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Literal, Optional
from typing import Optional

from pydantic import BaseModel

Expand Down

0 comments on commit 257ea62

Please sign in to comment.