mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
* wip * refactor(tests): move sdk function tracing into rust python harness * dead code * fix: handle harness keyboard interrupts * refactor(tests): deduplicate rust python harness helpers * fix(harness): expose validated strategy choices * wip * refactor(harness): let strategies own parity reports * docs(harness): update strategy structure * refactor(harness): localize strategy report views * wip * fix(harness): satisfy mapping runner type checks * fix(harness): clarify trace parity output * wip * fix(harness): clarify unit mapping report * fix(harness): finalize trace parity contracts * refactor(harness): structure parity contracts * feat: derive unit test mapping from traces * feat(harness): map rstest test families * feat(ocr): port Azure document intelligence tests * feat(harness): enforce complete unit mappings * feat(ocr): add reducto core transforms * feat(harness): classify host-only unit tests * fix(ocr): complete Rust provider plumbing * fix(harness): reuse OCR parity workers
38 lines
983 B
Python
38 lines
983 B
Python
from __future__ import annotations
|
|
|
|
from typing import Final
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from .profiler import FunctionTraceEvent
|
|
|
|
|
|
class _TraceEventPayload(BaseModel):
|
|
model_config = ConfigDict(strict=True, extra="forbid")
|
|
id: int
|
|
parent_id: int | None
|
|
function: str
|
|
module_path: str | None = None
|
|
file: str | None = None
|
|
line: int | None = None
|
|
|
|
|
|
class TraceResponsePayload(BaseModel):
|
|
model_config = ConfigDict(strict=True, extra="forbid")
|
|
response: object
|
|
trace: tuple[_TraceEventPayload, ...] | list[_TraceEventPayload]
|
|
|
|
|
|
def native_trace_events(payload: object) -> tuple[FunctionTraceEvent, ...]:
|
|
response: Final = TraceResponsePayload.model_validate(payload)
|
|
return tuple(
|
|
FunctionTraceEvent(
|
|
event.id,
|
|
event.parent_id,
|
|
event.function,
|
|
event.module_path,
|
|
event.file,
|
|
event.line,
|
|
)
|
|
for event in response.trace
|
|
)
|