refactor: 更新配置和权限逻辑,移除过时参数,优化用户信息组件的下拉触发方式
This commit is contained in:
parent
e3c5f41c7c
commit
fa2497e439
10
REFACTOR.md
10
REFACTOR.md
@ -14,10 +14,12 @@
|
||||
# 待办事项
|
||||
|
||||
- [x] 移除所有对于 v1 的模型的代码的支持、移除所有对于 legacy 参数的支持
|
||||
- [ ] 新建一个知识库类型 "enhanced" (名称待定)整体上使用类似于 当前 milvus 的逻辑,但是接口上仅使用新的字段
|
||||
1. 文件上传这里就是 base 来管理
|
||||
2。 然后支持配置 parser_config,chunk_config
|
||||
- [x] 移除 lightrag
|
||||
- [ ] 新增图谱构建,支持自定义 Schema、支持自定义并发数,知识库与向量检索解耦
|
||||
- [ ] 知识图谱抽取要求支持并发处理
|
||||
|
||||
|
||||
- [ ] Agent 的 user_id 使用的有歧义
|
||||
## 权限部分
|
||||
- [ ] Agent 的 user_id 使用的有歧义,从数据库表到代码中都修改为统一使用 yuxi_id 来代替
|
||||
- [ ] 权限新增一个 guest 的预设字段,暂无任何权限
|
||||
- [ ] department 的 id 也不能使用那个索引的 id 来使用了,应该是一个独立的 dept_id,需要确认
|
||||
@ -1,3 +1,5 @@
|
||||
import os
|
||||
|
||||
from deepagents.middleware.filesystem import FilesystemMiddleware
|
||||
from deepagents.middleware.patch_tool_calls import PatchToolCallsMiddleware
|
||||
from deepagents.middleware.subagents import SubAgentMiddleware
|
||||
@ -37,10 +39,8 @@ class DeepAgent(BaseAgent):
|
||||
|
||||
async def get_tools(self):
|
||||
"""返回 Deep Agent 的专用工具"""
|
||||
from yuxi import config
|
||||
|
||||
tools = []
|
||||
if config.enable_web_search:
|
||||
if os.getenv("TAVILY_API_KEY"):
|
||||
tavily = _create_tavily_search()
|
||||
if tavily:
|
||||
tools.append(tavily)
|
||||
|
||||
@ -56,7 +56,7 @@ def _register_tavily_tool():
|
||||
|
||||
|
||||
# 模块加载时注册
|
||||
if config.enable_web_search:
|
||||
if os.getenv("TAVILY_API_KEY"):
|
||||
try:
|
||||
_register_tavily_tool()
|
||||
except Exception as e:
|
||||
|
||||
@ -17,13 +17,9 @@ class Config(BaseModel):
|
||||
"""应用配置类。"""
|
||||
|
||||
save_dir: str = Field(default="saves", description="保存目录")
|
||||
model_dir: str = Field(default="", description="本地模型目录")
|
||||
|
||||
enable_reranker: bool = Field(default=False, description="是否开启重排序")
|
||||
enable_content_guard: bool = Field(default=False, description="是否启用内容审查")
|
||||
enable_content_guard_llm: bool = Field(default=False, description="是否启用LLM内容审查")
|
||||
enable_web_search: bool = Field(default=False, description="是否启用网络搜索")
|
||||
|
||||
default_model: str = Field(
|
||||
default="siliconflow-cn:Pro/MiniMaxAI/MiniMax-M2.5",
|
||||
description="默认对话模型",
|
||||
@ -92,9 +88,6 @@ class Config(BaseModel):
|
||||
logger.error(f"Failed to load config from {self._config_file}: {e}")
|
||||
|
||||
def _handle_environment(self) -> None:
|
||||
if os.getenv("TAVILY_API_KEY"):
|
||||
self.enable_web_search = True
|
||||
|
||||
self.sandbox_provider = (os.getenv("SANDBOX_PROVIDER") or self.sandbox_provider or "provisioner").strip()
|
||||
self.sandbox_provisioner_url = (
|
||||
os.getenv("SANDBOX_PROVISIONER_URL") or self.sandbox_provisioner_url or "http://sandbox-provisioner:8002"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="user-info-component">
|
||||
<a-dropdown :trigger="['hover']" v-if="userStore.isLoggedIn">
|
||||
<a-dropdown :trigger="['click']" v-if="userStore.isLoggedIn">
|
||||
<div class="user-info-dropdown" :data-align="showRole ? 'left' : 'center'">
|
||||
<div class="user-avatar">
|
||||
<img
|
||||
|
||||
Loading…
Reference in New Issue
Block a user