openlit 1.34.13__py3-none-any.whl → 1.34.15__py3-none-any.whl

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,4 +1,3 @@
1
- # pylint: disable=useless-return, bad-staticmethod-argument, disable=duplicate-code
2
1
  """Initializer of Auto Instrumentation of LiteLLM Functions"""
3
2
 
4
3
  from typing import Collection
@@ -17,15 +16,15 @@ _instruments = ("litellm >= 1.52.6",)
17
16
 
18
17
  class LiteLLMInstrumentor(BaseInstrumentor):
19
18
  """
20
- An instrumentor for LiteLLM's client library.
19
+ An instrumentor for LiteLLM client library.
21
20
  """
22
21
 
23
22
  def instrumentation_dependencies(self) -> Collection[str]:
24
23
  return _instruments
25
24
 
26
25
  def _instrument(self, **kwargs):
27
- application_name = kwargs.get("application_name", "default_application")
28
- environment = kwargs.get("environment", "default_environment")
26
+ application_name = kwargs.get("application_name", "default")
27
+ environment = kwargs.get("environment", "default")
29
28
  tracer = kwargs.get("tracer")
30
29
  metrics = kwargs.get("metrics_dict")
31
30
  pricing_info = kwargs.get("pricing_info", {})
@@ -33,7 +32,7 @@ class LiteLLMInstrumentor(BaseInstrumentor):
33
32
  disable_metrics = kwargs.get("disable_metrics")
34
33
  version = importlib.metadata.version("litellm")
35
34
 
36
- # completion
35
+ # Chat completions
37
36
  wrap_function_wrapper(
38
37
  "litellm",
39
38
  "completion",
@@ -41,6 +40,7 @@ class LiteLLMInstrumentor(BaseInstrumentor):
41
40
  tracer, pricing_info, capture_message_content, metrics, disable_metrics),
42
41
  )
43
42
 
43
+ # Async chat completions
44
44
  wrap_function_wrapper(
45
45
  "litellm",
46
46
  "acompletion",
@@ -48,6 +48,7 @@ class LiteLLMInstrumentor(BaseInstrumentor):
48
48
  tracer, pricing_info, capture_message_content, metrics, disable_metrics),
49
49
  )
50
50
 
51
+ # Embeddings
51
52
  wrap_function_wrapper(
52
53
  "litellm",
53
54
  "embedding",
@@ -55,6 +56,7 @@ class LiteLLMInstrumentor(BaseInstrumentor):
55
56
  tracer, pricing_info, capture_message_content, metrics, disable_metrics),
56
57
  )
57
58
 
59
+ # Async embeddings
58
60
  wrap_function_wrapper(
59
61
  "litellm",
60
62
  "aembedding",
@@ -63,5 +65,4 @@ class LiteLLMInstrumentor(BaseInstrumentor):
63
65
  )
64
66
 
65
67
  def _uninstrument(self, **kwargs):
66
- # Proper uninstrumentation logic to revert patched methods
67
68
  pass