Skip to content

Commit 74206d0

Browse files
authored
ref: Remove gen_ai.tool.type assertions from test framework
2 parents 14072b4 + 66d8b54 commit 74206d0

4 files changed

Lines changed: 0 additions & 19 deletions

File tree

src/runner/templates/agents/node/manual/template.njk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ const TOOLS = {{ agent.tools | dump }};
194194
toolSpan.setAttribute("gen_ai.operation.name", "execute_tool");
195195
toolSpan.setAttribute("gen_ai.agent.name", AGENT_NAME);
196196
toolSpan.setAttribute("gen_ai.tool.name", "{{ tool.name }}");
197-
toolSpan.setAttribute("gen_ai.tool.type", "function");
198197
toolSpan.setAttribute("gen_ai.tool.description", "{{ tool.description }}");
199198

200199
const toolInputJson{{ turnIndex }}_{{ loop.index }} = JSON.stringify({{ tool.arguments | dump }});

src/runner/templates/agents/python/manual/template.njk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ TOOLS = {{ agent.tools | dump }}
187187
tool_span.set_data("gen_ai.operation.name", "execute_tool")
188188
tool_span.set_data("gen_ai.agent.name", AGENT_NAME)
189189
tool_span.set_data("gen_ai.tool.name", "{{ tool.name }}")
190-
tool_span.set_data("gen_ai.tool.type", "function")
191190
tool_span.set_data("gen_ai.tool.description", "{{ tool.description }}")
192191

193192
tool_input_json = json.dumps({{ tool.arguments | dump }})

src/test-cases/agents/tool-call.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,12 @@ export const toolCallAgentTest: TestDefinition = {
107107
checkToolCalls([
108108
{
109109
name: "add",
110-
type: "function",
111110
description: "Add two numbers together",
112111
input: { a: 3, b: 5 },
113112
output: 8,
114113
},
115114
{
116115
name: "multiply",
117-
type: "function",
118116
description: "Multiply two numbers together",
119117
input: { a: 8, b: 4 },
120118
output: 32,

src/test-cases/checks.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ export const checkAgentSpanAttributes: Check = {
442442
* Validates:
443443
* - description equals "<gen_ai.operation.name> <gen_ai.tool.name>"
444444
* - gen_ai.operation.name matches TOOL_OPERATION_NAME_PATTERN
445-
* - gen_ai.tool.type exists
446445
* - gen_ai.tool.name exists
447446
* - gen_ai.tool.description exists
448447
*
@@ -460,7 +459,6 @@ export const checkToolSpanAttributes: Check = {
460459
"description": (span) =>
461460
`${span.data?.["gen_ai.operation.name"]} ${span.data?.["gen_ai.tool.name"]}`,
462461
"gen_ai.operation.name": TOOL_OPERATION_NAME_PATTERN,
463-
"gen_ai.tool.type": true,
464462
"gen_ai.tool.name": true,
465463
"gen_ai.tool.description": true,
466464
});
@@ -473,8 +471,6 @@ export const checkToolSpanAttributes: Check = {
473471
export interface ExpectedToolCall {
474472
/** Tool name to match */
475473
name: string;
476-
/** Expected tool type (e.g., "function") */
477-
type?: string;
478474
/** Expected tool description */
479475
description?: string;
480476
/** Expected input arguments (parsed from gen_ai.tool.input JSON) */
@@ -493,7 +489,6 @@ export interface ExpectedToolCall {
493489
* // Check a single tool call
494490
* checkToolCalls([{
495491
* name: "add",
496-
* type: "function",
497492
* description: "Add two numbers together",
498493
* input: { a: 4, b: 7 },
499494
* output: 11,
@@ -534,16 +529,6 @@ export function checkToolCalls(expectedTools: ExpectedToolCall[]): Check {
534529
continue;
535530
}
536531

537-
// Validate type if specified
538-
if (expected.type !== undefined) {
539-
const actual = toolSpan.data?.["gen_ai.tool.type"];
540-
if (actual !== expected.type) {
541-
const msg = `Tool "${expected.name}" should have type "${expected.type}" but has "${actual}"`;
542-
errors.push(msg);
543-
locations.push({ spanId: toolSpan.span_id, attribute: "gen_ai.tool.type", message: msg });
544-
}
545-
}
546-
547532
// Validate description if specified
548533
if (expected.description !== undefined) {
549534
const actual = toolSpan.data?.["gen_ai.tool.description"];

0 commit comments

Comments
 (0)