feat(assistant): check if key of file is same as filename uploaded

This commit is contained in:
Stan Girard 2024-04-17 17:22:40 +02:00
parent 3400b8633f
commit 8f04d832ac

View File

@ -57,6 +57,11 @@ class SummaryAssistant(ITO):
raise ValueError("The key of the file should be doc_to_summarize")
if not self.input.inputs.files[0].value:
raise ValueError("No file was uploaded")
# Check if name of file is same as the key
if not self.input.inputs.files[0].value == self.files[0].filename:
raise ValueError(
"The key of the file should be the same as the name of the file"
)
if not (
self.input.outputs.brain.activated or self.input.outputs.email.activated
):