diff options
| author | Silvio Junior <[email protected]> | 2025-08-01 11:20:08 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-01 15:20:08 +0000 |
| commit | 7748e56153159373ba4b9bf0f937ed476504b6c7 (patch) | |
| tree | b43ac3c1634acc326f791d503478175c30b3ea36 /packages/core/src/tools/tools.ts | |
| parent | e126d2fcd97221df7de63df09bc0eba386314781 (diff) | |
[Fix Telemetry for tool calls, PR 1/n] Propagate tool reported errors via ToolCallResponseInfo and ToolResult (#5222)
Diffstat (limited to 'packages/core/src/tools/tools.ts')
| -rw-r--r-- | packages/core/src/tools/tools.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/core/src/tools/tools.ts b/packages/core/src/tools/tools.ts index 0d7b402a..0e3ffabf 100644 --- a/packages/core/src/tools/tools.ts +++ b/packages/core/src/tools/tools.ts @@ -5,6 +5,7 @@ */ import { FunctionDeclaration, PartListUnion, Schema } from '@google/genai'; +import { ToolErrorType } from './tool-error.js'; /** * Interface representing the base Tool functionality @@ -217,6 +218,14 @@ export interface ToolResult { * For now, we keep it as the core logic in ReadFileTool currently produces it. */ returnDisplay: ToolResultDisplay; + + /** + * If this property is present, the tool call is considered a failure. + */ + error?: { + message: string; // raw error message + type?: ToolErrorType; // An optional machine-readable error type (e.g., 'FILE_NOT_FOUND'). + }; } export type ToolResultDisplay = string | FileDiff; |
