We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2747b7 commit 5e3db00Copy full SHA for 5e3db00
js/src/instrumentation/plugins/anthropic-plugin.ts
@@ -276,6 +276,10 @@ function toErrorMessage(error: unknown): string {
276
return error instanceof Error ? error.message : String(error);
277
}
278
279
+function getAnthropicToolRunnerInput(args: unknown[]): unknown {
280
+ return args.length > 0 ? args[0] : undefined;
281
+}
282
+
283
function wrapAnthropicToolRunnerTools(
284
params: AnthropicToolRunnerParams,
285
state: AnthropicToolRunnerState,
@@ -346,7 +350,7 @@ function wrapAnthropicToolRunnerTool(
346
350
},
347
351
{
348
352
event: {
349
- input: args.length === 1 ? args[0] : args,
353
+ input: getAnthropicToolRunnerInput(args),
354
metadata: {
355
"gen_ai.tool.name": toolName,
356
provider: "anthropic",
0 commit comments