Skip to content

添加 web 配置功能#51

Closed
wsh307 wants to merge 3 commits intoErlichLiu:mainfrom
wsh307:webConfig
Closed

添加 web 配置功能#51
wsh307 wants to merge 3 commits intoErlichLiu:mainfrom
wsh307:webConfig

Conversation

@wsh307
Copy link
Copy Markdown

@wsh307 wsh307 commented Feb 25, 2025

添加在线配置修改以及模型映射功能

@GowayLee GowayLee self-assigned this Feb 25, 2025
@GowayLee GowayLee added the enhancement New feature or request label Feb 25, 2025
Copy link
Copy Markdown
Collaborator

@GowayLee GowayLee left a comment

Choose a reason for hiding this comment

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

此PR改动过大, 建议merge到dev分支

Comment thread app/web_config/config_server.py Outdated
import uvicorn
from pathlib import Path
except ImportError as e:
raise ImportError(f"Web 配置界面依赖缺失: {e}. 请运行 'pip install jinja2 pyyaml uvicorn python-dotenv python-multipart'")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

本项目使用uv作为包管理器, 最好保持统一

# 加载选项
self.config_data["options"]["allow_origins"] = os.getenv("ALLOW_ORIGINS", "*")
self.config_data["options"]["is_origin_reasoning"] = os.getenv("IS_ORIGIN_REASONING", "true").lower() == "true"
self.config_data["options"]["log_level"] = os.getenv("LOG_LEVEL", "INFO")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这部分我们打算改为更加灵活的配置方式 #52
希望可以将web_config系统与新的配置系统进行融合

Comment thread app/main.py Outdated
"parent": None
})

return {"object": "list", "data": models_data}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

可以将构建返回体的逻辑拆分至模块, 保持main.py的可读性

@wsh307 wsh307 closed this Feb 27, 2025
@wsh307 wsh307 deleted the webConfig branch February 27, 2025 09:00
@wsh307 wsh307 restored the webConfig branch February 27, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants