Skip to content
Snippets Groups Projects
Unverified Commit 69b9ce76 authored by Huu Le's avatar Huu Le Committed by GitHub
Browse files

refactor code (#119)

parent 9ced116e
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,6 @@ class CsvFile(BaseModel): ...@@ -15,7 +15,6 @@ class CsvFile(BaseModel):
filename: str filename: str
filesize: int filesize: int
id: str id: str
type: str
class AnnotationData(BaseModel): class AnnotationData(BaseModel):
...@@ -89,12 +88,11 @@ class ChatData(BaseModel): ...@@ -89,12 +88,11 @@ class ChatData(BaseModel):
message_content = last_message.content message_content = last_message.content
for message in reversed(self.messages): for message in reversed(self.messages):
if message.role == MessageRole.USER and message.annotations is not None: if message.role == MessageRole.USER and message.annotations is not None:
annotation_text = "\n".join( annotation_contents = (
[ annotation.data.to_raw_content()
annotation.data.to_raw_content() for annotation in message.annotations
for annotation in message.annotations
]
) )
annotation_text = "\n".join(filter(None, annotation_contents))
message_content = f"{message_content}\n{annotation_text}" message_content = f"{message_content}\n{annotation_text}"
break break
return message_content return message_content
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment