Skip to content

Commit 66d8b54

Browse files
ericapisaniclaude
andcommitted
ref: Remove gen_ai.tool.type assertions from test framework
Remove all references to the gen_ai.tool.type attribute: - Remove from checkToolSpanAttributes assertion - Remove type field from ExpectedToolCall interface and checkToolCalls validation - Remove type: "function" from tool-call test expectations - Remove gen_ai.tool.type setAttribute/set_data from manual agent templates Refs PY-2284 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9452281 commit 66d8b54

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
@@ -186,7 +186,6 @@ const TOOLS = {{ agent.tools | dump }};
186186
toolSpan.setAttribute("gen_ai.operation.name", "execute_tool");
187187
toolSpan.setAttribute("gen_ai.agent.name", AGENT_NAME);
188188
toolSpan.setAttribute("gen_ai.tool.name", "{{ tool.name }}");
189-
toolSpan.setAttribute("gen_ai.tool.type", "function");
190189
toolSpan.setAttribute("gen_ai.tool.description", "{{ tool.description }}");
191190

192191
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
@@ -183,7 +183,6 @@ TOOLS = {{ agent.tools | dump }}
183183
tool_span.set_data("gen_ai.operation.name", "execute_tool")
184184
tool_span.set_data("gen_ai.agent.name", AGENT_NAME)
185185
tool_span.set_data("gen_ai.tool.name", "{{ tool.name }}")
186-
tool_span.set_data("gen_ai.tool.type", "function")
187186
tool_span.set_data("gen_ai.tool.description", "{{ tool.description }}")
188187

189188
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
@@ -225,7 +225,6 @@ export const checkAgentSpanAttributes: Check = {
225225
* Validates:
226226
* - description equals "<gen_ai.operation.name> <gen_ai.tool.name>"
227227
* - gen_ai.operation.name matches TOOL_OPERATION_NAME_PATTERN
228-
* - gen_ai.tool.type exists
229228
* - gen_ai.tool.name exists
230229
* - gen_ai.tool.description exists
231230
*
@@ -243,7 +242,6 @@ export const checkToolSpanAttributes: Check = {
243242
"description": (span) =>
244243
`${span.data?.["gen_ai.operation.name"]} ${span.data?.["gen_ai.tool.name"]}`,
245244
"gen_ai.operation.name": TOOL_OPERATION_NAME_PATTERN,
246-
"gen_ai.tool.type": true,
247245
"gen_ai.tool.name": true,
248246
"gen_ai.tool.description": true,
249247
});
@@ -256,8 +254,6 @@ export const checkToolSpanAttributes: Check = {
256254
export interface ExpectedToolCall {
257255
/** Tool name to match */
258256
name: string;
259-
/** Expected tool type (e.g., "function") */
260-
type?: string;
261257
/** Expected tool description */
262258
description?: string;
263259
/** Expected input arguments (parsed from gen_ai.tool.input JSON) */
@@ -276,7 +272,6 @@ export interface ExpectedToolCall {
276272
* // Check a single tool call
277273
* checkToolCalls([{
278274
* name: "add",
279-
* type: "function",
280275
* description: "Add two numbers together",
281276
* input: { a: 4, b: 7 },
282277
* output: 11,
@@ -317,16 +312,6 @@ export function checkToolCalls(expectedTools: ExpectedToolCall[]): Check {
317312
continue;
318313
}
319314

320-
// Validate type if specified
321-
if (expected.type !== undefined) {
322-
const actual = toolSpan.data?.["gen_ai.tool.type"];
323-
if (actual !== expected.type) {
324-
const msg = `Tool "${expected.name}" should have type "${expected.type}" but has "${actual}"`;
325-
errors.push(msg);
326-
locations.push({ spanId: toolSpan.span_id, attribute: "gen_ai.tool.type", message: msg });
327-
}
328-
}
329-
330315
// Validate description if specified
331316
if (expected.description !== undefined) {
332317
const actual = toolSpan.data?.["gen_ai.tool.description"];

0 commit comments

Comments
 (0)