openlit 1.33.22__py3-none-any.whl → 1.33.23__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.
@@ -25,35 +25,39 @@ def format_content(messages):
25
25
  prompt = ""
26
26
 
27
27
  if isinstance(messages, list):
28
- for content in messages:
29
- role = content.role
30
- parts = content.parts
31
- content_str = []
32
-
33
- for part in parts:
34
- # Collect relevant fields and handle each type of data that Part could contain
35
- if part.text:
36
- content_str.append(f"text: {part.text}")
37
- if part.video_metadata:
38
- content_str.append(f"video_metadata: {part.video_metadata}")
39
- if part.thought:
40
- content_str.append(f"thought: {part.thought}")
41
- if part.code_execution_result:
42
- content_str.append(f"code_execution_result: {part.code_execution_result}")
43
- if part.executable_code:
44
- content_str.append(f"executable_code: {part.executable_code}")
45
- if part.file_data:
46
- content_str.append(f"file_data: {part.file_data}")
47
- if part.function_call:
48
- content_str.append(f"function_call: {part.function_call}")
49
- if part.function_response:
50
- content_str.append(f"function_response: {part.function_response}")
51
- if part.inline_data:
52
- content_str.append(f"inline_data: {part.inline_data}")
53
-
54
- formatted_messages.append(f"{role}: {', '.join(content_str)}")
55
-
56
- prompt = "\n".join(formatted_messages)
28
+ try:
29
+ for content in messages:
30
+ role = content.role if content.role is not None else "user"
31
+ parts = content.parts
32
+ content_str = []
33
+
34
+ for part in parts:
35
+ # Collect relevant fields and handle each type of data that Part could contain
36
+ if part.text:
37
+ content_str.append(f"text: {part.text}")
38
+ if part.video_metadata:
39
+ content_str.append(f"video_metadata: {part.video_metadata}")
40
+ if part.thought:
41
+ content_str.append(f"thought: {part.thought}")
42
+ if part.code_execution_result:
43
+ content_str.append(f"code_execution_result: {part.code_execution_result}")
44
+ if part.executable_code:
45
+ content_str.append(f"executable_code: {part.executable_code}")
46
+ if part.file_data:
47
+ content_str.append(f"file_data: {part.file_data}")
48
+ if part.function_call:
49
+ content_str.append(f"function_call: {part.function_call}")
50
+ if part.function_response:
51
+ content_str.append(f"function_response: {part.function_response}")
52
+ if part.inline_data:
53
+ content_str.append(f"inline_data: {part.inline_data}")
54
+
55
+ formatted_messages.append(f"{role}: {', '.join(content_str)}")
56
+
57
+ prompt = "\n".join(formatted_messages)
58
+
59
+ except:
60
+ prompt = str(messages)
57
61
 
58
62
  else:
59
63
  prompt = messages
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openlit
3
- Version: 1.33.22
3
+ Version: 1.33.23
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
@@ -59,7 +59,7 @@ openlit/instrumentation/firecrawl/firecrawl.py,sha256=4X38UrLYeGm3uez-edYA6qEc0n
59
59
  openlit/instrumentation/google_ai_studio/__init__.py,sha256=d4aDvCSfDtT2geRbwG5yinu62uPTHaj4PtalimuvG-k,2685
60
60
  openlit/instrumentation/google_ai_studio/async_google_ai_studio.py,sha256=kv8X1c3klmFEPTyxj9kJag2D670_YZxxkBhsIrW7JH4,5501
61
61
  openlit/instrumentation/google_ai_studio/google_ai_studio.py,sha256=MJQjHF1o6DuXHr1xE2-hp_cgejV65-LpXIGL6bacE4Q,5403
62
- openlit/instrumentation/google_ai_studio/utils.py,sha256=q_kF_DmXcMuKERHjOi8O9x5yNAxzvURP3W9eyq5UcaA,11047
62
+ openlit/instrumentation/google_ai_studio/utils.py,sha256=s9-5qnIWfXsq2xjYbWToI0RBAUo5lT0yLPOILc6eY1k,11256
63
63
  openlit/instrumentation/gpt4all/__init__.py,sha256=cO8mi3hhPDXcNwb9AwQ3-wQ_ydnOeBRwb0cptlQmAM4,1805
64
64
  openlit/instrumentation/gpt4all/gpt4all.py,sha256=EYp0njZ1kF56rTAjYZVtufA5W4xTWGzSIntjJ4MEfl4,24185
65
65
  openlit/instrumentation/gpu/__init__.py,sha256=QQCFVEbRfdeTjmdFe-UeEiy19vEEWSIBpj2B1wYGhUs,11036
@@ -127,7 +127,7 @@ openlit/otel/events.py,sha256=VrMjTpvnLtYRBHCiFwJojTQqqNpRCxoD4yJYeQrtPsk,3560
127
127
  openlit/otel/metrics.py,sha256=GM2PDloBGRhBTkHHkYaqmOwIAQkY124ZhW4sEqW1Fgk,7086
128
128
  openlit/otel/tracing.py,sha256=tjV2bEbEDPUB1Z46gE-UsJsb04sRdFrfbhIDkxViZc0,3103
129
129
  openlit/semcov/__init__.py,sha256=_AYtEgo44psrG93XqA2gtxDXZNg3kcLyxMJ-xiV3c9U,13415
130
- openlit-1.33.22.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
131
- openlit-1.33.22.dist-info/METADATA,sha256=sfi8qXgdjMvcl9vMccAUa9fITxCOgZPzI3EWivgKwOY,23470
132
- openlit-1.33.22.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
133
- openlit-1.33.22.dist-info/RECORD,,
130
+ openlit-1.33.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
131
+ openlit-1.33.23.dist-info/METADATA,sha256=fTK6ToBIYL4z0bteu_gkeiKtWFMkGw90UKM-lVHrw2w,23470
132
+ openlit-1.33.23.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
133
+ openlit-1.33.23.dist-info/RECORD,,