openlit 1.32.4__py3-none-any.whl → 1.32.7__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 +5 -2
- openlit/__init__.py +6 -0
- openlit/instrumentation/assemblyai/__init__.py +43 -0
- openlit/instrumentation/assemblyai/assemblyai.py +127 -0
- openlit/instrumentation/bedrock/bedrock.py +2 -6
- openlit/instrumentation/controlflow/__init__.py +56 -0
- openlit/instrumentation/controlflow/controlflow.py +113 -0
- openlit/instrumentation/openai/openai.py +9 -6
- openlit/semcov/__init__.py +3 -0
- {openlit-1.32.4.dist-info → openlit-1.32.7.dist-info}/METADATA +3 -2
- {openlit-1.32.4.dist-info → openlit-1.32.7.dist-info}/RECORD +13 -9
- {openlit-1.32.4.dist-info → openlit-1.32.7.dist-info}/LICENSE +0 -0
- {openlit-1.32.4.dist-info → openlit-1.32.7.dist-info}/WHEEL +0 -0
openlit/__helpers.py
CHANGED
@@ -133,7 +133,7 @@ def get_image_model_cost(model, pricing_info, size, quality):
|
|
133
133
|
cost = 0
|
134
134
|
return cost
|
135
135
|
|
136
|
-
def get_audio_model_cost(model, pricing_info, prompt):
|
136
|
+
def get_audio_model_cost(model, pricing_info, prompt, duration=None):
|
137
137
|
"""
|
138
138
|
Retrieve the cost of processing for a given model based on prompt.
|
139
139
|
|
@@ -146,7 +146,10 @@ def get_audio_model_cost(model, pricing_info, prompt):
|
|
146
146
|
float: The calculated cost for the operation.
|
147
147
|
"""
|
148
148
|
try:
|
149
|
-
|
149
|
+
if prompt:
|
150
|
+
cost = (len(prompt) / 1000) * pricing_info["audio"][model]
|
151
|
+
else:
|
152
|
+
cost = duration * pricing_info["audio"][model]
|
150
153
|
except:
|
151
154
|
cost = 0
|
152
155
|
return cost
|
openlit/__init__.py
CHANGED
@@ -38,6 +38,7 @@ from openlit.instrumentation.vllm import VLLMInstrumentor
|
|
38
38
|
from openlit.instrumentation.google_ai_studio import GoogleAIStudioInstrumentor
|
39
39
|
from openlit.instrumentation.reka import RekaInstrumentor
|
40
40
|
from openlit.instrumentation.premai import PremAIInstrumentor
|
41
|
+
from openlit.instrumentation.assemblyai import AssemblyAIInstrumentor
|
41
42
|
from openlit.instrumentation.azure_ai_inference import AzureAIInferenceInstrumentor
|
42
43
|
from openlit.instrumentation.langchain import LangChainInstrumentor
|
43
44
|
from openlit.instrumentation.llamaindex import LlamaIndexInstrumentor
|
@@ -58,6 +59,7 @@ from openlit.instrumentation.dynamiq import DynamiqInstrumentor
|
|
58
59
|
from openlit.instrumentation.phidata import PhidataInstrumentor
|
59
60
|
from openlit.instrumentation.julep import JulepInstrumentor
|
60
61
|
from openlit.instrumentation.ai21 import AI21Instrumentor
|
62
|
+
from openlit.instrumentation.controlflow import ControlFlowInstrumentor
|
61
63
|
from openlit.instrumentation.gpu import GPUInstrumentor
|
62
64
|
import openlit.guard
|
63
65
|
import openlit.evals
|
@@ -254,6 +256,8 @@ def init(environment="default", application_name="default", tracer=None, otlp_en
|
|
254
256
|
"julep": "julep",
|
255
257
|
"astra": "astrapy",
|
256
258
|
"ai21": "ai21",
|
259
|
+
"controlflow": "controlflow",
|
260
|
+
"assemblyai": "assemblyai",
|
257
261
|
}
|
258
262
|
|
259
263
|
invalid_instrumentors = [
|
@@ -345,6 +349,8 @@ def init(environment="default", application_name="default", tracer=None, otlp_en
|
|
345
349
|
"julep": JulepInstrumentor(),
|
346
350
|
"astra": AstraInstrumentor(),
|
347
351
|
"ai21": AI21Instrumentor(),
|
352
|
+
"controlflow": ControlFlowInstrumentor(),
|
353
|
+
"assemblyai": AssemblyAIInstrumentor(),
|
348
354
|
}
|
349
355
|
|
350
356
|
# Initialize and instrument only the enabled instrumentors
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# pylint: disable=useless-return, bad-staticmethod-argument, disable=duplicate-code
|
2
|
+
"""Initializer of Auto Instrumentation of AssemblyAI Functions"""
|
3
|
+
|
4
|
+
from typing import Collection
|
5
|
+
import importlib.metadata
|
6
|
+
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
7
|
+
from wrapt import wrap_function_wrapper
|
8
|
+
|
9
|
+
from openlit.instrumentation.assemblyai.assemblyai import (
|
10
|
+
transcribe
|
11
|
+
)
|
12
|
+
|
13
|
+
_instruments = ("assemblyai >= 0.35.1",)
|
14
|
+
|
15
|
+
class AssemblyAIInstrumentor(BaseInstrumentor):
|
16
|
+
"""
|
17
|
+
An instrumentor for AssemblyAI's client library.
|
18
|
+
"""
|
19
|
+
|
20
|
+
def instrumentation_dependencies(self) -> Collection[str]:
|
21
|
+
return _instruments
|
22
|
+
|
23
|
+
def _instrument(self, **kwargs):
|
24
|
+
application_name = kwargs.get("application_name", "default")
|
25
|
+
environment = kwargs.get("environment", "default")
|
26
|
+
tracer = kwargs.get("tracer")
|
27
|
+
metrics = kwargs.get("metrics_dict")
|
28
|
+
pricing_info = kwargs.get("pricing_info", {})
|
29
|
+
trace_content = kwargs.get("trace_content", False)
|
30
|
+
disable_metrics = kwargs.get("disable_metrics")
|
31
|
+
version = importlib.metadata.version("assemblyai")
|
32
|
+
|
33
|
+
# sync transcribe
|
34
|
+
wrap_function_wrapper(
|
35
|
+
"assemblyai.transcriber",
|
36
|
+
"Transcriber.transcribe",
|
37
|
+
transcribe("assemblyai.transcribe", version, environment, application_name,
|
38
|
+
tracer, pricing_info, trace_content, metrics, disable_metrics),
|
39
|
+
)
|
40
|
+
|
41
|
+
def _uninstrument(self, **kwargs):
|
42
|
+
# Proper uninstrumentation logic to revert patched methods
|
43
|
+
pass
|
@@ -0,0 +1,127 @@
|
|
1
|
+
# pylint: disable=duplicate-code, broad-exception-caught, too-many-statements, unused-argument, possibly-used-before-assignment
|
2
|
+
"""
|
3
|
+
Module for monitoring Assembly AI API calls.
|
4
|
+
"""
|
5
|
+
|
6
|
+
import logging
|
7
|
+
from opentelemetry.trace import SpanKind, Status, StatusCode
|
8
|
+
from opentelemetry.sdk.resources import TELEMETRY_SDK_NAME
|
9
|
+
from openlit.__helpers import get_audio_model_cost
|
10
|
+
from openlit.__helpers import handle_exception
|
11
|
+
from openlit.semcov import SemanticConvetion
|
12
|
+
|
13
|
+
# Initialize logger for logging potential issues and operations
|
14
|
+
logger = logging.getLogger(__name__)
|
15
|
+
|
16
|
+
def transcribe(gen_ai_endpoint, version, environment, application_name,
|
17
|
+
tracer, pricing_info, trace_content, metrics, disable_metrics):
|
18
|
+
"""
|
19
|
+
Generates a telemetry wrapper for creating speech audio to collect metrics.
|
20
|
+
|
21
|
+
Args:
|
22
|
+
gen_ai_endpoint: Endpoint identifier for logging and tracing.
|
23
|
+
version: Version of the monitoring package.
|
24
|
+
environment: Deployment environment (e.g., production, staging).
|
25
|
+
application_name: Name of the application using the Assembly AI API.
|
26
|
+
tracer: OpenTelemetry tracer for creating spans.
|
27
|
+
pricing_info: Information used for calculating the cost of generating speech audio.
|
28
|
+
trace_content: Flag indicating whether to trace the input text and generated audio.
|
29
|
+
|
30
|
+
Returns:
|
31
|
+
A function that wraps the speech audio creation method to add telemetry.
|
32
|
+
"""
|
33
|
+
|
34
|
+
def wrapper(wrapped, instance, args, kwargs):
|
35
|
+
"""
|
36
|
+
Wraps the 'generate' API call to add telemetry.
|
37
|
+
|
38
|
+
This collects metrics such as execution time, cost, and handles errors
|
39
|
+
gracefully, adding details to the trace for observability.
|
40
|
+
|
41
|
+
Args:
|
42
|
+
wrapped: The original 'generate' method to be wrapped.
|
43
|
+
instance: The instance of the class where the original method is defined.
|
44
|
+
args: Positional arguments for the 'generate' method.
|
45
|
+
kwargs: Keyword arguments for the 'generate' method.
|
46
|
+
|
47
|
+
Returns:
|
48
|
+
The response from the original 'transcribe' method.
|
49
|
+
"""
|
50
|
+
|
51
|
+
with tracer.start_as_current_span(gen_ai_endpoint, kind= SpanKind.CLIENT) as span:
|
52
|
+
response = wrapped(*args, **kwargs)
|
53
|
+
|
54
|
+
try:
|
55
|
+
llm_model = response.speech_model if response.speech_model else "best"
|
56
|
+
|
57
|
+
# Calculate cost of the operation
|
58
|
+
cost = get_audio_model_cost(llm_model,
|
59
|
+
pricing_info, None, response.audio_duration)
|
60
|
+
|
61
|
+
# Set Span attributes
|
62
|
+
span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
|
63
|
+
span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
|
64
|
+
SemanticConvetion.GEN_AI_SYSTEM_ASSEMBLYAI)
|
65
|
+
span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
|
66
|
+
SemanticConvetion.GEN_AI_TYPE_AUDIO)
|
67
|
+
span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
|
68
|
+
gen_ai_endpoint)
|
69
|
+
span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
|
70
|
+
environment)
|
71
|
+
span.set_attribute(SemanticConvetion.GEN_AI_APPLICATION_NAME,
|
72
|
+
application_name)
|
73
|
+
span.set_attribute(SemanticConvetion.GEN_AI_RESPONSE_ID,
|
74
|
+
response.id)
|
75
|
+
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
76
|
+
llm_model)
|
77
|
+
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_AUDIO_DURATION,
|
78
|
+
response.audio_duration)
|
79
|
+
span.set_attribute(SemanticConvetion.GEN_AI_USAGE_COST,
|
80
|
+
cost)
|
81
|
+
|
82
|
+
if trace_content:
|
83
|
+
span.add_event(
|
84
|
+
name=SemanticConvetion.GEN_AI_CONTENT_PROMPT_EVENT,
|
85
|
+
attributes={
|
86
|
+
SemanticConvetion.GEN_AI_CONTENT_PROMPT: response.audio_url,
|
87
|
+
},
|
88
|
+
)
|
89
|
+
span.add_event(
|
90
|
+
name=SemanticConvetion.GEN_AI_CONTENT_COMPLETION_EVENT,
|
91
|
+
attributes={
|
92
|
+
SemanticConvetion.GEN_AI_CONTENT_COMPLETION: response.text,
|
93
|
+
},
|
94
|
+
)
|
95
|
+
|
96
|
+
span.set_status(Status(StatusCode.OK))
|
97
|
+
|
98
|
+
if disable_metrics is False:
|
99
|
+
attributes = {
|
100
|
+
TELEMETRY_SDK_NAME:
|
101
|
+
"openlit",
|
102
|
+
SemanticConvetion.GEN_AI_APPLICATION_NAME:
|
103
|
+
application_name,
|
104
|
+
SemanticConvetion.GEN_AI_SYSTEM:
|
105
|
+
SemanticConvetion.GEN_AI_SYSTEM_ASSEMBLYAI,
|
106
|
+
SemanticConvetion.GEN_AI_ENVIRONMENT:
|
107
|
+
environment,
|
108
|
+
SemanticConvetion.GEN_AI_TYPE:
|
109
|
+
SemanticConvetion.GEN_AI_TYPE_AUDIO,
|
110
|
+
SemanticConvetion.GEN_AI_REQUEST_MODEL:
|
111
|
+
llm_model,
|
112
|
+
}
|
113
|
+
|
114
|
+
metrics["genai_requests"].add(1, attributes)
|
115
|
+
metrics["genai_cost"].record(cost, attributes)
|
116
|
+
|
117
|
+
# Return original response
|
118
|
+
return response
|
119
|
+
|
120
|
+
except Exception as e:
|
121
|
+
handle_exception(span, e)
|
122
|
+
logger.error("Error in trace creation: %s", e)
|
123
|
+
|
124
|
+
# Return original response
|
125
|
+
return response
|
126
|
+
|
127
|
+
return wrapper
|
@@ -102,12 +102,8 @@ def converse(gen_ai_endpoint, version, environment, application_name, tracer,
|
|
102
102
|
content = message["content"]
|
103
103
|
|
104
104
|
if isinstance(content, list):
|
105
|
-
|
106
|
-
|
107
|
-
f'{item["type"]}: {item["text"] if "text" in item else item["image_url"]}'
|
108
|
-
if "type" in item else f'text: {item["text"]}'
|
109
|
-
for item in content
|
110
|
-
)
|
105
|
+
# pylint: disable=line-too-long
|
106
|
+
content_str = ", ".join(f'text: {item["text"]}' for item in content if "text" in item)
|
111
107
|
formatted_messages.append(f"{role}: {content_str}")
|
112
108
|
else:
|
113
109
|
formatted_messages.append(f"{role}: {content}")
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# pylint: disable=useless-return, bad-staticmethod-argument, disable=duplicate-code
|
2
|
+
"""Initializer of Auto Instrumentation of controlflow Functions"""
|
3
|
+
|
4
|
+
from typing import Collection
|
5
|
+
import importlib.metadata
|
6
|
+
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
7
|
+
from wrapt import wrap_function_wrapper
|
8
|
+
|
9
|
+
from openlit.instrumentation.controlflow.controlflow import (
|
10
|
+
wrap_controlflow
|
11
|
+
)
|
12
|
+
|
13
|
+
_instruments = ("controlflow >= 0.3.2",)
|
14
|
+
|
15
|
+
class ControlFlowInstrumentor(BaseInstrumentor):
|
16
|
+
"""
|
17
|
+
An instrumentor for controlflow's client library.
|
18
|
+
"""
|
19
|
+
|
20
|
+
def instrumentation_dependencies(self) -> Collection[str]:
|
21
|
+
return _instruments
|
22
|
+
|
23
|
+
def _instrument(self, **kwargs):
|
24
|
+
application_name = kwargs.get("application_name", "default_application")
|
25
|
+
environment = kwargs.get("environment", "default_environment")
|
26
|
+
tracer = kwargs.get("tracer")
|
27
|
+
metrics = kwargs.get("metrics_dict")
|
28
|
+
pricing_info = kwargs.get("pricing_info", {})
|
29
|
+
trace_content = kwargs.get("trace_content", False)
|
30
|
+
disable_metrics = kwargs.get("disable_metrics")
|
31
|
+
version = importlib.metadata.version("controlflow")
|
32
|
+
|
33
|
+
wrap_function_wrapper(
|
34
|
+
"controlflow.agents.agent",
|
35
|
+
"Agent.__init__",
|
36
|
+
wrap_controlflow("controlflow.create_agent", version, environment, application_name,
|
37
|
+
tracer, pricing_info, trace_content, metrics, disable_metrics),
|
38
|
+
)
|
39
|
+
|
40
|
+
wrap_function_wrapper(
|
41
|
+
"controlflow.tasks.task",
|
42
|
+
"Task.__init__",
|
43
|
+
wrap_controlflow("controlflow.create_task", version, environment, application_name,
|
44
|
+
tracer, pricing_info, trace_content, metrics, disable_metrics),
|
45
|
+
)
|
46
|
+
|
47
|
+
wrap_function_wrapper(
|
48
|
+
"controlflow",
|
49
|
+
"run",
|
50
|
+
wrap_controlflow("controlflow.run", version, environment, application_name,
|
51
|
+
tracer, pricing_info, trace_content, metrics, disable_metrics),
|
52
|
+
)
|
53
|
+
|
54
|
+
def _uninstrument(self, **kwargs):
|
55
|
+
# Proper uninstrumentation logic to revert patched methods
|
56
|
+
pass
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# pylint: disable=duplicate-code, broad-exception-caught, too-many-statements, unused-argument, bare-except
|
2
|
+
"""
|
3
|
+
Module for monitoring controlflow.
|
4
|
+
"""
|
5
|
+
|
6
|
+
import logging
|
7
|
+
from opentelemetry.trace import SpanKind, Status, StatusCode
|
8
|
+
from opentelemetry.sdk.resources import TELEMETRY_SDK_NAME
|
9
|
+
from openlit.__helpers import handle_exception
|
10
|
+
from openlit.semcov import SemanticConvetion
|
11
|
+
|
12
|
+
# Initialize logger for logging potential issues and operations
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
def wrap_controlflow(gen_ai_endpoint, version, environment, application_name,
|
16
|
+
tracer, pricing_info, trace_content, metrics, disable_metrics):
|
17
|
+
"""
|
18
|
+
Creates a wrapper around a function call to trace and log its execution metrics.
|
19
|
+
|
20
|
+
This function wraps any given function to measure its execution time,
|
21
|
+
log its operation, and trace its execution using OpenTelemetry.
|
22
|
+
|
23
|
+
Parameters:
|
24
|
+
- gen_ai_endpoint (str): A descriptor or name for the endpoint being traced.
|
25
|
+
- version (str): The version of the Langchain application.
|
26
|
+
- environment (str): The deployment environment (e.g., 'production', 'development').
|
27
|
+
- application_name (str): Name of the Langchain application.
|
28
|
+
- tracer (opentelemetry.trace.Tracer): The tracer object used for OpenTelemetry tracing.
|
29
|
+
- pricing_info (dict): Information about the pricing for internal metrics (currently not used).
|
30
|
+
- trace_content (bool): Flag indicating whether to trace the content of the response.
|
31
|
+
|
32
|
+
Returns:
|
33
|
+
- function: A higher-order function that takes a function 'wrapped' and returns
|
34
|
+
a new function that wraps 'wrapped' with additional tracing and logging.
|
35
|
+
"""
|
36
|
+
|
37
|
+
def wrapper(wrapped, instance, args, kwargs):
|
38
|
+
"""
|
39
|
+
An inner wrapper function that executes the wrapped function, measures execution
|
40
|
+
time, and records trace data using OpenTelemetry.
|
41
|
+
|
42
|
+
Parameters:
|
43
|
+
- wrapped (Callable): The original function that this wrapper will execute.
|
44
|
+
- instance (object): The instance to which the wrapped function belongs. This
|
45
|
+
is used for instance methods. For static and classmethods,
|
46
|
+
this may be None.
|
47
|
+
- args (tuple): Positional arguments passed to the wrapped function.
|
48
|
+
- kwargs (dict): Keyword arguments passed to the wrapped function.
|
49
|
+
|
50
|
+
Returns:
|
51
|
+
- The result of the wrapped function call.
|
52
|
+
|
53
|
+
The wrapper initiates a span with the provided tracer, sets various attributes
|
54
|
+
on the span based on the function's execution and response, and ensures
|
55
|
+
errors are handled and logged appropriately.
|
56
|
+
"""
|
57
|
+
|
58
|
+
with tracer.start_as_current_span(gen_ai_endpoint, kind= SpanKind.CLIENT) as span:
|
59
|
+
response = wrapped(*args, **kwargs)
|
60
|
+
|
61
|
+
try:
|
62
|
+
span.set_attribute(TELEMETRY_SDK_NAME, "openlit")
|
63
|
+
span.set_attribute(SemanticConvetion.GEN_AI_ENDPOINT,
|
64
|
+
gen_ai_endpoint)
|
65
|
+
span.set_attribute(SemanticConvetion.GEN_AI_SYSTEM,
|
66
|
+
SemanticConvetion.GEN_AI_SYSTEM_CONTROLFLOW)
|
67
|
+
span.set_attribute(SemanticConvetion.GEN_AI_ENVIRONMENT,
|
68
|
+
environment)
|
69
|
+
span.set_attribute(SemanticConvetion.GEN_AI_APPLICATION_NAME,
|
70
|
+
application_name)
|
71
|
+
span.set_attribute(SemanticConvetion.GEN_AI_TYPE,
|
72
|
+
SemanticConvetion.GEN_AI_TYPE_AGENT)
|
73
|
+
|
74
|
+
if gen_ai_endpoint == "controlflow.create_agent":
|
75
|
+
span.set_attribute(SemanticConvetion.GEN_AI_AGENT_ROLE,
|
76
|
+
instance.name)
|
77
|
+
span.set_attribute(SemanticConvetion.GEN_AI_AGENT_INSTRUCTIONS,
|
78
|
+
kwargs.get("instructions", ""))
|
79
|
+
span.set_attribute(SemanticConvetion.GEN_AI_AGENT_TOOLS,
|
80
|
+
str(kwargs.get("tools", "")))
|
81
|
+
|
82
|
+
try:
|
83
|
+
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
84
|
+
instance.model.model_name)
|
85
|
+
except:
|
86
|
+
span.set_attribute(SemanticConvetion.GEN_AI_REQUEST_MODEL,
|
87
|
+
kwargs.get("model", "openai/gpt-4o-mini"))
|
88
|
+
|
89
|
+
elif gen_ai_endpoint == "controlflow.create_task":
|
90
|
+
if kwargs.get("objective","") == "":
|
91
|
+
span.set_attribute(SemanticConvetion.GEN_AI_AGENT_GOAL,
|
92
|
+
str(args[0]))
|
93
|
+
else:
|
94
|
+
span.set_attribute(SemanticConvetion.GEN_AI_AGENT_GOAL,
|
95
|
+
kwargs.get("objective",""))
|
96
|
+
span.set_attribute(SemanticConvetion.GEN_AI_AGENT_INSTRUCTIONS,
|
97
|
+
kwargs.get("instructions", ""))
|
98
|
+
span.set_attribute(SemanticConvetion.GEN_AI_AGENT_CONTEXT,
|
99
|
+
str(kwargs.get("context", "")))
|
100
|
+
|
101
|
+
span.set_status(Status(StatusCode.OK))
|
102
|
+
|
103
|
+
# Return original response
|
104
|
+
return response
|
105
|
+
|
106
|
+
except Exception as e:
|
107
|
+
handle_exception(span, e)
|
108
|
+
logger.error("Error in trace creation: %s", e)
|
109
|
+
|
110
|
+
# Return original response
|
111
|
+
return response
|
112
|
+
|
113
|
+
return wrapper
|
@@ -103,12 +103,15 @@ def chat_completions(gen_ai_endpoint, version, environment, application_name,
|
|
103
103
|
content = message["content"]
|
104
104
|
|
105
105
|
if isinstance(content, list):
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
106
|
+
content_str_list = []
|
107
|
+
for item in content:
|
108
|
+
if item["type"] == "text":
|
109
|
+
content_str_list.append(f'text: {item["text"]}')
|
110
|
+
elif (item["type"] == "image_url" and
|
111
|
+
not item["image_url"]["url"].startswith("data:")):
|
112
|
+
# pylint: disable=line-too-long
|
113
|
+
content_str_list.append(f'image_url: {item["image_url"]["url"]}')
|
114
|
+
content_str = ", ".join(content_str_list)
|
112
115
|
formatted_messages.append(f"{role}: {content_str}")
|
113
116
|
else:
|
114
117
|
formatted_messages.append(f"{role}: {content}")
|
openlit/semcov/__init__.py
CHANGED
@@ -46,6 +46,7 @@ class SemanticConvetion:
|
|
46
46
|
GEN_AI_REQUEST_AUDIO_RESPONSE_FORMAT = "gen_ai.request.audio_response_format"
|
47
47
|
GEN_AI_REQUEST_AUDIO_SPEED = "gen_ai.request.audio_speed"
|
48
48
|
GEN_AI_REQUEST_AUDIO_SETTINGS = "gen_ai.request.audio_settings"
|
49
|
+
GEN_AI_REQUEST_AUDIO_DURATION = "gen_ai.request.audio_duration"
|
49
50
|
GEN_AI_REQUEST_FINETUNE_STATUS = "gen_ai.request.fine_tune_status"
|
50
51
|
GEN_AI_REQUEST_FINETUNE_MODEL_SUFFIX = "gen_ai.request.fine_tune_model_suffix"
|
51
52
|
GEN_AI_REQUEST_FINETUNE_MODEL_EPOCHS = "gen_ai.request.fine_tune_n_epochs"
|
@@ -128,6 +129,8 @@ class SemanticConvetion:
|
|
128
129
|
GEN_AI_SYSTEM_PHIDATA = "phidata"
|
129
130
|
GEN_AI_SYSTEM_JULEP = "julep"
|
130
131
|
GEN_AI_SYSTEM_AI21 = "ai21"
|
132
|
+
GEN_AI_SYSTEM_CONTROLFLOW = "controlflow"
|
133
|
+
GEN_AI_SYSTEM_ASSEMBLYAI = "assemblyai"
|
131
134
|
|
132
135
|
# Vector DB
|
133
136
|
DB_OPERATION_API_ENDPOINT = "db.operation.api_endpoint"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openlit
|
3
|
-
Version: 1.32.
|
3
|
+
Version: 1.32.7
|
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
|
Home-page: https://github.com/openlit/openlit/tree/main/openlit/python
|
6
6
|
Keywords: OpenTelemetry,otel,otlp,llm,tracing,openai,anthropic,claude,cohere,llm monitoring,observability,monitoring,gpt,Generative AI,chatGPT,gpu
|
@@ -79,7 +79,7 @@ This project proudly follows and maintains the [Semantic Conventions](https://gi
|
|
79
79
|
| [✅ AI21](https://docs.openlit.io/latest/integrations/ai21) | | [✅ mem0](https://docs.openlit.io/latest/integrations/mem0) | |
|
80
80
|
| [✅ Vertex AI](https://docs.openlit.io/latest/integrations/vertexai) | | [✅ MultiOn](https://docs.openlit.io/latest/integrations/multion) | |
|
81
81
|
| [✅ Groq](https://docs.openlit.io/latest/integrations/groq) | | [✅ Julep AI](https://docs.openlit.io/latest/integrations/julep-ai) | |
|
82
|
-
| [✅ ElevenLabs](https://docs.openlit.io/latest/integrations/elevenlabs) | |
|
82
|
+
| [✅ ElevenLabs](https://docs.openlit.io/latest/integrations/elevenlabs) | | [✅ ControlFlow](https://docs.openlit.io/latest/integrations/controlflow) | |
|
83
83
|
| [✅ vLLM](https://docs.openlit.io/latest/integrations/vllm) | | | |
|
84
84
|
| [✅ OLA Krutrim](https://docs.openlit.io/latest/integrations/krutrim) | | | |
|
85
85
|
| [✅ Google AI Studio](https://docs.openlit.io/latest/integrations/google-ai-studio) | | | |
|
@@ -88,6 +88,7 @@ This project proudly follows and maintains the [Semantic Conventions](https://gi
|
|
88
88
|
| [✅ Reka AI](https://docs.openlit.io/latest/integrations/reka) | | | |
|
89
89
|
| [✅ xAI](https://docs.openlit.io/latest/integrations/xai) | | | |
|
90
90
|
| [✅ Prem AI](https://docs.openlit.io/latest/integrations/premai) | | | |
|
91
|
+
| [✅ Assembly AI](https://docs.openlit.io/latest/integrations/assemblyai) | | | |
|
91
92
|
|
92
93
|
## Supported Destinations
|
93
94
|
- [✅ OpenTelemetry Collector](https://docs.openlit.io/latest/connections/otelcol)
|
@@ -1,5 +1,5 @@
|
|
1
|
-
openlit/__helpers.py,sha256=
|
2
|
-
openlit/__init__.py,sha256=
|
1
|
+
openlit/__helpers.py,sha256=bqMxdNndLW5NGO2wwpAoHEOnAFr_mhnmVLua3ifpSEc,6427
|
2
|
+
openlit/__init__.py,sha256=PXKZfrDNrQRxZGY1yowoSf1VHkKoLO_hE4pcEqj0qbY,21444
|
3
3
|
openlit/evals/__init__.py,sha256=nJe99nuLo1b5rf7pt9U9BCdSDedzbVi2Fj96cgl7msM,380
|
4
4
|
openlit/evals/all.py,sha256=oWrue3PotE-rB5WePG3MRYSA-ro6WivkclSHjYlAqGs,7154
|
5
5
|
openlit/evals/bias_detection.py,sha256=mCdsfK7x1vX7S3psC3g641IMlZ-7df3h-V6eiICj5N8,8154
|
@@ -20,6 +20,8 @@ openlit/instrumentation/ai21/async_ai21.py,sha256=OVDKt9Ymlp0OTCNVEirvRwqMSL5VZH
|
|
20
20
|
openlit/instrumentation/anthropic/__init__.py,sha256=oaU53BOPyfUKbEzYvLr1DPymDluurSnwo4Hernf2XdU,1955
|
21
21
|
openlit/instrumentation/anthropic/anthropic.py,sha256=y7CEGhKOGHWt8G_5Phr4qPJTfPGRJIAr9Yk6nM3CcvM,16775
|
22
22
|
openlit/instrumentation/anthropic/async_anthropic.py,sha256=Zz1KRKIG9wGn0quOoLvjORC-49IvHQpJ6GBdB-4PfCQ,16816
|
23
|
+
openlit/instrumentation/assemblyai/__init__.py,sha256=h5AADJkkqZA4IvUZ6rn8P32eVSmD15LgdcPlBX23Ve0,1560
|
24
|
+
openlit/instrumentation/assemblyai/assemblyai.py,sha256=muOq9C5JigG8N2Yd90j128LUKz8r-Gb3rOYSAjrarDM,5710
|
23
25
|
openlit/instrumentation/astra/__init__.py,sha256=G4alCOR6hXQvUQPDCS8lY1rj0Mz-KmrW5vVWk5loO78,8054
|
24
26
|
openlit/instrumentation/astra/astra.py,sha256=ddZuzwhsszQK1nsttJrQ01YKsvbOJ4I6HHNFAS2KdtY,12074
|
25
27
|
openlit/instrumentation/astra/async_astra.py,sha256=4l6HlQdCjPKZNFmKRGqEO0LMkSvwxLbg4BJ6x5RrSu4,12086
|
@@ -27,11 +29,13 @@ openlit/instrumentation/azure_ai_inference/__init__.py,sha256=Xl_4hjQeXcA-NgkqwT
|
|
27
29
|
openlit/instrumentation/azure_ai_inference/async_azure_ai_inference.py,sha256=T3SLSJxwrjOaGGkedB6DT92SCHLWbaJu5YAzZzAeBsk,22748
|
28
30
|
openlit/instrumentation/azure_ai_inference/azure_ai_inference.py,sha256=IzwDZ99h7HpOI-NnEkYqOIh2sAm-2aHi4BcTMoXNx1c,22694
|
29
31
|
openlit/instrumentation/bedrock/__init__.py,sha256=DLLYio4S4gUzRElqNRT8WMKzM79HZwOBVjXfJI4BfaA,1545
|
30
|
-
openlit/instrumentation/bedrock/bedrock.py,sha256=
|
32
|
+
openlit/instrumentation/bedrock/bedrock.py,sha256=F-n2WMlppxb7wM7UWEu1wqRZEpFzcGXWVmN9v9mAfeE,9288
|
31
33
|
openlit/instrumentation/chroma/__init__.py,sha256=61lFpHlUEQUobsUJZHXdvOViKwsOH8AOvSfc4VgCmiM,3253
|
32
34
|
openlit/instrumentation/chroma/chroma.py,sha256=E80j_41UeZi8RzTsHbpvi1izOA_n-0-3_VdrA68AJPA,10531
|
33
35
|
openlit/instrumentation/cohere/__init__.py,sha256=PC5T1qIg9pwLNocBP_WjG5B_6p_z019s8quk_fNLAMs,1920
|
34
36
|
openlit/instrumentation/cohere/cohere.py,sha256=62-P2K39v6pIJme6vTVViLJ9PP8q_UWkTv2l3Wa2gHA,21217
|
37
|
+
openlit/instrumentation/controlflow/__init__.py,sha256=iKZ08IANfoN_n4o1TZJIK_C_t6RZQ6AS1H7kMfyBbYA,2118
|
38
|
+
openlit/instrumentation/controlflow/controlflow.py,sha256=DP4KWBzcVg-zeCb4C6r-hK9_LdDzWNPBsOjbK-5WRqY,5528
|
35
39
|
openlit/instrumentation/crewai/__init__.py,sha256=cETkkwnKYEMAKlMrHbZ9-RvcRUPYaSNqNIhy2-vCDK8,1794
|
36
40
|
openlit/instrumentation/crewai/crewai.py,sha256=mpEJql6aDs3wwBjLz686anOHkIA5gWfhFCCHAgJRY0w,7049
|
37
41
|
openlit/instrumentation/dynamiq/__init__.py,sha256=2uIHHxFWca0g2YLO2RBfi2Al6uWUYvVZBfDiPOHCdpQ,2331
|
@@ -79,7 +83,7 @@ openlit/instrumentation/openai/__init__.py,sha256=AZ2cPr3TMKkgGdMl_yXMeSi7bWhtmM
|
|
79
83
|
openlit/instrumentation/openai/async_azure_openai.py,sha256=XbST1UE_zXzNL6RX2XwCsK_a6IhG9PHVTMKBjGrUcB0,48961
|
80
84
|
openlit/instrumentation/openai/async_openai.py,sha256=XFsfN81mbmdgRON2dwmt8pypqoTnlrNWer1eit7wZbQ,50176
|
81
85
|
openlit/instrumentation/openai/azure_openai.py,sha256=dZUc5MtCwg_sZJWiruG6exYGhPAm-339sqs3sKZNRPU,48761
|
82
|
-
openlit/instrumentation/openai/openai.py,sha256=
|
86
|
+
openlit/instrumentation/openai/openai.py,sha256=2udwA-MxLJfpKERTipCEIcRyLerPJT9IaFc_OmZPZ5U,50262
|
83
87
|
openlit/instrumentation/phidata/__init__.py,sha256=rfPCXYOIsJbxChee2p269UzkJ1Z-pvQbii7Fgrw1v2g,1527
|
84
88
|
openlit/instrumentation/phidata/phidata.py,sha256=9Aza2bLgeq688Ahyy7ekbxpSh4RTD7FFKtLmv4TNbrw,4667
|
85
89
|
openlit/instrumentation/pinecone/__init__.py,sha256=Mv9bElqNs07_JQkYyNnO0wOM3hdbprmw7sttdMeKC7g,2526
|
@@ -101,8 +105,8 @@ openlit/instrumentation/vllm/__init__.py,sha256=OVWalQ1dXvip1DUsjUGaHX4J-2FrSp-T
|
|
101
105
|
openlit/instrumentation/vllm/vllm.py,sha256=lDzM7F5pgxvh8nKL0dcKB4TD0Mc9wXOWeXOsOGN7Wd8,6527
|
102
106
|
openlit/otel/metrics.py,sha256=y7SQDTyfLakMrz0V4DThN-WAeap7YZzyndeYGSP6nVg,4516
|
103
107
|
openlit/otel/tracing.py,sha256=fG3vl-flSZ30whCi7rrG25PlkIhhr8PhnfJYCkZzCD0,3895
|
104
|
-
openlit/semcov/__init__.py,sha256=
|
105
|
-
openlit-1.32.
|
106
|
-
openlit-1.32.
|
107
|
-
openlit-1.32.
|
108
|
-
openlit-1.32.
|
108
|
+
openlit/semcov/__init__.py,sha256=9gCyLKqhV2iErzNMIb4H9-CAlzaMUUoNXJmRZbDdhfc,10628
|
109
|
+
openlit-1.32.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
110
|
+
openlit-1.32.7.dist-info/METADATA,sha256=7asxUq7rdEPsvzQ375lE42Wi6XQOYMF17fPrIymLHNk,22670
|
111
|
+
openlit-1.32.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
112
|
+
openlit-1.32.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|