Update callToolById.ts
This commit is contained in:
parent
a9e5b37d0e
commit
7dd0a03ffe
1 changed files with 5 additions and 2 deletions
|
|
@ -31,7 +31,8 @@ export const callToolById = createAsyncThunk<
|
|||
return;
|
||||
}
|
||||
|
||||
// Track tool call acceptance
|
||||
// Track tool call acceptance and start timing
|
||||
const startTime = Date.now();
|
||||
posthog.capture("gui_tool_call_decision", {
|
||||
decision: "accept",
|
||||
toolName: toolCallState.toolCall.function.name,
|
||||
|
|
@ -115,11 +116,13 @@ export const callToolById = createAsyncThunk<
|
|||
);
|
||||
}
|
||||
|
||||
// Capture telemetry for tool call execution outcome
|
||||
// Capture telemetry for tool call execution outcome with duration
|
||||
const duration_ms = Date.now() - startTime;
|
||||
posthog.capture("gui_tool_call_outcome", {
|
||||
succeeded: errorMessage === undefined,
|
||||
toolName: toolCallState.toolCall.function.name,
|
||||
errorMessage: errorMessage,
|
||||
duration_ms: duration_ms,
|
||||
});
|
||||
|
||||
if (streamResponse) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue