mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
refactor: route agent tool settings through runtime
This commit is contained in:
@@ -11,7 +11,10 @@ from urllib.parse import urlencode, urljoin, urlparse
|
||||
|
||||
from app.agent.skills.metadata import parse_skill_metadata
|
||||
from app.runtime.cache import cached, fresh
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
from app.application.configuration import get_runtime_settings
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.log import logger
|
||||
from app.adapters.network.http import RequestUtils
|
||||
from app.foundation.singleton import WeakSingleton
|
||||
@@ -200,7 +203,7 @@ class SkillHelper(metaclass=WeakSingleton):
|
||||
将技能源列表写回配置文件,并同步更新内存中的 settings。
|
||||
"""
|
||||
filtered_sources = [item.strip() for item in sources if item and item.strip()]
|
||||
success, message = settings.update_setting(
|
||||
success, message = get_runtime_settings().update(
|
||||
key="SKILL_MARKET",
|
||||
value=",".join(filtered_sources),
|
||||
)
|
||||
|
||||
@@ -4,7 +4,9 @@ import json
|
||||
import shutil
|
||||
from typing import Any, Optional
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.application.plugin.runtime import get_plugin_manager
|
||||
from app.application.plugin.install import PluginInstallCommand
|
||||
from app.application.configuration import get_configured_system_config as SystemConfigOper
|
||||
|
||||
@@ -14,7 +14,9 @@ from pathlib import Path
|
||||
from typing import Any, Optional
|
||||
|
||||
from app.agent.tools.impl._command_safety import validate_command_safety
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.log import logger
|
||||
|
||||
if os.name == "posix":
|
||||
|
||||
@@ -6,7 +6,9 @@ from pydantic import BaseModel, Field
|
||||
from app.agent.llm.capability import AgentCapabilityManager
|
||||
from app.agent.tools.base import MoviePilotTool
|
||||
from app.agent.tools.tags import ToolTag
|
||||
from app.runtime.config import settings
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
from app.runtime.log import logger
|
||||
from app.schemas.message import Message
|
||||
from app.schemas.message import MessageType
|
||||
|
||||
Reference in New Issue
Block a user