diff options
| author | Arya Gummadi <[email protected]> | 2025-08-18 23:57:10 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-19 06:57:10 +0000 |
| commit | ec0d9f4ff7377ac060d066bf297da7b4f92246ab (patch) | |
| tree | b828d8298a3eb056e218976063f50bf7a8ce0133 /packages/core/src | |
| parent | 8f8082fe3da9e1972f8b8226c68fa14e326a3d8a (diff) | |
fix: add privacy settings hook and tests (#6360)
Diffstat (limited to 'packages/core/src')
| -rw-r--r-- | packages/core/src/core/loggingContentGenerator.ts | 14 | ||||
| -rw-r--r-- | packages/core/src/index.ts | 1 |
2 files changed, 6 insertions, 9 deletions
diff --git a/packages/core/src/core/loggingContentGenerator.ts b/packages/core/src/core/loggingContentGenerator.ts index 13bd6918..2abe3dce 100644 --- a/packages/core/src/core/loggingContentGenerator.ts +++ b/packages/core/src/core/loggingContentGenerator.ts @@ -27,20 +27,12 @@ import { } from '../telemetry/loggers.js'; import { ContentGenerator } from './contentGenerator.js'; import { toContents } from '../code_assist/converter.js'; +import { isStructuredError } from '../utils/quotaErrorDetection.js'; interface StructuredError { status: number; } -export function isStructuredError(error: unknown): error is StructuredError { - return ( - typeof error === 'object' && - error !== null && - 'status' in error && - typeof (error as StructuredError).status === 'number' - ); -} - /** * A decorator that wraps a ContentGenerator to add logging to API calls. */ @@ -50,6 +42,10 @@ export class LoggingContentGenerator implements ContentGenerator { private readonly config: Config, ) {} + getWrapped(): ContentGenerator { + return this.wrapped; + } + private logApiRequest( contents: Content[], model: string, diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 45f7e4ce..e8dbe947 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -10,6 +10,7 @@ export * from './config/config.js'; // Export Core Logic export * from './core/client.js'; export * from './core/contentGenerator.js'; +export * from './core/loggingContentGenerator.js'; export * from './core/geminiChat.js'; export * from './core/logger.js'; export * from './core/prompts.js'; |
