fix: auto-fix code issues (cron)
- 修复重复导入/字段 - 修复异常处理 - 修复PEP8格式问题 - 添加类型注解 - 修复main.py中的语法错误(缺失try语句的from导入) - 添加缺失的timedelta导入到plugin_manager.py - 添加缺失的urllib.parse导入到plugin_manager.py和workflow_manager.py - 添加缺失的os导入到document_processor.py - 修复import排序问题 - 修复行长度超过100字符的问题 - 添加缺失的Alert导入到test_phase8_task8.py - 添加缺失的get_export_manager导入到main.py
This commit is contained in:
@@ -18,7 +18,6 @@ from datetime import datetime, timedelta
|
||||
from typing import Any, Optional
|
||||
|
||||
import httpx
|
||||
from export_manager import ExportEntity, ExportRelation, ExportTranscript
|
||||
from fastapi import (
|
||||
Body,
|
||||
Depends,
|
||||
@@ -36,6 +35,13 @@ from fastapi.responses import JSONResponse, PlainTextResponse, StreamingResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from export_manager import (
|
||||
ExportEntity,
|
||||
ExportRelation,
|
||||
ExportTranscript,
|
||||
get_export_manager,
|
||||
)
|
||||
|
||||
# Configure logger
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -140,7 +146,7 @@ except ImportError as e:
|
||||
|
||||
# Phase 7: Workflow Manager
|
||||
try:
|
||||
from workflow_manager import WebhookConfig, Workflow
|
||||
from workflow_manager import WebhookConfig, Workflow, WorkflowManager
|
||||
|
||||
WORKFLOW_AVAILABLE = True
|
||||
except ImportError as e:
|
||||
@@ -174,10 +180,13 @@ except ImportError as e:
|
||||
|
||||
# Phase 7 Task 7: Plugin Manager
|
||||
try:
|
||||
from plugin_manager import (
|
||||
BotHandler,
|
||||
Plugin,
|
||||
PluginManager,
|
||||
PluginStatus,
|
||||
PluginType,
|
||||
WebDAVSyncHandler,
|
||||
WebhookIntegration,
|
||||
get_plugin_manager,
|
||||
)
|
||||
@@ -299,10 +308,12 @@ except ImportError as e:
|
||||
|
||||
# Phase 8 Task 8: Operations & Monitoring Manager
|
||||
try:
|
||||
from ops_manager import (
|
||||
AlertChannelType,
|
||||
AlertRuleType,
|
||||
AlertSeverity,
|
||||
AlertStatus,
|
||||
OpsManager,
|
||||
ResourceType,
|
||||
get_ops_manager,
|
||||
)
|
||||
@@ -1933,7 +1944,10 @@ async def agent_command(project_id: str, command: AgentCommand, _=Depends(verify
|
||||
else:
|
||||
result["action"] = "none"
|
||||
result["message"] = (
|
||||
"无法理解的指令,请尝试:\n- 合并实体:把所有'客户端'合并到'App'\n- 提问:张总对项目的态度如何?\n- 编辑:修改'K8s'的定义为..."
|
||||
"无法理解的指令,请尝试:\n"
|
||||
"- 合并实体:把所有'客户端'合并到'App'\n"
|
||||
"- 提问:张总对项目的态度如何?\n"
|
||||
"- 编辑:修改'K8s'的定义为..."
|
||||
)
|
||||
|
||||
return result
|
||||
@@ -4176,12 +4190,18 @@ async def test_webhook_endpoint(webhook_id: str, _=Depends(verify_api_key)):
|
||||
|
||||
# 构建测试消息
|
||||
test_message = {
|
||||
"content": "🔔 这是来自 InsightFlow 的 Webhook 测试消息\n\n如果您收到这条消息,说明 Webhook 配置正确!",
|
||||
"content": (
|
||||
"🔔 这是来自 InsightFlow 的 Webhook 测试消息\n\n"
|
||||
"如果您收到这条消息,说明 Webhook 配置正确!"
|
||||
),
|
||||
}
|
||||
|
||||
if webhook.webhook_type == "slack":
|
||||
test_message = {
|
||||
"text": "🔔 这是来自 InsightFlow 的 Webhook 测试消息\n\n如果您收到这条消息,说明 Webhook 配置正确!",
|
||||
"text": (
|
||||
"🔔 这是来自 InsightFlow 的 Webhook 测试消息\n\n"
|
||||
"如果您收到这条消息,说明 Webhook 配置正确!"
|
||||
),
|
||||
}
|
||||
|
||||
success = await manager.notifier.send(webhook, test_message)
|
||||
|
||||
Reference in New Issue
Block a user