Skip to content

Commit c4f69a3

Browse files
committed
be more strict about tool name
1 parent f5cc78c commit c4f69a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/src/utils/vercel-ai.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ function processToolCallSpan(span: Span, attributes: SpanAttributes): void {
122122
if (!attributes['gen_ai.tool.type']) {
123123
span.setAttribute('gen_ai.tool.type', 'function');
124124
}
125-
span.updateName(`execute_tool ${attributes['gen_ai.tool.name']}`);
125+
const toolName = attributes['gen_ai.tool.name'];
126+
if (toolName) {
127+
span.updateName(`execute_tool ${toolName}`);
128+
}
126129
}
127130

128131
function processGenerateSpan(span: Span, name: string, attributes: SpanAttributes): void {

0 commit comments

Comments
 (0)