fix linter, fix ci, fix tests
This commit is contained in:
@@ -9,14 +9,9 @@
|
||||
|
||||
from .base import CombinedScore, ScoringResult, ScoringServiceProtocol
|
||||
from .deepseek_service import DeepSeekService
|
||||
from .exceptions import (
|
||||
DeepSeekAPIError,
|
||||
InsufficientExamplesError,
|
||||
ModelNotLoadedError,
|
||||
ScoringError,
|
||||
TextTooShortError,
|
||||
VectorStoreError,
|
||||
)
|
||||
from .exceptions import (DeepSeekAPIError, InsufficientExamplesError,
|
||||
ModelNotLoadedError, ScoringError, TextTooShortError,
|
||||
VectorStoreError)
|
||||
from .rag_client import RagApiClient
|
||||
from .scoring_manager import ScoringManager
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import json
|
||||
from typing import List, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from helper_bot.utils.metrics import track_errors, track_time
|
||||
from logs.custom_logger import logger
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ HTTP клиент для взаимодействия с внешним RAG се
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import httpx
|
||||
|
||||
from helper_bot.utils.metrics import track_errors, track_time
|
||||
from logs.custom_logger import logger
|
||||
|
||||
from .base import ScoringResult
|
||||
from .exceptions import InsufficientExamplesError, ScoringError, TextTooShortError
|
||||
from .exceptions import (InsufficientExamplesError, ScoringError,
|
||||
TextTooShortError)
|
||||
|
||||
|
||||
class RagApiClient:
|
||||
@@ -160,11 +160,19 @@ class RagApiClient:
|
||||
else None
|
||||
)
|
||||
rag_score_pos_only_raw = data.get("rag_score_pos_only")
|
||||
rag_score_pos_only = float(rag_score_pos_only_raw) if rag_score_pos_only_raw is not None else None
|
||||
rag_score_pos_only = (
|
||||
float(rag_score_pos_only_raw)
|
||||
if rag_score_pos_only_raw is not None
|
||||
else None
|
||||
)
|
||||
|
||||
# Форматируем confidence для логирования
|
||||
confidence_str = f"{confidence:.4f}" if confidence is not None else "None"
|
||||
rag_score_pos_only_str = f"{rag_score_pos_only:.4f}" if rag_score_pos_only is not None else "None"
|
||||
rag_score_pos_only_str = (
|
||||
f"{rag_score_pos_only:.4f}"
|
||||
if rag_score_pos_only is not None
|
||||
else "None"
|
||||
)
|
||||
|
||||
logger.info(
|
||||
f"RagApiClient: Скор успешно получен из API - "
|
||||
|
||||
@@ -13,7 +13,8 @@ from logs.custom_logger import logger
|
||||
|
||||
from .base import CombinedScore, ScoringResult
|
||||
from .deepseek_service import DeepSeekService
|
||||
from .exceptions import InsufficientExamplesError, ScoringError, TextTooShortError
|
||||
from .exceptions import (InsufficientExamplesError, ScoringError,
|
||||
TextTooShortError)
|
||||
from .rag_client import RagApiClient
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user