litellm/litellm/telemetry/sink.py
devin-ai-integration[bot] 1311894845
refactor: clean up fresh tech debt in per-user Copilot auth, Ternary FOCUS export and telemetry (#45769)
* refactor: read typed credential fields directly in per-user Copilot auth

- github_copilot_auth_mode reads credential.credential_values directly instead of getattr+isinstance+cast
- _new_async_github_client uses plain attribute access for get_async_httpx_client
- _per_user_oauth_configured and _all_per_user_credential_names iterate typed CredentialItem fields
- list_user_connections builds login/connected_at maps in one shot instead of seeded mutable dicts

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor: read typed fields directly in team member budget auth and pass-through route registration

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Revert "refactor: read typed fields directly in team member budget auth and pass-through route registration"

This reverts commit ae37be318d.

* refactor: deduplicate Ternary export locking and type HTTP handler override

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor: drop dead telemetry helpers, reuse PrismaClient.writer_db, remove restating comments

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* ci: retrigger unit shards after an unrelated mcp-elicitation timeout

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-15 04:29:27 +00:00

27 lines
701 B
Python

from enum import Enum
from typing import Protocol
from litellm.telemetry.records import AttemptRecord, InstanceInfo, RequestRecord, UIEvent
from litellm.telemetry.report import Report
class TelemetrySink(Protocol):
def set_instance(self, info: InstanceInfo) -> None: ...
def record_request(self, record: RequestRecord) -> None: ...
def record_attempt(self, record: AttemptRecord) -> None: ...
def record_ui_event(self, event: UIEvent) -> None: ...
async def flush(self) -> None: ...
class ExportOutcome(str, Enum):
SENT = "sent"
REJECTED = "rejected"
RETRY = "retry"
class Exporter(Protocol):
async def export(self, report: Report) -> ExportOutcome: ...