Skip to content

perf: Optimize code style#6277

Open
wangliang181230 wants to merge 1 commit into
1Panel-dev:v2from
wangliang181230:PR/60-perf-Optimize-code-style
Open

perf: Optimize code style#6277
wangliang181230 wants to merge 1 commit into
1Panel-dev:v2from
wangliang181230:PR/60-perf-Optimize-code-style

Conversation

@wangliang181230

Copy link
Copy Markdown
Contributor

perf: Optimize code style

@wangliang181230 wangliang181230 force-pushed the PR/60-perf-Optimize-code-style branch from 851eb46 to b08a2f4 Compare June 25, 2026 09:26
@wangliang181230 wangliang181230 force-pushed the PR/60-perf-Optimize-code-style branch from b08a2f4 to 504da54 Compare June 25, 2026 09:26
Comment thread apps/chat/mcp/tools.py
}).open()

def call_tool(self, params):
name = params["name"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name 没在用

client: Any
if documents is None or len(documents) == 0:
if not documents:
return []

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

删除冗余代码

raise ImportError(
"Could not import RESTfulClient from xinference. Please install it"
" with `pip install xinference` or `pip install xinference_client`."
) from e

@wangliang181230 wangliang181230 Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import提到顶部去。

'padding_problem_text') if 'problem_padding' in chat_record.details else None,
**(show_source_dict if show_source else {}),
**(show_exec_dict if show_exec else show_exec_dict)
**show_exec_dict

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if-else 值相同,把 if-else 去掉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant