mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 21:23:22 +08:00
update
This commit is contained in:
parent
3449065585
commit
23ee92e52e
@ -157,8 +157,8 @@ class PluginToolManager(BasePluginClient):
|
|||||||
raise ValueError("File chunk is too large which reached the limit of 8KB")
|
raise ValueError("File chunk is too large which reached the limit of 8KB")
|
||||||
|
|
||||||
# Check if file is too large
|
# Check if file is too large
|
||||||
size_with_chunk_written = files[chunk_id].bytes_written + file_chunk_size
|
size_with_new_chunk = files[chunk_id].bytes_written + file_chunk_size
|
||||||
if size_with_chunk_written > dify_config.TOOL_FILE_MAX_SIZE:
|
if size_with_new_chunk > dify_config.TOOL_FILE_MAX_SIZE:
|
||||||
# Delete the file if it's too large
|
# Delete the file if it's too large
|
||||||
del files[chunk_id]
|
del files[chunk_id]
|
||||||
# Skip yielding this message
|
# Skip yielding this message
|
||||||
@ -167,7 +167,7 @@ class PluginToolManager(BasePluginClient):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Append the blob data to the buffer
|
# Append the blob data to the buffer
|
||||||
files[chunk_id].data[files[chunk_id].bytes_written : size_with_chunk_written] = blob_data
|
files[chunk_id].data[files[chunk_id].bytes_written : size_with_new_chunk] = blob_data
|
||||||
files[chunk_id].bytes_written += file_chunk_size
|
files[chunk_id].bytes_written += file_chunk_size
|
||||||
else:
|
else:
|
||||||
yield resp
|
yield resp
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user