feat(ai_agent): 完善AI适配器和服务功能 - 添加OpenClaw和Hermes健康检查接口 - 实现OpenClaw工具调用功能 - 重构AI适配器使用常量定义 - 增加AI技能系统支持 - 更新配置文件中的默认模型提供者设置 refactor(scheduler): 使用常量替换硬编码值 - 将硬编码的actor值替换为ActorValue常量 - 将receive_id_type替换为FeishuReceiveIdType枚举 refactor(audit): 统一审计日志常量使用 - 将硬编码的actor、source、risk_level等值替换为对应常量 - 更新审核服务中的状态和操作常量引用 refactor(approvals): 标准化审批模块常量使用 - 将applicant默认值替换为ActorValue.API常量 - 使用ApprovalStatus常量替代硬编码状态值 - 更新审核操作常量引用 ```
42 lines
1.0 KiB
Python
42 lines
1.0 KiB
Python
from typing import Any
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from app.core.constants import ActorValue
|
|
from app.modules.ai_agent.constants import AIDefault, AIRiskPreference
|
|
from app.modules.audit.constants import AuditSource
|
|
|
|
|
|
class AIAskRequest(BaseModel):
|
|
prompt: str
|
|
context: dict[str, Any] = Field(default_factory=dict)
|
|
actor: str = ActorValue.API
|
|
source: str = AuditSource.API
|
|
|
|
|
|
class AIAskResponse(BaseModel):
|
|
provider: str
|
|
answer: str
|
|
raw: dict[str, Any] = Field(default_factory=dict)
|
|
|
|
|
|
class OpenClawToolInvokeRequest(BaseModel):
|
|
tool: str
|
|
action: str = AIDefault.ACTION_JSON
|
|
args: dict[str, Any] = Field(default_factory=dict)
|
|
session_key: str = AIDefault.SESSION_KEY_MAIN
|
|
actor: str = ActorValue.API
|
|
|
|
|
|
class DraftPolicyRequest(BaseModel):
|
|
title: str
|
|
policy_type: str
|
|
requirements: list[str]
|
|
actor: str = ActorValue.API
|
|
|
|
|
|
class InvestmentResearchRequest(BaseModel):
|
|
symbol_or_topic: str
|
|
risk_preference: str = AIRiskPreference.BALANCED
|
|
actor: str = ActorValue.API
|