mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
Merge branch 'main' into 12-24-json-for-translation
This commit is contained in:
commit
bb6617491f
@ -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"):
|
||||||
|
|||||||
@ -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.")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user