summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/cli/src/gemini.tsx2
-rw-r--r--packages/cli/src/nonInteractiveCli.ts2
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts6
-rw-r--r--packages/core/src/core/geminiChat.ts4
-rw-r--r--packages/core/src/telemetry/types.ts12
5 files changed, 13 insertions, 13 deletions
diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx
index 74091874..3c0b151b 100644
--- a/packages/cli/src/gemini.tsx
+++ b/packages/cli/src/gemini.tsx
@@ -215,7 +215,7 @@ export async function main() {
'event.timestamp': new Date().toISOString(),
prompt: input,
prompt_id,
- auth_type: config.getContentGeneratorConfig().authType!,
+ auth_type: config.getContentGeneratorConfig()?.authType,
prompt_length: input.length,
});
diff --git a/packages/cli/src/nonInteractiveCli.ts b/packages/cli/src/nonInteractiveCli.ts
index 2db28eba..7bc0f6aa 100644
--- a/packages/cli/src/nonInteractiveCli.ts
+++ b/packages/cli/src/nonInteractiveCli.ts
@@ -160,7 +160,7 @@ export async function runNonInteractive(
console.error(
parseAndFormatApiError(
error,
- config.getContentGeneratorConfig().authType,
+ config.getContentGeneratorConfig()?.authType,
),
);
process.exit(1);
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 05fb9835..21d57b3b 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -226,7 +226,7 @@ export const useGeminiStream = (
new UserPromptEvent(
trimmedQuery.length,
prompt_id,
- config.getContentGeneratorConfig().authType!,
+ config.getContentGeneratorConfig()?.authType,
trimmedQuery,
),
);
@@ -408,7 +408,7 @@ export const useGeminiStream = (
type: MessageType.ERROR,
text: parseAndFormatApiError(
eventValue.error,
- config.getContentGeneratorConfig().authType,
+ config.getContentGeneratorConfig()?.authType,
undefined,
config.getModel(),
DEFAULT_GEMINI_FLASH_MODEL,
@@ -588,7 +588,7 @@ export const useGeminiStream = (
type: MessageType.ERROR,
text: parseAndFormatApiError(
getErrorMessage(error) || 'Unknown error',
- config.getContentGeneratorConfig().authType,
+ config.getContentGeneratorConfig()?.authType,
undefined,
config.getModel(),
DEFAULT_GEMINI_FLASH_MODEL,
diff --git a/packages/core/src/core/geminiChat.ts b/packages/core/src/core/geminiChat.ts
index ab4f602c..f93470dd 100644
--- a/packages/core/src/core/geminiChat.ts
+++ b/packages/core/src/core/geminiChat.ts
@@ -172,7 +172,7 @@ export class GeminiChat {
this.config.getModel(),
durationMs,
prompt_id,
- this.config.getContentGeneratorConfig().authType!,
+ this.config.getContentGeneratorConfig()?.authType,
usageMetadata,
responseText,
),
@@ -194,7 +194,7 @@ export class GeminiChat {
errorMessage,
durationMs,
prompt_id,
- this.config.getContentGeneratorConfig().authType!,
+ this.config.getContentGeneratorConfig()?.authType,
errorType,
),
);
diff --git a/packages/core/src/telemetry/types.ts b/packages/core/src/telemetry/types.ts
index 9f6e1462..9ac12050 100644
--- a/packages/core/src/telemetry/types.ts
+++ b/packages/core/src/telemetry/types.ts
@@ -96,13 +96,13 @@ export class UserPromptEvent {
'event.timestamp': string; // ISO 8601
prompt_length: number;
prompt_id: string;
- auth_type: string;
+ auth_type?: string;
prompt?: string;
constructor(
prompt_length: number,
prompt_Id: string,
- auth_type: string,
+ auth_type?: string,
prompt?: string,
) {
this['event.name'] = 'user_prompt';
@@ -167,14 +167,14 @@ export class ApiErrorEvent {
status_code?: number | string;
duration_ms: number;
prompt_id: string;
- auth_type: string;
+ auth_type?: string;
constructor(
model: string,
error: string,
duration_ms: number,
prompt_id: string,
- auth_type: string,
+ auth_type?: string,
error_type?: string,
status_code?: number | string,
) {
@@ -205,13 +205,13 @@ export class ApiResponseEvent {
total_token_count: number;
response_text?: string;
prompt_id: string;
- auth_type: string;
+ auth_type?: string;
constructor(
model: string,
duration_ms: number,
prompt_id: string,
- auth_type: string,
+ auth_type?: string,
usage_data?: GenerateContentResponseUsageMetadata,
response_text?: string,
error?: string,