refactor(core,ai): 调整模块导入路径并移除废弃文件 - 修复 scheduler.py 中的导入路径错误,将 reports.service 改为 reports.services - 移除废弃的 app/core/background/task_queue.py 文件 - 移除废弃的 app/modules/ai_agent/adapters.py 文件 - 修复 ai_memory/service.py 中的导入路径错误,将 events.service 改为 events.services ```
26 lines
679 B
Python
26 lines
679 B
Python
from typing import Any
|
|
|
|
|
|
from app.modules.ai_agent.adapters.base import AIAdapter
|
|
from app.modules.ai_agent.constants import (
|
|
NOOP_PROVIDER_ANSWER,
|
|
AIProviderName,
|
|
AIRequestKey,
|
|
AIResponseKey,
|
|
)
|
|
|
|
|
|
class NoopAdapter(AIAdapter):
|
|
"""Deterministic adapter used when no model provider is configured."""
|
|
|
|
provider_name = AIProviderName.NOOP
|
|
|
|
def ask(self, prompt: str, context: dict[str, Any] | None = None) -> dict[str, Any]:
|
|
return {
|
|
AIResponseKey.ANSWER: NOOP_PROVIDER_ANSWER,
|
|
AIResponseKey.RAW: {
|
|
AIRequestKey.PROMPT: prompt,
|
|
AIRequestKey.CONTEXT: context or {},
|
|
},
|
|
}
|