Merge branch 'main' into 12-24-json-for-translation

This commit is contained in:
Stephen Zhou 2025-12-25 10:27:32 +08:00 committed by GitHub
commit bb6617491f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -153,11 +153,11 @@ class ToolInvokeMessage(BaseModel):
@classmethod @classmethod
def transform_variable_value(cls, values): def transform_variable_value(cls, values):
""" """
Only basic types and lists are allowed. Only basic types, lists, and None are allowed.
""" """
value = values.get("variable_value") value = values.get("variable_value")
if not isinstance(value, dict | list | str | int | float | bool): if value is not None and not isinstance(value, dict | list | str | int | float | bool):
raise ValueError("Only basic types and lists are allowed.") raise ValueError("Only basic types, lists, and None are allowed.")
# if stream is true, the value must be a string # if stream is true, the value must be a string
if values.get("stream"): if values.get("stream"):

View File

@ -281,7 +281,7 @@ class ParameterExtractorNode(Node[ParameterExtractorNodeData]):
# handle invoke result # handle invoke result
text = invoke_result.message.content or "" text = invoke_result.message.get_text_content()
if not isinstance(text, str): if not isinstance(text, str):
raise InvalidTextContentTypeError(f"Invalid text content type: {type(text)}. Expected str.") raise InvalidTextContentTypeError(f"Invalid text content type: {type(text)}. Expected str.")