chore: apply ruff auto-fixes and remove dead AST scripts
This commit is contained in:
10
ai_client.py
10
ai_client.py
@@ -21,7 +21,6 @@ import hashlib
|
||||
import difflib
|
||||
import threading
|
||||
import requests
|
||||
from pathlib import Path
|
||||
from typing import Optional, Callable, Any
|
||||
import os
|
||||
import project_manager
|
||||
@@ -1416,7 +1415,7 @@ def _send_anthropic(md_content: str, user_message: str, base_dir: str, file_item
|
||||
def _ensure_deepseek_client() -> None:
|
||||
global _deepseek_client
|
||||
if _deepseek_client is None:
|
||||
creds = _load_credentials()
|
||||
_load_credentials()
|
||||
# Placeholder for Dedicated DeepSeek SDK instantiation
|
||||
# import deepseek
|
||||
# _deepseek_client = deepseek.DeepSeek(api_key=creds["deepseek"]["api_key"])
|
||||
@@ -1672,7 +1671,6 @@ def run_tier4_analysis(stderr: str) -> str:
|
||||
return f"[QA ANALYSIS FAILED] {e}"
|
||||
# ------------------------------------------------------------------ unified send
|
||||
|
||||
import json
|
||||
|
||||
|
||||
def send(
|
||||
@@ -1737,7 +1735,7 @@ def get_history_bleed_stats(md_content: str | None = None) -> dict[str, Any]:
|
||||
# For Anthropic, we have a robust estimator
|
||||
with _anthropic_history_lock:
|
||||
history_snapshot = list(_anthropic_history)
|
||||
hist_only = _estimate_prompt_tokens([], history_snapshot) - 2500 # subtract fixed tools
|
||||
_estimate_prompt_tokens([], history_snapshot) - 2500 # subtract fixed tools
|
||||
sys_tok = max(1, int(len(md_content) / _CHARS_PER_TOKEN)) if md_content else 0
|
||||
current_tokens = _estimate_prompt_tokens([], history_snapshot)
|
||||
if md_content:
|
||||
@@ -1784,7 +1782,7 @@ def get_history_bleed_stats(md_content: str | None = None) -> dict[str, Any]:
|
||||
"current": current_tokens,
|
||||
"percentage": percentage,
|
||||
}, sys_tok=0, tool_tok=0)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pass
|
||||
elif md_content:
|
||||
try:
|
||||
@@ -1801,7 +1799,7 @@ def get_history_bleed_stats(md_content: str | None = None) -> dict[str, Any]:
|
||||
"current": current_tokens,
|
||||
"percentage": percentage,
|
||||
})
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
pass
|
||||
return _add_bleed_derived({
|
||||
"provider": "gemini",
|
||||
|
||||
Reference in New Issue
Block a user