improved formatting for tools in the traces

This commit is contained in:
Salman Paracha 2025-12-09 17:50:23 -08:00
parent c748ea0a71
commit 57aeb5dcfb

View file

@ -275,7 +275,11 @@ async fn build_llm_span(
// Add optional attributes
if let Some(tools) = tool_names {
span_builder = span_builder.with_attribute(llm::TOOLS, tools.join("\n"));
let formatted_tools = tools.iter()
.map(|name| format!("{}(...)", name))
.collect::<Vec<_>>()
.join("\n");
span_builder = span_builder.with_attribute(llm::TOOLS, formatted_tools);
}
if let Some(preview) = user_message_preview {