mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-03 18:17:56 -05:00
refac
This commit is contained in:
1 parent
a058de949f
commit
90bdabcb35
2 files changed
+34
-16
No files matched your search
@@ -962,6 +962,7 @@ async def process_tool_result(
|
||||
tool_type,
|
||||
metadata=None,
|
||||
user=None,
|
||||
truncate=True,
|
||||
):
|
||||
tool_result_embeds = []
|
||||
if isinstance(tool_result, MCPAppResult):
|
||||
@@ -1170,7 +1171,8 @@ async def process_tool_result(
|
||||
else:
|
||||
tool_result = str(tool_result)
|
||||
|
||||
max_chars = await Config.get('tools.output_max_chars')
|
||||
# truncate=False for results that stay inside a program and never reach the context.
|
||||
max_chars = await Config.get('tools.output_max_chars') if truncate else None
|
||||
if max_chars and tool_result and len(tool_result) > max_chars:
|
||||
note = f'Truncated: {len(tool_result)} characters, limit {max_chars}'
|
||||
# Machine tools read the saved file, so saving their results would only copy it again.
|
||||
|
||||
Reference in new issue
Block a user