```
feat: 添加飞书用户模块和订阅功能支持 - 新增feishu_users模块用于处理飞书用户身份验证和权限管理 - 新增subscriptions模块用于处理订阅相关功能 - 新增personalization模块用于个性化服务 - 在alembic迁移配置中注册新的模型模块 - 在API路由器中添加feishu_users和subscriptions路由 - 实现事件调度服务的改进,包括错误处理和状态更新优化 - 添加飞书命令处理的权限检查机制 - 实现飞书应用票据事件处理 - 改进审计日志记录功能 ```
This commit is contained in:
@@ -32,7 +32,14 @@ class OpenClawHermesAdapter(AIAdapter):
|
||||
|
||||
def ask(self, prompt: str, context: dict[str, Any] | None = None) -> dict[str, Any]:
|
||||
base_context = context or {}
|
||||
recall = self._recall_memory(prompt, base_context)
|
||||
allow_provider_memory = bool(
|
||||
base_context.get(AIContextKey.ALLOW_PROVIDER_MEMORY, True)
|
||||
)
|
||||
recall = (
|
||||
self._recall_memory(prompt, base_context)
|
||||
if allow_provider_memory
|
||||
else {AIResponseKey.ANSWER: "", AIResponseKey.RAW: {}}
|
||||
)
|
||||
openclaw = self._openclaw_context(base_context)
|
||||
hermes_context = {
|
||||
**base_context,
|
||||
@@ -41,10 +48,14 @@ class OpenClawHermesAdapter(AIAdapter):
|
||||
AIContextKey.OPENCLAW: openclaw,
|
||||
}
|
||||
hermes_result = self.hermes.ask(prompt, hermes_context)
|
||||
remember = self._remember_interaction(
|
||||
prompt,
|
||||
base_context,
|
||||
hermes_result[AIResponseKey.ANSWER],
|
||||
remember = (
|
||||
self._remember_interaction(
|
||||
prompt,
|
||||
base_context,
|
||||
hermes_result[AIResponseKey.ANSWER],
|
||||
)
|
||||
if allow_provider_memory
|
||||
else {AIResponseKey.OK: False, AIResponseKey.RAW: {}}
|
||||
)
|
||||
return {
|
||||
AIResponseKey.ANSWER: hermes_result[AIResponseKey.ANSWER],
|
||||
|
||||
Reference in New Issue
Block a user