lmnr 0.7.15__tar.gz → 0.7.16__tar.gz
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.
Potentially problematic release.
This version of lmnr might be problematic. Click here for more details.
- {lmnr-0.7.15 → lmnr-0.7.16}/PKG-INFO +1 -1
- {lmnr-0.7.15 → lmnr-0.7.16}/pyproject.toml +1 -1
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/litellm/__init__.py +51 -4
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/google_genai/__init__.py +16 -1
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/version.py +1 -1
- {lmnr-0.7.15 → lmnr-0.7.16}/README.md +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/cli.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/.flake8 +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/decorators/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/litellm/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/config.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/event_emitter.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/event_models.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/span_utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/streaming.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/anthropic/version.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/cua_agent/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/cua_computer/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/cua_computer/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/google_genai/config.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/google_genai/schema_utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/google_genai/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/config.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/event_emitter.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/event_models.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/span_utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/version.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/langgraph/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/langgraph/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/chat_wrappers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/config.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/event_emitter.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/event_models.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/v0/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/v1/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/v1/responses_wrappers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/version.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openhands_ai/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/opentelemetry/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/skyvern/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/threading/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/_instrument_initializers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/attributes.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/context.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/exporter.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/instruments.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/processor.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/tracing/tracer.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/utils/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/utils/json_encoder.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/utils/package_check.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/utils/wrappers.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/py.typed +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/browser_use_cdp_otel.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/browser_use_otel.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/bubus_otel.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/cdp_utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/patchright_otel.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/playwright_otel.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/pw_utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/recorder/record.umd.min.cjs +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/browser/utils.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/async_client.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/resources/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/resources/agent.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/resources/base.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/resources/browser_events.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/resources/evals.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/resources/evaluators.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/asynchronous/resources/tags.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/resources/__init__.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/resources/agent.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/resources/base.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/resources/browser_events.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/resources/evals.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/resources/evaluators.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/resources/tags.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/client/synchronous/sync_client.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/datasets.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/decorators.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/eval_control.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/evaluations.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/laminar.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/log.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/types.py +0 -0
- {lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/sdk/utils.py +0 -0
|
@@ -406,7 +406,15 @@ try:
|
|
|
406
406
|
details.get("cached_tokens"),
|
|
407
407
|
)
|
|
408
408
|
# TODO: add audio/image/text token details
|
|
409
|
-
|
|
409
|
+
if usage_dict.get("completion_tokens_details"):
|
|
410
|
+
details = usage_dict.get("completion_tokens_details", {})
|
|
411
|
+
details = model_as_dict(details)
|
|
412
|
+
if details.get("reasoning_tokens"):
|
|
413
|
+
set_span_attribute(
|
|
414
|
+
span,
|
|
415
|
+
"gen_ai.usage.reasoning_tokens",
|
|
416
|
+
details.get("reasoning_tokens"),
|
|
417
|
+
)
|
|
410
418
|
|
|
411
419
|
def _process_tool_calls(self, span, tool_calls, choice_index, is_response=True):
|
|
412
420
|
"""Process and set tool call attributes on the span"""
|
|
@@ -467,17 +475,56 @@ try:
|
|
|
467
475
|
content = message.get("content", "")
|
|
468
476
|
if content is None:
|
|
469
477
|
continue
|
|
478
|
+
reasoning_content = message.get("reasoning_content")
|
|
479
|
+
if reasoning_content:
|
|
480
|
+
if isinstance(reasoning_content, str):
|
|
481
|
+
reasoning_content = [
|
|
482
|
+
{
|
|
483
|
+
"type": "text",
|
|
484
|
+
"text": reasoning_content,
|
|
485
|
+
}
|
|
486
|
+
]
|
|
487
|
+
elif not isinstance(reasoning_content, list):
|
|
488
|
+
reasoning_content = [
|
|
489
|
+
{
|
|
490
|
+
"type": "text",
|
|
491
|
+
"text": str(reasoning_content),
|
|
492
|
+
}
|
|
493
|
+
]
|
|
494
|
+
else:
|
|
495
|
+
reasoning_content = []
|
|
470
496
|
if isinstance(content, str):
|
|
471
|
-
|
|
497
|
+
if reasoning_content:
|
|
498
|
+
set_span_attribute(
|
|
499
|
+
span,
|
|
500
|
+
f"gen_ai.completion.{i}.content",
|
|
501
|
+
json.dumps(
|
|
502
|
+
reasoning_content
|
|
503
|
+
+ [
|
|
504
|
+
{
|
|
505
|
+
"type": "text",
|
|
506
|
+
"text": content,
|
|
507
|
+
}
|
|
508
|
+
]
|
|
509
|
+
),
|
|
510
|
+
)
|
|
511
|
+
else:
|
|
512
|
+
set_span_attribute(
|
|
513
|
+
span,
|
|
514
|
+
f"gen_ai.completion.{i}.content",
|
|
515
|
+
content,
|
|
516
|
+
)
|
|
472
517
|
elif isinstance(content, list):
|
|
473
518
|
set_span_attribute(
|
|
474
|
-
span,
|
|
519
|
+
span,
|
|
520
|
+
f"gen_ai.completion.{i}.content",
|
|
521
|
+
json.dumps(reasoning_content + content),
|
|
475
522
|
)
|
|
476
523
|
else:
|
|
477
524
|
set_span_attribute(
|
|
478
525
|
span,
|
|
479
526
|
f"gen_ai.completion.{i}.content",
|
|
480
|
-
json.dumps(model_as_dict(content)),
|
|
527
|
+
json.dumps(reasoning_content + [model_as_dict(content)]),
|
|
481
528
|
)
|
|
482
529
|
|
|
483
530
|
def _process_content_part(self, content_part: dict) -> dict:
|
|
@@ -272,6 +272,16 @@ def _set_response_attributes(span, response: types.GenerateContentResponse):
|
|
|
272
272
|
|
|
273
273
|
if response.usage_metadata:
|
|
274
274
|
usage_dict = to_dict(response.usage_metadata)
|
|
275
|
+
candidates_token_count = usage_dict.get("candidates_token_count")
|
|
276
|
+
# unlike OpenAI, and unlike input cached tokens, thinking tokens are
|
|
277
|
+
# not counted as part of candidates token count, so we need to add them
|
|
278
|
+
# separately for consistency with other instrumentations
|
|
279
|
+
thoughts_token_count = usage_dict.get("thoughts_token_count")
|
|
280
|
+
output_token_count = (
|
|
281
|
+
(candidates_token_count or 0) + (thoughts_token_count or 0)
|
|
282
|
+
if candidates_token_count is not None or thoughts_token_count is not None
|
|
283
|
+
else None
|
|
284
|
+
)
|
|
275
285
|
set_span_attribute(
|
|
276
286
|
span,
|
|
277
287
|
gen_ai_attributes.GEN_AI_USAGE_INPUT_TOKENS,
|
|
@@ -280,7 +290,7 @@ def _set_response_attributes(span, response: types.GenerateContentResponse):
|
|
|
280
290
|
set_span_attribute(
|
|
281
291
|
span,
|
|
282
292
|
gen_ai_attributes.GEN_AI_USAGE_OUTPUT_TOKENS,
|
|
283
|
-
|
|
293
|
+
output_token_count,
|
|
284
294
|
)
|
|
285
295
|
set_span_attribute(
|
|
286
296
|
span,
|
|
@@ -292,6 +302,11 @@ def _set_response_attributes(span, response: types.GenerateContentResponse):
|
|
|
292
302
|
SpanAttributes.LLM_USAGE_CACHE_READ_INPUT_TOKENS,
|
|
293
303
|
usage_dict.get("cached_content_token_count"),
|
|
294
304
|
)
|
|
305
|
+
set_span_attribute(
|
|
306
|
+
span,
|
|
307
|
+
SpanAttributes.LLM_USAGE_REASONING_TOKENS,
|
|
308
|
+
thoughts_token_count,
|
|
309
|
+
)
|
|
295
310
|
|
|
296
311
|
if should_send_prompts():
|
|
297
312
|
set_span_attribute(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/utils.py
RENAMED
|
File without changes
|
{lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/groq/version.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lmnr-0.7.15 → lmnr-0.7.16}/src/lmnr/opentelemetry_lib/opentelemetry/instrumentation/openai/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|