Skip to content

Commit 46d0ac8

Browse files
committed
lint
1 parent d54de92 commit 46d0ac8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ddtrace/llmobs/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
CACHE_READ_INPUT_TOKENS_METRIC_KEY = "cache_read_input_tokens"
4545
BILLABLE_CHARACTER_COUNT_METRIC_KEY = "billable_character_count"
4646

47-
TIME_TO_FIRST_TOKEN_METRIC_KEY = "time_to_first_token"
47+
TIME_TO_FIRST_TOKEN_METRIC_KEY = "time_to_first_token" # nosec B105
4848
TIME_IN_QUEUE_METRIC_KEY = "time_in_queue"
4949
TIME_IN_MODEL_PREFILL_METRIC_KEY = "time_in_model_prefill"
5050
TIME_IN_MODEL_DECODE_METRIC_KEY = "time_in_model_decode"

ddtrace/llmobs/_integrations/vllm.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _build_metrics(self, data: RequestData, stats=None) -> Dict[str, Any]:
6868
"""Build token and latency metrics from request data."""
6969
it = int(data.input_tokens or 0)
7070
ot = int(data.output_tokens or 0)
71-
metrics = {
71+
metrics: Dict[str, Any] = {
7272
INPUT_TOKENS_METRIC_KEY: it,
7373
OUTPUT_TOKENS_METRIC_KEY: ot,
7474
TOTAL_TOKENS_METRIC_KEY: it + ot,
@@ -153,7 +153,11 @@ def _llmobs_set_tags(
153153
return
154154

155155
stats = kwargs.get("stats")
156-
ctx = self._build_embedding_context(data, stats) if operation == "embedding" else self._build_completion_context(data, stats)
156+
ctx = (
157+
self._build_embedding_context(data, stats)
158+
if operation == "embedding"
159+
else self._build_completion_context(data, stats)
160+
)
157161
ctx[MODEL_NAME] = span.get_tag("vllm.request.model") or ""
158162
ctx[MODEL_PROVIDER] = span.get_tag("vllm.request.provider") or ""
159163
span._set_ctx_items(ctx)

0 commit comments

Comments
 (0)