mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
fix: TypeError: Cannot read properties of undefined (reading 'authType') (#3914)
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ export async function runNonInteractive(
|
||||
console.error(
|
||||
parseAndFormatApiError(
|
||||
error,
|
||||
config.getContentGeneratorConfig().authType,
|
||||
config.getContentGeneratorConfig()?.authType,
|
||||
),
|
||||
);
|
||||
process.exit(1);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user