Skip to content

Commit 9bbe850

Browse files
CopilotOhYee
andcommitted
refactor(core): use constant for server install command to reduce duplication
Extract the repeated install command string into a constant _SERVER_INSTALL_CMD to make the code more maintainable and easier to update in the future. This addresses code review feedback about reducing duplication in the package mapping structure. Co-authored-by: OhYee <[email protected]>
1 parent 7575061 commit 9bbe850

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

agentrun/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,11 @@
292292
# 可选依赖包映射:导入错误的包名 -> 安装使用的包名
293293
# Optional dependency mapping: import error package name -> installation package name
294294
# 所有 server 相关的可选依赖 / All server-related optional dependencies
295+
_SERVER_INSTALL_CMD = "agentrun-sdk[server]"
295296
_OPTIONAL_PACKAGES = [
296-
("fastapi", "agentrun-sdk[server]"),
297-
("uvicorn", "agentrun-sdk[server]"),
298-
("ag_ui", "agentrun-sdk[server]"),
297+
("fastapi", _SERVER_INSTALL_CMD),
298+
("uvicorn", _SERVER_INSTALL_CMD),
299+
("ag_ui", _SERVER_INSTALL_CMD),
299300
]
300301

301302

0 commit comments

Comments
 (0)