Skip to content

Commit a43f1f4

Browse files
committed
drop search units if equal to 0
1 parent c000d6e commit a43f1f4

File tree

1 file changed

+5
-5
lines changed
  • src/langtrace_python_sdk/instrumentation/cohere

1 file changed

+5
-5
lines changed

src/langtrace_python_sdk/instrumentation/cohere/patch.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ def traced_method(wrapped, instance, args, kwargs):
489489
(usage.input_tokens or 0)
490490
+ (usage.output_tokens or 0),
491491
)
492-
493-
span.set_attribute(
494-
"search_units",
495-
usage.search_units or 0,
496-
)
492+
if usage.search_units is not None:
493+
span.set_attribute(
494+
"search_units",
495+
usage.search_units or 0,
496+
)
497497

498498
yield event
499499
finally:

0 commit comments

Comments
 (0)