telemetry-dev-litellm 0.2.3__tar.gz → 0.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: telemetry-dev-litellm
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: LiteLLM integration for telemetry.dev Python SDK
5
5
  Keywords: telemetry,opentelemetry,llm,genai,litellm,tracing
6
6
  Author: telemetry.dev
@@ -62,7 +62,7 @@ Use the exported functions as drop-in replacements when you do not want global m
62
62
  from telemetry_dev_litellm import completion
63
63
 
64
64
  response = completion(
65
- model="gpt-4o-mini",
65
+ model="openai/gpt-6-luna",
66
66
  messages=[{"role": "user", "content": "Say hi"}],
67
67
  )
68
68
  ```
@@ -76,7 +76,7 @@ import litellm
76
76
  from telemetry_dev_litellm import instrument_litellm, uninstrument_litellm
77
77
 
78
78
  instrument_litellm()
79
- response = litellm.completion(model="gpt-4o-mini", messages=[...])
79
+ response = litellm.completion(model="openai/gpt-6-luna", messages=[...])
80
80
  uninstrument_litellm()
81
81
  ```
82
82
 
@@ -38,7 +38,7 @@ Use the exported functions as drop-in replacements when you do not want global m
38
38
  from telemetry_dev_litellm import completion
39
39
 
40
40
  response = completion(
41
- model="gpt-4o-mini",
41
+ model="openai/gpt-6-luna",
42
42
  messages=[{"role": "user", "content": "Say hi"}],
43
43
  )
44
44
  ```
@@ -52,7 +52,7 @@ import litellm
52
52
  from telemetry_dev_litellm import instrument_litellm, uninstrument_litellm
53
53
 
54
54
  instrument_litellm()
55
- response = litellm.completion(model="gpt-4o-mini", messages=[...])
55
+ response = litellm.completion(model="openai/gpt-6-luna", messages=[...])
56
56
  uninstrument_litellm()
57
57
  ```
58
58
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "telemetry-dev-litellm"
3
- version = "0.2.3"
3
+ version = "0.2.5"
4
4
  description = "LiteLLM integration for telemetry.dev Python SDK"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "telemetry-dev-litellm"
3
- version = "0.2.3"
3
+ version = "0.2.5"
4
4
  description = "LiteLLM integration for telemetry.dev Python SDK"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -17,7 +17,7 @@ import litellm
17
17
  import telemetry_dev
18
18
  from opentelemetry import trace
19
19
 
20
- __version__ = "0.2.3"
20
+ __version__ = "0.2.5"
21
21
 
22
22
  RequestMapper = Callable[[tuple[Any, ...], Mapping[str, Any]], tuple[str, dict[str, Any]]]
23
23
  ResponseMapper = Callable[[Any], dict[str, Any]]
@@ -47,7 +47,6 @@ if hasattr(os, "register_at_fork") and "_install_fork_hook" not in globals():
47
47
  _install_fork_hook = True
48
48
  os.register_at_fork(after_in_child=_reset_install_lock_in_child)
49
49
 
50
- _OMIT = object()
51
50
  # The core applies max_attribute_length after the mask. More choices, or more responses items
52
51
  # and rejected parts tracked for truncation, than this are not kept.
53
52
  _STREAM_CAPTURE_MAX_ITEMS = 1000
@@ -160,15 +159,6 @@ def _adopt_budget(
160
159
  return True
161
160
 
162
161
 
163
- def _capture_masked(handle: telemetry_dev.SpanHandle) -> bool:
164
- compatible = cast(Any, handle)
165
- masked = getattr(compatible, "capture_masked", None)
166
- if isinstance(masked, bool):
167
- return masked
168
- client = getattr(compatible, "_client", None)
169
- return getattr(client, "mask", _OMIT) is not None if client is not None else True
170
-
171
-
172
162
  def _mark_capture_incomplete(fields: dict[str, Any], mask_output: bool) -> None:
173
163
  attributes = fields.get("attributes")
174
164
  fields["attributes"] = {
@@ -908,7 +898,7 @@ class _InstrumentedStream:
908
898
  self._saw_first = False
909
899
  self._finished = False
910
900
  self._completed = False
911
- self._mask_output_when_incomplete = _capture_masked(handle)
901
+ self._mask_output_when_incomplete = handle.capture_masked
912
902
  self._budget = _stream_capture_budget()
913
903
  self._response_id: str | None = None
914
904
  self._response_model: str | None = None
@@ -1063,9 +1053,7 @@ class _InstrumentedStream:
1063
1053
  )
1064
1054
  if has_output:
1065
1055
  self._saw_output = True
1066
- record_output_chunk = getattr(self._handle, "record_output_chunk", None)
1067
- if callable(record_output_chunk):
1068
- record_output_chunk(received_at * 1000)
1056
+ self._handle.record_output_chunk(received_at * 1000)
1069
1057
  except Exception as exc:
1070
1058
  self._report(exc)
1071
1059
  # The chunk is kept before its metadata is read, so a failure in the metadata (ID,
@@ -1288,7 +1276,7 @@ class _InstrumentedResponsesStream:
1288
1276
  self._retained_item_count = 0
1289
1277
  self._truncated_key_count = 0
1290
1278
  self._truncation_overflow = False
1291
- self._mask_output_when_incomplete = _capture_masked(handle)
1279
+ self._mask_output_when_incomplete = handle.capture_masked
1292
1280
  self._budget = _stream_capture_budget()
1293
1281
  self._charges: dict[object, tuple[int, int]] = {}
1294
1282
  self._annotation_charge_keys: dict[object, dict[int, object]] = {}