openlit 1.34.30__py3-none-any.whl → 1.34.31__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.
Files changed (168) hide show
  1. openlit/__helpers.py +235 -86
  2. openlit/__init__.py +16 -13
  3. openlit/_instrumentors.py +2 -1
  4. openlit/evals/all.py +50 -21
  5. openlit/evals/bias_detection.py +47 -20
  6. openlit/evals/hallucination.py +53 -22
  7. openlit/evals/toxicity.py +50 -21
  8. openlit/evals/utils.py +54 -30
  9. openlit/guard/all.py +61 -19
  10. openlit/guard/prompt_injection.py +34 -14
  11. openlit/guard/restrict_topic.py +46 -15
  12. openlit/guard/sensitive_topic.py +34 -14
  13. openlit/guard/utils.py +58 -22
  14. openlit/instrumentation/ag2/__init__.py +24 -8
  15. openlit/instrumentation/ag2/ag2.py +34 -13
  16. openlit/instrumentation/ag2/async_ag2.py +34 -13
  17. openlit/instrumentation/ag2/utils.py +133 -30
  18. openlit/instrumentation/ai21/__init__.py +43 -14
  19. openlit/instrumentation/ai21/ai21.py +47 -21
  20. openlit/instrumentation/ai21/async_ai21.py +47 -21
  21. openlit/instrumentation/ai21/utils.py +299 -78
  22. openlit/instrumentation/anthropic/__init__.py +21 -4
  23. openlit/instrumentation/anthropic/anthropic.py +28 -17
  24. openlit/instrumentation/anthropic/async_anthropic.py +28 -17
  25. openlit/instrumentation/anthropic/utils.py +145 -35
  26. openlit/instrumentation/assemblyai/__init__.py +11 -2
  27. openlit/instrumentation/assemblyai/assemblyai.py +15 -4
  28. openlit/instrumentation/assemblyai/utils.py +120 -25
  29. openlit/instrumentation/astra/__init__.py +43 -10
  30. openlit/instrumentation/astra/astra.py +28 -5
  31. openlit/instrumentation/astra/async_astra.py +28 -5
  32. openlit/instrumentation/astra/utils.py +151 -55
  33. openlit/instrumentation/azure_ai_inference/__init__.py +43 -10
  34. openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py +53 -21
  35. openlit/instrumentation/azure_ai_inference/azure_ai_inference.py +53 -21
  36. openlit/instrumentation/azure_ai_inference/utils.py +307 -83
  37. openlit/instrumentation/bedrock/__init__.py +21 -4
  38. openlit/instrumentation/bedrock/bedrock.py +63 -25
  39. openlit/instrumentation/bedrock/utils.py +139 -30
  40. openlit/instrumentation/chroma/__init__.py +89 -16
  41. openlit/instrumentation/chroma/chroma.py +28 -6
  42. openlit/instrumentation/chroma/utils.py +167 -51
  43. openlit/instrumentation/cohere/__init__.py +63 -18
  44. openlit/instrumentation/cohere/async_cohere.py +63 -24
  45. openlit/instrumentation/cohere/cohere.py +63 -24
  46. openlit/instrumentation/cohere/utils.py +286 -73
  47. openlit/instrumentation/controlflow/__init__.py +35 -9
  48. openlit/instrumentation/controlflow/controlflow.py +66 -33
  49. openlit/instrumentation/crawl4ai/__init__.py +25 -10
  50. openlit/instrumentation/crawl4ai/async_crawl4ai.py +78 -31
  51. openlit/instrumentation/crawl4ai/crawl4ai.py +78 -31
  52. openlit/instrumentation/crewai/__init__.py +40 -15
  53. openlit/instrumentation/crewai/async_crewai.py +32 -7
  54. openlit/instrumentation/crewai/crewai.py +32 -7
  55. openlit/instrumentation/crewai/utils.py +159 -56
  56. openlit/instrumentation/dynamiq/__init__.py +46 -12
  57. openlit/instrumentation/dynamiq/dynamiq.py +74 -33
  58. openlit/instrumentation/elevenlabs/__init__.py +23 -4
  59. openlit/instrumentation/elevenlabs/async_elevenlabs.py +16 -4
  60. openlit/instrumentation/elevenlabs/elevenlabs.py +16 -4
  61. openlit/instrumentation/elevenlabs/utils.py +128 -25
  62. openlit/instrumentation/embedchain/__init__.py +11 -2
  63. openlit/instrumentation/embedchain/embedchain.py +68 -35
  64. openlit/instrumentation/firecrawl/__init__.py +24 -7
  65. openlit/instrumentation/firecrawl/firecrawl.py +46 -20
  66. openlit/instrumentation/google_ai_studio/__init__.py +45 -10
  67. openlit/instrumentation/google_ai_studio/async_google_ai_studio.py +67 -44
  68. openlit/instrumentation/google_ai_studio/google_ai_studio.py +67 -44
  69. openlit/instrumentation/google_ai_studio/utils.py +180 -67
  70. openlit/instrumentation/gpt4all/__init__.py +22 -7
  71. openlit/instrumentation/gpt4all/gpt4all.py +67 -29
  72. openlit/instrumentation/gpt4all/utils.py +285 -61
  73. openlit/instrumentation/gpu/__init__.py +128 -47
  74. openlit/instrumentation/groq/__init__.py +21 -4
  75. openlit/instrumentation/groq/async_groq.py +33 -21
  76. openlit/instrumentation/groq/groq.py +33 -21
  77. openlit/instrumentation/groq/utils.py +192 -55
  78. openlit/instrumentation/haystack/__init__.py +70 -24
  79. openlit/instrumentation/haystack/async_haystack.py +28 -6
  80. openlit/instrumentation/haystack/haystack.py +28 -6
  81. openlit/instrumentation/haystack/utils.py +196 -74
  82. openlit/instrumentation/julep/__init__.py +69 -19
  83. openlit/instrumentation/julep/async_julep.py +53 -27
  84. openlit/instrumentation/julep/julep.py +53 -28
  85. openlit/instrumentation/langchain/__init__.py +74 -63
  86. openlit/instrumentation/langchain/callback_handler.py +1100 -0
  87. openlit/instrumentation/langchain_community/__init__.py +13 -2
  88. openlit/instrumentation/langchain_community/async_langchain_community.py +23 -5
  89. openlit/instrumentation/langchain_community/langchain_community.py +23 -5
  90. openlit/instrumentation/langchain_community/utils.py +35 -9
  91. openlit/instrumentation/letta/__init__.py +68 -15
  92. openlit/instrumentation/letta/letta.py +99 -54
  93. openlit/instrumentation/litellm/__init__.py +43 -14
  94. openlit/instrumentation/litellm/async_litellm.py +51 -26
  95. openlit/instrumentation/litellm/litellm.py +51 -26
  96. openlit/instrumentation/litellm/utils.py +304 -102
  97. openlit/instrumentation/llamaindex/__init__.py +267 -90
  98. openlit/instrumentation/llamaindex/async_llamaindex.py +28 -6
  99. openlit/instrumentation/llamaindex/llamaindex.py +28 -6
  100. openlit/instrumentation/llamaindex/utils.py +204 -91
  101. openlit/instrumentation/mem0/__init__.py +11 -2
  102. openlit/instrumentation/mem0/mem0.py +50 -29
  103. openlit/instrumentation/milvus/__init__.py +10 -2
  104. openlit/instrumentation/milvus/milvus.py +31 -6
  105. openlit/instrumentation/milvus/utils.py +166 -67
  106. openlit/instrumentation/mistral/__init__.py +63 -18
  107. openlit/instrumentation/mistral/async_mistral.py +63 -24
  108. openlit/instrumentation/mistral/mistral.py +63 -24
  109. openlit/instrumentation/mistral/utils.py +277 -69
  110. openlit/instrumentation/multion/__init__.py +69 -19
  111. openlit/instrumentation/multion/async_multion.py +57 -26
  112. openlit/instrumentation/multion/multion.py +57 -26
  113. openlit/instrumentation/ollama/__init__.py +39 -18
  114. openlit/instrumentation/ollama/async_ollama.py +57 -26
  115. openlit/instrumentation/ollama/ollama.py +57 -26
  116. openlit/instrumentation/ollama/utils.py +226 -50
  117. openlit/instrumentation/openai/__init__.py +156 -32
  118. openlit/instrumentation/openai/async_openai.py +147 -67
  119. openlit/instrumentation/openai/openai.py +150 -67
  120. openlit/instrumentation/openai/utils.py +657 -185
  121. openlit/instrumentation/openai_agents/__init__.py +5 -1
  122. openlit/instrumentation/openai_agents/processor.py +110 -90
  123. openlit/instrumentation/phidata/__init__.py +13 -5
  124. openlit/instrumentation/phidata/phidata.py +67 -32
  125. openlit/instrumentation/pinecone/__init__.py +48 -9
  126. openlit/instrumentation/pinecone/async_pinecone.py +27 -5
  127. openlit/instrumentation/pinecone/pinecone.py +27 -5
  128. openlit/instrumentation/pinecone/utils.py +153 -47
  129. openlit/instrumentation/premai/__init__.py +22 -7
  130. openlit/instrumentation/premai/premai.py +51 -26
  131. openlit/instrumentation/premai/utils.py +246 -59
  132. openlit/instrumentation/pydantic_ai/__init__.py +49 -22
  133. openlit/instrumentation/pydantic_ai/pydantic_ai.py +69 -16
  134. openlit/instrumentation/pydantic_ai/utils.py +89 -24
  135. openlit/instrumentation/qdrant/__init__.py +19 -4
  136. openlit/instrumentation/qdrant/async_qdrant.py +33 -7
  137. openlit/instrumentation/qdrant/qdrant.py +33 -7
  138. openlit/instrumentation/qdrant/utils.py +228 -93
  139. openlit/instrumentation/reka/__init__.py +23 -10
  140. openlit/instrumentation/reka/async_reka.py +17 -11
  141. openlit/instrumentation/reka/reka.py +17 -11
  142. openlit/instrumentation/reka/utils.py +138 -36
  143. openlit/instrumentation/together/__init__.py +44 -12
  144. openlit/instrumentation/together/async_together.py +50 -27
  145. openlit/instrumentation/together/together.py +50 -27
  146. openlit/instrumentation/together/utils.py +301 -71
  147. openlit/instrumentation/transformers/__init__.py +2 -1
  148. openlit/instrumentation/transformers/transformers.py +13 -3
  149. openlit/instrumentation/transformers/utils.py +139 -36
  150. openlit/instrumentation/vertexai/__init__.py +81 -16
  151. openlit/instrumentation/vertexai/async_vertexai.py +33 -15
  152. openlit/instrumentation/vertexai/utils.py +123 -27
  153. openlit/instrumentation/vertexai/vertexai.py +33 -15
  154. openlit/instrumentation/vllm/__init__.py +12 -5
  155. openlit/instrumentation/vllm/utils.py +121 -31
  156. openlit/instrumentation/vllm/vllm.py +16 -10
  157. openlit/otel/events.py +35 -10
  158. openlit/otel/metrics.py +32 -24
  159. openlit/otel/tracing.py +24 -9
  160. openlit/semcov/__init__.py +72 -6
  161. {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/METADATA +2 -1
  162. openlit-1.34.31.dist-info/RECORD +166 -0
  163. openlit/instrumentation/langchain/async_langchain.py +0 -102
  164. openlit/instrumentation/langchain/langchain.py +0 -102
  165. openlit/instrumentation/langchain/utils.py +0 -252
  166. openlit-1.34.30.dist-info/RECORD +0 -168
  167. {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/LICENSE +0 -0
  168. {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/WHEEL +0 -0
@@ -4,48 +4,101 @@ Module for monitoring Pydantic AI API calls.
4
4
 
5
5
  from openlit.instrumentation.pydantic_ai.utils import (
6
6
  common_agent_run,
7
- common_agent_create
7
+ common_agent_create,
8
8
  )
9
9
 
10
- def agent_create(version, environment, application_name,
11
- tracer, pricing_info, capture_message_content, metrics, disable_metrics):
12
10
 
11
+ def agent_create(
12
+ version,
13
+ environment,
14
+ application_name,
15
+ tracer,
16
+ pricing_info,
17
+ capture_message_content,
18
+ metrics,
19
+ disable_metrics,
20
+ ):
13
21
  """
14
22
  Generates a telemetry wrapper for GenAI function call
15
23
  """
16
24
 
17
25
  def wrapper(wrapped, instance, args, kwargs):
18
26
  response = wrapped(*args, **kwargs)
19
- return common_agent_create(wrapped, instance, args, kwargs, tracer,
20
- version, environment, application_name,
21
- capture_message_content, response=response)
27
+ return common_agent_create(
28
+ wrapped,
29
+ instance,
30
+ args,
31
+ kwargs,
32
+ tracer,
33
+ version,
34
+ environment,
35
+ application_name,
36
+ capture_message_content,
37
+ response=response,
38
+ )
22
39
 
23
40
  return wrapper
24
41
 
25
- def agent_run(version, environment, application_name,
26
- tracer, pricing_info, capture_message_content, metrics, disable_metrics):
42
+
43
+ def agent_run(
44
+ version,
45
+ environment,
46
+ application_name,
47
+ tracer,
48
+ pricing_info,
49
+ capture_message_content,
50
+ metrics,
51
+ disable_metrics,
52
+ ):
27
53
  """
28
54
  Generates a telemetry wrapper for GenAI function call
29
55
  """
30
56
 
31
57
  def wrapper(wrapped, instance, args, kwargs):
32
58
  response = wrapped(*args, **kwargs)
33
- return common_agent_run(wrapped, instance, args, kwargs, tracer,
34
- version, environment, application_name,
35
- capture_message_content, response=response)
59
+ return common_agent_run(
60
+ wrapped,
61
+ instance,
62
+ args,
63
+ kwargs,
64
+ tracer,
65
+ version,
66
+ environment,
67
+ application_name,
68
+ capture_message_content,
69
+ response=response,
70
+ )
36
71
 
37
72
  return wrapper
38
73
 
39
- def async_agent_run(version, environment, application_name,
40
- tracer, pricing_info, capture_message_content, metrics, disable_metrics):
74
+
75
+ def async_agent_run(
76
+ version,
77
+ environment,
78
+ application_name,
79
+ tracer,
80
+ pricing_info,
81
+ capture_message_content,
82
+ metrics,
83
+ disable_metrics,
84
+ ):
41
85
  """
42
86
  Generates a telemetry wrapper for GenAI function call
43
87
  """
44
88
 
45
89
  async def wrapper(wrapped, instance, args, kwargs):
46
90
  response = await wrapped(*args, **kwargs)
47
- return common_agent_run(wrapped, instance, args, kwargs, tracer,
48
- version, environment, application_name,
49
- capture_message_content, response=response)
91
+ return common_agent_run(
92
+ wrapped,
93
+ instance,
94
+ args,
95
+ kwargs,
96
+ tracer,
97
+ version,
98
+ environment,
99
+ application_name,
100
+ capture_message_content,
101
+ response=response,
102
+ )
50
103
 
51
104
  return wrapper
@@ -1,27 +1,42 @@
1
1
  """
2
2
  Pydantic AI OpenTelemetry instrumentation utility functions
3
3
  """
4
+
4
5
  import logging
5
- from opentelemetry.sdk.resources import SERVICE_NAME, TELEMETRY_SDK_NAME, DEPLOYMENT_ENVIRONMENT
6
- from opentelemetry.trace import Status, StatusCode, SpanKind
7
- from openlit.__helpers import (
8
- handle_exception
6
+ from opentelemetry.sdk.resources import (
7
+ SERVICE_NAME,
8
+ TELEMETRY_SDK_NAME,
9
+ DEPLOYMENT_ENVIRONMENT,
9
10
  )
11
+ from opentelemetry.trace import Status, StatusCode, SpanKind
12
+ from openlit.__helpers import handle_exception
10
13
  from openlit.semcov import SemanticConvention
11
14
 
12
15
  # Initialize logger for logging potential issues and operations
13
16
  logger = logging.getLogger(__name__)
14
17
 
15
- def set_span_attributes(span, version, operation_name, environment,
16
- application_name, server_address, server_port, request_model, agent_name):
18
+
19
+ def set_span_attributes(
20
+ span,
21
+ version,
22
+ operation_name,
23
+ environment,
24
+ application_name,
25
+ server_address,
26
+ server_port,
27
+ request_model,
28
+ agent_name,
29
+ ):
17
30
  """
18
31
  Set common OpenTelemetry span attributes for Pydantic AI operations.
19
32
  """
20
33
 
21
34
  # Set Span attributes (OTel Semconv)
22
- span.set_attribute(TELEMETRY_SDK_NAME, 'openlit')
35
+ span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
23
36
  span.set_attribute(SemanticConvention.GEN_AI_OPERATION, operation_name)
24
- span.set_attribute(SemanticConvention.GEN_AI_SYSTEM, SemanticConvention.GEN_AI_SYSTEM_PYDANTIC_AI)
37
+ span.set_attribute(
38
+ SemanticConvention.GEN_AI_SYSTEM, SemanticConvention.GEN_AI_SYSTEM_PYDANTIC_AI
39
+ )
25
40
  span.set_attribute(SemanticConvention.GEN_AI_AGENT_NAME, agent_name)
26
41
  span.set_attribute(SemanticConvention.SERVER_ADDRESS, server_address)
27
42
  span.set_attribute(SemanticConvention.SERVER_PORT, server_port)
@@ -32,8 +47,19 @@ def set_span_attributes(span, version, operation_name, environment,
32
47
  span.set_attribute(SERVICE_NAME, application_name)
33
48
  span.set_attribute(SemanticConvention.GEN_AI_SDK_VERSION, version)
34
49
 
35
- def common_agent_run(wrapped, instance, args, kwargs, tracer, version, environment, application_name,
36
- capture_message_content, response):
50
+
51
+ def common_agent_run(
52
+ wrapped,
53
+ instance,
54
+ args,
55
+ kwargs,
56
+ tracer,
57
+ version,
58
+ environment,
59
+ application_name,
60
+ capture_message_content,
61
+ response,
62
+ ):
37
63
  """
38
64
  Handle telemetry for Pydantic AI agent run operations.
39
65
  """
@@ -41,13 +67,27 @@ def common_agent_run(wrapped, instance, args, kwargs, tracer, version, environme
41
67
  server_address, server_port = instance.model.base_url, 443
42
68
  agent_name = instance.name or "pydantic_agent"
43
69
  request_model = str(instance.model.model_name)
44
- span_name = f'{SemanticConvention.GEN_AI_OPERATION_TYPE_EXECUTE_AGENT_TASK} {agent_name}'
70
+ span_name = (
71
+ f"{SemanticConvention.GEN_AI_OPERATION_TYPE_EXECUTE_AGENT_TASK} {agent_name}"
72
+ )
45
73
 
46
74
  with tracer.start_as_current_span(span_name, kind=SpanKind.CLIENT) as span:
47
75
  try:
48
- set_span_attributes(span, version, SemanticConvention.GEN_AI_OPERATION_TYPE_EXECUTE_AGENT_TASK,
49
- environment, application_name, server_address, server_port, request_model, agent_name)
50
- span.set_attribute(SemanticConvention.GEN_AI_AGENT_DESCRIPTION, str(instance._system_prompts))
76
+ set_span_attributes(
77
+ span,
78
+ version,
79
+ SemanticConvention.GEN_AI_OPERATION_TYPE_EXECUTE_AGENT_TASK,
80
+ environment,
81
+ application_name,
82
+ server_address,
83
+ server_port,
84
+ request_model,
85
+ agent_name,
86
+ )
87
+ span.set_attribute(
88
+ SemanticConvention.GEN_AI_AGENT_DESCRIPTION,
89
+ str(instance._system_prompts),
90
+ )
51
91
  span.set_attribute(SemanticConvention.GEN_AI_RESPONSE_MODEL, request_model)
52
92
 
53
93
  if capture_message_content:
@@ -64,25 +104,50 @@ def common_agent_run(wrapped, instance, args, kwargs, tracer, version, environme
64
104
 
65
105
  except Exception as e:
66
106
  handle_exception(span, e)
67
- logger.error('Error in trace creation: %s', e)
107
+ logger.error("Error in trace creation: %s", e)
68
108
  return response
69
109
 
70
- def common_agent_create(wrapped, instance, args, kwargs, tracer, version, environment, application_name,
71
- capture_message_content, response):
110
+
111
+ def common_agent_create(
112
+ wrapped,
113
+ instance,
114
+ args,
115
+ kwargs,
116
+ tracer,
117
+ version,
118
+ environment,
119
+ application_name,
120
+ capture_message_content,
121
+ response,
122
+ ):
72
123
  """
73
124
  Handle telemetry for Pydantic AI agent creation operations.
74
125
  """
75
126
 
76
- server_address, server_port = '127.0.0.1', 80
127
+ server_address, server_port = "127.0.0.1", 80
77
128
  agent_name = kwargs.get("name", "pydantic_agent")
78
- span_name = f'{SemanticConvention.GEN_AI_OPERATION_TYPE_CREATE_AGENT} {agent_name}'
129
+ span_name = f"{SemanticConvention.GEN_AI_OPERATION_TYPE_CREATE_AGENT} {agent_name}"
79
130
 
80
131
  with tracer.start_as_current_span(span_name, kind=SpanKind.CLIENT) as span:
81
132
  try:
82
- request_model = args[0] or kwargs.get("model", "google-gla:gemini-1.5-flash")
83
- set_span_attributes(span, version, SemanticConvention.GEN_AI_OPERATION_TYPE_CREATE_AGENT,
84
- environment, application_name, server_address, server_port, request_model, agent_name)
85
- span.set_attribute(SemanticConvention.GEN_AI_AGENT_DESCRIPTION, str(kwargs.get("system_prompt", "")))
133
+ request_model = args[0] or kwargs.get(
134
+ "model", "google-gla:gemini-1.5-flash"
135
+ )
136
+ set_span_attributes(
137
+ span,
138
+ version,
139
+ SemanticConvention.GEN_AI_OPERATION_TYPE_CREATE_AGENT,
140
+ environment,
141
+ application_name,
142
+ server_address,
143
+ server_port,
144
+ request_model,
145
+ agent_name,
146
+ )
147
+ span.set_attribute(
148
+ SemanticConvention.GEN_AI_AGENT_DESCRIPTION,
149
+ str(kwargs.get("system_prompt", "")),
150
+ )
86
151
  span.set_attribute(SemanticConvention.GEN_AI_RESPONSE_MODEL, request_model)
87
152
 
88
153
  span.set_status(Status(StatusCode.OK))
@@ -91,5 +156,5 @@ def common_agent_create(wrapped, instance, args, kwargs, tracer, version, enviro
91
156
 
92
157
  except Exception as e:
93
158
  handle_exception(span, e)
94
- logger.error('Error in trace creation: %s', e)
159
+ logger.error("Error in trace creation: %s", e)
95
160
  return response
@@ -36,6 +36,7 @@ QDRANT_OPERATIONS = [
36
36
  ("query_points", "qdrant.query_points"),
37
37
  ]
38
38
 
39
+
39
40
  class QdrantInstrumentor(BaseInstrumentor):
40
41
  """
41
42
  An instrumentor for Qdrant client library.
@@ -60,8 +61,15 @@ class QdrantInstrumentor(BaseInstrumentor):
60
61
  "qdrant_client",
61
62
  f"QdrantClient.{method_name}",
62
63
  general_wrap(
63
- endpoint, version, environment, application_name, tracer,
64
- pricing_info, capture_message_content, metrics, disable_metrics
64
+ endpoint,
65
+ version,
66
+ environment,
67
+ application_name,
68
+ tracer,
69
+ pricing_info,
70
+ capture_message_content,
71
+ metrics,
72
+ disable_metrics,
65
73
  ),
66
74
  )
67
75
 
@@ -71,8 +79,15 @@ class QdrantInstrumentor(BaseInstrumentor):
71
79
  "qdrant_client",
72
80
  f"AsyncQdrantClient.{method_name}",
73
81
  async_general_wrap(
74
- endpoint, version, environment, application_name, tracer,
75
- pricing_info, capture_message_content, metrics, disable_metrics
82
+ endpoint,
83
+ version,
84
+ environment,
85
+ application_name,
86
+ tracer,
87
+ pricing_info,
88
+ capture_message_content,
89
+ metrics,
90
+ disable_metrics,
76
91
  ),
77
92
  )
78
93
 
@@ -7,10 +7,24 @@ import time
7
7
  from opentelemetry.trace import SpanKind
8
8
  from opentelemetry import context as context_api
9
9
  from openlit.__helpers import handle_exception
10
- from openlit.instrumentation.qdrant.utils import DB_OPERATION_MAP, process_qdrant_response, set_server_address_and_port
10
+ from openlit.instrumentation.qdrant.utils import (
11
+ DB_OPERATION_MAP,
12
+ process_qdrant_response,
13
+ set_server_address_and_port,
14
+ )
11
15
 
12
- def async_general_wrap(gen_ai_endpoint, version, environment, application_name, tracer,
13
- pricing_info, capture_message_content, metrics, disable_metrics):
16
+
17
+ def async_general_wrap(
18
+ gen_ai_endpoint,
19
+ version,
20
+ environment,
21
+ application_name,
22
+ tracer,
23
+ pricing_info,
24
+ capture_message_content,
25
+ metrics,
26
+ disable_metrics,
27
+ ):
14
28
  """
15
29
  Generates a telemetry wrapper for Pinecone function calls.
16
30
  """
@@ -41,10 +55,22 @@ def async_general_wrap(gen_ai_endpoint, version, environment, application_name,
41
55
  try:
42
56
  # Process response with endpoint information
43
57
  response = process_qdrant_response(
44
- response, db_operation, server_address, server_port,
45
- environment, application_name, metrics, start_time, span,
46
- capture_message_content, disable_metrics, version,
47
- instance=instance, args=args, endpoint=gen_ai_endpoint, **kwargs
58
+ response,
59
+ db_operation,
60
+ server_address,
61
+ server_port,
62
+ environment,
63
+ application_name,
64
+ metrics,
65
+ start_time,
66
+ span,
67
+ capture_message_content,
68
+ disable_metrics,
69
+ version,
70
+ instance=instance,
71
+ args=args,
72
+ endpoint=gen_ai_endpoint,
73
+ **kwargs,
48
74
  )
49
75
 
50
76
  except Exception as e:
@@ -7,10 +7,24 @@ import time
7
7
  from opentelemetry.trace import SpanKind
8
8
  from opentelemetry import context as context_api
9
9
  from openlit.__helpers import handle_exception
10
- from openlit.instrumentation.qdrant.utils import DB_OPERATION_MAP, process_qdrant_response, set_server_address_and_port
10
+ from openlit.instrumentation.qdrant.utils import (
11
+ DB_OPERATION_MAP,
12
+ process_qdrant_response,
13
+ set_server_address_and_port,
14
+ )
11
15
 
12
- def general_wrap(gen_ai_endpoint, version, environment, application_name, tracer,
13
- pricing_info, capture_message_content, metrics, disable_metrics):
16
+
17
+ def general_wrap(
18
+ gen_ai_endpoint,
19
+ version,
20
+ environment,
21
+ application_name,
22
+ tracer,
23
+ pricing_info,
24
+ capture_message_content,
25
+ metrics,
26
+ disable_metrics,
27
+ ):
14
28
  """
15
29
  Generates a telemetry wrapper for Pinecone function calls.
16
30
  """
@@ -41,10 +55,22 @@ def general_wrap(gen_ai_endpoint, version, environment, application_name, tracer
41
55
  try:
42
56
  # Process response with endpoint information
43
57
  response = process_qdrant_response(
44
- response, db_operation, server_address, server_port,
45
- environment, application_name, metrics, start_time, span,
46
- capture_message_content, disable_metrics, version,
47
- instance=instance, args=args, endpoint=gen_ai_endpoint, **kwargs
58
+ response,
59
+ db_operation,
60
+ server_address,
61
+ server_port,
62
+ environment,
63
+ application_name,
64
+ metrics,
65
+ start_time,
66
+ span,
67
+ capture_message_content,
68
+ disable_metrics,
69
+ version,
70
+ instance=instance,
71
+ args=args,
72
+ endpoint=gen_ai_endpoint,
73
+ **kwargs,
48
74
  )
49
75
 
50
76
  except Exception as e: