Skip to content

Commit 8adc914

Browse files
committed
remove hints that failed mypy
1 parent a1fa741 commit 8adc914

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

semantic_router/schema.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,25 @@ class Message(BaseModel):
5555
role: str
5656
content: str
5757

58-
def to_openai(self) -> dict[str, str]:
58+
def to_openai(self):
5959
if self.role.lower() not in ["user", "assistant", "system"]:
6060
raise ValueError("Role must be either 'user', 'assistant' or 'system'")
6161
return {"role": self.role, "content": self.content}
6262

63-
def to_cohere(self) -> dict[str, str]:
63+
def to_cohere(self):
6464
return {"role": self.role, "message": self.content}
6565

6666

6767
class Conversation(BaseModel):
6868
messages: list[Message]
6969

7070
def split_by_topic(
71-
self,
72-
encoder: BaseEncoder,
73-
threshold: float = 0.5,
74-
split_method: Literal[
75-
"consecutive_similarity_drop", "cumulative_similarity_drop"
76-
] = "consecutive_similarity_drop",
71+
self,
72+
encoder: BaseEncoder,
73+
threshold: float = 0.5,
74+
split_method: Literal[
75+
"consecutive_similarity_drop", "cumulative_similarity_drop"
76+
] = "consecutive_similarity_drop",
7777
) -> dict[str, list[str]]:
7878
docs = [f"{m.role}: {m.content}" for m in self.messages]
7979
return semantic_splitter(

0 commit comments

Comments
 (0)