@@ -228,7 +228,8 @@ def record_call_llm(
228228 attributes = {
229229 "gen_ai_system" : "volcengine" ,
230230 "gen_ai_response_model" : llm_request .model ,
231- "gen_ai_operation_name" : "chat_completions" ,
231+ "gen_ai_operation_name" : "chat" ,
232+ "gen_ai_operation_type" : "llm" ,
232233 "stream" : "false" ,
233234 "server_address" : "api.volcengine.com" ,
234235 } # required by Volcengine APMPlus
@@ -313,19 +314,18 @@ def record_tool_call(
313314 span = trace .get_current_span ()
314315 if not span :
315316 return
316- operation = "tool"
317- operation_type = tool .name
317+ operation_type = "tool"
318+ operation_name = tool .name
318319 operation_backend = ""
319320 if tool .custom_metadata :
320321 operation_backend = tool .custom_metadata .get ("backend" , "" )
321- # if random.randint(0, 1) == 0:
322- # operation_type = "load_memory"
323- # operation_backend = "mem0"
322+
324323 attributes = {
325- "gen_ai_operation_name" : operation ,
324+ "gen_ai_operation_name" : operation_name ,
326325 "gen_ai_operation_type" : operation_type ,
327326 "gen_ai_operation_backend" : operation_backend ,
328327 }
328+
329329 if hasattr (span , "start_time" ) and self .apmplus_span_latency :
330330 # span 耗时
331331 duration = (time .time_ns () - span .start_time ) / 1e9 # type: ignore
0 commit comments