perf: use file transfer in getting icon and installing local plugins (#1674)

This commit is contained in:
Junyan Qin
2025-09-19 19:38:27 +08:00
parent 5a6206f148
commit 0ffb4d5792
3 changed files with 21 additions and 4 deletions

View File

@@ -560,7 +560,18 @@ class RuntimeConnectionHandler(handler.Handler):
'plugin_name': plugin_name,
},
)
return result
plugin_icon_file_key = result['plugin_icon_file_key']
mime_type = result['mime_type']
plugin_icon_bytes = await self.read_local_file(plugin_icon_file_key)
await self.delete_local_file(plugin_icon_file_key)
return {
'plugin_icon_base64': base64.b64encode(plugin_icon_bytes).decode('utf-8'),
'mime_type': mime_type,
}
async def call_tool(self, tool_name: str, parameters: dict[str, Any]) -> dict[str, Any]:
"""Call tool"""