fix(api): lint errors in Rate Limiter + RAG services
- Remove unused imports (settings, uuid) - Add 'from e' to exception raises (B904) - Add strict=True to zip() (B905) - Remove unused variable Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,14 +16,12 @@ Phase 13.2 #84 - Runbook RAG Tool
|
||||
|
||||
import hashlib
|
||||
import struct
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
from typing import Protocol
|
||||
|
||||
import redis.asyncio as redis
|
||||
import structlog
|
||||
|
||||
from src.core.config import settings
|
||||
from src.services.embedding_service import IEmbeddingService, get_embedding_service
|
||||
|
||||
logger = structlog.get_logger(__name__)
|
||||
@@ -311,7 +309,7 @@ class RAGService:
|
||||
embeddings = await embedding_service.embed_batch(texts, concurrency=3)
|
||||
|
||||
# 儲存到 Redis
|
||||
for chunk, embedding in zip(all_chunks, embeddings):
|
||||
for chunk, embedding in zip(all_chunks, embeddings, strict=True):
|
||||
await self._store_chunk(chunk, embedding)
|
||||
total_chunks += 1
|
||||
|
||||
@@ -373,7 +371,7 @@ class RAGService:
|
||||
parsed = []
|
||||
i = 1
|
||||
while i < len(results):
|
||||
key = results[i]
|
||||
# results[i] is the Redis key, results[i+1] is the fields
|
||||
fields = results[i + 1] if i + 1 < len(results) else []
|
||||
|
||||
# 將 fields list 轉為 dict
|
||||
|
||||
Reference in New Issue
Block a user