Skip to content

Commit f5cc78c

Browse files
committed
fix tests
1 parent aa812ab commit f5cc78c

File tree

2 files changed

+5
-6
lines changed
  • dev-packages/node-integration-tests/suites/tracing/vercelai
  • packages/core/src/utils

2 files changed

+5
-6
lines changed

dev-packages/node-integration-tests/suites/tracing/vercelai/test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ describe('Vercel AI integration', () => {
183183
data: {
184184
'ai.operationId': 'ai.toolCall',
185185
'gen_ai.tool.call.id': 'call-1',
186-
'gen_ai.tool.input': expect.any(String),
187186
'gen_ai.tool.name': 'getWeather',
188-
'gen_ai.tool.output': expect.any(String),
189187
'gen_ai.tool.type': 'function',
190188
'operation.name': 'ai.toolCall',
191189
'sentry.op': 'gen_ai.execute_tool',
@@ -390,10 +388,10 @@ describe('Vercel AI integration', () => {
390388
expect.objectContaining({
391389
data: {
392390
'ai.operationId': 'ai.toolCall',
393-
'ai.toolCall.args': expect.any(String),
394-
'ai.toolCall.result': expect.any(String),
395391
'gen_ai.tool.call.id': 'call-1',
396392
'gen_ai.tool.name': 'getWeather',
393+
'gen_ai.tool.input': expect.any(String),
394+
'gen_ai.tool.output': expect.any(String),
397395
'gen_ai.tool.type': 'function',
398396
'operation.name': 'ai.toolCall',
399397
'sentry.op': 'gen_ai.execute_tool',

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ function processEndedVercelAiSpan(span: SpanJSON): void {
9696
renameAttributeKey(attributes, AI_RESPONSE_TEXT_ATTRIBUTE, 'gen_ai.response.text');
9797
renameAttributeKey(attributes, AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, 'gen_ai.response.tool_calls');
9898
renameAttributeKey(attributes, AI_PROMPT_TOOLS_ATTRIBUTE, 'gen_ai.request.available_tools');
99+
100+
renameAttributeKey(attributes, AI_TOOL_CALL_ARGS_ATTRIBUTE, 'gen_ai.tool.input');
101+
renameAttributeKey(attributes, AI_TOOL_CALL_RESULT_ATTRIBUTE, 'gen_ai.tool.output');
99102
}
100103

101104
/**
@@ -115,8 +118,6 @@ function processToolCallSpan(span: Span, attributes: SpanAttributes): void {
115118
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, 'gen_ai.execute_tool');
116119
renameAttributeKey(attributes, AI_TOOL_CALL_NAME_ATTRIBUTE, 'gen_ai.tool.name');
117120
renameAttributeKey(attributes, AI_TOOL_CALL_ID_ATTRIBUTE, 'gen_ai.tool.call.id');
118-
renameAttributeKey(attributes, AI_TOOL_CALL_ARGS_ATTRIBUTE, 'gen_ai.tool.input');
119-
renameAttributeKey(attributes, AI_TOOL_CALL_RESULT_ATTRIBUTE, 'gen_ai.tool.output');
120121
// https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/#gen-ai-tool-type
121122
if (!attributes['gen_ai.tool.type']) {
122123
span.setAttribute('gen_ai.tool.type', 'function');

0 commit comments

Comments
 (0)