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.
- openlit/__helpers.py +235 -86
- openlit/__init__.py +16 -13
- openlit/_instrumentors.py +2 -1
- openlit/evals/all.py +50 -21
- openlit/evals/bias_detection.py +47 -20
- openlit/evals/hallucination.py +53 -22
- openlit/evals/toxicity.py +50 -21
- openlit/evals/utils.py +54 -30
- openlit/guard/all.py +61 -19
- openlit/guard/prompt_injection.py +34 -14
- openlit/guard/restrict_topic.py +46 -15
- openlit/guard/sensitive_topic.py +34 -14
- openlit/guard/utils.py +58 -22
- openlit/instrumentation/ag2/__init__.py +24 -8
- openlit/instrumentation/ag2/ag2.py +34 -13
- openlit/instrumentation/ag2/async_ag2.py +34 -13
- openlit/instrumentation/ag2/utils.py +133 -30
- openlit/instrumentation/ai21/__init__.py +43 -14
- openlit/instrumentation/ai21/ai21.py +47 -21
- openlit/instrumentation/ai21/async_ai21.py +47 -21
- openlit/instrumentation/ai21/utils.py +299 -78
- openlit/instrumentation/anthropic/__init__.py +21 -4
- openlit/instrumentation/anthropic/anthropic.py +28 -17
- openlit/instrumentation/anthropic/async_anthropic.py +28 -17
- openlit/instrumentation/anthropic/utils.py +145 -35
- openlit/instrumentation/assemblyai/__init__.py +11 -2
- openlit/instrumentation/assemblyai/assemblyai.py +15 -4
- openlit/instrumentation/assemblyai/utils.py +120 -25
- openlit/instrumentation/astra/__init__.py +43 -10
- openlit/instrumentation/astra/astra.py +28 -5
- openlit/instrumentation/astra/async_astra.py +28 -5
- openlit/instrumentation/astra/utils.py +151 -55
- openlit/instrumentation/azure_ai_inference/__init__.py +43 -10
- openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py +53 -21
- openlit/instrumentation/azure_ai_inference/azure_ai_inference.py +53 -21
- openlit/instrumentation/azure_ai_inference/utils.py +307 -83
- openlit/instrumentation/bedrock/__init__.py +21 -4
- openlit/instrumentation/bedrock/bedrock.py +63 -25
- openlit/instrumentation/bedrock/utils.py +139 -30
- openlit/instrumentation/chroma/__init__.py +89 -16
- openlit/instrumentation/chroma/chroma.py +28 -6
- openlit/instrumentation/chroma/utils.py +167 -51
- openlit/instrumentation/cohere/__init__.py +63 -18
- openlit/instrumentation/cohere/async_cohere.py +63 -24
- openlit/instrumentation/cohere/cohere.py +63 -24
- openlit/instrumentation/cohere/utils.py +286 -73
- openlit/instrumentation/controlflow/__init__.py +35 -9
- openlit/instrumentation/controlflow/controlflow.py +66 -33
- openlit/instrumentation/crawl4ai/__init__.py +25 -10
- openlit/instrumentation/crawl4ai/async_crawl4ai.py +78 -31
- openlit/instrumentation/crawl4ai/crawl4ai.py +78 -31
- openlit/instrumentation/crewai/__init__.py +40 -15
- openlit/instrumentation/crewai/async_crewai.py +32 -7
- openlit/instrumentation/crewai/crewai.py +32 -7
- openlit/instrumentation/crewai/utils.py +159 -56
- openlit/instrumentation/dynamiq/__init__.py +46 -12
- openlit/instrumentation/dynamiq/dynamiq.py +74 -33
- openlit/instrumentation/elevenlabs/__init__.py +23 -4
- openlit/instrumentation/elevenlabs/async_elevenlabs.py +16 -4
- openlit/instrumentation/elevenlabs/elevenlabs.py +16 -4
- openlit/instrumentation/elevenlabs/utils.py +128 -25
- openlit/instrumentation/embedchain/__init__.py +11 -2
- openlit/instrumentation/embedchain/embedchain.py +68 -35
- openlit/instrumentation/firecrawl/__init__.py +24 -7
- openlit/instrumentation/firecrawl/firecrawl.py +46 -20
- openlit/instrumentation/google_ai_studio/__init__.py +45 -10
- openlit/instrumentation/google_ai_studio/async_google_ai_studio.py +67 -44
- openlit/instrumentation/google_ai_studio/google_ai_studio.py +67 -44
- openlit/instrumentation/google_ai_studio/utils.py +180 -67
- openlit/instrumentation/gpt4all/__init__.py +22 -7
- openlit/instrumentation/gpt4all/gpt4all.py +67 -29
- openlit/instrumentation/gpt4all/utils.py +285 -61
- openlit/instrumentation/gpu/__init__.py +128 -47
- openlit/instrumentation/groq/__init__.py +21 -4
- openlit/instrumentation/groq/async_groq.py +33 -21
- openlit/instrumentation/groq/groq.py +33 -21
- openlit/instrumentation/groq/utils.py +192 -55
- openlit/instrumentation/haystack/__init__.py +70 -24
- openlit/instrumentation/haystack/async_haystack.py +28 -6
- openlit/instrumentation/haystack/haystack.py +28 -6
- openlit/instrumentation/haystack/utils.py +196 -74
- openlit/instrumentation/julep/__init__.py +69 -19
- openlit/instrumentation/julep/async_julep.py +53 -27
- openlit/instrumentation/julep/julep.py +53 -28
- openlit/instrumentation/langchain/__init__.py +74 -63
- openlit/instrumentation/langchain/callback_handler.py +1100 -0
- openlit/instrumentation/langchain_community/__init__.py +13 -2
- openlit/instrumentation/langchain_community/async_langchain_community.py +23 -5
- openlit/instrumentation/langchain_community/langchain_community.py +23 -5
- openlit/instrumentation/langchain_community/utils.py +35 -9
- openlit/instrumentation/letta/__init__.py +68 -15
- openlit/instrumentation/letta/letta.py +99 -54
- openlit/instrumentation/litellm/__init__.py +43 -14
- openlit/instrumentation/litellm/async_litellm.py +51 -26
- openlit/instrumentation/litellm/litellm.py +51 -26
- openlit/instrumentation/litellm/utils.py +304 -102
- openlit/instrumentation/llamaindex/__init__.py +267 -90
- openlit/instrumentation/llamaindex/async_llamaindex.py +28 -6
- openlit/instrumentation/llamaindex/llamaindex.py +28 -6
- openlit/instrumentation/llamaindex/utils.py +204 -91
- openlit/instrumentation/mem0/__init__.py +11 -2
- openlit/instrumentation/mem0/mem0.py +50 -29
- openlit/instrumentation/milvus/__init__.py +10 -2
- openlit/instrumentation/milvus/milvus.py +31 -6
- openlit/instrumentation/milvus/utils.py +166 -67
- openlit/instrumentation/mistral/__init__.py +63 -18
- openlit/instrumentation/mistral/async_mistral.py +63 -24
- openlit/instrumentation/mistral/mistral.py +63 -24
- openlit/instrumentation/mistral/utils.py +277 -69
- openlit/instrumentation/multion/__init__.py +69 -19
- openlit/instrumentation/multion/async_multion.py +57 -26
- openlit/instrumentation/multion/multion.py +57 -26
- openlit/instrumentation/ollama/__init__.py +39 -18
- openlit/instrumentation/ollama/async_ollama.py +57 -26
- openlit/instrumentation/ollama/ollama.py +57 -26
- openlit/instrumentation/ollama/utils.py +226 -50
- openlit/instrumentation/openai/__init__.py +156 -32
- openlit/instrumentation/openai/async_openai.py +147 -67
- openlit/instrumentation/openai/openai.py +150 -67
- openlit/instrumentation/openai/utils.py +657 -185
- openlit/instrumentation/openai_agents/__init__.py +5 -1
- openlit/instrumentation/openai_agents/processor.py +110 -90
- openlit/instrumentation/phidata/__init__.py +13 -5
- openlit/instrumentation/phidata/phidata.py +67 -32
- openlit/instrumentation/pinecone/__init__.py +48 -9
- openlit/instrumentation/pinecone/async_pinecone.py +27 -5
- openlit/instrumentation/pinecone/pinecone.py +27 -5
- openlit/instrumentation/pinecone/utils.py +153 -47
- openlit/instrumentation/premai/__init__.py +22 -7
- openlit/instrumentation/premai/premai.py +51 -26
- openlit/instrumentation/premai/utils.py +246 -59
- openlit/instrumentation/pydantic_ai/__init__.py +49 -22
- openlit/instrumentation/pydantic_ai/pydantic_ai.py +69 -16
- openlit/instrumentation/pydantic_ai/utils.py +89 -24
- openlit/instrumentation/qdrant/__init__.py +19 -4
- openlit/instrumentation/qdrant/async_qdrant.py +33 -7
- openlit/instrumentation/qdrant/qdrant.py +33 -7
- openlit/instrumentation/qdrant/utils.py +228 -93
- openlit/instrumentation/reka/__init__.py +23 -10
- openlit/instrumentation/reka/async_reka.py +17 -11
- openlit/instrumentation/reka/reka.py +17 -11
- openlit/instrumentation/reka/utils.py +138 -36
- openlit/instrumentation/together/__init__.py +44 -12
- openlit/instrumentation/together/async_together.py +50 -27
- openlit/instrumentation/together/together.py +50 -27
- openlit/instrumentation/together/utils.py +301 -71
- openlit/instrumentation/transformers/__init__.py +2 -1
- openlit/instrumentation/transformers/transformers.py +13 -3
- openlit/instrumentation/transformers/utils.py +139 -36
- openlit/instrumentation/vertexai/__init__.py +81 -16
- openlit/instrumentation/vertexai/async_vertexai.py +33 -15
- openlit/instrumentation/vertexai/utils.py +123 -27
- openlit/instrumentation/vertexai/vertexai.py +33 -15
- openlit/instrumentation/vllm/__init__.py +12 -5
- openlit/instrumentation/vllm/utils.py +121 -31
- openlit/instrumentation/vllm/vllm.py +16 -10
- openlit/otel/events.py +35 -10
- openlit/otel/metrics.py +32 -24
- openlit/otel/tracing.py +24 -9
- openlit/semcov/__init__.py +72 -6
- {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/METADATA +2 -1
- openlit-1.34.31.dist-info/RECORD +166 -0
- openlit/instrumentation/langchain/async_langchain.py +0 -102
- openlit/instrumentation/langchain/langchain.py +0 -102
- openlit/instrumentation/langchain/utils.py +0 -252
- openlit-1.34.30.dist-info/RECORD +0 -168
- {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/LICENSE +0 -0
- {openlit-1.34.30.dist-info → openlit-1.34.31.dist-info}/WHEEL +0 -0
openlit/otel/metrics.py
CHANGED
@@ -2,33 +2,35 @@
|
|
2
2
|
"""
|
3
3
|
Setups up OpenTelemetry Meter
|
4
4
|
"""
|
5
|
+
|
5
6
|
import os
|
6
7
|
from opentelemetry import metrics
|
7
8
|
from opentelemetry.sdk.metrics import MeterProvider
|
8
|
-
from opentelemetry.sdk.metrics.export import
|
9
|
-
|
9
|
+
from opentelemetry.sdk.metrics.export import (
|
10
|
+
PeriodicExportingMetricReader,
|
11
|
+
ConsoleMetricExporter,
|
12
|
+
)
|
13
|
+
from opentelemetry.sdk.resources import (
|
14
|
+
SERVICE_NAME,
|
15
|
+
TELEMETRY_SDK_NAME,
|
16
|
+
DEPLOYMENT_ENVIRONMENT,
|
17
|
+
)
|
10
18
|
from opentelemetry.sdk.resources import Resource
|
11
19
|
from openlit.semcov import SemanticConvention
|
12
20
|
|
13
21
|
if os.environ.get("OTEL_EXPORTER_OTLP_PROTOCOL") == "grpc":
|
14
|
-
from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import
|
22
|
+
from opentelemetry.exporter.otlp.proto.grpc.metric_exporter import (
|
23
|
+
OTLPMetricExporter,
|
24
|
+
)
|
15
25
|
else:
|
16
|
-
from opentelemetry.exporter.otlp.proto.http.metric_exporter import
|
26
|
+
from opentelemetry.exporter.otlp.proto.http.metric_exporter import (
|
27
|
+
OTLPMetricExporter,
|
28
|
+
)
|
17
29
|
|
18
30
|
# Global flag to check if the meter provider initialization is complete.
|
19
31
|
METER_SET = False
|
20
32
|
|
21
|
-
_DB_CLIENT_OPERATION_DURATION_BUCKETS = [
|
22
|
-
0.001,
|
23
|
-
0.005,
|
24
|
-
0.01,
|
25
|
-
0.05,
|
26
|
-
0.1,
|
27
|
-
0.5,
|
28
|
-
1,
|
29
|
-
5,
|
30
|
-
10
|
31
|
-
]
|
33
|
+
_DB_CLIENT_OPERATION_DURATION_BUCKETS = [0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10]
|
32
34
|
|
33
35
|
_GEN_AI_CLIENT_OPERATION_DURATION_BUCKETS = [
|
34
36
|
0.01,
|
@@ -60,7 +62,7 @@ _GEN_AI_SERVER_TBT = [
|
|
60
62
|
0.5,
|
61
63
|
0.75,
|
62
64
|
1.0,
|
63
|
-
2.5
|
65
|
+
2.5,
|
64
66
|
]
|
65
67
|
|
66
68
|
_GEN_AI_SERVER_TFTT = [
|
@@ -79,7 +81,7 @@ _GEN_AI_SERVER_TFTT = [
|
|
79
81
|
2.5,
|
80
82
|
5.0,
|
81
83
|
7.5,
|
82
|
-
10.0
|
84
|
+
10.0,
|
83
85
|
]
|
84
86
|
|
85
87
|
_GEN_AI_CLIENT_TOKEN_USAGE_BUCKETS = [
|
@@ -99,6 +101,7 @@ _GEN_AI_CLIENT_TOKEN_USAGE_BUCKETS = [
|
|
99
101
|
67108864,
|
100
102
|
]
|
101
103
|
|
104
|
+
|
102
105
|
def setup_meter(application_name, environment, meter, otlp_endpoint, otlp_headers):
|
103
106
|
"""
|
104
107
|
Sets up OpenTelemetry metrics with a counter for total requests.
|
@@ -118,10 +121,12 @@ def setup_meter(application_name, environment, meter, otlp_endpoint, otlp_header
|
|
118
121
|
try:
|
119
122
|
if meter is None and not METER_SET:
|
120
123
|
# Create a resource with the service name attribute.
|
121
|
-
resource = Resource.create(
|
122
|
-
|
123
|
-
|
124
|
-
|
124
|
+
resource = Resource.create(
|
125
|
+
attributes={
|
126
|
+
SERVICE_NAME: application_name,
|
127
|
+
DEPLOYMENT_ENVIRONMENT: environment,
|
128
|
+
TELEMETRY_SDK_NAME: "openlit",
|
129
|
+
}
|
125
130
|
)
|
126
131
|
|
127
132
|
# Only set environment variables if you have a non-None value.
|
@@ -130,7 +135,9 @@ def setup_meter(application_name, environment, meter, otlp_endpoint, otlp_header
|
|
130
135
|
|
131
136
|
if otlp_headers is not None:
|
132
137
|
if isinstance(otlp_headers, dict):
|
133
|
-
headers_str =
|
138
|
+
headers_str = ",".join(
|
139
|
+
f"{key}={value}" for key, value in otlp_headers.items()
|
140
|
+
)
|
134
141
|
else:
|
135
142
|
headers_str = otlp_headers
|
136
143
|
# Now, we have either converted the dict to a string or used the provided string.
|
@@ -144,7 +151,9 @@ def setup_meter(application_name, environment, meter, otlp_endpoint, otlp_header
|
|
144
151
|
|
145
152
|
metric_reader = PeriodicExportingMetricReader(metric_exporter)
|
146
153
|
|
147
|
-
meter_provider = MeterProvider(
|
154
|
+
meter_provider = MeterProvider(
|
155
|
+
resource=resource, metric_readers=[metric_reader]
|
156
|
+
)
|
148
157
|
|
149
158
|
metrics.set_meter_provider(meter_provider)
|
150
159
|
|
@@ -185,7 +194,6 @@ def setup_meter(application_name, environment, meter, otlp_endpoint, otlp_header
|
|
185
194
|
unit="s",
|
186
195
|
explicit_bucket_boundaries_advisory=_DB_CLIENT_OPERATION_DURATION_BUCKETS,
|
187
196
|
),
|
188
|
-
|
189
197
|
# Extra
|
190
198
|
"genai_requests": meter.create_counter(
|
191
199
|
name=SemanticConvention.GEN_AI_REQUESTS,
|
openlit/otel/tracing.py
CHANGED
@@ -4,7 +4,11 @@ Setups up OpenTelemetry tracer
|
|
4
4
|
|
5
5
|
import os
|
6
6
|
from opentelemetry import trace
|
7
|
-
from opentelemetry.sdk.resources import
|
7
|
+
from opentelemetry.sdk.resources import (
|
8
|
+
SERVICE_NAME,
|
9
|
+
TELEMETRY_SDK_NAME,
|
10
|
+
DEPLOYMENT_ENVIRONMENT,
|
11
|
+
)
|
8
12
|
from opentelemetry.sdk.resources import Resource
|
9
13
|
from opentelemetry.sdk.trace import TracerProvider
|
10
14
|
from opentelemetry.sdk.trace.export import BatchSpanProcessor, SimpleSpanProcessor
|
@@ -18,7 +22,10 @@ else:
|
|
18
22
|
# Global flag to check if the tracer provider initialization is complete.
|
19
23
|
TRACER_SET = False
|
20
24
|
|
21
|
-
|
25
|
+
|
26
|
+
def setup_tracing(
|
27
|
+
application_name, environment, tracer, otlp_endpoint, otlp_headers, disable_batch
|
28
|
+
):
|
22
29
|
"""
|
23
30
|
Sets up tracing with OpenTelemetry.
|
24
31
|
Initializes the tracer provider and configures the span processor and exporter.
|
@@ -33,15 +40,17 @@ def setup_tracing(application_name, environment, tracer, otlp_endpoint, otlp_hea
|
|
33
40
|
global TRACER_SET
|
34
41
|
|
35
42
|
try:
|
36
|
-
#Disable Haystack Auto Tracing
|
43
|
+
# Disable Haystack Auto Tracing
|
37
44
|
os.environ["HAYSTACK_AUTO_TRACE_ENABLED"] = "false"
|
38
45
|
|
39
46
|
if not TRACER_SET:
|
40
47
|
# Create a resource with the service name attribute.
|
41
|
-
resource = Resource.create(
|
42
|
-
|
43
|
-
|
44
|
-
|
48
|
+
resource = Resource.create(
|
49
|
+
attributes={
|
50
|
+
SERVICE_NAME: application_name,
|
51
|
+
DEPLOYMENT_ENVIRONMENT: environment,
|
52
|
+
TELEMETRY_SDK_NAME: "openlit",
|
53
|
+
}
|
45
54
|
)
|
46
55
|
|
47
56
|
# Initialize the TracerProvider with the created resource.
|
@@ -53,7 +62,9 @@ def setup_tracing(application_name, environment, tracer, otlp_endpoint, otlp_hea
|
|
53
62
|
|
54
63
|
if otlp_headers is not None:
|
55
64
|
if isinstance(otlp_headers, dict):
|
56
|
-
headers_str =
|
65
|
+
headers_str = ",".join(
|
66
|
+
f"{key}={value}" for key, value in otlp_headers.items()
|
67
|
+
)
|
57
68
|
else:
|
58
69
|
headers_str = otlp_headers
|
59
70
|
|
@@ -63,7 +74,11 @@ def setup_tracing(application_name, environment, tracer, otlp_endpoint, otlp_hea
|
|
63
74
|
if os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"):
|
64
75
|
span_exporter = OTLPSpanExporter()
|
65
76
|
# pylint: disable=line-too-long
|
66
|
-
span_processor =
|
77
|
+
span_processor = (
|
78
|
+
BatchSpanProcessor(span_exporter)
|
79
|
+
if not disable_batch
|
80
|
+
else SimpleSpanProcessor(span_exporter)
|
81
|
+
)
|
67
82
|
else:
|
68
83
|
span_exporter = ConsoleSpanExporter()
|
69
84
|
span_processor = SimpleSpanProcessor(span_exporter)
|
openlit/semcov/__init__.py
CHANGED
@@ -6,6 +6,8 @@ intended for use across different components of AI applications, including reque
|
|
6
6
|
response processing, usage metrics, and interaction with vector databases and AI systems.
|
7
7
|
The purpose is to standardize the semantics for easier integration, analytics, and maintenance.
|
8
8
|
"""
|
9
|
+
|
10
|
+
|
9
11
|
class SemanticConvention:
|
10
12
|
"""
|
11
13
|
The SemanticConvention class provides a centralized repository of constant values that
|
@@ -155,9 +157,15 @@ class SemanticConvention:
|
|
155
157
|
GEN_AI_FRAMEWORK_PIPELINE_INPUT_DATA = "gen_ai.framework.pipeline.input_data"
|
156
158
|
GEN_AI_FRAMEWORK_PIPELINE_OUTPUT_DATA = "gen_ai.framework.pipeline.output_data"
|
157
159
|
GEN_AI_FRAMEWORK_PIPELINE_METADATA = "gen_ai.framework.pipeline.metadata"
|
158
|
-
GEN_AI_FRAMEWORK_PIPELINE_MAX_RUNS =
|
159
|
-
|
160
|
-
|
160
|
+
GEN_AI_FRAMEWORK_PIPELINE_MAX_RUNS = (
|
161
|
+
"gen_ai.framework.pipeline.max_runs_per_component"
|
162
|
+
)
|
163
|
+
GEN_AI_FRAMEWORK_PIPELINE_COMPONENT_COUNT = (
|
164
|
+
"gen_ai.framework.pipeline.component_count"
|
165
|
+
)
|
166
|
+
GEN_AI_FRAMEWORK_PIPELINE_EXECUTION_TIME = (
|
167
|
+
"gen_ai.framework.pipeline.execution_time"
|
168
|
+
)
|
161
169
|
|
162
170
|
# GenAI Request Attributes (Extra)
|
163
171
|
GEN_AI_REQUEST_IS_STREAM = "gen_ai.request.is_stream"
|
@@ -220,7 +228,6 @@ class SemanticConvention:
|
|
220
228
|
DB_QUERY_SUMMARY = "db.query.summary"
|
221
229
|
DB_RESPONSE_RETURNED_ROWS = "db.response.returned_rows"
|
222
230
|
|
223
|
-
|
224
231
|
# Vector DB Attributes (Extras)
|
225
232
|
DB_SDK_VERSION = "db.sdk.version"
|
226
233
|
DB_OPERATION_API_ENDPOINT = "db.operation.api_endpoint"
|
@@ -286,7 +293,6 @@ class SemanticConvention:
|
|
286
293
|
GEN_AI_AGENT_NAME = "gen_ai.agent.name"
|
287
294
|
GEN_AI_AGENT_DESCRIPTION = "gen_ai.agent.description"
|
288
295
|
|
289
|
-
|
290
296
|
GEN_AI_AGENT_TYPE = "gen_ai.agent.type"
|
291
297
|
GEN_AI_AGENT_TASK_ID = "gen_ai.agent.task.id"
|
292
298
|
GEN_AI_AGENT_ROLE = "gen_ai.agent.role"
|
@@ -405,6 +411,64 @@ class SemanticConvention:
|
|
405
411
|
GEN_AI_FRAMEWORK_INDEX_NAME = "gen_ai.framework.index.name"
|
406
412
|
GEN_AI_FRAMEWORK_INDEX_TYPE = "gen_ai.framework.index.type"
|
407
413
|
|
414
|
+
# === GENERAL FRAMEWORK SEMANTIC CONVENTIONS (reusable across frameworks) ===
|
415
|
+
|
416
|
+
# Framework tracing attributes (general, reusable across frameworks)
|
417
|
+
GEN_AI_FRAMEWORK_TAGS = "gen_ai.framework.tags"
|
418
|
+
|
419
|
+
# Framework performance tracking (general)
|
420
|
+
GEN_AI_FRAMEWORK_PERFORMANCE_VS_BASELINE = (
|
421
|
+
"gen_ai.framework.performance.vs_baseline"
|
422
|
+
)
|
423
|
+
GEN_AI_FRAMEWORK_PERFORMANCE_BASELINE_AVG = (
|
424
|
+
"gen_ai.framework.performance.baseline_avg"
|
425
|
+
)
|
426
|
+
GEN_AI_FRAMEWORK_PERFORMANCE_BASELINE_PERCENTILE = (
|
427
|
+
"gen_ai.framework.performance.baseline_percentile"
|
428
|
+
)
|
429
|
+
|
430
|
+
# Framework error classification (general)
|
431
|
+
GEN_AI_FRAMEWORK_ERROR_CLASS = "gen_ai.framework.error.class"
|
432
|
+
GEN_AI_FRAMEWORK_ERROR_TYPE = "gen_ai.framework.error.type"
|
433
|
+
GEN_AI_FRAMEWORK_ERROR_MESSAGE = "gen_ai.framework.error.message"
|
434
|
+
|
435
|
+
# Workflow attributes (general, reusable)
|
436
|
+
GEN_AI_WORKFLOW_TYPE = "gen_ai.workflow.type"
|
437
|
+
GEN_AI_WORKFLOW_INPUT = "gen_ai.workflow.input"
|
438
|
+
GEN_AI_WORKFLOW_OUTPUT = "gen_ai.workflow.output"
|
439
|
+
|
440
|
+
# Serialized function information (general, reusable)
|
441
|
+
GEN_AI_SERIALIZED_NAME = "gen_ai.serialized.name"
|
442
|
+
GEN_AI_SERIALIZED_SIGNATURE = "gen_ai.serialized.signature"
|
443
|
+
GEN_AI_SERIALIZED_DOC = "gen_ai.serialized.doc"
|
444
|
+
GEN_AI_SERIALIZED_MODULE = "gen_ai.serialized.module"
|
445
|
+
|
446
|
+
# Tool operation attributes (general, reusable)
|
447
|
+
GEN_AI_TOOL_INPUT = "gen_ai.tool.input"
|
448
|
+
GEN_AI_TOOL_OUTPUT = "gen_ai.tool.output"
|
449
|
+
|
450
|
+
# Retrieval operation attributes (general, reusable)
|
451
|
+
GEN_AI_RETRIEVAL_QUERY = "gen_ai.retrieval.query"
|
452
|
+
GEN_AI_RETRIEVAL_DOCUMENT_COUNT = "gen_ai.retrieval.document_count"
|
453
|
+
GEN_AI_RETRIEVAL_DOCUMENTS = "gen_ai.retrieval.documents"
|
454
|
+
|
455
|
+
# Provider information (general, reusable)
|
456
|
+
GEN_AI_REQUEST_PROVIDER = "gen_ai.request.provider"
|
457
|
+
|
458
|
+
# Enhanced token details (general, reusable across providers)
|
459
|
+
GEN_AI_USAGE_COMPLETION_TOKENS_DETAILS_AUDIO = (
|
460
|
+
"gen_ai.usage.completion_tokens_details.audio"
|
461
|
+
)
|
462
|
+
GEN_AI_USAGE_COMPLETION_TOKENS_DETAILS_REASONING = (
|
463
|
+
"gen_ai.usage.completion_tokens_details.reasoning"
|
464
|
+
)
|
465
|
+
GEN_AI_USAGE_PROMPT_TOKENS_DETAILS_CACHE_READ = (
|
466
|
+
"gen_ai.usage.prompt_tokens_details.cache_read"
|
467
|
+
)
|
468
|
+
GEN_AI_USAGE_PROMPT_TOKENS_DETAILS_CACHE_WRITE = (
|
469
|
+
"gen_ai.usage.prompt_tokens_details.cache_write"
|
470
|
+
)
|
471
|
+
|
408
472
|
# === STANDARD OPENTELEMETRY SEMANTIC CONVENTIONS ===
|
409
473
|
# These are framework-agnostic and reusable across all agent frameworks
|
410
474
|
|
@@ -415,7 +479,9 @@ class SemanticConvention:
|
|
415
479
|
GEN_AI_OPENAI_RUN_ID = "gen_ai.openai.run.id"
|
416
480
|
GEN_AI_OPENAI_REQUEST_SERVICE_TIER = "gen_ai.openai.request.service_tier"
|
417
481
|
GEN_AI_OPENAI_RESPONSE_SERVICE_TIER = "gen_ai.openai.response.service_tier"
|
418
|
-
GEN_AI_OPENAI_RESPONSE_SYSTEM_FINGERPRINT =
|
482
|
+
GEN_AI_OPENAI_RESPONSE_SYSTEM_FINGERPRINT = (
|
483
|
+
"gen_ai.openai.response.system_fingerprint"
|
484
|
+
)
|
419
485
|
|
420
486
|
# Data Source Attributes (for RAG and knowledge retrieval)
|
421
487
|
GEN_AI_DATA_SOURCE_ID = "gen_ai.data_source.id"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: openlit
|
3
|
-
Version: 1.34.
|
3
|
+
Version: 1.34.31
|
4
4
|
Summary: OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects
|
5
5
|
License: Apache-2.0
|
6
6
|
Keywords: OpenTelemetry,otel,otlp,llm,tracing,openai,anthropic,claude,cohere,llm monitoring,observability,monitoring,gpt,Generative AI,chatGPT,gpu
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Requires-Dist: anthropic (>=0.42.0,<1.0.0)
|
18
18
|
Requires-Dist: boto3 (>=1.34.0,<2.0.0)
|
19
19
|
Requires-Dist: botocore (>=1.34.0,<2.0.0)
|
20
|
+
Requires-Dist: langchain (>=0.3.15,<0.4.0)
|
20
21
|
Requires-Dist: openai (>=1.1.1,<2.0.0)
|
21
22
|
Requires-Dist: openai-agents (>=0.0.3)
|
22
23
|
Requires-Dist: opentelemetry-api (>=1.30.0,<2.0.0)
|
@@ -0,0 +1,166 @@
|
|
1
|
+
openlit/__helpers.py,sha256=KovxaOSxiDeVW63IDZ1CtryKE65ij2kjuYTSvCLCypI,20988
|
2
|
+
openlit/__init__.py,sha256=eZTnbu_X9tQeln3vsmHv99QSsciLB7jrOZCSljSJvDg,18538
|
3
|
+
openlit/_instrumentors.py,sha256=jqGvYkvMc5WdZdhhHn6BjzEJsZnCxkHkgMpQ7mbRDXE,5746
|
4
|
+
openlit/evals/__init__.py,sha256=nJe99nuLo1b5rf7pt9U9BCdSDedzbVi2Fj96cgl7msM,380
|
5
|
+
openlit/evals/all.py,sha256=X1RXC6A-TVlKvUX-4ZSafiu1B4C_40zzXGqvcb0a0kU,7310
|
6
|
+
openlit/evals/bias_detection.py,sha256=nAiKlUo19-4MwqmsXqqJqCA35qIYLtnHVaKCPumWvSA,8286
|
7
|
+
openlit/evals/hallucination.py,sha256=vrdc4mj5fg9QNOa7Y4-eH-WkrfSUFkG1ETnQ8epOAS0,7693
|
8
|
+
openlit/evals/toxicity.py,sha256=Q16efwcjvkG6oaicgyqXRkqqfqdbJmGj4BTdyY-2wxg,7162
|
9
|
+
openlit/evals/utils.py,sha256=Q-t571hShg059uXJ24oQWmIAmWw8u829dvzu1rAD9Y4,8667
|
10
|
+
openlit/guard/__init__.py,sha256=B-D7iPadGFn5i7nEsQfVbS6feL1ViRht3zWTQ45Jgkg,417
|
11
|
+
openlit/guard/all.py,sha256=wXoUoISNgpQ78KMwrTsB_3ZLHQWXxjrCERYjoBNVRHw,10121
|
12
|
+
openlit/guard/prompt_injection.py,sha256=MlX4nWqBRfRUCkoIsfv_OMazJnFyKDZJYzMTM1RAu1g,5908
|
13
|
+
openlit/guard/restrict_topic.py,sha256=ElQ-vJVeGyS2qqsIsWM72nmtRmodVO1BJimXv3vwfU0,6756
|
14
|
+
openlit/guard/sensitive_topic.py,sha256=aaaeEAj6_tcV9wMmGpsFPypDHTbbXrRof7NtWGazuSs,5676
|
15
|
+
openlit/guard/utils.py,sha256=K7A5LIDHM3ctsLYfo-jHuoByMuCPKK1llJDjZBpM8L4,8108
|
16
|
+
openlit/instrumentation/ag2/__init__.py,sha256=KoSuHsSOnoVY7n3tmC5IB1JQyxaEZf605V2qfVXTm1s,2132
|
17
|
+
openlit/instrumentation/ag2/ag2.py,sha256=LEhuPSoTtNnqkOwjzjv2Y57CDjgAhShYBQ_Wc9F1ukw,4077
|
18
|
+
openlit/instrumentation/ag2/async_ag2.py,sha256=GP4fmapsR6pWpld7KyY9jOvj9OfE_J4sXFyhG5uZDN4,4153
|
19
|
+
openlit/instrumentation/ag2/utils.py,sha256=IqOd6Y_EwhARla0N-4vLiM2oY4UVTIU4LoYgC0ycnHI,7803
|
20
|
+
openlit/instrumentation/ai21/__init__.py,sha256=RyJdKcjcfEkRjECi02M7lApGmEu-OhbIfZwP8XI4oT8,3008
|
21
|
+
openlit/instrumentation/ai21/ai21.py,sha256=prcC0bV6hlET72qQ00uswTGixKVfu-b8B9_EpLhpk_g,6685
|
22
|
+
openlit/instrumentation/ai21/async_ai21.py,sha256=nr_Gaw6BLqredXzq_kcQpxDntYTCYFEnIXouBA3bZGo,6811
|
23
|
+
openlit/instrumentation/ai21/utils.py,sha256=IBsDVCqh2oNmRcS5VzjY0506wXWq-wEPlkCsmn3HObs,15982
|
24
|
+
openlit/instrumentation/anthropic/__init__.py,sha256=eazV3p1kJTatRJSx_rG7tnTWGJaAKEDV5ZZpz1QECZE,2008
|
25
|
+
openlit/instrumentation/anthropic/anthropic.py,sha256=VnwcgUWAfatwudzhJxzHNVEE5vpu1_mLqWTnYaOTJzM,4938
|
26
|
+
openlit/instrumentation/anthropic/async_anthropic.py,sha256=1aOyllnpxBT5yx-RQUa9NVySVdUBrKawUyDAbYKixS8,5040
|
27
|
+
openlit/instrumentation/anthropic/utils.py,sha256=-yzLSKIthkUe5PHHzDrNwsl4J4ntb0gmkLK7oKmoP2g,10397
|
28
|
+
openlit/instrumentation/assemblyai/__init__.py,sha256=jJrXDHUZaPLuJM8xLGIsc_BDr51dLDcJvZqP-9plSmc,1530
|
29
|
+
openlit/instrumentation/assemblyai/assemblyai.py,sha256=7uM8LDKxYrKg5uz7vEPPWLsYmvSer0dg3aViiyxLVIM,2113
|
30
|
+
openlit/instrumentation/assemblyai/utils.py,sha256=4mxFFMYxWIBIRAxlvll63HpixbGLcCQwaJ_1vP5ovwI,6637
|
31
|
+
openlit/instrumentation/astra/__init__.py,sha256=91focJU9K3qQizsei8ehLMvqHq_q9xxwhbBVtOpVq4U,4516
|
32
|
+
openlit/instrumentation/astra/astra.py,sha256=_IDxZKRSEuVZJ7IEDDTqJZS-klt7qhySHsx2b4Trnfs,2304
|
33
|
+
openlit/instrumentation/astra/async_astra.py,sha256=q7kfJ4dtfYASPINyVk85l1iCQn64WRiLPCOzC9poWxg,2334
|
34
|
+
openlit/instrumentation/astra/utils.py,sha256=Nwp4R4PaXT55Errvh4KGMNjdBzeKP-lHzIcchAcMriI,12891
|
35
|
+
openlit/instrumentation/azure_ai_inference/__init__.py,sha256=DJXpz6naSKeKDuXX69xk93gKp6rDRLZtcVJ-EOTyZcE,3015
|
36
|
+
openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py,sha256=6k-wRSn0sxldcMJeuskXMSVuWULuB42fQ9jvNaJtcog,6110
|
37
|
+
openlit/instrumentation/azure_ai_inference/azure_ai_inference.py,sha256=NS9c64lIUKc4gXJFkc5GpXR_V_akn58gRgY-slUK8BU,6018
|
38
|
+
openlit/instrumentation/azure_ai_inference/utils.py,sha256=LZy2y3ZEiUwspviYDvX8sMxPNhlmA6HgS5bd2Z5T1Z8,17399
|
39
|
+
openlit/instrumentation/bedrock/__init__.py,sha256=Nbkb6xVr_7ydnfTdC44YqchKq9kZm9M7l3jVovI24ic,1936
|
40
|
+
openlit/instrumentation/bedrock/bedrock.py,sha256=KPUkNHrHdlv1uZXfRH3PRD0mH_bwFXAKsnuHe5aW__o,8403
|
41
|
+
openlit/instrumentation/bedrock/utils.py,sha256=iq_6Hy0mJA8tBbPToOWHFUB0wbaKE9uOCjBVmLPu-So,10078
|
42
|
+
openlit/instrumentation/chroma/__init__.py,sha256=XXGz6OqEhWKPCOTY3zxtKI-daN8nNZQSv_iUwhnbcVE,4401
|
43
|
+
openlit/instrumentation/chroma/chroma.py,sha256=U_2AtWZB6KFKi-9qrMeY_mu_Y-RdGrlP16-Ry_0A5js,2291
|
44
|
+
openlit/instrumentation/chroma/utils.py,sha256=AK_Yg5dfFtIPgvldoZsXbN-BsImk8f2vhSmM2fozRPE,13483
|
45
|
+
openlit/instrumentation/cohere/__init__.py,sha256=f28WPma2laM2fZq-slO6WC5KDxhnEG8uVUPLAUq04ew,3714
|
46
|
+
openlit/instrumentation/cohere/async_cohere.py,sha256=ObtqQi4nH_bL7okvIzNAtZPORPnM1W4cQVZujMTEZDw,7172
|
47
|
+
openlit/instrumentation/cohere/cohere.py,sha256=3zhkeURdXJEi1qmk_Qz0DauJ42f15z5EpzzD37VYSD0,7034
|
48
|
+
openlit/instrumentation/cohere/utils.py,sha256=D6er_96dB4Kv_fBeGEUAYh8fkz0ekYw93lfG-M6iKjE,16292
|
49
|
+
openlit/instrumentation/controlflow/__init__.py,sha256=ynza804YTxMkXWKUw-JnFdJoj6vWQVcgu3RWlU-Da08,2584
|
50
|
+
openlit/instrumentation/controlflow/controlflow.py,sha256=cgmSMwoL8vsA5dx2UbRXckIh36YFWqgTw6XE1h1dbAo,5848
|
51
|
+
openlit/instrumentation/crawl4ai/__init__.py,sha256=MdIBrW3teO3ZwW3wTW8j8-PMJwWM4-9WqElWLkwp4Qk,2214
|
52
|
+
openlit/instrumentation/crawl4ai/async_crawl4ai.py,sha256=xJaIovev85DWxfL2UaTdlIA__chT-4aCKWep4mG6HdU,5485
|
53
|
+
openlit/instrumentation/crawl4ai/crawl4ai.py,sha256=N8JYvtUijQUO42FJpk1aZpPDxJUzdWQDgOjzSALoV_k,5467
|
54
|
+
openlit/instrumentation/crewai/__init__.py,sha256=aoDRTmRB3qNAkp7vs7cuRGRPcWTEvlFU4l-vE2Whmig,5403
|
55
|
+
openlit/instrumentation/crewai/async_crewai.py,sha256=7KW0ex_tNyMbbAlc8mmjPA19JUEo_rxqyDLgUFCNetk,3627
|
56
|
+
openlit/instrumentation/crewai/crewai.py,sha256=I8tW08rlrPduL3n8PAbYI69fHeU9IQ90Rqug7TjhLoQ,3940
|
57
|
+
openlit/instrumentation/crewai/utils.py,sha256=M27rhhIryq2sJy4bQoym9zka_gshlgT_Ib1oJqFv_b4,22280
|
58
|
+
openlit/instrumentation/dynamiq/__init__.py,sha256=8FUw7xEM2IYsohVsBkeTogckWrSp100phGR1L8u8Sb0,2947
|
59
|
+
openlit/instrumentation/dynamiq/dynamiq.py,sha256=ZScAUCLUBaLMOxTHH59kowaG4eJdXbvPoQ2E5Xdhf8k,5779
|
60
|
+
openlit/instrumentation/elevenlabs/__init__.py,sha256=Zsr3xAh_L8HtFyIDcYPWFNZlj_NrnH4XrAi-uwYdlOA,2180
|
61
|
+
openlit/instrumentation/elevenlabs/async_elevenlabs.py,sha256=cbex994A2RpoatW6qdk-JaX5_uwp9Im3Jy0C3kEvwSM,1984
|
62
|
+
openlit/instrumentation/elevenlabs/elevenlabs.py,sha256=PtsITKZCR94wd3r6fFJKzQzL0t4Cu4KPBi9qS78Ax_s,1972
|
63
|
+
openlit/instrumentation/elevenlabs/utils.py,sha256=UEEJoHPzqSI15mzjF0mJHiv0g_mhYnFH2IcMjDJzmQs,6478
|
64
|
+
openlit/instrumentation/embedchain/__init__.py,sha256=9vy-OINQ29llRFB5-knKVP6WRn1yh8z3lpwQXcOgTws,2103
|
65
|
+
openlit/instrumentation/embedchain/embedchain.py,sha256=Jx_61HNfr66CLMp5YtvuslT5_VyY_aLoo1bCW0luIM0,7941
|
66
|
+
openlit/instrumentation/firecrawl/__init__.py,sha256=HqTTQBdDxmR0cZl7S6gWBf7EX-ZKm05OCMmec5TjCVY,2151
|
67
|
+
openlit/instrumentation/firecrawl/firecrawl.py,sha256=v16mveWDU4aX2EMwQTgzZA7uiiaZwWtHpG8jfhVjFG8,3966
|
68
|
+
openlit/instrumentation/google_ai_studio/__init__.py,sha256=Xa78K2mLrZ9X5x4tA9j4JKOay-CoHNG3YZtlEMOQJek,3029
|
69
|
+
openlit/instrumentation/google_ai_studio/async_google_ai_studio.py,sha256=923S43XowlKqigUuc4VmldhhRfZuxog0aOnfEb2F3Tc,5590
|
70
|
+
openlit/instrumentation/google_ai_studio/google_ai_studio.py,sha256=0RAGZfLzayJ_kQCEL5Q24Zj8Clxw4Qcuh9gGSS3GqSc,5492
|
71
|
+
openlit/instrumentation/google_ai_studio/utils.py,sha256=gvV-E0Zv-c_GQdiFYCLuX8Ykx53LPd6fm1v8CXhLZHE,11994
|
72
|
+
openlit/instrumentation/gpt4all/__init__.py,sha256=R5wohml8-9AJa28HufwMSfHR96hTpQhIyXBz_BNKuVY,1870
|
73
|
+
openlit/instrumentation/gpt4all/gpt4all.py,sha256=J9h6WGePG-5lTH3m6B4gdsXNlZnS9clscm4Q2le4190,7049
|
74
|
+
openlit/instrumentation/gpt4all/utils.py,sha256=IPaJA0b5x3r3VppEAlYXK7yWEMazWpq_114BTj7Aimo,13923
|
75
|
+
openlit/instrumentation/gpu/__init__.py,sha256=S0s-jHSyUxnyIIzkjp3d_dr646Y4s4_IkJTQgypj1PA,12771
|
76
|
+
openlit/instrumentation/groq/__init__.py,sha256=YhTxho8_MAx8uDr8jl3ZK75lqWwjk45NkK6NbfRo6bU,1979
|
77
|
+
openlit/instrumentation/groq/async_groq.py,sha256=ZYv8dNJpoRR8usfZru0pqTJilafBWMDrzDi_1cH7Cwo,5186
|
78
|
+
openlit/instrumentation/groq/groq.py,sha256=DhjSucp1GKPpii6ISLTmTzR_3PHuaEW82n_3j9Dy074,5078
|
79
|
+
openlit/instrumentation/groq/utils.py,sha256=OlFAav1SPRR3GJsiNuKsIzAY5BMqsXFJ7Qf3Jg2v1QE,10122
|
80
|
+
openlit/instrumentation/haystack/__init__.py,sha256=ykfKH0zARpWN76gzSw4fpsW9I-flE5unSpGHVuKLZaE,4272
|
81
|
+
openlit/instrumentation/haystack/async_haystack.py,sha256=b_nNEk5qnOrw-j4o0MFJkhVZ2JtI8JIXC0C9In7tuz8,2161
|
82
|
+
openlit/instrumentation/haystack/haystack.py,sha256=kST4C7MLmxPdHhRNeTOKFgXbd61ZwGm-PU00mr9uMxo,2124
|
83
|
+
openlit/instrumentation/haystack/utils.py,sha256=4ffYv1x10nqW_jofz5Ss7i2GUupP2jL-F7O1Yw_axdU,18456
|
84
|
+
openlit/instrumentation/julep/__init__.py,sha256=zqjuUKlq8jmcKtSfvg9N79WzEtZ9pqE9F1IA12_ZWYo,4046
|
85
|
+
openlit/instrumentation/julep/async_julep.py,sha256=VFr88mZNxd3ipNco_w4IWtsDJOFdLeDffO-P8eByo-4,5482
|
86
|
+
openlit/instrumentation/julep/julep.py,sha256=ZaFnWUuFaZ1k4t9xINP9ULJISFJ3LWqGszUV4RmhJMM,5484
|
87
|
+
openlit/instrumentation/langchain/__init__.py,sha256=co_6AEIYy0V9iCRKd8z_uUSOXHaomj0UxqfhTAGC3lM,4079
|
88
|
+
openlit/instrumentation/langchain/callback_handler.py,sha256=hDfwaOF7CUnxRRgAH_WxBBxqwuG9ndIbsYoJ8Yz7TI4,40315
|
89
|
+
openlit/instrumentation/langchain_community/__init__.py,sha256=QvR3xfA49RVWd6HiQfNRuwfpEFtomvabsFj6vmnIiGo,2895
|
90
|
+
openlit/instrumentation/langchain_community/async_langchain_community.py,sha256=VloZe82GnQspzwKe5_uFBl7Lq6TfNhLYUuwCeJwEC20,1769
|
91
|
+
openlit/instrumentation/langchain_community/langchain_community.py,sha256=meEaGXnk-7aRgxDfxllaJNF5j29-SyrHj0HXTH2wmWM,1739
|
92
|
+
openlit/instrumentation/langchain_community/utils.py,sha256=IvSYBx5JgTwRHZioGsnRy2JUL_5Xlfa5SlCe_8CuOMw,3593
|
93
|
+
openlit/instrumentation/letta/__init__.py,sha256=VAzvL1tfAkad4jHWh8JQPqxuLXHdj0gq-umKPL4j_tg,3870
|
94
|
+
openlit/instrumentation/letta/letta.py,sha256=SFxzNFh5Y4POaSQs86xyw0t6t20usowvf9IGCp1zYn0,8609
|
95
|
+
openlit/instrumentation/litellm/__init__.py,sha256=nuD1lef9Ba0v2443hrLW3nxJ0kOrXNkGVfgH-SnERRY,2770
|
96
|
+
openlit/instrumentation/litellm/async_litellm.py,sha256=oO4mW4lXpEDr2qaNpXSace24pyXVzXByv5_hPiCTm_Q,6944
|
97
|
+
openlit/instrumentation/litellm/litellm.py,sha256=nOAQtK7R_12vpGBqy1wwy81EEGDpIda1x85FMNevkvA,6828
|
98
|
+
openlit/instrumentation/litellm/utils.py,sha256=CZg-QMdSOp7H7nFA7jPAwPUVq3DRaG3aJ0GH_aYsUvE,15359
|
99
|
+
openlit/instrumentation/llamaindex/__init__.py,sha256=PSwnjVC9M_2RR_FAZUcrLK67d1DushpEVu-sUBafwo0,13262
|
100
|
+
openlit/instrumentation/llamaindex/async_llamaindex.py,sha256=SXoZuxd6EyutIdiIKkWaJJ1bUbylle-XDwTFpVzPf5o,2156
|
101
|
+
openlit/instrumentation/llamaindex/llamaindex.py,sha256=W3VwmfWyVz2Pbt8JAZVm0vcFNwUqd55qKyFqieqYB4k,2209
|
102
|
+
openlit/instrumentation/llamaindex/utils.py,sha256=othgk7FqJpmU2eAU0P39ijzXO4N1ijEukO7Zqr00RPA,20292
|
103
|
+
openlit/instrumentation/mem0/__init__.py,sha256=PuhkFCBdidls3xDW9YbpjSj5UqwUeQKoHIL7CcCmNUw,2591
|
104
|
+
openlit/instrumentation/mem0/mem0.py,sha256=LruioW93patji8F0ldC3rLflET3Mtttk_GLxC3YRNtk,5404
|
105
|
+
openlit/instrumentation/milvus/__init__.py,sha256=UHoffG-ObNqVXSQ-uDICDOOtCcx5fz9F_XwvCMec12Y,1981
|
106
|
+
openlit/instrumentation/milvus/milvus.py,sha256=2htUMPKS_iwmJC-iwfdjzapQmeHUtdQr6v1cjioQ2U0,2271
|
107
|
+
openlit/instrumentation/milvus/utils.py,sha256=LO0z6tPrMVKyl7XF_ABlcYuRr3GQEZCU1LF1gHS8pPI,12477
|
108
|
+
openlit/instrumentation/mistral/__init__.py,sha256=euy8u_nDXdv6di4vItdZiemtFC4qckQudfWbLsRfr8Q,3713
|
109
|
+
openlit/instrumentation/mistral/async_mistral.py,sha256=ZBgylHsj53HfpLN29o1WXL5nBFLZ-pQX4CN8yZWvxWI,7129
|
110
|
+
openlit/instrumentation/mistral/mistral.py,sha256=s4ALglDmvnRL6nknQdN7AwtGurTKj6xhCZ8V3khKAIE,6991
|
111
|
+
openlit/instrumentation/mistral/utils.py,sha256=0QHQiJPM1g70-bMtMvcgTg9x5HZY4Q9811eG_8SfoBw,14987
|
112
|
+
openlit/instrumentation/multion/__init__.py,sha256=0lUnZRArs3o3Uzgv_IZ4OKMyhuVStrPslqEURJ9FrrU,3979
|
113
|
+
openlit/instrumentation/multion/async_multion.py,sha256=l8-Bjlty5HGTSkVJ4qxJgOirylg5WhiEG6ScwyPZCAU,6402
|
114
|
+
openlit/instrumentation/multion/multion.py,sha256=E2Xce1iL7dbFY8F1W8exR0BSuwc3Ta5H7SE3C0jVnq8,6384
|
115
|
+
openlit/instrumentation/ollama/__init__.py,sha256=tJ-4lU-n8vcJYqE_5DKAcb4CvXaG-bdWHhHSkV1oFJU,3820
|
116
|
+
openlit/instrumentation/ollama/async_ollama.py,sha256=gNC7M0Niyj3G3g1H8WIYhgdUG1rWGQACxA2Ks9rVeos,6909
|
117
|
+
openlit/instrumentation/ollama/ollama.py,sha256=Uqzq_h3EdTblXqTNu67lnQ_WiHKQCJFNjTSanqFjxtE,6781
|
118
|
+
openlit/instrumentation/ollama/utils.py,sha256=999_IonFR_sqvyVA_vTCip4PDCU8Al1ySc2Vm4GGx9E,13159
|
119
|
+
openlit/instrumentation/openai/__init__.py,sha256=lJCrxSA1ihvnHf24vDregF4lCcmf2RRdCJ2CvqS2_Sc,7368
|
120
|
+
openlit/instrumentation/openai/async_openai.py,sha256=b9GkIG5H48l-HcXWzAHpKKnu3ApiLUHQsnyei2Utlo8,18342
|
121
|
+
openlit/instrumentation/openai/openai.py,sha256=TeIfaifTbIIqvzhwE93tzzZ4a1umazy1r6MzwrTcyi8,18049
|
122
|
+
openlit/instrumentation/openai/utils.py,sha256=S2GlMz-_GB4a8AidY9ilzMDiWQkiqSBWe2VvhqcWSDE,40374
|
123
|
+
openlit/instrumentation/openai_agents/__init__.py,sha256=jUy5xXPHh6r0jXQLtFmTvXO0tARtliIzsNIxA7b6KHY,2327
|
124
|
+
openlit/instrumentation/openai_agents/processor.py,sha256=MnsidL656FMMF47ijKDgPDcie0bvCZMaxG6BBT-2Sqk,16738
|
125
|
+
openlit/instrumentation/phidata/__init__.py,sha256=Pys96tzeUHGygOuZc1yVgLeB_47VtFTqo996ZUdZtS0,1691
|
126
|
+
openlit/instrumentation/phidata/phidata.py,sha256=tdsCwiNAy_l4RDcKKfI5pXJryvhNX5KqGNfaL_tp01E,5036
|
127
|
+
openlit/instrumentation/pinecone/__init__.py,sha256=vafyXc-9JKnR0x7iV-IPfIquHh6umPymE78BRBsxWEw,4197
|
128
|
+
openlit/instrumentation/pinecone/async_pinecone.py,sha256=kwpujdfSblTHryR9v6sKcm0ag99J-BLzfjuMAwWYogI,2312
|
129
|
+
openlit/instrumentation/pinecone/pinecone.py,sha256=eNRac9Hj8W18XiZ7m2xWqVcMWygpnABW1ND8Tq7Zuj4,2270
|
130
|
+
openlit/instrumentation/pinecone/utils.py,sha256=6FouF3XlQn4G0VHPv5pxoe9G7u5SLEsPOC48fTOigfA,11316
|
131
|
+
openlit/instrumentation/premai/__init__.py,sha256=6s6lW4g_E-STrFJA6LoiQg82O_g3D01ddkPA2OX5USk,1971
|
132
|
+
openlit/instrumentation/premai/premai.py,sha256=zCRrl8hoBDKQh9dlB4NbBi6xgi3BBQBx7rWccAb5Nbs,6602
|
133
|
+
openlit/instrumentation/premai/utils.py,sha256=UpYne7CgOXTWoq2kEAxXXELZYW1HumdYxBqd4hBlbNA,12772
|
134
|
+
openlit/instrumentation/pydantic_ai/__init__.py,sha256=yGVK7MCB-c9gsCfKCRaRD79BbVhCeEJEEEJG-0MK__4,2408
|
135
|
+
openlit/instrumentation/pydantic_ai/pydantic_ai.py,sha256=PP-wzLeER4dG-KK5YQOwanTL1T6xoMU19cMcB74x-eo,2109
|
136
|
+
openlit/instrumentation/pydantic_ai/utils.py,sha256=YY6XOzrTW5M4Ky3p-dTvvI7yWTwnuumgN2n-6BF7_mU,4813
|
137
|
+
openlit/instrumentation/qdrant/__init__.py,sha256=qBD9kWikrQozgkcYDPgsladlac5VpvtGBwulYqwQQfI,3293
|
138
|
+
openlit/instrumentation/qdrant/async_qdrant.py,sha256=kj-q9de8JDGZ6Fw5hlWIcly0SxvFD5M2a6K9PHMuejc,2553
|
139
|
+
openlit/instrumentation/qdrant/qdrant.py,sha256=zjaVRpwnvTPJ78mzsM1Dy3Vk-_3rtOI_hKMM9-enWkg,2517
|
140
|
+
openlit/instrumentation/qdrant/utils.py,sha256=1uvWURITgAX-5e9baT3sjKpeFP0JRtddDPTslO172s8,16692
|
141
|
+
openlit/instrumentation/reka/__init__.py,sha256=-ayOFL90Q0RnotLvM6jT9Ti4DHZpnoH3zN_GIP_jroo,1955
|
142
|
+
openlit/instrumentation/reka/async_reka.py,sha256=JdjQLiEF73Jb294_bM3uKlW-0tKT01FpE-jv-8wrEBk,1944
|
143
|
+
openlit/instrumentation/reka/reka.py,sha256=4XFYz58GnRcyEHK_tGXEZf_6TxWjLNbDI7qDiyuW3sk,1926
|
144
|
+
openlit/instrumentation/reka/utils.py,sha256=611Pi0_8fyNqHjUQwjnkZioe-a3GgBmoDHDIqlroJUc,7406
|
145
|
+
openlit/instrumentation/together/__init__.py,sha256=aduV6PH1mIPUv-yxIb5t2Z8KfxFrDEvNUD0QUehsltE,2966
|
146
|
+
openlit/instrumentation/together/async_together.py,sha256=bEfNuxQ1kHq3VxiC3Y0THeeKi_WY7VLWWtzsJWOGDqE,6959
|
147
|
+
openlit/instrumentation/together/together.py,sha256=LqneCj9i3LVCavi87QKuKmgXpnk1me7PwvjlGv0Jun8,6860
|
148
|
+
openlit/instrumentation/together/utils.py,sha256=fNJmVgYTDuN3ysr3ZaPkpLEHebum51EDE__Thn5o-WU,15976
|
149
|
+
openlit/instrumentation/transformers/__init__.py,sha256=KJ0hQxbHRacIlEw-itF7S7Yu70aru1i3j9d807gwI28,1513
|
150
|
+
openlit/instrumentation/transformers/transformers.py,sha256=WnBy6KulCo9jKrdk4I2OG1Yhwop3F-tbmWoYxnvoyVg,1833
|
151
|
+
openlit/instrumentation/transformers/utils.py,sha256=41hpSdTiJjei-avQjkOMzvFDTlbHXkKyfyaKtpfsK5A,9322
|
152
|
+
openlit/instrumentation/vertexai/__init__.py,sha256=XfOu1ROUg7QpsD_CyPMNIkpmoYiMRQHkPmyhUkgKAHk,4657
|
153
|
+
openlit/instrumentation/vertexai/async_vertexai.py,sha256=TPPW3o8eVy2NudnrGl9i0C6inz2PpF56UZaPO4TS7bk,4993
|
154
|
+
openlit/instrumentation/vertexai/utils.py,sha256=fLyRkDuNptbYpm4CNfTpPfFCbFwFr5m3rjgobagY2eY,8965
|
155
|
+
openlit/instrumentation/vertexai/vertexai.py,sha256=Iwp8bJpMFKioAbqcoMKlhvthWdPnQq1J47a1lcdCTSA,4903
|
156
|
+
openlit/instrumentation/vllm/__init__.py,sha256=x7SIh7utfGxSLpXpPQfNHZe9evLJ3YGPHbDzlh2ZFEY,1472
|
157
|
+
openlit/instrumentation/vllm/utils.py,sha256=LsmSQPii9wtksoIjvTrucarFxjDNsxOMSZMrXI-7Qac,6460
|
158
|
+
openlit/instrumentation/vllm/vllm.py,sha256=zdzKUkQYmpFlOQ8rObzRiVZEyHOaJFxUagwCp2yJhuE,2029
|
159
|
+
openlit/otel/events.py,sha256=iOyKIYHA-QYq5bnHVTV_JKeGC5Tsi1icc5nOa3Km_fA,3825
|
160
|
+
openlit/otel/metrics.py,sha256=ipH2NB65yOG7yGB32vqmMQ5HjWSeKAk3q4hzGRXRBOs,7238
|
161
|
+
openlit/otel/tracing.py,sha256=6KZc-Yubq-S7wEPshUiMNFkw8XN5WvrqIovWaq3gsKw,3301
|
162
|
+
openlit/semcov/__init__.py,sha256=2KET4cIKtoYfeSAS0O8waYA5Of-hwYX7HvJyxU-1lt0,22518
|
163
|
+
openlit-1.34.31.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
164
|
+
openlit-1.34.31.dist-info/METADATA,sha256=W2HpGFrGhQjZtGyzVP4eGzpCBMYXtbAB8ZNIgpn6B-g,23552
|
165
|
+
openlit-1.34.31.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
166
|
+
openlit-1.34.31.dist-info/RECORD,,
|
@@ -1,102 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Module for monitoring LangChain API calls.
|
3
|
-
"""
|
4
|
-
|
5
|
-
import time
|
6
|
-
from opentelemetry.trace import SpanKind
|
7
|
-
from openlit.__helpers import (
|
8
|
-
handle_exception,
|
9
|
-
set_server_address_and_port
|
10
|
-
)
|
11
|
-
from openlit.instrumentation.langchain.utils import (
|
12
|
-
get_model_from_instance,
|
13
|
-
process_chat_response,
|
14
|
-
process_hub_response,
|
15
|
-
)
|
16
|
-
from openlit.semcov import SemanticConvention
|
17
|
-
|
18
|
-
def async_hub(gen_ai_endpoint, version, environment, application_name, tracer,
|
19
|
-
pricing_info, capture_message_content, metrics, disable_metrics):
|
20
|
-
"""
|
21
|
-
Generates a telemetry wrapper for LangChain async hub operations.
|
22
|
-
"""
|
23
|
-
|
24
|
-
async def wrapper(wrapped, instance, args, kwargs):
|
25
|
-
"""
|
26
|
-
Wraps the LangChain async hub operation call.
|
27
|
-
"""
|
28
|
-
|
29
|
-
server_address, server_port = set_server_address_and_port(instance, "langchain.com", 443)
|
30
|
-
|
31
|
-
with tracer.start_as_current_span(gen_ai_endpoint, kind=SpanKind.CLIENT) as span:
|
32
|
-
response = await wrapped(*args, **kwargs)
|
33
|
-
|
34
|
-
try:
|
35
|
-
response = process_hub_response(
|
36
|
-
response=response,
|
37
|
-
gen_ai_endpoint=gen_ai_endpoint,
|
38
|
-
server_port=server_port,
|
39
|
-
server_address=server_address,
|
40
|
-
environment=environment,
|
41
|
-
application_name=application_name,
|
42
|
-
span=span,
|
43
|
-
version=version
|
44
|
-
)
|
45
|
-
|
46
|
-
except Exception as e:
|
47
|
-
handle_exception(span, e)
|
48
|
-
|
49
|
-
return response
|
50
|
-
|
51
|
-
return wrapper
|
52
|
-
|
53
|
-
def async_chat(gen_ai_endpoint, version, environment, application_name,
|
54
|
-
tracer, pricing_info, capture_message_content, metrics, disable_metrics):
|
55
|
-
"""
|
56
|
-
Generates a telemetry wrapper for LangChain async chat operations.
|
57
|
-
"""
|
58
|
-
|
59
|
-
async def wrapper(wrapped, instance, args, kwargs):
|
60
|
-
"""
|
61
|
-
Wraps the LangChain async chat operation call.
|
62
|
-
"""
|
63
|
-
|
64
|
-
server_address, server_port = set_server_address_and_port(instance, "langchain.com", 443)
|
65
|
-
request_model = get_model_from_instance(instance)
|
66
|
-
|
67
|
-
span_name = f"{SemanticConvention.GEN_AI_OPERATION_TYPE_CHAT} {request_model}"
|
68
|
-
|
69
|
-
with tracer.start_as_current_span(span_name, kind=SpanKind.CLIENT) as span:
|
70
|
-
start_time = time.time()
|
71
|
-
response = await wrapped(*args, **kwargs)
|
72
|
-
end_time = time.time()
|
73
|
-
|
74
|
-
try:
|
75
|
-
# Add instance to kwargs for processing
|
76
|
-
kwargs["instance"] = instance
|
77
|
-
|
78
|
-
response = process_chat_response(
|
79
|
-
response=response,
|
80
|
-
request_model=request_model,
|
81
|
-
pricing_info=pricing_info,
|
82
|
-
server_port=server_port,
|
83
|
-
server_address=server_address,
|
84
|
-
environment=environment,
|
85
|
-
application_name=application_name,
|
86
|
-
metrics=metrics,
|
87
|
-
start_time=start_time,
|
88
|
-
end_time=end_time,
|
89
|
-
span=span,
|
90
|
-
capture_message_content=capture_message_content,
|
91
|
-
disable_metrics=disable_metrics,
|
92
|
-
version=version,
|
93
|
-
args=args,
|
94
|
-
**kwargs
|
95
|
-
)
|
96
|
-
|
97
|
-
except Exception as e:
|
98
|
-
handle_exception(span, e)
|
99
|
-
|
100
|
-
return response
|
101
|
-
|
102
|
-
return wrapper
|