mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 13:37:24 +08:00
fix: stream with empty line
This commit is contained in:
parent
947bfdc807
commit
fb3a701c86
@ -56,7 +56,8 @@ class BasePluginManager:
|
|||||||
line = line.decode("utf-8").strip()
|
line = line.decode("utf-8").strip()
|
||||||
if line.startswith("data:"):
|
if line.startswith("data:"):
|
||||||
line = line[5:].strip()
|
line = line[5:].strip()
|
||||||
yield line
|
if line:
|
||||||
|
yield line
|
||||||
|
|
||||||
def _stream_request_with_model(
|
def _stream_request_with_model(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@ -212,8 +212,8 @@ class ToolNode(BaseNode):
|
|||||||
chunk_content=message.message.text, from_variable_selector=[self.node_id, "text"]
|
chunk_content=message.message.text, from_variable_selector=[self.node_id, "text"]
|
||||||
)
|
)
|
||||||
elif message.type == ToolInvokeMessage.MessageType.JSON:
|
elif message.type == ToolInvokeMessage.MessageType.JSON:
|
||||||
assert isinstance(message, ToolInvokeMessage.JsonMessage)
|
assert isinstance(message.message, ToolInvokeMessage.JsonMessage)
|
||||||
json.append(message.json_object)
|
json.append(message.message.json_object)
|
||||||
elif message.type == ToolInvokeMessage.MessageType.LINK:
|
elif message.type == ToolInvokeMessage.MessageType.LINK:
|
||||||
assert isinstance(message.message, ToolInvokeMessage.TextMessage)
|
assert isinstance(message.message, ToolInvokeMessage.TextMessage)
|
||||||
stream_text = f"Link: {message.message.text}\n"
|
stream_text = f"Link: {message.message.text}\n"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user