Skip to content

Commit 170c780

Browse files
author
ChidcGithub
committed
Fix ruff lint errors in validation.py
- Remove unused imports (json, urllib.parse) - Remove redundant aiohttp imports in validate_async methods
1 parent c58173a commit 170c780

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

codegnipy/validation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"""
77

88
import asyncio
9-
import json
109
import re
11-
import urllib.parse
1210
from abc import ABC, abstractmethod
1311
from dataclasses import dataclass, field
1412
from enum import Enum
@@ -147,8 +145,6 @@ def is_available(self) -> bool:
147145

148146
async def validate_async(self, claim: str, context: Optional["CognitiveContext"] = None) -> ExternalValidationResult:
149147
"""使用 Web 搜索验证声明"""
150-
import aiohttp
151-
152148
if not self.is_available():
153149
return ExternalValidationResult(
154150
claim=claim,
@@ -419,8 +415,6 @@ def is_available(self) -> bool:
419415

420416
async def validate_async(self, claim: str, context: Optional["CognitiveContext"] = None) -> ExternalValidationResult:
421417
"""使用知识图谱验证声明"""
422-
import aiohttp
423-
424418
try:
425419
# 尝试提取实体
426420
entities = await self._extract_entities(claim)

0 commit comments

Comments
 (0)