Suppress token usage warnings for custom OpenAI-compatible endpoints

• Add warning filter for token usage
• Support vLLM, SGLang endpoints
• Non-critical for RAGAS evaluation
This commit is contained in:
yangdx 2025-11-05 18:25:28 +08:00
parent 451257aed5
commit 994a82dc7f

View file

@ -62,6 +62,15 @@ warnings.filterwarnings(
category=DeprecationWarning,
)
# Suppress token usage warning for custom OpenAI-compatible endpoints
# Custom endpoints (vLLM, SGLang, etc.) often don't return usage information
# This is non-critical as token tracking is not required for RAGAS evaluation
warnings.filterwarnings(
"ignore",
message=".*Unexpected type for token usage.*",
category=UserWarning,
)
# Add parent directory to path
sys.path.insert(0, str(Path(__file__).parent.parent.parent))