openlit 1.33.16__py3-none-any.whl → 1.33.17__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/langchain/langchain.py +2 -28
- {openlit-1.33.16.dist-info → openlit-1.33.17.dist-info}/METADATA +1 -1
- {openlit-1.33.16.dist-info → openlit-1.33.17.dist-info}/RECORD +5 -5
- {openlit-1.33.16.dist-info → openlit-1.33.17.dist-info}/LICENSE +0 -0
- {openlit-1.33.16.dist-info → openlit-1.33.17.dist-info}/WHEEL +0 -0
@@ -14,6 +14,7 @@ from openlit.__helpers import (
|
|
14
14
|
calculate_ttft,
|
15
15
|
calculate_tbt,
|
16
16
|
create_metrics_attributes,
|
17
|
+
extract_and_format_input,
|
17
18
|
)
|
18
19
|
from openlit.semcov import SemanticConvetion
|
19
20
|
|
@@ -249,34 +250,7 @@ def chat(gen_ai_endpoint, version, environment, application_name,
|
|
249
250
|
end_time = time.time()
|
250
251
|
|
251
252
|
try:
|
252
|
-
|
253
|
-
message_prompt = kwargs.get("messages", "") or args[0]
|
254
|
-
formatted_messages = []
|
255
|
-
|
256
|
-
for message in message_prompt:
|
257
|
-
# Handle the case where message is a tuple
|
258
|
-
if isinstance(message, tuple) and len(message) == 2:
|
259
|
-
role, content = message
|
260
|
-
# Handle the case where message is a dictionary
|
261
|
-
elif isinstance(message, dict):
|
262
|
-
role = message["role"]
|
263
|
-
content = message["content"]
|
264
|
-
else:
|
265
|
-
continue
|
266
|
-
|
267
|
-
# Check if the content is a list
|
268
|
-
if isinstance(content, list):
|
269
|
-
content_str = ", ".join(
|
270
|
-
f'{item["type"]}: {item["text"] if "text" in item else item["image_url"]}'
|
271
|
-
if "type" in item else f'text: {item["text"]}'
|
272
|
-
for item in content
|
273
|
-
)
|
274
|
-
formatted_messages.append(f"{role}: {content_str}")
|
275
|
-
else:
|
276
|
-
formatted_messages.append(f"{role}: {content}")
|
277
|
-
|
278
|
-
# Join all formatted messages with newline
|
279
|
-
prompt = "\n".join(formatted_messages)
|
253
|
+
prompt = str(kwargs.get('messages', '') or args[0])
|
280
254
|
|
281
255
|
input_tokens = general_tokens(str(prompt))
|
282
256
|
output_tokens = general_tokens(str(response))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: openlit
|
3
|
-
Version: 1.33.
|
3
|
+
Version: 1.33.17
|
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
|
@@ -70,7 +70,7 @@ openlit/instrumentation/julep/async_julep.py,sha256=URZQsxXEaQ4nHmOTeM1tsADRp4xQ
|
|
70
70
|
openlit/instrumentation/julep/julep.py,sha256=0bGlsdW32JGu1fEdsfc-MDbOqqbcCrlkl-ojE98Zqys,5316
|
71
71
|
openlit/instrumentation/langchain/__init__.py,sha256=cNlumZ8fwLMlGVFMjNEndOIzooD4FQEOINX9tGVksII,3853
|
72
72
|
openlit/instrumentation/langchain/async_langchain.py,sha256=u_f7FZThF9VdsOPBlh8W6aytUUTRt9d5z2KD1zbz4UI,18302
|
73
|
-
openlit/instrumentation/langchain/langchain.py,sha256=
|
73
|
+
openlit/instrumentation/langchain/langchain.py,sha256=tl2kXJU_SSlBAP6w_cb52cFhcP_SPWoTmf-sm6Ro0zo,16973
|
74
74
|
openlit/instrumentation/letta/__init__.py,sha256=K8PtRKxuueyqEYE3LzxWJ74IieNKSI6dmk9sNRd8Mt0,3031
|
75
75
|
openlit/instrumentation/letta/letta.py,sha256=y8yZWGtY6lDv4sA2UlUTZjktXxUOYyXatwz_yso-akA,8455
|
76
76
|
openlit/instrumentation/litellm/__init__.py,sha256=qRqfwDMhP5adKGI2vRaelAkN12i0e8jtJrT31VFFM5A,2374
|
@@ -123,7 +123,7 @@ openlit/otel/events.py,sha256=VrMjTpvnLtYRBHCiFwJojTQqqNpRCxoD4yJYeQrtPsk,3560
|
|
123
123
|
openlit/otel/metrics.py,sha256=Iwx6baEiCZPNqsFf92K5mDWU8are8DOF0uQAuNZsCKg,6826
|
124
124
|
openlit/otel/tracing.py,sha256=tjV2bEbEDPUB1Z46gE-UsJsb04sRdFrfbhIDkxViZc0,3103
|
125
125
|
openlit/semcov/__init__.py,sha256=lM0Y3wMYYmCvfcNGD3k0xSn1XZUiGw-bKgCuwcGsOp8,13302
|
126
|
-
openlit-1.33.
|
127
|
-
openlit-1.33.
|
128
|
-
openlit-1.33.
|
129
|
-
openlit-1.33.
|
126
|
+
openlit-1.33.17.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
127
|
+
openlit-1.33.17.dist-info/METADATA,sha256=e1xpVcwlcHM70if9z1q85FuYXYFPu3hlj_EnaOG6M3U,23471
|
128
|
+
openlit-1.33.17.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
129
|
+
openlit-1.33.17.dist-info/RECORD,,
|
File without changes
|
File without changes
|