mirror of
https://github.com/katanemo/plano.git
synced 2026-06-14 15:15:15 +02:00
black formatting
This commit is contained in:
parent
d30018cf35
commit
d09fa97568
5 changed files with 52 additions and 13 deletions
|
|
@ -15,7 +15,6 @@ from opentelemetry.proto.collector.trace.v1 import (
|
|||
trace_service_pb2_grpc,
|
||||
)
|
||||
|
||||
|
||||
DEFAULT_GRPC_PORT = 4317
|
||||
DEFAULT_CAPACITY = 1000
|
||||
|
||||
|
|
@ -198,9 +197,9 @@ def span_to_llm_call(
|
|||
route_name=(
|
||||
str(attrs[_PLANO_ROUTE_NAME]) if _PLANO_ROUTE_NAME in attrs else None
|
||||
),
|
||||
is_streaming=bool(attrs[_LLM_IS_STREAMING])
|
||||
if _LLM_IS_STREAMING in attrs
|
||||
else None,
|
||||
is_streaming=(
|
||||
bool(attrs[_LLM_IS_STREAMING]) if _LLM_IS_STREAMING in attrs else None
|
||||
),
|
||||
status_code=_maybe_int(attrs.get(_HTTP_STATUS)),
|
||||
prompt_tokens=_maybe_int(attrs.get(_LLM_PROMPT_TOKENS)),
|
||||
completion_tokens=_maybe_int(attrs.get(_LLM_COMPLETION_TOKENS)),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ from typing import Any
|
|||
|
||||
import requests
|
||||
|
||||
|
||||
DEFAULT_PRICING_URL = "https://api.digitalocean.com/v2/gen-ai/models/catalog"
|
||||
FETCH_TIMEOUT_SECS = 5.0
|
||||
|
||||
|
|
|
|||
|
|
@ -271,7 +271,11 @@ def _recent_table(calls: list[LLMCall], limit: int = 15) -> Table:
|
|||
|
||||
recent = list(reversed(calls))[:limit]
|
||||
for c in recent:
|
||||
status_cell = "ok" if c.status_code and 200 <= c.status_code < 400 else str(c.status_code or "—")
|
||||
status_cell = (
|
||||
"ok"
|
||||
if c.status_code and 200 <= c.status_code < 400
|
||||
else str(c.status_code or "—")
|
||||
)
|
||||
row = [
|
||||
c.timestamp.strftime("%H:%M:%S"),
|
||||
c.model,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue