openlit 1.34.4__py3-none-any.whl → 1.34.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/instrumentation/google_ai_studio/__init__.py +2 -4
- openlit/instrumentation/google_ai_studio/async_google_ai_studio.py +0 -6
- openlit/instrumentation/google_ai_studio/google_ai_studio.py +0 -6
- openlit/instrumentation/google_ai_studio/utils.py +1 -2
- openlit/instrumentation/openai/async_openai.py +1 -1
- openlit/instrumentation/premai/__init__.py +0 -1
- openlit/instrumentation/premai/premai.py +84 -454
- openlit/instrumentation/premai/utils.py +325 -0
- openlit/instrumentation/reka/__init__.py +5 -7
- openlit/instrumentation/reka/async_reka.py +25 -163
- openlit/instrumentation/reka/reka.py +24 -162
- openlit/instrumentation/reka/utils.py +193 -0
- openlit/instrumentation/together/__init__.py +3 -5
- openlit/instrumentation/together/async_together.py +70 -476
- openlit/instrumentation/together/together.py +69 -475
- openlit/instrumentation/together/utils.py +320 -0
- {openlit-1.34.4.dist-info → openlit-1.34.7.dist-info}/METADATA +1 -1
- {openlit-1.34.4.dist-info → openlit-1.34.7.dist-info}/RECORD +20 -17
- {openlit-1.34.4.dist-info → openlit-1.34.7.dist-info}/LICENSE +0 -0
- {openlit-1.34.4.dist-info → openlit-1.34.7.dist-info}/WHEEL +0 -0
@@ -1,4 +1,3 @@
|
|
1
|
-
# pylint: disable=useless-return, bad-staticmethod-argument, disable=duplicate-code
|
2
1
|
"""Initializer of Auto Instrumentation of Google AI Studio Functions"""
|
3
2
|
|
4
3
|
from typing import Collection
|
@@ -25,8 +24,8 @@ class GoogleAIStudioInstrumentor(BaseInstrumentor):
|
|
25
24
|
return _instruments
|
26
25
|
|
27
26
|
def _instrument(self, **kwargs):
|
28
|
-
application_name = kwargs.get("application_name", "
|
29
|
-
environment = kwargs.get("environment", "
|
27
|
+
application_name = kwargs.get("application_name", "default")
|
28
|
+
environment = kwargs.get("environment", "default")
|
30
29
|
tracer = kwargs.get("tracer")
|
31
30
|
metrics = kwargs.get("metrics_dict")
|
32
31
|
pricing_info = kwargs.get("pricing_info", {})
|
@@ -67,5 +66,4 @@ class GoogleAIStudioInstrumentor(BaseInstrumentor):
|
|
67
66
|
)
|
68
67
|
|
69
68
|
def _uninstrument(self, **kwargs):
|
70
|
-
# Proper uninstrumentation logic to revert patched methods
|
71
69
|
pass
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Module for monitoring Google AI Studio API calls.
|
3
3
|
"""
|
4
4
|
|
5
|
-
import logging
|
6
5
|
import time
|
7
6
|
from opentelemetry.trace import SpanKind
|
8
7
|
from openlit.__helpers import (
|
@@ -16,9 +15,6 @@ from openlit.instrumentation.google_ai_studio.utils import (
|
|
16
15
|
)
|
17
16
|
from openlit.semcov import SemanticConvention
|
18
17
|
|
19
|
-
# Initialize logger for logging potential issues and operations
|
20
|
-
logger = logging.getLogger(__name__)
|
21
|
-
|
22
18
|
def async_generate(version, environment, application_name,
|
23
19
|
tracer, pricing_info, capture_message_content, metrics, disable_metrics):
|
24
20
|
"""
|
@@ -61,7 +57,6 @@ def async_generate(version, environment, application_name,
|
|
61
57
|
|
62
58
|
except Exception as e:
|
63
59
|
handle_exception(span, e)
|
64
|
-
logger.error("Error in trace creation: %s", e)
|
65
60
|
|
66
61
|
# Return original response
|
67
62
|
return response
|
@@ -144,7 +139,6 @@ def async_generate_stream(version, environment, application_name,
|
|
144
139
|
|
145
140
|
except Exception as e:
|
146
141
|
handle_exception(self._span, e)
|
147
|
-
logger.error("Error in trace creation: %s", e)
|
148
142
|
raise
|
149
143
|
|
150
144
|
async def wrapper(wrapped, instance, args, kwargs):
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Module for monitoring Google AI Studio API calls.
|
3
3
|
"""
|
4
4
|
|
5
|
-
import logging
|
6
5
|
import time
|
7
6
|
from opentelemetry.trace import SpanKind
|
8
7
|
from openlit.__helpers import (
|
@@ -16,9 +15,6 @@ from openlit.instrumentation.google_ai_studio.utils import (
|
|
16
15
|
)
|
17
16
|
from openlit.semcov import SemanticConvention
|
18
17
|
|
19
|
-
# Initialize logger for logging potential issues and operations
|
20
|
-
logger = logging.getLogger(__name__)
|
21
|
-
|
22
18
|
def generate(version, environment, application_name,
|
23
19
|
tracer, pricing_info, capture_message_content, metrics, disable_metrics):
|
24
20
|
"""
|
@@ -61,7 +57,6 @@ def generate(version, environment, application_name,
|
|
61
57
|
|
62
58
|
except Exception as e:
|
63
59
|
handle_exception(span, e)
|
64
|
-
logger.error("Error in trace creation: %s", e)
|
65
60
|
|
66
61
|
# Return original response
|
67
62
|
return response
|
@@ -144,7 +139,6 @@ def generate_stream(version, environment, application_name,
|
|
144
139
|
|
145
140
|
except Exception as e:
|
146
141
|
handle_exception(self._span, e)
|
147
|
-
logger.error("Error in trace creation: %s", e)
|
148
142
|
raise
|
149
143
|
|
150
144
|
def wrapper(wrapped, instance, args, kwargs):
|
@@ -15,8 +15,7 @@ from openlit.semcov import SemanticConvention
|
|
15
15
|
|
16
16
|
def format_content(messages):
|
17
17
|
"""
|
18
|
-
Process a list of messages to extract content
|
19
|
-
and concatenate all 'content' fields into a single string with role: content format.
|
18
|
+
Process a list of messages to extract content.
|
20
19
|
"""
|
21
20
|
|
22
21
|
formatted_messages = []
|
@@ -733,7 +733,7 @@ def async_chat_completions(version, environment, application_name,
|
|
733
733
|
formatted_messages = []
|
734
734
|
for message in message_prompt:
|
735
735
|
role = message["role"]
|
736
|
-
content = message
|
736
|
+
content = message.get("content", "")
|
737
737
|
|
738
738
|
if isinstance(content, list):
|
739
739
|
content_str = ", ".join(
|