Skip to content

Commit 5e3db00

Browse files
committed
fix
1 parent d2747b7 commit 5e3db00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/src/instrumentation/plugins/anthropic-plugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ function toErrorMessage(error: unknown): string {
276276
return error instanceof Error ? error.message : String(error);
277277
}
278278

279+
function getAnthropicToolRunnerInput(args: unknown[]): unknown {
280+
return args.length > 0 ? args[0] : undefined;
281+
}
282+
279283
function wrapAnthropicToolRunnerTools(
280284
params: AnthropicToolRunnerParams,
281285
state: AnthropicToolRunnerState,
@@ -346,7 +350,7 @@ function wrapAnthropicToolRunnerTool(
346350
},
347351
{
348352
event: {
349-
input: args.length === 1 ? args[0] : args,
353+
input: getAnthropicToolRunnerInput(args),
350354
metadata: {
351355
"gen_ai.tool.name": toolName,
352356
provider: "anthropic",

0 commit comments

Comments
 (0)