mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix: use shared httpx transport and remove unused TICKERR_CLIENT_TIER
- Replace raw urllib.request with litellm's _get_httpx_client() to follow the repo's shared HTTP layer policy - Remove TICKERR_CLIENT_TIER from callback_configs.json since the code never reads it and we don't need to collect tier data
This commit is contained in:
parent
b0d879a5ea
commit
d91cae477b
2 changed files with 6 additions and 16 deletions
|
|
@ -5,12 +5,6 @@
|
|||
"logo": "tickerr.png",
|
||||
"supports_key_team_logging": false,
|
||||
"dynamic_params": {
|
||||
"TICKERR_CLIENT_TIER": {
|
||||
"type": "text",
|
||||
"ui_name": "Client Tier",
|
||||
"description": "Optional. Your LLM plan tier: free, pro, team, enterprise, or api_pay_as_you_go. Used to correlate signals by tier.",
|
||||
"required": false
|
||||
},
|
||||
"TICKERR_REGION": {
|
||||
"type": "text",
|
||||
"ui_name": "Region",
|
||||
|
|
|
|||
|
|
@ -8,20 +8,18 @@ Usage:
|
|||
litellm.callbacks = ["tickerr"]
|
||||
|
||||
No API key. No account. Failure-only by default. Success sampling is opt-in.
|
||||
Zero dependencies beyond stdlib.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import threading
|
||||
import urllib.request
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
from litellm.llms.custom_httpx.http_handler import _get_httpx_client
|
||||
|
||||
_REPORT_URL = "https://tickerr.ai/api/v1/report"
|
||||
_UA = "litellm-tickerr/1.0"
|
||||
|
|
@ -127,13 +125,11 @@ class TickerrLogger(CustomLogger):
|
|||
|
||||
def _send() -> None:
|
||||
try:
|
||||
urllib.request.urlopen(
|
||||
urllib.request.Request(
|
||||
_REPORT_URL,
|
||||
data=json.dumps(payload).encode(),
|
||||
headers={"Content-Type": "application/json", "User-Agent": _UA},
|
||||
method="POST",
|
||||
),
|
||||
client = _get_httpx_client()
|
||||
client.post(
|
||||
_REPORT_URL,
|
||||
json=payload,
|
||||
headers={"User-Agent": _UA},
|
||||
timeout=2,
|
||||
)
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue