mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(lint): fix remaining PLR0913 violations in new files
- asqav: bundle start_time/end_time into a timing tuple to reduce _build_and_append from 6 to 5 args - milvus_ingestion: absorb unused content_type into **_ to bring store() within max-args limit while preserving the base class interface - test_guardrail_usage_config: remove flagged_count from _metric signature (hardcoded to 0 in the returned object) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
240afd4724
commit
f607966982
3 changed files with 8 additions and 11 deletions
|
|
@ -277,8 +277,7 @@ class AsqavLogger(CustomLogger):
|
|||
self,
|
||||
kwargs: dict[str, Any],
|
||||
response_obj: object,
|
||||
start_time: datetime | None,
|
||||
end_time: datetime | None,
|
||||
timing: tuple[datetime | None, datetime | None],
|
||||
status: str,
|
||||
) -> None:
|
||||
"""Build one audit record and append it to the JSONL log.
|
||||
|
|
@ -286,6 +285,7 @@ class AsqavLogger(CustomLogger):
|
|||
seq/prev_hash assignment and the file write happen under _lock so the
|
||||
on-disk order always matches the chain order.
|
||||
"""
|
||||
start_time, end_time = timing
|
||||
try:
|
||||
loggable = _extract_loggable(
|
||||
kwargs, response_obj, start_time, end_time, status
|
||||
|
|
@ -376,7 +376,7 @@ class AsqavLogger(CustomLogger):
|
|||
start_time: datetime | None,
|
||||
end_time: datetime | None,
|
||||
) -> None:
|
||||
self._build_and_append(kwargs, response_obj, start_time, end_time, "success")
|
||||
self._build_and_append(kwargs, response_obj, (start_time, end_time), "success")
|
||||
|
||||
def log_failure_event(
|
||||
self,
|
||||
|
|
@ -385,7 +385,7 @@ class AsqavLogger(CustomLogger):
|
|||
start_time: datetime | None,
|
||||
end_time: datetime | None,
|
||||
) -> None:
|
||||
self._build_and_append(kwargs, response_obj, start_time, end_time, "failure")
|
||||
self._build_and_append(kwargs, response_obj, (start_time, end_time), "failure")
|
||||
|
||||
async def async_log_success_event(
|
||||
self,
|
||||
|
|
@ -398,8 +398,7 @@ class AsqavLogger(CustomLogger):
|
|||
self._build_and_append,
|
||||
kwargs,
|
||||
response_obj,
|
||||
start_time,
|
||||
end_time,
|
||||
(start_time, end_time),
|
||||
"success",
|
||||
)
|
||||
|
||||
|
|
@ -414,8 +413,7 @@ class AsqavLogger(CustomLogger):
|
|||
self._build_and_append,
|
||||
kwargs,
|
||||
response_obj,
|
||||
start_time,
|
||||
end_time,
|
||||
(start_time, end_time),
|
||||
"failure",
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -219,9 +219,9 @@ class MilvusRAGIngestion(BaseRAGIngestion):
|
|||
self,
|
||||
file_content: bytes | None,
|
||||
filename: str | None,
|
||||
content_type: str | None,
|
||||
chunks: list[str],
|
||||
embeddings: list[list[float]] | None,
|
||||
**_: object, # absorbs content_type and any extra base-class params
|
||||
) -> tuple[str | None, str | None]:
|
||||
"""
|
||||
Insert chunks + embeddings into a Milvus collection.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ def _metric(
|
|||
requests_evaluated: int = 10,
|
||||
passed_count: int = 8,
|
||||
blocked_count: int = 2,
|
||||
flagged_count: int = 0,
|
||||
):
|
||||
return SimpleNamespace(
|
||||
guardrail_id=guardrail_id,
|
||||
|
|
@ -38,7 +37,7 @@ def _metric(
|
|||
requests_evaluated=requests_evaluated,
|
||||
passed_count=passed_count,
|
||||
blocked_count=blocked_count,
|
||||
flagged_count=flagged_count,
|
||||
flagged_count=0,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue