Skip to content

Commit d3b09a6

Browse files
committed
update span utils to require toolcall name
1 parent 2fd6b28 commit d3b09a6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • util/opentelemetry-util-genai/src/opentelemetry/util/genai

util/opentelemetry-util-genai/src/opentelemetry/util/genai/span_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ def _apply_tool_call_attributes(
419419
420420
Required attributes:
421421
- gen_ai.operation.name = "execute_tool"
422+
- gen_ai.tool.name
422423
423424
Recommended attributes (if available):
424-
- gen_ai.tool.name
425425
- gen_ai.tool.call.id
426426
- gen_ai.tool.type
427427
- gen_ai.tool.description
@@ -439,10 +439,9 @@ def _apply_tool_call_attributes(
439439
GenAI.GenAiOperationNameValues.EXECUTE_TOOL.value,
440440
)
441441

442-
# Set RECOMMENDED attributes (if present)
443-
if tool_call.name:
444-
span.set_attribute(GenAI.GEN_AI_TOOL_NAME, tool_call.name)
442+
span.set_attribute(GenAI.GEN_AI_TOOL_NAME, tool_call.name)
445443

444+
# Set RECOMMENDED attributes (if present)
446445
if tool_call.id:
447446
span.set_attribute(GenAI.GEN_AI_TOOL_CALL_ID, tool_call.id)
448447

0 commit comments

Comments
 (0)