Fix issue with file validation in Message class
This commit is contained in:
parent
ba8754a785
commit
aec4292239
1 changed files with 3 additions and 0 deletions
|
|
@ -37,6 +37,8 @@ class Message(Data):
|
|||
def validate_files(cls, value):
|
||||
if not value:
|
||||
value = []
|
||||
elif not isinstance(value, list):
|
||||
value = [value]
|
||||
return value
|
||||
|
||||
def model_post_init(self, __context: Any) -> None:
|
||||
|
|
@ -174,3 +176,4 @@ class Message(Data):
|
|||
instance.prompt = jsonable_encoder(prompt_template.to_json())
|
||||
instance.messages = instance.prompt.get("kwargs", {}).get("messages", [])
|
||||
return instance
|
||||
return instance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue