@@ -1518,7 +1518,7 @@ def _get_operation_name(self, span_data: Any) -> str:
15181518 if isinstance (first_input , dict ) and "role" in first_input :
15191519 return GenAIOperationName .CHAT
15201520 return GenAIOperationName .TEXT_COMPLETION
1521- elif _is_instance_of (span_data , AgentSpanData ):
1521+ if _is_instance_of (span_data , AgentSpanData ):
15221522 # Could be create_agent or invoke_agent based on context
15231523 operation = getattr (span_data , "operation" , None )
15241524 normalized = (
@@ -1531,17 +1531,17 @@ def _get_operation_name(self, span_data: Any) -> str:
15311531 if normalized in {"invoke" , "invoke_agent" }:
15321532 return GenAIOperationName .INVOKE_AGENT
15331533 return GenAIOperationName .INVOKE_AGENT
1534- elif _is_instance_of (span_data , FunctionSpanData ):
1534+ if _is_instance_of (span_data , FunctionSpanData ):
15351535 return GenAIOperationName .EXECUTE_TOOL
1536- elif _is_instance_of (span_data , ResponseSpanData ):
1536+ if _is_instance_of (span_data , ResponseSpanData ):
15371537 return GenAIOperationName .CHAT # Response typically from chat
1538- elif _is_instance_of (span_data , TranscriptionSpanData ):
1538+ if _is_instance_of (span_data , TranscriptionSpanData ):
15391539 return GenAIOperationName .TRANSCRIPTION
1540- elif _is_instance_of (span_data , SpeechSpanData ):
1540+ if _is_instance_of (span_data , SpeechSpanData ):
15411541 return GenAIOperationName .SPEECH
1542- elif _is_instance_of (span_data , GuardrailSpanData ):
1542+ if _is_instance_of (span_data , GuardrailSpanData ):
15431543 return GenAIOperationName .GUARDRAIL
1544- elif _is_instance_of (span_data , HandoffSpanData ):
1544+ if _is_instance_of (span_data , HandoffSpanData ):
15451545 return GenAIOperationName .HANDOFF
15461546 return "unknown"
15471547
0 commit comments